跳转到主要内容
POST
/
payment
curl --request POST \
  --url https://uat-api.clinkbill.com/api/payment \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '
{
  "customerId": "cus_xxxxx",
  "productId": "prd_xxxxx",
  "priceId": "price_xxxxx",
  "paymentInstrumentId": "pi_xxxxx",
  "paymentMethodType": "CARD",
  "returnUrl": "https://merchant.example.com/payment/return",
  "merchantReferenceId": "pay_ref_123",
  "platformType": "WEB",
  "deviceType": "Android"
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "orderId": "<string>",
    "sessionId": "<string>",
    "action": {
      "redirectUrl": "<string>",
      "walletHandleRedirectOrDisplayQrCode": {
        "imageUrlPng": "<string>",
        "imageUrlSvg": "<string>",
        "imageDataUrl": "<string>",
        "hostedInstructionsUrl": "<string>",
        "mobileAuthUrl": "<string>",
        "fallbackUrl": "<string>",
        "packageName": "<string>",
        "expiresAt": 123,
        "expiresSecond": 123
      },
      "paymentMethodType": "<string>",
      "postData": {}
    },
    "amount": 123,
    "currency": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.clinkbill.com/llms.txt

Use this file to discover all available pages before exploring further.

授权

X-API-KEY
string
header
必填

Your secret API key obtained from the Clink dashboard (Developers section)

X-Timestamp
string
header
必填

Current timestamp in milliseconds since Unix epoch (required for request signing)

请求体

application/json

Parameters required to create a one-time payment by API. Provide at least one customer identifier. Provide either priceId with productId, or amount with currency.

paymentInstrumentId
string
必填

Existing payment instrument ID.

paymentMethodType
enum<string>
必填

Payment method type. Supported values are uppercase.

可用选项:
ALIPAY,
CARD,
CASHAPP,
GCASH,
KAKAO,
PROMPTPAY,
QRIS,
TNG,
WECHAT
returnUrl
string
必填

URL where the customer is redirected after required payment actions.

customerId
string

Existing customer ID. At least one customer identifier is required.

customerEmail
string

Customer email. Used to resolve or create a customer when customerId is not provided.

referenceCustomerId
string

Merchant-side customer ID used to resolve, create, or bind a customer.

priceId
string

Predefined one-time price ID. If provided, productId is required.

productId
string

Product ID. Required when priceId is provided.

priceDataList
object[]

Product and price line items for direct amount payments or display/risk data.

amount
number

Direct payment amount. Required with currency when priceId is not provided.

currency
string

Direct payment currency. Required with amount when priceId is not provided.

merchantReferenceId
string

Merchant-side reference ID for reconciliation.

promotionCode
string

Promotion code to apply.

metadata
object

Merchant metadata. Values must be strings.

platformType
enum<string>

Platform type. Supported values are WEB and WAP.

可用选项:
WEB,
WAP
deviceType
enum<string>

Device type. Supported values are Android and iOS.

可用选项:
Android,
iOS

响应

Payment created successfully

code
integer<int32>

Response status code, 200 when success

示例:

200

msg
string

Brief description of what happened, 'success' when happy case

示例:

"success"

data
object

Response data returned after creating a one-time payment. It contains the order and session identifiers, together with the payment flow result.