Skip to main content
POST
/
checkout
/
session
cURL
curl --request POST \
  --url https://api.clinkbill.dev/api/checkout/session \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '{
  "customerId": "customer_id",
  "originalAmount": 4.99,
  "originalCurrency": "USD",
  "priceId": "price_id",
  "productId": "prd_id"
}'
{
  "code": 200,
  "msg": "success",
  "data": {
    "sessionId": "sess_abc123xyz",
    "tokenValue": "<string>",
    "customerId": "cus_12345",
    "originalAmount": 99.99,
    "originalCurrency": "USD",
    "url": "https://checkout.clinkbill.dev/pay/sess_abc123xyz",
    "merchantReferenceId": "order_ref_123",
    "expireTime": "2023-11-07T05:31:56Z"
  }
}

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 initialize a new checkout session

originalAmount
number
required

Total transaction amount in the specified currency (must be greater than 0)

Required range: x > 0
originalCurrency
string
required

Three-letter ISO currency code for the transaction (e.g., USD, EUR, GBP)

customerId
string

Existing customer's unique identifier (required if customerEmail is not provided)

customerEmail
string

Customer's email address. A new customer account will be created if the email is not associated with an existing customer

merchantReferenceId
string

Your internal reference ID for tracking (non-unique identifier, does not guarantee idempotency)

priceId
string

Unique identifier of the predefined price configuration from your dashboard

productId
string

Unique identifier of the product configured in your dashboard

successUrl
string

URL where customers will be redirected after successful payment completion

cancelUrl
string

URL where customers will be redirected if they cancel the checkout process

priceDataList
object[]

List of product pricing details for one-time purchases. Use this when creating transactions without pre-configured products

Response

200 - application/json

Checkout session created successfully

Response object returned when creating a new checkout session

code
integer

HTTP status code indicating the request result (200 for success, 4xx for client errors, 5xx for server errors)

Example:

200

msg
string

Human-readable message describing the result ('success' for successful operations, error details for failures)

Example:

"success"

data
object

Checkout session details when successfully created