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
idstring

Unique identifier for the object.

namestring

The product's name, meant to be displayable to the customer.

livemodeboolean

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

imagenullable string

A URL of image for this product, meant to be displayable to the customer.

descriptionstring

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.

urlnullable string

A URL of a publicly-accessible webpage for this product.

shippableboolean

Whether this product is shipped (i.e., physical goods).

activeboolean

Whether the product is currently available for purchase.

default_pricepositive integer

The default price for this product in cents.

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 PRODUCT OBJECT
{
  "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
nameREQUIREDstring

The product's name, meant to be displayable to the customer.

descriptionREQUIREDstring

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.

default_priceREQUIREDinteger

The default price for this product in cents.

purchase_typeREQUIREDenum

Specifies product type. Either one_time or recurring.

recurring_intervalenum

Specifies billing frequency. Either daily, monthly, weekly, yearly, every_3_months, or every_6_months. Required if purchase_type is recurring.

shippableboolean

Whether this product is shipped (i.e., physical goods).

urlstring

A URL of a publicly-accessible webpage for this product.

Returns

Returns a product object if the call succeeded.

POST/v1/products
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"
}'
RESPONSE
{
  "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
namestring

The product's name, meant to be displayable to the customer.

descriptionstring

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.

default_priceinteger

The default price for this product in cents.

shippableboolean

Whether this product is shipped (i.e., physical goods).

urlstring

A URL of a publicly-accessible webpage for this product.

Returns

Returns the product object if the update succeeded.

PATCH/v1/products/:id
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"
}'
RESPONSE
{
  "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.

GET/v1/products/:id
curl --request GET \
  --url https://api.framepayments.com/v1/products/6113c3cb-2304-45e1-9551-fa7fb804418f \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
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 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.

GET/v1/products
curl --request GET \
  --url https://api.framepayments.com/v1/products \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "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.

DELETE/v1/products/:id
curl --request DELETE \
  --url https://api.framepayments.com/v1/products/d533a3e1-e1fc-4502-8366-f8115c1cd51b \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
namestring

The product's name, meant to be displayable to the customer.

activeboolean

Whether the product is currently available for purchase.

shippableboolean

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.

GET/v1/products/search
curl --request GET \
  --url 'https://api.framepayments.com/v1/products/search?name=Silver&active=true' \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
    }
  ]
}