Approve Transaction
This API is used to approve a transaction by validating the provided merchant ID, token, and payment ID. If the transaction is valid and the website is active, it will be marked as used.
Endpoint Details
URL:
/api/transaction/approveMethod:
POSTContent-Type:
application/json
Request Parameters
Parameter
Type
Required
Description
merchant_id
string
Yes
The unique identifier of the merchant's website. Must exist in the websites table.
token
string
Yes
The transaction token associated with the payment.
payment_id
string
Yes
The unique identifier of the payment transaction.
Validation Rules
merchant_idmust exist in thewebsitestable.tokenandpayment_idmust be valid strings.
Response
Success Response
Status Code: 200 OK
Error Responses
403 Forbidden - Inactive Website
Status Code: 403
404 Not Found - Invalid or Used Transaction
Status Code: 404
400 Bad Request - Unsuccessful Transaction
Status Code: 400
Notes
The
approveTransactionAPI ensures that the transaction belongs to an active website.If the transaction is already used, it cannot be approved again.
The
updated_atfield in the success response indicates when the transaction was marked as used.
Example Request
Example Implementation
Last updated