Retrieve a product
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:4000/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://localhost:4000/v1/products/{id} \
--header 'Authorization: Bearer <token>'{
"id": "prod_9Xk2mQ1pL0vRsT",
"object": "product",
"name": "<string>",
"description": "<string>",
"rate_usd_per_second": "0.004",
"rate_per_second_wei": "4000",
"currency": "ausd",
"allow_pause": true,
"start_mode": "checkout",
"active": true,
"active_subscriptions": 123,
"livemode": true,
"created": 123
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}Products
Retrieve a product
GET
/
v1
/
products
/
{id}
Retrieve a product
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:4000/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://localhost:4000/v1/products/{id} \
--header 'Authorization: Bearer <token>'{
"id": "prod_9Xk2mQ1pL0vRsT",
"object": "product",
"name": "<string>",
"description": "<string>",
"rate_usd_per_second": "0.004",
"rate_per_second_wei": "4000",
"currency": "ausd",
"allow_pause": true,
"start_mode": "checkout",
"active": true,
"active_subscriptions": 123,
"livemode": true,
"created": 123
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "api_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Your secret key: sk_test_… for test mode, sk_live_… for live. Server-side only.
Path Parameters
Response
The product.
Example:
"prod_9Xk2mQ1pL0vRsT"
Available options:
product USD per second as a decimal string. Never a float.
Pattern:
^\d+(\.\d+)?$Example:
"0.004"
Rate in token base units (6 decimals for AUSD).
Example:
"4000"
Available options:
ausd checkout starts the meter when the subscriber authorises; merchant waits until you call subscriptions.start.
Available options:
checkout, merchant Running or paused meters on this product.
Unix seconds.