Skip to main content
POST
/
billing
/
session
cURL
curl --request POST \
  --url https://api.clinkbill.dev/api/billing/session \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '{
  "customerId": "cus_xxxxx"
}'
{
  "code": 200,
  "msg": "success",
  "data": {
    "url": "https://portal.clinkbill.dev/session/eyJ0eXAiOffsssxxxxxx",
    "expiresAt": 1755152165726
  }
}

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 customer portal session

customerId
string
required

Existing customer's unique identifier

returnUrl
string

Redirect URL when customer click on 'Return to Merchant'

Response

200 - application/json

Customer portal 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

Customer Portal session details when successfully created