Add a price variant to a product
A one-time price, a subscription (interval required), pay-what-you-want or free. On a published product the price is live at once.
Scope: products.write.
POST
/v1/products/{slug}/variantsAuthorization
AuthorizationBearer token (API Key) · headerrequiredAPI Key for programmatic access (format: insy_xxxxx)
Path parameters
slugstringrequiredHeader parameters
Idempotency-KeystringUp to 255 characters. A retry with the same key and body returns the first result instead of acting twice.
Request body
requiredapplication/jsonnamestringrequiredmin length 2 · max length 100
descriptionstringrequiredmin length 2 · max length 3000
priceCentsnumberrequiredPrice in minor units (cents); 0 for a free variant.
min 0
currencyobjectDefaults to the product's currency.
Show propertiesHide properties
objectpriceTypeobjectShow propertiesHide properties
objectintervalstringRequired when priceType is subscription.
Allowed:
monthyearResponses
201Successful response
successbooleanrequiredWhether the request was successful
errorCodestringrequiredThe error code returned by the request
Allowed:
not_foundbad_requestalready_existsunauthorizedforbiddeninternal_server_errorservice_unavailabletimeoutconflictprecondition_failedunprocessable_entitytoo_many_requestsmessagestringrequiredThe message returned by the request
dataV1VariantCreatedObjectShow propertiesHide properties
productstringrequiredProduct name.
variantV1VariantObjectrequiredShow propertiesHide properties
idstringrequirednamestringrequiredpriceobjectWhat the saved variant charges.
Show propertiesHide properties
amountCentsnumberrequiredMinor units (cents).
currencystring | nullrequiredpriceTypestringAllowed:
one_timesubscriptionfreepay_what_you_wantintervalstring | null400Invalid input (`errorCode: bad_request`, `reason: invalid_input`).
401Missing, invalid or expired access token or API key.
403The token lacks the operation's scope (`reason: insufficient_scope`).
409The first request with this Idempotency-Key is still running (`reason: action_pending`).
422This Idempotency-Key was used with a different request (`reason: idempotency_key_reused`).
429Per-account rate limit (120/min, 3000/h, shared with `/mcp`); see `Retry-After`.
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.insy.io/v1/products/string/variants" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"priceCents": 0,
"currency": "USD",
"priceType": "one_time",
"interval": "month"
}'const response = await fetch("https://api.insy.io/v1/products/string/variants", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "string",
"description": "string",
"priceCents": 0,
"currency": "USD",
"priceType": "one_time",
"interval": "month"
})
});import requests
response = requests.post(
"https://api.insy.io/v1/products/string/variants",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"name": "string",
"description": "string",
"priceCents": 0,
"currency": "USD",
"priceType": "one_time",
"interval": "month"
},
)Response
{
"success": true,
"errorCode": "not_found",
"message": "Success",
"data": {
"product": "string",
"variant": {
"id": "string",
"name": "string",
"price": {
"amountCents": 0,
"currency": "PLN"
},
"priceType": "one_time",
"interval": "month"
}
}
}Invalid input (`errorCode: bad_request`, `reason: invalid_input`).
Missing, invalid or expired access token or API key.
The token lacks the operation's scope (`reason: insufficient_scope`).
The first request with this Idempotency-Key is still running (`reason: action_pending`).
This Idempotency-Key was used with a different request (`reason: idempotency_key_reused`).
Per-account rate limit (120/min, 3000/h, shared with `/mcp`); see `Retry-After`.