v1

latestOpenAPI 3.0.02026-07-24103118224.7 KB
Customer

Create a customer

Creates a customer for the authenticated merchant. Only the email is required. If a customer with this email already exists for the merchant, the existing customer is returned with HTTP 200 instead of 201. Use the X-On-Behalf-Of header to create the customer for a connected sub-merchant.

post/api/customer

Request body

emailstring email required

Email address of the customer

firstNamestring nullable

First name of the customer

lastNamestring nullable

Last name of the customer

Example request

{
  "email": "john.doe@example.com",
  "firstName": "John",
  "lastName": "Doe"
}

Response

Customer already existed; existing customer returned.

idstring required

Unique identifier of the customer

createdAtstring date-time required

Date when the customer was created

updatedAtstring date-time required

Date when the customer was last updated

emailstring nullable required

Email address of the customer

firstNamestring nullable required

First name of the customer

lastNamestring nullable required

Last name of the customer

phonestring nullable required

Phone number of the customer

billingCountrystring nullable required

Billing country code (ISO 3166-1 alpha-2)

businessNamestring nullable required

Business name if purchasing as a business

purchasingAsBusinessboolean required

Whether the customer is purchasing as a business

taxIdstring nullable required

Tax ID (e.g., VAT number) for business customers

taxTypestring nullable required

Type of tax ID (e.g., eu_vat, us_ein)

Example response

{
  "id": "cus_abc123xyz789",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-03-20T14:45:00.000Z",
  "email": "john.doe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "phone": "+33612345678",
  "billingCountry": "FR",
  "businessName": "Acme Corporation",
  "taxId": "FR12345678901",
  "taxType": "eu_vat",
  "paymentMethods": [
    {
      "id": "cpm_abc123xyz789",
      "currency": "EUR",
      "cardBrand": "Visa",
      "cardLast4": "4242",
      "cardExpMonth": 12,
      "cardExpYear": 2025,
      "isDefault": true
    },
    {
      "id": "cpm_def456uvw012",
      "currency": "USD",
      "cardBrand": "Mastercard",
      "cardLast4": "5555",
      "cardExpMonth": 6,
      "cardExpYear": 2026,
      "isDefault": false
    }
  ]
}