Skip to main content
POST
/
subscription
/
edit
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/subscription/edit \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscriptionId": "sub_fooBOwYsaK50AEfK",
  "newAmount": 1000,
  "newCycleCount": 6,
  "newNextPaymentDate": 1753104947000
}
'
{
  "errorCode": "bad_request",
  "errorDescription": "Failed to read request"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

Idempotency-Key
string

A unique key for making the request idempotent. Must match pattern: ^[a-zA-Z0-9\-_:\.]+$. See Idempotent Requests for more details.

Maximum string length: 255

Body

application/json
subscriptionId
string
required

Unique identifier of the subscription

Example:

"sub_fooBOwYsaK50AEfK"

newAmount
integer<int64>

New recurring amount for the subscription, if changed. The amount in lowest count unit. e.g.: For USD 1, amount is 100 representing 100 cents (The minimum amount should be greater than 1 USD).

šŸ”’ Can only be edited if the subscription is in one of: TRIALING, ACTIVE, UNPAID

Example:

1000

newCycleCount
integer<int64>

New number of billing cycles for the subscription, if changed.

šŸ”’ Can only be edited if the subscription is in one of: TRIALING, ACTIVE, UNPAID

Example:

6

newNextPaymentDate
integer<int64>

New next payment date in epoch milliseconds, if changed. Future payments will be deducted at the frequency interval defined in the subscription, calculated from the new next payment date.

šŸ”’ Can only be edited if the subscription is in one of: TRIALING, ACTIVE, UNPAID

Example:

1753104947000

Response

Subscription edited successfully