Skip to main content
POST
/
subscription
Create Subscription
curl --request POST \
  --url https://uat-api.clinkbill.com/api/subscription \
  --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",
  "paymentCurrency": "USD",
  "returnUrl": "https://merchant.example.com/subscription/return",
  "merchantReferenceId": "sub_ref_123",
  "metadata": {
    "orderNo": "SO-10001"
  },
  "platformType": "WEB",
  "deviceType": "Android"
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "subscriptionId": "<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>",
    "orderId": "<string>",
    "invoiceId": "<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.

Authorizations

X-API-KEY
string
header
required

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

X-Timestamp
string
header
required

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

Body

application/json

Parameters required to create a subscription by API. Provide at least one of customerId, customerEmail, or referenceCustomerId.

priceId
string
required

Recurring price ID.

productId
string
required

Product ID for the subscription.

paymentInstrumentId
string
required

Existing payment instrument ID used for the initial payment and renewals.

paymentMethodType
enum<string>
required

Payment method type. Supported values are uppercase.

Available options:
CARD,
GCASH
paymentCurrency
string
required

Payment currency. The value is normalized to uppercase.

returnUrl
string
required

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.

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.

Available options:
WEB,
WAP
deviceType
enum<string>

Device type. Supported values are Android and iOS.

Available options:
Android,
iOS

Response

Subscription created successfully

code
integer<int32>

Response status code, 200 when success

Example:

200

msg
string

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

Example:

"success"

data
object

Response data returned after creating a subscription. It contains the subscription, order, and invoice identifiers, together with the payment flow result.