Refunds
Last updated
Last updated
Refunds can be created through our API, and you can retrieve, update, and delete refunds as needed. With our refund feature, you can easily process refunds for transactions made through the Sonic Payment Gateway platform.
To create a refund, make a POST request to the following endpoint: Include the following information in the request body:
transaction_id
string
The unique identifier of the transaction to be refunded
amount
number
The amount of the refund in the currency of the original transaction
reason
string
A short explanation for the refund
metadata
object
Additional information associated with the refund, in key-value pairs
Example curl request:
Example curl request:
Example curl request:
Example curl request:
Example curl request:
The API will return a 200 OK response if the request is successful, with a message confirming the deletion of the refund. If the refund does not exist or has already been deleted, the API will return a 404 Not Found error.
Note: Once a refund has been deleted, it cannot be restored. Make sure to double-check the refund ID before making a DELETE request.
To retrieve a specific refund, make a GET request to the following endpoint: The API will return a 200 OK response if the request is successful, with an object of the refund in the response body.
To retrieve all refunds, make a GET request to the following endpoint: The API will return a 200 OK response if the request is successful, with an array of refund objects in the response body.
To update an existing refund, make a PUT request to the following endpoint: Include the updated information in the request body.
To delete a refund, make a DELETE request to the following endpoint: