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
idstringoptional

Unique identifier for the object.

billing_addressnullable dictionaryoptional

The customer's billing address.

shipping_addressnullable dictionaryoptional

The customer's shipping address.

namestringoptional

The customer's full name or business name.

statusenumoptional

Status of this Customer, one of active or blocked.

payment_methodsarray of dictionariesoptional

List of the customer's last 5 payment methods.

descriptionnullable stringoptional

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

emailstringoptional

The customer's email address.

phonenullable stringoptional

The customer's phone number.

date_of_birthnullable stringoptional

The customer's date of birth in YYYY-MM-DD format.

metadatadictionaryoptional

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

livemodebooleanoptional

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

createdtimestampoptional

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

updatedtimestampoptional

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

objectstringoptional

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

THE CUSTOMER OBJECT
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995552,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "active",
  "metadata": []
}

Create a customer

Parameters
namestring

The customer's full name or business name.

descriptionstringoptional

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

emailstring

The customer's email address.

phonestringoptional

The customer's phone number.

ssnstringoptional

The customer's Social Security Number in XXX-XX-XXXX or XXXXXXXXXX format. This field never returned in API responses.

date_of_birthstringoptional

The customer's date of birth in YYYY-MM-DD format.

metadatadictionaryoptional

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

billing_addressdictionaryoptional

The customer's billing address.

shipping_addressdictionaryoptional

The customer's shipping address.

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@example.com",
  "ssn": "123-45-6789",
  "date_of_birth": "1985-05-15"
}'
RESPONSE
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995552,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "active",
  "metadata": []
}

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
namestringoptional

The customer's full name or business name.

descriptionstringoptional

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

emailstringoptional

The customer's email address.

phonestringoptional

The customer's phone number.

ssnstringoptional

The customer's Social Security Number in XXX-XX-XXXX or XXXXXXXXXX format. This field is never returned in API responses. Cannot be removed once set.

date_of_birthstringoptional

The customer's date of birth in YYYY-MM-DD format. Cannot be removed once set.

metadatadictionaryoptional

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

billing_addressdictionaryoptional

The customer's billing address.

shipping_addressdictionaryoptional

The customer's shipping address.

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/55435398-ec47-4bb4-ac9e-64031481cf48 \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "John",
  "ssn": "123-45-6789",
  "date_of_birth": "1985-05-15"
}'
RESPONSE
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995552,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "active",
  "metadata": []
}

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/55435398-ec47-4bb4-ac9e-64031481cf48 \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995552,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "active",
  "metadata": []
}

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_pageintegeroptional

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

pageintegeroptional

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": "55435398-ec47-4bb4-ac9e-64031481cf48",
      "created": 1736995552,
      "payment_methods": [],
      "billing_address": null,
      "shipping_address": null,
      "updated": 1736995552,
      "livemode": false,
      "metadata": {},
      "name": "John",
      "phone": null,
      "email": "john@example.com",
      "description": null,
      "date_of_birth": "1985-05-15",
      "object": "customer",
      "status": "active",
      "metadata": []
    },
    {...},
    {...}
  ]
}

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
namestringoptional

The customer's full name or business name.

emailstringoptional

The customer's email address.

phonestringoptional

The customer's phone number.

created_beforeintegeroptional

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

created_afterintegeroptional

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=John' \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "meta": {
    "page": 1,
    "url": "/v1/customers/search?name=John",
    "has_more": false,
    "prev": null,
    "next": null
  },
  "data": [
    {
      "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
      "created": 1736995552,
      "payment_methods": [],
      "billing_address": null,
      "shipping_address": null,
      "updated": 1736995552,
      "livemode": false,
      "metadata": {},
      "name": "John",
      "phone": null,
      "email": "john@example.com",
      "description": null,
      "date_of_birth": "1985-05-15",
      "object": "customer",
      "status": "active",
      "metadata": []
    }
  ]
}

Block a customer

Blocks an active customer, preventing all future payment activities. All payment methods associated with the Customer become blocked.

Parameters

No parameters.

Returns

Returns the Customer object if the block succeeded. Returns an error if block parameters are invalid.

POST/v1/customers/:id/block
curl --request POST \
  --url https://api.framepayments.com/v1/customers/55435398-ec47-4bb4-ac9e-64031481cf48/block \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995850,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "blocked",
  "metadata": []
}

Unblock a customer

Reactivates a blocked customer, allowing them to resume payment activities.

Parameters

No parameters.

Returns

Returns the Customer object if the unblock succeeded. Returns an error if unblock parameters are invalid.

POST/v1/customers/:id/unblock
curl --request POST \
  --url https://api.framepayments.com/v1/customers/55435398-ec47-4bb4-ac9e-64031481cf48/unblock \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "55435398-ec47-4bb4-ac9e-64031481cf48",
  "created": 1736995552,
  "payment_methods": [],
  "billing_address": null,
  "shipping_address": null,
  "updated": 1736995940,
  "livemode": false,
  "metadata": {},
  "name": "John",
  "phone": null,
  "email": "john@example.com",
  "description": null,
  "date_of_birth": "1985-05-15",
  "object": "customer",
  "status": "active",
  "metadata": []
}