Products API

Manage products — lightweight anchor entities for the things you sell. Products can be linked to deals.

Endpoints

MethodPathDescription
POST/productsCreate a product
GET/productsList products
GET/products/:idGet a product
PATCH/products/:idUpdate a product
DELETE/products/:idDelete a product

Create a product

POST /products

Request body

FieldTypeRequiredDescription
namestringyesProduct name
slugstringyesURL-safe identifier (unique per org)
descriptionstringnoProduct description
priceintegernoPrice in cents
currencystringnoISO 4217 currency code (e.g. USD)
is_activebooleannoWhether the product is active (default true)
metadataobjectnoArbitrary key-value data

Example

curl -X POST "$REX_URL/products" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Enterprise Plan",
    "slug": "enterprise-plan",
    "description": "Full-featured plan for large teams",
    "price": 99900,
    "currency": "USD"
  }'

Response

{
  "data": {
    "id": "prod_01HQ...",
    "name": "Enterprise Plan",
    "slug": "enterprise-plan",
    "description": "Full-featured plan for large teams",
    "price": 99900,
    "currency": "USD",
    "is_active": true,
    "created_at": "2026-03-16T12:00:00Z",
    "updated_at": "2026-03-16T12:00:00Z"
  }
}

List products

GET /products

Query parameters

ParameterTypeDescription
cursorstringPagination cursor
limitintegerResults per page (default 50, max 200)
is_activebooleanFilter by active status

Example

curl "$REX_URL/products?is_active=true" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "prod_01HQ...",
      "name": "Enterprise Plan",
      "slug": "enterprise-plan",
      "price": 99900,
      "currency": "USD",
      "is_active": true,
      "created_at": "2026-03-16T12:00:00Z",
      "updated_at": "2026-03-16T12:00:00Z"
    }
  ],
  "has_more": false
}

Get a product

GET /products/:id

Example

curl "$REX_URL/products/prod_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

Same shape as the create response.

Update a product

PATCH /products/:id

All fields from the create request body are accepted. Only provided fields are updated.

Example

curl -X PATCH "$REX_URL/products/prod_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "price": 119900
  }'

Response

Returns the full updated product.

Delete a product

DELETE /products/:id

Example

curl -X DELETE "$REX_URL/products/prod_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

204 No Content on success.

Was this page helpful?

·