Unified Gateway
STSPay
STSPay is our core payment orchestration layer. It supports two main creation modes: hosting a checkout page for your customers or retrieving a raw QRIS payload for custom frontend implementations.
Create Payment
Initialize a transaction. Use the type parameter to switch between a hosted link or a direct QRIS string.
POST/payments/create
Request Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| merchant_id | String | Required | Your unique STS Merchant ID. Found in Console dashboard. |
| secret_key | String | Required | Your private API Secret Key. Used for authentication. |
| type | Enum | payment_link | Creation mode. Options: payment_link or qris. |
| amount | Number | Required | Total transaction amount in IDR. Min: 100. |
| payer_email | String | Required | Customer email address for identification. |
| external_id | String | Optional | Custom unique ID for this transaction. Generated automatically if not provided. |
| success_url | String (URL) | Optional | Redirect target after successful payment on checkout page. |
Implementation Examples
Shell / cURL
curl -X POST https://api.stspoint.id/payments/create \ -H "Content-Type: application/json" \ -H "X-Callback-URL: https://your-server.com/callback" \ -d '{ "merchant_id": "STS-XXXXXXXX", "secret_key": "STS-Key-XXXXXXXX", "external_id": "ORDER-9921", "type": "payment_link", "amount": 50000, "payer_email": "customer@email.com", "description": "Digital Product Purchase", "success_url": "https://your-store.com/success" }'
Mode: Payment Link
Hosted Checkout Response
{
"success": true,
"data": {
"external_id": "ORDER-9921",
"checkout_url": "https://api.stspoint.id/checkout/ORDER-9921",
"status": "PENDING",
"amount": 50000
}
}Mode: QRIS
Direct QRIS Payload
{
"success": true,
"data": {
"external_id": "ORDER-9921",
"qr_string": "00020101021226660011ID.CO.XENDIT.WWW...",
"status": "PENDING",
"amount": 50000
}
}Status Verification
Poll the current state of a transaction using the external_id.
POST/payments/status
Status Success Response
{
"success": true,
"data": {
"external_id": "ORDER-9921",
"status": "PAID",
"amount": 50000,
"payer_email": "customer@email.com",
"created_at": "2024-10-24T08:42:11Z",
"updated_at": "2024-10-24T08:45:02Z"
}
}Transaction States
PENDINGPAIDEXPIREDFAILED
For better efficiency, we highly recommend using dynamic **Webhooks** via the `X-Callback-URL` header.