Ir al contenido
UnoPagoDocumentación
Referencia de la APICustomer dataCustomers

Create a customer

POST
/v1/customers

This API is used to create a customer

Autorización

bearerAuth
headerAutorizaciónBearer <token>

Your API key, created in Configuración → Claves API. The key alone, without the Bearer prefix, is accepted too.

application/json
  1. body

Input for creating a new customer

externalId?string
firstName*string
Longitud1 <= length <= 50
lastName*string
Longitudlength <= 50
email?string
Patrón^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Formatoemail
Longitudlength <= 128
phoneNumber?string
Patrón^(?:[01]\d{3}-?\d{7}|\+58(?!0)\d{3}-?\d{7}|\+(?!58)\d{1,3}\d{3}-?\d{7})$
address?string
Longitud1 <= length <= 200
nationalId?string
Patrón^[JVEGP]
Longitud2 <= length <= 10
students?array<>
createContactInvite?boolean
Por defectofalse

Cuerpo de la respuesta

Successful response

application/json
  1. response
id*string
Patrón^[cC][0-9a-z]{6,}$
Formatocuid
accountId*string
externalId*string|null
mainContactId*string|null
nationalId*string|null
firstName*string
lastName*string
email*string|null
phoneNumber*string|null
address*string|null
createdAt*string
updatedAt*string
foundContact?
payerLinkPending*boolean

True when the customer's phone belongs to a payer who was not linked automatically: the account is not verified yet, or the payer already belongs to another account and has to accept an invite. An unverified account's payer is linked once it is verified; until then they are only invited if createContactInvite was set.

Ejemplo de solicitud
curl -X POST 'https://api.unopago.com/v1/customers' \  -H 'Content-Type: application/json' \  -d '{  "firstName": "string",  "lastName": "string"}'
Ejemplo de respuesta
{  "id": "string",  "accountId": "string",  "externalId": "string",  "mainContactId": "string",  "nationalId": "string",  "firstName": "string",  "lastName": "string",  "email": "string",  "phoneNumber": "string",  "address": "string",  "createdAt": "string",  "updatedAt": "string",  "foundContact": {    "gender": "MALE",    "id": "string",    "externalId": "string",    "email": "string",    "phoneNumber": "string",    "emailVerified": "string",    "phoneVerified": "string",    "firstStepsStartedAt": "string",    "firstName": "string",    "lastName": "string",    "nationalId": "string",    "dateOfBirth": "string",    "nationality": "string",    "address": "string",    "createdAt": "string",    "updatedAt": "string"  },  "payerLinkPending": true}