docs

Create a product

Creates a new product. Optionally includes: - An image URL (use the /upload-url endpoint to get a one-time upload URL first) - A default price object which will be set as the default price for this product

POST
/products
  Creates a new product.
  
  Optionally includes:
  - An image URL (use the /upload-url endpoint to get a one-time upload URL first)
  - A default price object which will be set as the default price for this product
AuthorizationBearer <token>

API key for merchant integrations. Send as Authorization: Bearer <your key>.

In: header

Request Body

application/json

Product data. The image field should be a URL string from Cloudflare Images.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/products" \  -H "Content-Type: application/json" \  -d '{    "name": "Premium Plan"  }'
{
  "id": "prod_abc123",
  "name": "Premium Plan",
  "description": "Premium subscription plan",
  "image": "https://example.com/image.jpg",
  "unitLabel": "month",
  "active": true,
  "isSystemCreated": false,
  "metadata": {
    "category": "subscription"
  },
  "prices": [
    {
      "id": "price_abc123",
      "unitAmount": 10000,
      "currency": "EGP",
      "type": "ONE_TIME",
      "interval": "MONTH",
      "intervalCount": 1,
      "customUnitAmount": {},
      "stock": 100,
      "createdAt": "2024-01-01T00:00:00.000Z"
    }
  ],
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z"
}
Empty