Create API to Get Refund Status
The getRefundStatus API retrieves the current status and details of a refund session or transaction. By using the gid
, the platform tracks whether a refund has been successfully processed, is still pending, or has failed. This API ensures that refund transactions are accurately recorded and updated in the system, preventing discrepancies in order and payment records.
- Endpoint: POST/api/v1/payment_session/{gid}
When the Fynd Commerce calls this API, the Payment Extension first validates the order_checksum_auth
in the request headers to ensure data security and integrity. Once validated, the extension responds with the latest refund status and associated transaction details. This response allows the platform to keep customers and sellers informed about the refund progress.Additionally, Fynd Commerce can use this API in scheduled background tasks (cron jobs) to automatically check and update refund statuses for transactions where updates were previously missed.
Response
In the response below given, the response from the getRefundStatus API provides the current status and details of the refund session associated with a specific transaction. When Fynd Commerce calls this API, the Payment extension responds with detailed information about the refund, including the amount being refunded, the currency in which the refund is being processed, and the request_id
that uniquely identifies the refund request.
Additionally, the response includes the gid
, which links the refund status to the original payment transaction. This ensures that the refund is properly associated with the correct order.
{
"aggregator_payment_refund_details": [
{
"amount": 10000,
"currency": "INR",
"request_id": "17066802422601819004",
"status": "pending"
}
],
"gid": "TR661CED900E91E14001"
}