> For the complete documentation index, see [llms.txt](https://blended.gitbook.io/a1pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blended.gitbook.io/a1pay/accept-payment-using-a1pay/query-status-with-a1pay-reference.md).

# Query Status With A1Pay Reference

The second way you can query for the status of a transaction, this time, using the A1Pay reference that is returned to your ReturnURL through URL query parameters

## Get Transaction Status

<mark style="color:blue;">`GET`</mark> `https://a1pay.net/api/query/status`

Get transaction status using A1Pay reference returned to your ReturnURL

#### Query Parameters

| Name           | Type   | Description                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------- |
| transactionRef | string | The A1Pay reference for this transaction returned as **Ref** URL parameter to your ReturnURL |

#### Headers

| Name | Type   | Description                                                     |
| ---- | ------ | --------------------------------------------------------------- |
| Hash | string | SHA256 of Amount in two decimal places + MerchantId + SecretKey |

{% tabs %}
{% tab title="200 JSON of status and data. data will carry transaction response object if status = success. It will carry a string representation of the error message if status = error." %}

```javascript
{
  "status": "success",
  "data": {
    "AmountPaid": "100000.00",
    "FriendlyMessage": "Transaction completed successfully",
    "FurtherExplanation": null,
    "IsSuccessful": true,
    "PayerEmail": "email@a1pay.net",
    "PayerName": "SOLOMON GRUNDY",
    "PaymentReference_Local": "A1PAYREFERENCE",
    "PaymentReference_Switch": "SWITCHREFERENCE",
    "ResponseCode": "00",
    "ResponseDescription": "Approved By Financial Institution",
    "TransactionDate": "02/06/2018",
    "TransactionType": "School Fees"
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
Always look out for the **IsSuccessful** property of the data object in the response. A status=success alone is not enough to determine that your transaction is successful
{% endhint %}

{% hint style="info" %}
Its always a good practice to log all responses from A1Pay for future reference.
{% endhint %}
