# Status

## Endpoint URL

### Search using order number (generated by merchant)

| Environment | URL                                                                   | Method |
| ----------- | --------------------------------------------------------------------- | ------ |
| Sandbox     | <https://sandbox.securepay.my/api/v1/payments/status/:order\\_number> | GET    |
| Production  | <https://securepay.my/api/v1/payments/status/:order\\_number>         | GET    |

### Search using merchant number (generated by SecurePay)

| Environment | URL                                                                                                    |
| ----------- | ------------------------------------------------------------------------------------------------------ |
| Sandbox     | <https://sandbox.securepay.my/api/v1/payments/status/merchant\\_reference\\_number/:merchantrefnumber> |
| Production  | <https://securepay.my/api/v1/payments/status/merchant\\_reference\\_number/:merchantrefnumber>         |

{% hint style="info" %}
:order\_number is a unique order number generated by merchant end for reference.&#x20;
{% endhint %}

## Credentials

|                                 |                                      |
| ------------------------------- | ------------------------------------ |
| uid (Merchant API UID)          | 2aaa1633-e63f-4371-9b85-91d936aa56a1 |
| token (Merchant API Auth Token) | ZyUfF8EmyabcMWPcaocX                 |

## Example using curl

```bash
curl -u 2aaa1633-e63f-4371-9b85-91d936aa56a1:ZyUfF8EmyabcMWPcaocX https://sandbox.securepay.my/api/v1/payments/status/20200927045002577 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   786    0   786    0     0  16040      0 --:--:-- --:--:-- --:--:-- 16040
{
   "buyer_name" : "ADAM HARIS AHMAD",
   "buyer_phone" : "+60123122999",
   "exchange_number" : "MXKJI1601182203",
   "receipt_url" : "https://sandbox.securepay.my/api/v1/receipt/MXKJI1601182203.pdf?uid=e549ab7f07af9e52673e",
   "status_url" : "https://sandbox.securepay.my/api/v1/status/MXKJI1601182203?uid=e549ab7f07af9e52673e",
   "merchant_reference_number" : "MXKJI1601182203",
   "client_ip" : "14.192.210.186",
   "payment_status" : true,
   "transaction_amount" : "50.00",
   "order_number" : "20200927045002577",
   "currency" : "MYR",
   "buyer_email" : "amir@localhost.my",
   "payment_id" : 2159,
   "retry_url" : null,
   "interface_name": "Default",
   "interface_uid": "8db044bd-b450-4126-a0cd-101c0ba7b3ee",
   "source" : "FPX",
   "transaction_amount_received" : "50.00",
   "created_at": "2020-09-29T19:15:42.419+08:00",
   "created_at_unixtime": "1601378142"
}
```

## Response values

| Parameter                     | Description                                                |
| ----------------------------- | ---------------------------------------------------------- |
| source                        | FPX, Credit Card or other                                  |
| payment\_status               | true - success payment and false - failed payment          |
| currency                      | RM - Ringgit Malaysia (other currencies are not supported) |
| transaction\_amount           | Amount in RM for this transaction.                         |
| transaction\_amount\_received | Amount received, if payment\_status false set to 0.00      |
| order\_number                 | Order Number sent previously by merchant.                  |
| merchant\_reference\_number   | This number is generated by securepay platform             |
| exchange\_number              | This number is generated by securepay platform             |
| buyer\_name                   | Buyer name                                                 |
| buyer\_phone                  | Buyer phone                                                |
| buyer\_email                  | Buyer email                                                |
| interface\_name               | API name                                                   |
| interface\_uid                | API UID                                                    |
| payment\_id                   | For reference                                              |
| client\_ip                    | Client IP address                                          |
| status\_url                   | SecurePay Status URL                                       |
| retry\_url                    | Any failed payment, can make retry using this links        |
| receipt\_url                  | SecurePay PDF receipt URL                                  |
| created\_at                   | Created date and time ISO8601 format                       |
| created\_at\_unixtime         | Created date and time in unix time epoch format            |
