> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/payouts/refunds/refund-transaction-status-tsq.md).

# Refund Transaction Status (TSQ)

Using a single API, you can request/call for the transaction status of an initiated Refund.

| Header        | Value               |
| ------------- | ------------------- |
| Authorization | `Bearer SECRET_KEY` |
| Content-type  | `application/json`  |

## BaseUrl

Sandbox/PROD : <https://api.startbutton.tech>

> GET: `{{baseurl}}/transaction/refunds/:query/status`

The secret key can be gotten from the 'Settings' page on your Startbutton dashboard.

| Query key            | Required? | Description                                                                                                                                                                                                                                                                                                                              |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| transactionReference | Yes       | <p>This can be either:<br>1. the <code>refund transaction</code> reference. This reference provides the details and status of the refund processed.<br><br>2. the <code>original transaction</code> reference. This reference provides a list of all refunds associated with the transaction (in cases of multiple partial refunds).</p> |

The `refund transaction` reference can be obtained from the email you receive after a Refund is processed or from the Refunds tab on the Dashboard, while the `original transaction` reference can be obtained from the Dashboard or webhook notification.

#### Sample response:

{% tabs %}
{% tab title="Success" %}

```json
{ 
    "success": true, 
    "message": "Refund Transaction fetched successfully", 
    "data": { 
        "refund": { 
            "type": "full", 
            "_id": "65d7356de4e2a1cxxxxxxx", 
            "merchant": "65d5e4f44ef2d99xxxxxxxx", 
            "transactionReference": "dfa61b8b95a9", 
            "amount": 1000, 
            "reference": "Rdfa61b8b95a9-c4cmjvfndg-1", 
            "currency": "NGN", 
            "channel": "dashboard", 
            "party": "xxxxx", 
            "reason": "customer disputes", 
            "status": "successful", 
            "createdAt": "2024-02-22T11:52:13.371Z", 
            "updatedAt": "2024-02-22T12:19:05.507Z", 
            "__v": 0, 
            "meta": {} 
        }, 
        "transaction": { 
            "_id": "65d6467306037xxxxxxx", 
            "transType": "collection", 
            "status": "reversed", 
            "toAmount": 100000, 
            "toCurrency": "NGN", 
            "merchantId": "65d5e4f44ef2dxxxxxxxxx", 
            "transactionReference": "dfa61b8xxxx", 
            "customerEmail": "test+customer101@startbutton.africa", 
            "paymentPartnerId": "644a475218872xxxxxxxxxxx", 
            "paymentCode": "9085ccxxxxxx", 
            "isRecurrent": false, 
            "postProcess": null, 
            "settleCurrency": "NGN", 
            "paymentRateComboId": "65d618930603xxxxxxx", 
            "customEmails": [], 
            "createdAt": "2024-02-21T18:52:35.445Z", 
            "updatedAt": "2024-02-22T12:38:07.579Z", 
            "exchangeRate": 1, 
            "usdBuyRate": 1, 
            "usdSellRate": 1, 
            "feeAmount": 2600, 
            "paidAt": "2024-02-21T18:59:50.266Z", 
            "toWallet": "65d643a115f808f07c5e3e80", 
            "meta": { 
                "refunds": { 
                    "amount": 100000, 
                    "transactions": 1 
                } 
            }, 
            "fromBalanceAfterLedger": 0, 
            "fromBalanceAfterAvailable": 0 
        } 
    } 
}
```

{% endtab %}

{% tab title="Incorrect transaction reference" %}

```json
{ 
    "success": false, 
    "message": "Transaction not found" 
}
```

{% endtab %}
{% endtabs %}
