Create a product
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rate_usd_per_second: '0.004',
description: '<string>',
allow_pause: true
})
};
fetch('http://localhost:4000/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://localhost:4000/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rate_usd_per_second": "0.004",
"description": "<string>",
"allow_pause": true
}
'{
"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
Create a product
POST
/
v1
/
products
Create a product
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rate_usd_per_second: '0.004',
description: '<string>',
allow_pause: true
})
};
fetch('http://localhost:4000/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://localhost:4000/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rate_usd_per_second": "0.004",
"description": "<string>",
"allow_pause": true
}
'{
"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
Body
application/json
Response
The created product.