Customers

This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.

The Customer object

Attributes
idstring

Unique identifier for the object.

billing_addressnullable dictionary

The customer's billing address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

shipping_addressnullable dictionary

The customer's shipping address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

namestring

The customer's full name or business name.

descriptionnullable string

An arbitrary string attached to the object. Often useful for displaying to users.

emailstring

The customer's email address.

phonenullable string

The customer's phone number.

livemodeboolean

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

createdtimestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

updatedtimestamp

Time at which the object was last updated. Measured in seconds since the Unix epoch.

objectstring

String representing the object's type. Objects of the same type share the same value.

THE CUSTOMER OBJECT
{
  "id": "618938e5-57c4-47f7-8da5-5bc607d97101",
  "created": 1713323382,
  "shipping_address": null,
  "updated": 1713323382,
  "livemode": false,
  "name": "John",
  "phone": null,
  "email": "john@website.com",
  "description": null,
  "object": "customer",
  "metadata": [],
  "billing_address": null
}

Create a customer

Parameters
nameREQUIREDstring

The customer's full name or business name.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

emailREQUIREDstring

The customer's email address.

metadatadictionary

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

phonestring

The customer's phone number.

billing_addressdictionary

The customer's billing address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

shipping_addressdictionary

The customer's shipping address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

Returns

Returns the Customer object after successful customer creation. Returns an error if create parameters are invalid.

POST/v1/customers
curl --request POST \
  --url https://api.framepayments.com/v1/customers \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "John",
  "email": "john@website.com"
}'
RESPONSE
{
  "id": "618938e5-57c4-47f7-8da5-5bc607d97101",
  "created": 1713323382,
  "shipping_address": null,
  "updated": 1713323382,
  "livemode": false,
  "name": "John",
  "phone": null,
  "email": "john@website.com",
  "description": null,
  "object": "customer",
  "metadata": [],
  "billing_address": null
}

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts mostly the same arguments as the customer creation call.

Parameters
namestring

The customer's full name or business name.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

emailstring

The customer's email address.

metadatadictionary

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

phonestring

The customer's phone number.

billing_addressdictionary

The customer's billing address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

shipping_addressdictionary

The customer's shipping address.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

Returns

Returns the customer object if the update succeeded. Returns an error if update parameters are invalid.

PATCH/v1/customers/:id
curl --request PATCH \
  --url https://api.framepayments.com/v1/customers/618938e5-57c4-47f7-8da5-5bc607d97101 \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "John Doe"
}'
RESPONSE
{
  "id": "618938e5-57c4-47f7-8da5-5bc607d97101",
  "created": 1713323382,
  "shipping_address": null,
  "updated": 1713441199,
  "livemode": false,
  "name": "John Doe",
  "phone": null,
  "email": "john@website.com",
  "description": null,
  "object": "customer",
  "metadata": [],
  "billing_address": null
}

Retrieve a customer

Retrieves a Customer object.

Parameters

No parameters.

Returns

Returns the Customer object for a valid identifier. If it's for a deleted Customer, a subset of the customer's information is returned, including a deleted property that's set to true.

GET/v1/customers/:id
curl --request GET \
  --url https://api.framepayments.com/v1/customers/618938e5-57c4-47f7-8da5-5bc607d97101 \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "618938e5-57c4-47f7-8da5-5bc607d97101",
  "created": 1713323382,
  "shipping_address": null,
  "updated": 1713323382,
  "livemode": false,
  "name": "John",
  "phone": null,
  "email": "john@website.com",
  "description": null,
  "object": "customer",
  "metadata": [],
  "billing_address": null
}

List all customers

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

Parameters
per_pageinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 50.

pageinteger

The page offset at which you'd like to resume fetching data.

Returns

A dictionary with a data property that contains an array of up to limit customers. Each entry in the array is a separate customer object. If no more customers are available, the resulting array will be empty.

GET/v1/customers
curl --request GET \
  --url https://api.framepayments.com/v1/customers \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "meta": {
    "page": 1,
    "url": "/v1/customers",
    "has_more": false,
    "prev": null,
    "next": null
  },
  "data": [
    {
      "id": "618938e5-57c4-47f7-8da5-5bc607d97101",
      "created": 1713323382,
      "shipping_address": null,
      "updated": 1713323382,
      "livemode": false,
      "name": "John",
      "phone": null,
      "email": "john@website.com",
      "description": null,
      "object": "customer",
      "metadata": [],
      "billing_address": null
    },
    {...},
    {...}
  ]
}

Delete a customer

Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.

Parameters

No parameters.

Returns

Returns an object with a deleted parameter on success. If the customer ID does not exist, this call returns an error.

Unlike other objects, deleted customers can still be retrieved through the API in order to be able to track their history. Deleting customers removes all credit card details and prevents any further operations to be performed (such as adding a new subscription).

DELETE/v1/customers/:id
curl --request DELETE \
  --url https://api.framepayments.com/v1/customers/a8d21fd2-b5ae-499f-b844-c0a66fe183b5 \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "a8d21fd2-b5ae-499f-b844-c0a66fe183b5",
  "object": "customer",
  "deleted": true
}

Search customers

Search for customers you've previously created using Frame's Search Query Language. Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages.

Parameters
namestring

The customer's full name or business name.

emailstring

The customer's email address.

phonestring

The customer's phone number.

created_beforeinteger

Time at which the object was created. Measured in seconds since the Unix epoch.

created_afterinteger

Time at which the object was created. Measured in seconds since the Unix epoch.

Returns

A dictionary with a data property that contains an array of up to limit customers. If no objects match the query, the resulting array will be empty.

GET/v1/customers/search
curl --request GET \
  --url 'https://api.framepayments.com/v1/customers/search?name=Shawn' \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "meta": {
    "page": 1,
    "url": "/v1/customers/search?name=Shawn",
    "has_more": false,
    "prev": null,
    "next": null
  },
  "data": [
    {
      "id": "a8d21fd2-b5ae-499f-b844-c0a66fe183b5",
      "created": 1711983995,
      "shipping_address": null,
      "updated": 1713453756,
      "livemode": false,
      "name": "Shawn",
      "phone": "12013514000",
      "email": "mendez@example.com",
      "description": "",
      "object": "customer",
      "metadata": [],
      "billing_address": null
    }
  ]
}