Skip to main content
POST
/
v1
/
businesses
/
{business_id}
/
customers
curl -X POST https://sandbox.layerfi.com/v1/businesses/${business_id}/customers \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
    -d '{
          "external_id": "customer-1",
          "individual_name": "John Doe",
          "company_name": "Acme, Inc.",
          "email": "john@hotmail.com",
          "mobile_phone": "555-555-5555",
          "office_phone": "555-555-5555",
          "address_string": "123 Main St, Phoenix, AZ 85001",
          "notes": "This is a note"
        }'
{
 "data": {
   "type": "CustomerData",
   "id": "4f7c1b16-e057-4ec0-8b20-50308ba5b9ea",
   "external_id": "customer-1",
   "individual_name": "John Doe",
   "company_name": "Acme, Inc.",
   "email": "john@hotmail.com",
   "mobile_phone": "555-555-5555",
   "office_phone": "555-555-5555",
   "address_string": "123 Main St, Phoenix, AZ 85001",
   "notes": "This is a note",
   "status": "ACTIVE",
   "transaction_tags": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "key": "department",
      "value": "sales",
      "dimension_display_name": "Department",
      "value_display_name": "Sales Team",
      "dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
      "definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "created_at": "2024-02-27T02:16:40.389772Z",
      "updated_at": "2024-02-27T02:16:40.389772Z",
      "deleted_at": null,
      "archived_at": null
    }
  ]
 }
}
This endpoint is idempotent using the external_id field. If a customer with the same external_id already exists, the existing customer will be updated and returned.

Path Parameters

business_id
string
required
ID of the Business the customer is associated with.

Body

external_id
string
External ID for the customer within your platform. Idempotency key.
individual_name
string
Name of the individual customer.
company_name
string
Name of the company customer.
email
string
Email address of the customer.
mobile_phone
string
Mobile phone number of the customer.
office_phone
string
Office phone number of the customer.
address_string
string
Full address of the customer.
notes
string
Notes about the customer.
tags
Array of Tags

Response

Returns the created Customer object
curl -X POST https://sandbox.layerfi.com/v1/businesses/${business_id}/customers \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
    -d '{
          "external_id": "customer-1",
          "individual_name": "John Doe",
          "company_name": "Acme, Inc.",
          "email": "john@hotmail.com",
          "mobile_phone": "555-555-5555",
          "office_phone": "555-555-5555",
          "address_string": "123 Main St, Phoenix, AZ 85001",
          "notes": "This is a note"
        }'
{
 "data": {
   "type": "CustomerData",
   "id": "4f7c1b16-e057-4ec0-8b20-50308ba5b9ea",
   "external_id": "customer-1",
   "individual_name": "John Doe",
   "company_name": "Acme, Inc.",
   "email": "john@hotmail.com",
   "mobile_phone": "555-555-5555",
   "office_phone": "555-555-5555",
   "address_string": "123 Main St, Phoenix, AZ 85001",
   "notes": "This is a note",
   "status": "ACTIVE",
   "transaction_tags": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "key": "department",
      "value": "sales",
      "dimension_display_name": "Department",
      "value_display_name": "Sales Team",
      "dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
      "definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "created_at": "2024-02-27T02:16:40.389772Z",
      "updated_at": "2024-02-27T02:16:40.389772Z",
      "deleted_at": null,
      "archived_at": null
    }
  ]
 }
}
I