2Creating a Checkout Session
Once authenticated, you can create a checkout session for your customer. This generates a unique payment URL that you can redirect your customer to.
Checkout Session Endpoint
| Endpoint | Method | Description | Authentication |
|---|---|---|---|
| /api/checkout/sessions | POST | Create a checkout session and return a hosted payment URL. | Bearer access token |
Checkout Session Request
The checkout session request requires details about the payment, customer, and callback URLs:
RequestPOST /api/checkout/sessions
curl -X POST "https://api.saligpay.com/api/checkout/sessions" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"amount": 125000,
"currency": "PHP",
"reference_id": "ORD-10293",
"success_url": "https://merchant.example/success",
"cancel_url": "https://merchant.example/cancel",
"customer_email": "buyer@example.com"
}'Request Parameters Explained
Required Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | number | Yes | Amount in centavos. |
| currency | string | Yes | ISO currency code. Use PHP for Philippine Peso. |
| reference_id | string | Yes | Your unique internal order identifier. |
| success_url | string | Yes | Return URL when checkout succeeds. |
| cancel_url | string | Yes | Return URL when checkout is cancelled. |
Optional Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_email | string | No | Prefills payer email in checkout. |
| metadata | object | No | Arbitrary data returned to webhooks and lookup APIs. |