Customers

Create customer

Changed on

The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. Remember the credit and debit card tokenization process: https://developers.conekta.com/page/web-checkout-tokenizer

post/customers

Request

Headers

Accept-Language'es' | 'en'

Use for knowing which language to use

X-Child-Company-Idstring

In the case of a holding company, the company id of the child company to which will process the request.

Request body

corporateboolean

It is a value that allows identifying if the email is corporate or not.

custom_referencestring

It is an undefined value.

date_of_birthstring

It is a parameter that allows to identify the date of birth of the client.

emailstring email required

An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc).

default_payment_source_idstring

It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)

default_shipping_contact_idstring

It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact)

metadataobject
namestring required

Client's name

national_idstring

It is a parameter that allows to identify the national identification number of the client.

phonestring required

Is the customer's phone number

plan_idstring

Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription

Example request

{
  "antifraud_info": {
    "account_created_at": 1484040996,
    "first_paid_at": 1485151007
  },
  "date_of_birth": "24/07/1992",
  "email": "miguel@gmail.com",
  "default_payment_source_id": "src_1a2b3c4d5e6f7g8h",
  "default_shipping_contact_id": "ship_cont_1a2b3c4d5e6f7g8h",
  "fiscal_entities": [
    {
      "address": {
        "street1": "Nuevo Leon 254",
        "street2": "Departamento 404",
        "postal_code": "06100",
        "city": "Ciudad de Mexico",
        "state": "Ciudad de Mexico",
        "country": "MX"
      },
      "company_name": "conekta"
    }
  ],
  "name": "miguel",
  "national_id": "HEGG560427MVZRRL04",
  "payment_sources": [
    {
      "type": "card | cash | spei | bnpl | pay_by_bank",
      "token_id": "tok_32hj4g234as"
    }
  ],
  "phone": "+5215555555555",
  "plan_id": "plan_987234823",
  "shipping_contacts": [
    {
      "phone": "+525511223344",
      "receiver": "Marvin Fuller",
      "between_streets": "Ackerman Crescent",
      "address": {
        "street1": "Nuevo Leon 254",
        "street2": "Departamento 404",
        "postal_code": "06100",
        "city": "Ciudad de Mexico",
        "state": "Ciudad de Mexico",
        "country": "MX",
        "residential": true
      }
    }
  ],
  "subscription": {
    "plan_id": "f84gdgf5g48r15fd21g8w424fd1",
    "card_id": "src_2qUCNd5AyQqfPMBuV",
    "trial_end": 1484040996
  }
}

Response

successful operation

corporateboolean

true if the customer is a company

created_atinteger required

Creation date of the object

custom_referencestring

Custom reference

date_of_birthstring

It is a parameter that allows to identify the date of birth of the client.

default_fiscal_entity_idstring nullable
default_shipping_contact_idstring
default_payment_source_idstring nullable
emailstring email
idstring required

Customer's ID

livemodeboolean required

true if the object exists in live mode or the value false if the object exists in test mode

namestring required

Customer's name

national_idstring

It is a parameter that allows to identify the national identification number of the client.

metadataobject
objectstring required
phonestring

Customer's phone number

Example response

{
  "antifraud_info": {
    "first_paid_at": 1485151007,
    "account_created_at": 1484040996
  },
  "created_at": 1485151007,
  "custom_reference": "custom_reference",
  "date_of_birth": "24/07/1992",
  "default_fiscal_entity_id": "fis_ent_2tKqqAfqPi21oCmEJ",
  "default_shipping_contact_id": "ship_cont_2tKZsTYcsryyu7Ah8",
  "default_payment_source_id": "src_2tHJfJ79KyUwpxTio",
  "email": "Felipe@gmail.com",
  "fiscal_entities": {
    "object": "list",
    "data": [
      {
        "address": {
          "street1": "Nuevo Leon 254",
          "street2": "Departamento 404",
          "postal_code": "06100",
          "city": "Ciudad de Mexico",
          "state": "Ciudad de Mexico",
          "country": "MX"
        },
        "company_name": "conekta",
        "id": "ship_cont_2tKZsTYcsryyu7Ah8",
        "object": "shipping_contact",
        "created_at": 1675715413,
        "parent_id": "cus_2tKcHxhTz7xU5SymF"
      }
    ]
  },
  "id": "cus_2tHJfJ79KyUwpxTik",
  "livemode": true,
  "name": "Felipe",
  "national_id": "HEGG560427MVZRRL04",
  "object": "customer",
  "payment_sources": {
    "object": "list",
    "next_page_url": "https://api.conekta.io/resources?limit=10&next=chrg_1",
    "previous_page_url": "https://api.conekta.io/resources?limit=10&previous=chrg_1",
    "data": [
      {
        "id": "src_2s8K1B3PBKDontpi9",
        "object": "payment_source",
        "created_at": 1675715413,
        "parent_id": "cus_2s8K1B3PBKDontpi8",
        "agreements": [
          {
            "agreement": "2409526",
            "provider": "bbva_cash_in"
          }
        ],
        "reference": "93000262276908",
        "barcode": "93000262276908",
        "barcode_url": "https://barcodes.conekta.com/644ebf80f2243197aad6cd8810375b905b613dbe.png",
        "expires_at": 1742483424,
        "provider": "Cash"
      }
    ]
  },
  "phone": "+5215555555555",
  "shipping_contacts": {
    "object": "list",
    "data": [
      {
        "phone": "+525511223344",
        "receiver": "Marvin Fuller",
        "between_streets": "Ackerman Crescent",
        "address": {
          "street1": "Nuevo Leon 254",
          "street2": "Departamento 404",
          "postal_code": "06100",
          "city": "Ciudad de Mexico",
          "state": "Ciudad de Mexico",
          "country": "MX",
          "residential": true
        },
        "id": "ship_cont_2tKZsTYcsryyu7Ah8",
        "object": "shipping_contact",
        "created_at": 1675715413
      }
    ]
  },
  "subscription": {
    "billing_cycle_start": 1677626827,
    "billing_cycle_end": 1677626827,
    "canceled_at": 1678258162,
    "canceled_reason": "user_cancelation",
    "card_id": "src_2tKcHxhTz7xU5SymL",
    "charge_id": "2tKcHxhTz7xU5SymL",
    "created_at": 1677626837,
    "customer_custom_reference": "dotnet_123456",
    "customer_id": "cus_2tKcHxhTz7xU5SymF",
    "id": "gold-plan",
    "last_billing_cycle_order_id": "ord_2tSoMP7bZJbLiq4z8",
    "object": "subscription",
    "paused_at": 1678258162,
    "plan_id": "plan_2tXx672QLQ68CkmMn",
    "status": "past_due",
    "subscription_start": 1677626837,
    "trial_start": 1677626837,
    "trial_end": 1677626837
  }
}

Changes

    • breaking

      added subschema #1: shipping_contact_address to the // request property allOf list

    • breaking

      added the pattern [A-Za-z]{2} to the request property //

    • breaking

      the // request property type changed from no type to object

    • breaking

      the ///// response's property type changed from no type to object for status

    • warning

      the // request property's maxLength was set to 249

    • warning

      removed the request property ////

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the optional property /////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • warning

      removed the optional property ////// from the response with the status

    • info

      added subschema #1: shipping_contact_address to the ///// response property allOf list for the response status

    • info

      the ///// response's property pattern [A-Za-z]{2} was added for the status