List products
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:4000/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://localhost:4000/v1/products \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"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
}
],
"has_more": true,
"url": "<string>"
}{
"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
List products
GET
/
v1
/
products
List products
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:4000/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://localhost:4000/v1/products \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"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
}
],
"has_more": true,
"url": "<string>"
}{
"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.
Query Parameters
Required range:
1 <= x <= 100Example:
10
Id of the last object on the previous page.
Only active (true) or only archived (false) Products.
Available options:
true, false