Skip to main content
POST
/
api
/
transactions
payment transactions
curl --request POST \
  --url https://api.example.com/api/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "transactionId": "string",
  "description": "string",
  "amount": "string",
  "currency": "string",
  "paymentGatewayType": "string",
  "completePayRedirectUrl": "string",
  "onlineScenario": true,
  "customerIdentifier": "string",
  "cancelPayRedirectUrl": "string"
}
'
{
  "paymentUrl": "<string>",
  "paymentId": "<string>",
  "expireTime": 123,
  "status": "waiting"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
trace-id
string
default:{{$string.uuid}}

Body

application/json
transactionId
string
required

The business transaction id corresponding to the payment, such as order number

amount
string
required
currency
string
required

ISO 4217 standard

date
string
required
paymentGatewayType
enum<string>
required

alipay-page (Alipay) / wechat-pay-native (WeChat Pay) / stripe-connect (Stripe)

Available options:
stripe-connect,
alipay-page,
wechat-pay-native
completePayRedirectUrl
string
required

Both successful and failed payments are considered completed. When the payment gateway is Stripe, this field is required and must start with https

onlineScenario
boolean
required

True for instant payment, false for recurring payment

cancelPayRedirectUrl
string
required

When the payment gateway is Stripe, this field is required and must be a URL starting with https

description
string

Description of the business transaction

customerIdentifier
string

Customer unique identifier, which can be phone number/email/UUID, etc. When using Stripe payment, this value must be an email

Response

200 - application/json
paymentUrl
string
required

Alipay/Stripe can directly navigate to the payment page via this URL, while WeChat requires rendering this link into a QR code, which users scan to make a payment

paymentId
string
required

Unique ID generated when initiating payment

expireTime
integer
required

Payment timeout duration (in seconds)

status
enum<string>
required

Payment status

Available options:
waiting,
processing,
succeeded,
failed,
closed