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,
  "interval": "MONTH",
  "intervalCount": 2
}
'
{
  "errorCode": "bad_request",
  "errorDescription": "Failed to read request"
}
All editable fields can only be modified if the subscription is in one of: TRIALING, ACTIVE, UNPAID, PAUSED

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
Pattern: ^[a-zA-Z0-9\-_:\.]+$

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).

Example:

1000

newCycleCount
integer<int64>

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

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.

Example:

1753104947000

interval
enum<string>

The interval group between subscriptions.

⚠️ Please note: When editing interval, intervalCount and newNextPaymentDate must also be provided.

Available options:
DAY,
WEEK,
MONTH,
YEAR
Example:

"MONTH"

intervalCount
integer<int64>

The number of intervals between subscription billings. For example, interval = MONTH and intervalCount = 3 bills every 3 months.

⚠️ Please note: When editing intervalCount, interval and newNextPaymentDate must also be provided.

Example:

2

Response

Subscription edited successfully