Publish a subscription product from test to production environment. This is a one-way, first-publish-only operation.
POST /v1/actions/subscription-product/publish-product
Authentication: API Key
Do not include the X-Environment header for this endpoint. Publishing is always one-way from test to production.
Request Body
Field Type Required Description idstring Yes Product ID (PROD_xxx format)
Example Request
SDK
TypeScript (fetch)
Java
Python
Go
Rust
C
C++
cURL
wget
await client . subscriptionProducts . publish ({
id: "PROD_3F7H2J5L8N1Q4S6U" ,
});
Success Response (200)
{
"data" : {
"product" : {
"id" : "PROD_3F7H2J5L8N1Q4S6U" ,
"storeId" : "STO_2D5F8G3H1K4M6N9P" ,
"name" : "Pro Plan" ,
"description" : "Full access to all Pro features." ,
"billingPeriod" : "monthly" ,
"prices" : {
"USD" : { "amount" : "29.00" , "taxCategory" : "saas" },
"EUR" : { "amount" : "27.00" , "taxCategory" : "saas" }
},
"media" : [],
"successUrl" : "https://example.com/welcome" ,
"metadata" : { "trialDays" : 14 },
"status" : "active" ,
"createdAt" : "2026-03-30T10:30:00.000Z" ,
"updatedAt" : "2026-03-30T12:00:00.000Z"
}
}
}
Response Fields
Same as Create Subscription Product response .
Only the first publish is supported. Once a product has a production version, this endpoint returns an error. To update a published product, use the Update Product endpoint in the production environment.
Errors
Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts).
Status errors[0].messageWhat it means Recommended handling 400 Missing header: x-context-merchant-idThe merchant context header was not forwarded Fix your SDK configuration 400 Missing required field: idRequest body did not include id Add id, resubmit 400 Expected format: PROD_xxx, got "X"id is not a valid Short IDUse a PROD_ prefixed Short ID 400 No test version foundThe product has no version in the test environment to publish Create and activate a test version first via Update Product / Update Status 400 Test version is not activeTest version exists but its status is inactive Activate the test version via Update Status, then publish 400 Already published to productionProduct already has a production version (publish is first-publish-only) Use Update Product in the production environment instead 401 UnauthorizedAuthentication failed Verify API key, timestamp, and signature 404 Product not found / Source version not foundProduct ID does not exist (or its source version is missing) Verify the product ID 500 Internal server errorTransient downstream failure Retry with exponential backoff (start 5s, max 3 attempts)