Skip to content

Creates a customer

Request

POST {{baseURL}}/pay-api/v1/customers

This endpoint creates a customer.

The return field id is the customerId, also referred to as the customer identifier. Use this value to specify this customer in other endpoints.

See Also:
To list customers, see GET /pay-api/v1/customers.
To retrieve a customer by ID, see GET /pay-api/v1/customers/{customerId}.
To update a customer's information, see PUT /pay-api/v1/customers/{customerId}.
To delete a customer, see DELETE /pay-api/v1/customers/{customerId}.

Security
Bearer
Bodyapplication/json
firstNamestringrequired

Specifies the customer's first name.

Example: Alexandro

Example:"Alexandro"
lastNamestringrequired

Indicates the customer's last name.

Example: Peppared

Example:"Peppared"
companyNamestring or null

Specifies the name of the customer's company or organization.

Example: Peppared Street Cafe

Example:"Peppared Street Cafe"
emailstring or null

Indicates the customer's email.

Example: peppared@example.com

Example:"peppared@example.com"
mobilePhoneNumberstring or null, (E.164), <= 20 characters^(null|\+\d{1,20})$

Indicates the customer's mobile phone number.

Example: +14155552309

Example:"+14155552309"
isMobileNumberSmsNotificationsEnabledboolean

Indicates the customer's SMS notification is enabled.

If true, the customer's SMS notification is enabled.
If false, the customer's SMS notification is not enabled.
If missing or omitted, the information is not available.

Example: true

useBillingAsShippingAddressboolean

Indicates to use the billing address as the shipping address.

If true, use the billing address as the shipping address.
If false, do not use the billing address as the shipping address. Instead, use the field shippingAddress.

Example: true

Example:true
billingAddressobject

Specifies the customer's address.

shippingAddressobject

Specifies the customer's address.

paymentMethodsCardsArray of objects or null

Payment methods

paymentMethodsAchAccountsArray of objects or null

ACH bank account payment methods.

curl -i -X POST \
  https://developer.flute.com/_mock/api-reference/pay-api/v1/customers \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "firstName": "Alexandro",
    "lastName": "Peppared",
    "companyName": "Peppared Street Cafe",
    "email": "pepparedstreetcafe@eaxample.com",
    "mobilePhoneNumber": "+14155554618",
    "isMobileNumberSmsNotificationsEnabled": true,
    "useBillingAsShippingAddress": false,
    "billingAddress": {
      "addressLine1": "7429 Desert Mirage Lane",
      "addressLine2": "Office 7",
      "city": "Phoenix",
      "zip": "60612-0001",
      "stateName": "Illinois",
      "stateId": 4,
      "countryId": 1
    },
    "shippingAddress": {
      "addressLine1": "7429 Desert Mirage Lane",
      "addressLine2": "Office 7",
      "city": "Phoenix",
      "zip": "60612-0001",
      "stateName": "Illinois",
      "stateId": 4,
      "countryId": 1
    },
    "paymentMethodsCards": [
      {
        "name": "Payment_method1",
        "pan": "444466666655555",
        "expirationMonth": 1,
        "expirationYear": 2032,
        "securityCode": "345"
      },
      {
        "name": "Payment_method2",
        "pan": "1234567890123",
        "expirationMonth": 4,
        "expirationYear": 25,
        "securityCode": null
      }
    ],
    "paymentMethodsAchAccounts": null
  }'

Responses

OK

Bodyapplication/json
idstring, (uuid)

Indicates the customerId or the customer identifier.

Example: 965865ef-b17d-4153-b952-d8902e584f7d

Example:"965865ef-b17d-4153-b952-d8902e584f7d"
Response
{ "id": "965865ef-b17d-4153-b952-d8902e584f7d" }