Introduction
Accept QR Code Payments Effortlessly with our API Integration. Simplify the process of accepting QR code-based payments using our API. Streamline your payment operations and provide a secure, convenient, and contactless payment option for your customers. Seamlessly integrate QRIS technology to expand your payment capabilities and stay ahead of the trend.
Request
You need to authenticate your requests to access any endpoint in the SenGo API.
Request Parameters
- Name
reference- Type
- mandatory
- Description
A unique reference number or identifier for the transaction. all transaction references should be unique.
- Name
amount- Type
- mandatory
- Description
Amount your user should paid to complete the transaction
- Name
expiryMinutes- Type
- opsional
- Description
If you want the transaction to last for 1 hour, you would set the value of the expiryMinutes parameter to 60.
- Name
viewName- Type
- mandatory
- Description
The name or identifier of the receiver for the transaction.
- Name
additionalInfo.callback- Type
- mandatory
- Description
The callback URL where notifications or updates related to the transaction will be sent.
You need to authenticate your Headers request to access any endpoint in the SenGo API, to see the authentication documentation please read the Authentication section.
Request Json
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{HOST}}/qris',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"reference": "REFF012",
"amount": 10000,
"expiryMinutes": 30,
"viewName": "Merchant Name",
"additionalInfo": {
"callback": "http://your-site-callback.com/notify"
}
}',
CURLOPT_HTTPHEADER => array(
'X-Client-Key: ',
'X-Client-Token: ',
'X-Signature: '
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
Response Json
{
"responseCode": 200,
"responseMessage": "success",
"responseData": {
"id": "66e934f6-f5d6-4f1c-bb3d-450ec2873782",
"merchantRef": "REFF012",
"status": "pending",
"feePayer": "customer",
"amount": 10000,
"fee": 85,
"totalAmount": 10085,
"expiredDate": "2025-03-23T10:24:58+07:00",
"additionalInfo": {
"callback": "http://your-site-callback.com/notify"
},
"qris": {
"content": "00020101021226640017ID.CO.DANAMON.WWW0118936000110000274394021010319543930303UME51440014ID.CO.QRIS.WWW0215ID10243618787380303UME627601161757471499309912051666e934f6f5d64f1c07091540393439919000200010931546444853033605405194776014BANDAR LAMPUNG520489995907TopUpKu5802ID610535122630436F3",
"url": ""
}
}
}
Response Parameters
| Parameter | Description |
|---|---|
| responseCode | The HTTP response code indicating the status of the request. See the Error Codes section for details. |
| responseMessage | A descriptive message indicating the status of the request. |
| responseData | An object containing the data related to the transaction response. |
| responseData.id | SenGo unique identifier for the transaction. |
| responseData.status | The current status of the transaction. success, pending, expired, failed. |
| responseData.feePayer | The party responsible for paying the transaction fee. customer or merchant. |
| responseData.amount | The original amount associated with the transaction. |
| responseData.fee | The fee charged for the transaction. |
| responseData.totalAmount | The total amount (original amount + fee) for the transaction. |
| responseData.expiredDate | The date and time when the transaction will expire. |
| responseData.additionalInfo.callback | The callback URL where notifications or updates related to the transaction will be sent. |
| responseData.qris.content | The code representing the generated barcode for users to scan. |
| responseData.qris.image | Barcode generated and converted to base64 image. |
| responseData.qris.url | The url for redirect to the success page or failed page after the user scan the barcode. |
If you want to see the error code status, please read the Extras >> Error Code section.
