Products
Introduction
A product represents the item being sold to a customer. It should contain all the necessary information about what the customer is purchasing including the price and product details.
Create a Product
There are 2 types of products you can create,
- A
Regularproduct used for one-time purchases in a payment page. - A
Subscriptionproduct used for making recurring purchases.
1a. Creating a Regular Product
Create a regular product by sending a request with the most basic parameters.
curl -X POST 'https://api.breeze.cash/v2/products' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "Example Regular Product",
"description": "More details about this product",
"image": "https://example.com/test.jpg",
"clientProductId": "<(optional)your-unique-product-id>",
"type": "REGULAR",
"amount": "100",
"currency": "USD",
}'A successful response should look like:
{
"status": "SUCCEEDED",
"data": {
"name": "Example Regular Product",
"description": "More details about this product",
"image": "https://example.com/test.jpg",
"clientProductId": "<(optional)your-unique-product-id>",
"status": "PENDING",
"type": "REGULAR",
"amount": "100",
"currency": "USD",
"id": "prd_123abc456"
}
}1b. Creating a Subscription Product
Create a subscription product by sending a request with the most basic parameters.
curl -X POST 'https://api.breeze.cash/v2/products' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "Example Subscription Product",
"description": "More details about this product",
"images": "https://example.com/test.jpg",
"type": "SUBSCRIPTION",
"clientProductId": "<your-unique-product-id>",
}'A successful response should look like:
{
"status": "SUCCEEDED",
"data": {
"name": "Example Subscription Product",
"description": "More details about this product",
"image": "https://example.com/test.jpg",
"clientProductId": "<your-unique-product-id>",
"status": "PENDING",
"type": "SUBSCRIPTION",
"id": "prd_234abc567",
...
}
}2. GET all Products for a merchant
Request
curl -X GET 'api.breeze.cash/v2/products' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
Response
{
"status": "SUCCEEDED",
"data": [
{
"clientProductId": "testId",
"_lock": {
"locked": false
},
"image": "{{IMAGE_URL}}",
"type": "REGULAR",
"livemode": false,
"description": "test",
"merchantId": "{{merchant_ID}}",
"status": "ACTIVE",
"id": "{{product_id}}",
"createdAt": 1767778980568,
"displayName": "Test Display",
"defaultPriceId": "{{default_price_id}}",
"updatedAt": 1767778980604,
"prices": [
{
"type": "ONE_TIME",
"createdAt": 1767778980604,
"id": "{{price_id}}",
"currency": "USD",
"_lock": {
"locked": false
},
"livemode": false,
"status": "ACTIVE",
"amountStr": "10000",
"productId": "{{product_id}}"
}
]
}
]3. Creating a Subscription Product Price
Create a price for a subscription product.
curl -X POST 'https://api.breeze.cash/v1/products/prd_234abc567/price' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
--data-raw '{
"currency": "USD",
"amount": 1000,
"type": "RECURRING",
"billingCycleConfig": {
"interval": "month",
"frequency": 1,
},
}'A successful response should look like:
{
"status": "SUCCEEDED",
"data": {
"currency": "USD",
"amountStr": "1000",
"status": "ACTIVE",
"productId": "prd_234abc567",
"type": "RECURRING",
"billingCycleConfig": {
"interval": "month",
"frequency": 1
},
"id": "prc_345abc678",
...
}
}Creating a Payment Page with an existing Regular Product
With your product created, create a payment page for this product by passing a list of product IDs into the request.
curl -X POST 'https://api.breeze.cash/v1/payment_pages' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
--data-raw '{
"lineItems": [
{
"product": "prd_123abc456",
"quantity": 1
}
],
"billingEmail": "[email protected]",
"clientReferenceId": "order-<your-unique-id>",
"successReturnUrl": "https://your-domain.com/order-complete",
"failReturnUrl": "https://your-domain.com/order-aborted",
"customer": {
"referenceId": "<your-unique-user-id>",
}
}'Continue reading here: https://docs.breeze.cash/docs/quick-start#/
Creating a Subscription with an existing Product
You can also create a subscription by passing the product and price into the request.
curl -X POST 'https://api.breeze.cash/merchant/v1/subscriptions' \
-u "YOUR_API_KEY:" \
--header 'Content-Type: application/json' \
--data-raw '{
"clientReferenceId": "your-unique-subscription-reference-id",
"productId": "prd_abc123xyz",
"priceId": "prc_abc123xyz",
"customer": {
"id": "cust_123xyz"
}
}'Continue reading here: https://docs.breeze.cash/docs/quick-start-subscription#/
Updated 20 days ago
