Skip to main content
POST
/
subscription
/
merchant
/
one-time-charge
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/subscription/merchant/one-time-charge \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscriptionId": "sub_fooBOwYsaK50AEfK",
  "amount": 500,
  "currency": "USD",
  "comments": "One-time setup fee for premium add-on"
}
'
{
  "intentId": "in_gKAqR0DjLeOihdTE",
  "status": "SUCCESS",
  "errorCode": null,
  "errorMessage": null
}

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

Subscription One Time Charge

subscriptionId
string
required

Unique identifier of the subscription to charge against. The subscription's saved payment method will be used for this charge.

Example:

"sub_fooBOwYsaK50AEfK"

amount
integer<int64>
required

The amount in lowest count unit. e.g.: For USD 1, amount is 100 representing 100 cents. Must be within the currency's supported minimum and maximum bounds.

Example:

500

currency
string
required

Three letter abbreviation of the currency. Refer supported currencies

Example:

"USD"

comments
string

Optional free-form note describing the reason for this one-time charge.

Example:

"One-time setup fee for premium add-on"

Response

Subscription One Time Charge response

intentId
string

Unique identifier of the payment intent created for this one-time charge.

Example:

"in_gKAqR0DjLeOihdTE"

status
string

The status of the payment intent. Refer payment intent status

Example:

"SUCCESS"

errorCode
string | null

Machine readable failure reason when status is FAILED. null on a successful charge. See all possible values here.

Example:

"card_declined"

errorMessage
string | null

Human readable description of the failure reason when the charge was not successful. null on a successful charge.

Example:

"The payment has been declined by the customer's bank."