Products
Products encompass the distinct goods or services provided to your customers. For instance, you may offer variations such as Standard and Premium versions, with each variant constituting a separate product offering.
The Product object
Attributes
Unique identifier for the object.
The product's name, meant to be displayable to the customer.
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
A URL of image for this product, meant to be displayable to the customer.
The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
A URL of a publicly-accessible webpage for this product.
Whether this product is shipped (i.e., physical goods).
Whether the product is currently available for purchase.
The default price for this product in cents.
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": "6113c3cb-2304-45e1-9551-fa7fb804418f",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "Best plan for you!",
"url": null,
"shippable": false,
"object": "product",
"active": true,
"default_price": 500000,
"created": 1713435744,
"updated": 1713435744
}
Create a product
Creates a new product object.
Parameters
The product's name, meant to be displayable to the customer.
The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
The default price for this product in cents.
Specifies product type. Either one_time
or recurring
.
Specifies billing frequency. Either daily
, monthly
, weekly
, yearly
, every_3_months
, or every_6_months
. Required if purchase_type
is recurring
.
Whether this product is shipped (i.e., physical goods).
A URL of a publicly-accessible webpage for this product.
Returns
Returns a product object if the call succeeded.
curl --request POST \
--url https://api.framepayments.com/v1/products \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "Silver Plan",
"default_price": 5000,
"description": "Best plan for you!",
"purchase_type": "one_time"
}'
{
"id": "6113c3cb-2304-45e1-9551-fa7fb804418f",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "Best plan for you!",
"url": null,
"shippable": false,
"object": "product",
"active": true,
"default_price": 5000,
"created": 1713435744,
"updated": 1713435744
}
Update a product
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Parameters
The product's name, meant to be displayable to the customer.
The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
The default price for this product in cents.
Whether this product is shipped (i.e., physical goods).
A URL of a publicly-accessible webpage for this product.
Returns
Returns the product object if the update succeeded.
curl --request PATCH \
--url https://api.framepayments.com/v1/products/4a29843d-f47b-4117-b8b2-3416611b15b8 \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"description": "The most popular"
}'
{
"id": "4a29843d-f47b-4117-b8b2-3416611b15b8",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "The most popular",
"url": "https://framepayments.com",
"shippable": false,
"object": "product",
"active": true,
"default_price": 1200,
"created": 1722310781,
"updated": 1722313340
}
Retrieve a product
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Frame will return the corresponding product information.
Parameters
No parameters.
Returns
Returns a product object if a valid identifier was provided.
curl --request GET \
--url https://api.framepayments.com/v1/products/6113c3cb-2304-45e1-9551-fa7fb804418f \
--header 'Authorization: Bearer API_KEY'
{
"id": "6113c3cb-2304-45e1-9551-fa7fb804418f",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "Best plan for you!",
"url": null,
"shippable": false,
"object": "product",
"active": true,
"default_price": 500000,
"created": 1713435744,
"updated": 1713435744
}
List all products
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products 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
PaymentMethods of type type. Each entry in the array is a separate PaymentMethod object. If no more PaymentMethods are available, the resulting array will be empty.
curl --request GET \
--url https://api.framepayments.com/v1/products \
--header 'Authorization: Bearer API_KEY'
{
"meta": {
"page": 1,
"url": "/v1/products",
"has_more": false,
"prev": null,
"next": null
},
"data": [
{
"id": "6113c3cb-2304-45e1-9551-fa7fb804418f",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "Best plan for you!",
"url": null,
"shippable": false,
"object": "product",
"active": true,
"default_price": 500000,
"created": 1713435744,
"updated": 1713435744
},
{...},
{...}
]
}
Delete a product
Delete a product. Deleting a product is only possible if it has no charges associated with it.
Parameters
No parameters.
Returns
Returns a deleted object on success. Otherwise, this call returns an error.
curl --request DELETE \
--url https://api.framepayments.com/v1/products/d533a3e1-e1fc-4502-8366-f8115c1cd51b \
--header 'Authorization: Bearer API_KEY'
{
"id": "d533a3e1-e1fc-4502-8366-f8115c1cd51b",
"object": "product",
"deleted": true
}
Search products
Search for products 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 product's name, meant to be displayable to the customer.
Whether the product is currently available for purchase.
Whether this product is shipped (i.e., physical goods).
Returns
A dictionary with a data
property that contains an array of up to limit
products. If no objects match the query, the resulting array will be empty.
curl --request GET \
--url 'https://api.framepayments.com/v1/products/search?name=Silver&active=true' \
--header 'Authorization: Bearer API_KEY'
{
"meta": {
"page": 1,
"url": "/v1/products/search?name=Silver&active=true",
"has_more": false,
"prev": null,
"next": null
},
"products": [
{
"id": "6113c3cb-2304-45e1-9551-fa7fb804418f",
"name": "Silver Plan",
"livemode": false,
"image": null,
"description": "Best plan for you!",
"url": null,
"shippable": false,
"object": "product",
"active": true,
"default_price": 500000,
"created": 1713435744,
"updated": 1713435744
}
]
}