Skip to content

Customers: Create

POST/customers

Creates a customer object and stores the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.

Request body CustomerRequest (object)

  • customer_idstring, nullable

    The identifier for the customer object. If not provided the customer ID will be autogenerated.

  • namestring, nullable

    The customer's name

  • emailstring, nullable

    The customer's email address

  • phonestring, nullable

    The customer's phone number

  • descriptionstring, nullable

    An arbitrary string that you can attach to a customer object.

  • phone_country_codestring, nullable

    The country code for the customer phone number

  • addressAddressDetails (object), nullable

    Address details

    Show 10 child attributes
    • citystring, nullable

      The city, district, suburb, town, or village of the address.

    • countrystring (enum), nullable

      Possible values: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM and 237 more

    • line1string, nullable

      The first line of the street address or P.O. Box.

    • line2string, nullable

      The second line of the street address or P.O. Box (e.g., apartment, suite, unit, or building).

    • line3string, nullable

      The third line of the street address, if applicable.

    • zipstring, nullable

      The zip/postal code for the address

    • statestring, nullable

      The address state

    • first_namestring, nullable

      The first name for the address

    • last_namestring, nullable

      The last name for the address

    • origin_zipstring, nullable

      The zip/postal code of the origin

  • metadataobject, nullable

    You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.

  • tax_registration_idstring, nullable

    Customer's tax registration ID

  • document_detailsCustomerDocumentDetails (object), nullable
    Show 2 child attributes
    • document_typestring (enum)required

      Represents the type of identification document used for validation.

      Possible values: cpf, cnpj

    • document_numberstringrequired

      The customer's document number Length of the document number depends upon the document_type. For CPF/CNPJ it is typically 11/14 digits long

Responses

  • 200Customer Created
  • 400Invalid data

Request

curl --request POST \
  --url https://sandbox.cardencer.com/customers \
  --header 'Content-Type: application/json' \
  --header 'api-key: snd_...' \
  --data '{
    "email": "guest@example.com",
    "name": "John Doe"
  }'

Response

{
  "customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
  "created_at": "2023-01-18T11:04:09.922Z"
}