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
Unique identifier for the object.
The customer's billing address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
Address line 2 (e.g., apartment, suite, unit, or building).
The customer's shipping address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
Address line 2 (e.g., apartment, suite, unit, or building).
The customer's full name or business name.
An arbitrary string attached to the object. Often useful for displaying to users.
The customer's email address.
The customer's phone number.
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
Time at which the object was created. Measured in seconds since the Unix epoch.
Time at which the object was last updated. Measured in seconds since the Unix epoch.
String representing the object's type. Objects of the same type share the same value.
{
"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
The customer's full name or business name.
An arbitrary string attached to the object. Often useful for displaying to users.
The customer's email address.
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.
The customer's phone number.
The customer's billing address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
Address line 2 (e.g., apartment, suite, unit, or building).
The customer's shipping address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
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.
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"
}'
{
"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
The customer's full name or business name.
An arbitrary string attached to the object. Often useful for displaying to users.
The customer's email address.
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.
The customer's phone number.
The customer's billing address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
Address line 2 (e.g., apartment, suite, unit, or building).
The customer's shipping address.
City, district, suburb, town, or village.
Two-letter country code (ISO 3166-1 alpha-2).
State, county, province, or region.
ZIP or postal code.
Address line 1 (e.g., street, PO Box, or company name).
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.
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"
}'
{
"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.
curl --request GET \
--url https://api.framepayments.com/v1/customers/618938e5-57c4-47f7-8da5-5bc607d97101 \
--header 'Authorization: Bearer API_KEY'
{
"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
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 50.
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.
curl --request GET \
--url https://api.framepayments.com/v1/customers \
--header 'Authorization: Bearer API_KEY'
{
"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).
curl --request DELETE \
--url https://api.framepayments.com/v1/customers/a8d21fd2-b5ae-499f-b844-c0a66fe183b5 \
--header 'Authorization: Bearer API_KEY'
{
"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
The customer's full name or business name.
The customer's email address.
The customer's phone number.
Time at which the object was created. Measured in seconds since the Unix epoch.
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.
curl --request GET \
--url 'https://api.framepayments.com/v1/customers/search?name=Shawn' \
--header 'Authorization: Bearer API_KEY'
{
"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
}
]
}