DesenvolvedoresReferência da APIClientes
Criar ou atualizar cliente
POST
Cria o cliente ou atualiza o existente com o mesmo e-mail (nome, telefone e documento informados).
Chave: Só chave secreta (chamada pelo servidor).
Escopo: customers:write.
Idempotência: aceita o cabeçalho Idempotency-Key.
chaveSecretaheader
AutorizaçãoBearer <chave de API>Chave secreta (sk_…). Use só no servidor; requisições de navegador (com Origin) são recusadas.
Idempotency-Key?stringDe 1 a 255 caracteres visíveis. Repetir a chamada com a mesma chave devolve a mesma resposta por 24 horas.
application/json- body
email*stringFormato
emailTamanho
length <= 254name?stringTamanho
1 <= length <= 160phone?stringSó números, com DDD.
Padrão
^\+?\d{10,15}$document?stringCPF ou CNPJ válido.
Tamanho
length <= 20marketingConsent?booleanJá existia um cliente com este e-mail; os dados foram atualizados.
application/json- response
data*meta*curl -X POST 'https://minepag.com.br/api/v1/customers' \ -H 'Content-Type: application/json' \ -d '{ "email": "user@example.com"}'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "email": "string", "name": "string", "phone": "string", "document": { "type": "cpf", "last4": "string" }, "status": "active", "source": "checkout", "marketingConsent": true, "notes": "string", "metrics": { "paidOrdersCount": -9007199254740991, "lifetimeValue": -9007199254740991, "refundedTotal": -9007199254740991, "firstOrderAt": "2019-08-24T14:15:22Z", "lastOrderAt": "2019-08-24T14:15:22Z" }, "createdAt": "2019-08-24T14:15:22Z" }, "meta": { "requestId": "string" }}