Subscriptions

Update Subscription

Update Subscription items and handle proration behavior. Can modify prices, quantities, and add/remove items. The items array is the desired end state of the Subscription: items are paired to existing lines by offerId, missing ones are removed, and new ones are added (up to 20 total). All resulting items must share the same currency and billing period (recurring interval + interval count); otherwise the request is rejected with a 400. An item naming the offer already live and sending no unitPrice keeps the unit price that line bills now. On a subscription still billed at a discount, a single item naming another offer the discount covers and sending no unitPrice is priced from that offer with the same discount taken off; a change it cannot price is rejected with a 400. Exception: for a subscription managed in the new dashboard, each item names only its offerId and quantity, at the offer's own price and name, and prorationBehavior stays none: an upgrade is billed now and a downgrade on the next invoice. A unitPrice, a name or another prorationBehavior is rejected with a 400 before any change.

Authorization

Public key Secret key
x-fngs-public-key<token>

In: header

x-fngs-secret-key<token>

In: header

Path Parameters

subscriptionIdOrNumber*string

Subscription identifier - the initial order number, exactly as returned in subscription.id. Omit the leading # the dashboard shows: a #-prefixed value passes validation but resolves to nothing. Payment-provider subscription ids are not accepted.

Match^#?([0-9A-Za-z]{12,32}|[0-9]+)(-[0-9]+)?$

Request Body

application/json

PATCH /v0/subscriptions/:subscriptionIdOrNumber/update Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

PATCH
/v0/subscriptions/{subscriptionIdOrNumber}/update
curl -X PATCH "https://example.com/v0/subscriptions/ABC123DEF456/update" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "id": "si_1234567890",        "currency": "USD",        "value": 3999,        "quantity": 1,        "offerId": "123e4567-e89b-12d3-a456-426614174000"      }    ]  }'
{  "status": "success",  "data": {    "success": true  }}