Verify Payments API
The following endpoint retrieves the details of a single Payment
/payments/:id/verify
Path parameters
Field | is required? | Description |
---|---|---|
id | mandatory | integer Unique identifier of the Payment to be retrieved |
Query parameters
Field | is required? | Description |
---|---|---|
verification_signature | required | string Signature which has been provided to you while you successfully made a charge. Would have recived directly as a response to payments/charge API call OR as a payload on payment.completed webhook response |
Example
curl --location --request POST 'https://api.durianpay.id/v1/payments/pay_wA2X2Mvm2d4965/verify' \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H 'content-type: application/json' \
-d '{
"verification_signature": "adf9a1a37af514c91225f6680e2df723fefebb7638519bcc7e7c9de02f2a3ab2"
}
'
Response Code : 200
Here is an example of success response
{
"data": true // or false depending on verification
}
Error Response Code : 400
Here is an example error response for invalid request
{
"error": "error reading request body",
"error_code": "DPAY_INTERNAL_ERROR",
}
Error Response Code : 401
Here is an example error response for unauthorized access
{
"error": "invalid Authorization header in request",
"error_code": "DPAY_UNAUTHORIZED_ACCESS"
}
Error Response Code : 500
Here is an example error response for internal server error
{
"error": "error verifying payment",
"error_code": "DPAY_INTERNAL_ERROR"
}