Atualize os dados do cliente.

Método

import { Malga } from 'malga'

const malga = new Malga({
  apiKey: '17a64c8f-a387-4682-bdd8-d280493715e0',
  clientId: 'd1d2b51a-0446-432a-b055-034518c2660e',
})

await malga.customers.update(
  '2c48166b-51fe-4d8d-a450-1385df8a95b9',
  {
    name: 'João da Silva',
    phoneNumber: '99999999999',
    address: {
      city: 'Rio de Janeiro',
      complement: 'Sala 214',
      country: 'BR',
      district: 'São Conrado',
      state: 'RJ',
      street: 'Estrada da Gávea',
      streetNumber: '696',
      zipCode: '22610002'
    }
  }
)
{
  id: '2c48166b-51fe-4d8d-a450-1385df8a95b9',
  updatedAt: '2023-12-31T20:36:30.741Z',
  createdAt: '2023-12-31T19:36:30.741Z',
  idempotencyKey: null,
  requestId: null,
  clientId: 'd1d2b51a-0446-432a-b055-034518c2660e',
  cardId: null,
  name: 'João da Silva',
  email: 'joao.silva@test.com',
  phoneNumber: '99999999999',
  documentNumber: '99999999999',
  documentType: 'cpf',
  documentCountry: 'BR',
  address: {
    country: 'BR',
    id: '5818e483-5914-46ee-a409-af4dd915a533',
    updatedAt: '2023-12-31T20:36:30.741Z',
    createdAt: '2023-12-31T19:36:30.741Z',
    idempotencyKey: null,
    requestId: null,
    street: 'Estrada da Gávea',
    streetNumber: '696',
    complement: 'Sala 214',
    zipCode: '22610002',
    state: 'RJ',
    city: 'Rio de Janeiro',
    district: 'São Conrado',
    deletedAt: null
  }
}

Parâmetros

Lista de todos os parâmetros suportados pelo método.

id
string
required

ID do cliente

payload
object
required

Segundo parâmetro