Update subscription

Applies one change to a subscription. free_period grants free billing periods that start when the current paid period ends: the subscriber keeps access, is not charged at the next renewal date, and billing resumes at the plan's normal price when the free period ends. A scheduled cancellation is reversed. Rejections return FAILED_PRECONDITION with reason SUBSCRIPTION_NOT_ELIGIBLE, FREE_PERIOD_ALREADY_ACTIVE or RENEWAL_IN_PROGRESS. Reusing an idempotency_key with different parameters returns ALREADY_EXISTS.

POST
/sdk/subscriptions/{id}

Authorization

Authorization<token>

Bearer token authentication for client-side SDK operations. Format: 'Authorization: Bearer '

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/sdk/subscriptions/string" \  -H "Content-Type: application/json" \  -d '{    "idempotencyKey": "string"  }'
{  "id": "string",  "externalAccountId": "string",  "planId": "string",  "status": "string",  "period": {    "value": 0,    "unit": "string"  },  "trialEnd": "2019-08-24T14:15:22Z",  "accessEndDate": "2019-08-24T14:15:22Z",  "currentPeriodEnd": "2019-08-24T14:15:22Z",  "nextBillingDate": "2019-08-24T14:15:22Z",  "cancelAtPeriodEnd": true,  "canceledAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "checkoutLinkMetadata": {    "property1": "string",    "property2": "string"  },  "freePeriod": {    "type": "FREE_PERIOD_TYPE_UNSPECIFIED",    "startsAt": "2019-08-24T14:15:22Z",    "endsAt": "2019-08-24T14:15:22Z"  }}

How is this guide?