# List (deprecated and no longer available)

## Endpoint URL

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

## Credentials

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

## Parameters

| Parameter       | Description                                                                       |
| --------------- | --------------------------------------------------------------------------------- |
| per\_page       | How many data to display, default is 10 data and maximum 100 per page             |
| page            | Jump into a page. e.g: the data have 5 pages, to visit 3rd page just set page = 3 |
| payment\_status | Success payment is set to true and false for unsuccessful.                        |
| start\_date     | Search data by date range e.g start\_date: 2020-09-10                             |
| end\_date       | Search data by date range e.g end\_date: 2020-09-15                               |

{% hint style="info" %}
Default parameters list will be applied (refer Default section), If no parameters are supply during API request.
{% endhint %}

{% hint style="warning" %}
Both start\_date and end\_date need to be supplied for date range search. E.g For daily transaction on 20/09/2020 need to set start\_date=2020-09-20 and end\_date=2020-09-20&#x20;
{% endhint %}

| <https://sandbox.securepay.my/api/v1/payments/list?start\\_date=2020-09-20\\&end\\_date=2020-09-20> |
| --------------------------------------------------------------------------------------------------- |

## Default

Per page: 10\
Maximum per page: 100 (Please use pagination if data more than 100)\
Payment status: Success (True)\
Data search limit: 3 months (90 days)

## Paginate

Fetch 5 payments per page&#x20;

<https://sandbox.securepay.my/api/v1/payments/list?per\\_page=5>

{% hint style="info" %}
and the response will be paginated and also will include pagination headers
{% endhint %}

Get pagination info from header

![Pagination headers](https://1585239032-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHFsN346MN-4Eibh12Q%2F-MI6kFQieNOcJJ-Pe-ZM%2F-MI7E9ppLixeTB_JKzkk%2FScreenshot%202020-09-26%20at%2010.26.37%20AM.png?alt=media\&token=9608d120-5e9d-4cd9-a24c-5df427f4d8d6)

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

```bash
curl -i -H "Application/json" -u 2aaa1633-e63f-4371-9b85-91d936aa56a1:ZyUfF8EmyabcMWPcaocX https://sandbox.securepay.my/api/v1/payments/list?per_page=5

```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
```

{% endtab %}
{% endtabs %}

```
X-Total: 6
X-Total-Pages: 2
X-Page: 1
X-Per-Page: 5
X-Next-Page: 2
X-Prev-Page: 
X-Offset: 
```

Getting second page

<https://sandbox.securepay.my/api/v1/payments/list?per\\_page=5\\&page=2>

```
X-Total: 6
X-Total-Pages: 2
X-Page: 2
X-Per-Page: 5
X-Next-Page: 
X-Prev-Page: 1
X-Offset: 
```

{% hint style="info" %}
Example fetch 100 payments data
{% endhint %}

<https://sandbox.securepay.my/api/v1/payments/list?per\\_page=100>

```
X-Total: 380
X-Total-Pages: 4
X-Page: 1
X-Per-Page: 100
X-Next-Page: 2
X-Prev-Page: 
X-Offset: 
```

<https://sandbox.securepay.my/api/v1/payments/list?per\\_page=100\\&page=3>

```
X-Total: 380
X-Total-Pages: 4
X-Page: 3
X-Per-Page: 100
X-Next-Page: 4 
X-Prev-Page: 2
X-Offset: 
```

## Payment status

There are true and false for payment status.

True status - Payment successfully received

False Status - Payment not successfully go through

To request the list by payment status e.g:\
1\. request success payment status (default)\
`https://sandbox.securepay.my/api/v1/payments/list?payment_status`

`https://sandbox.securepay.my/api/v1/payments/list?payment_status=true`

2\. request failed payment status\
`https://sandbox.securepay.my/api/v1/payments/list?payment_status=false`

3\. request success and failed status`https://sandbox.securepay.my/api/v1/payments/list?payment_status=all`

4\. request success payment status with 10 data on page 2\
`https://sandbox.securepay.my/api/v1/payments/list?payment_status=true&per_page=10&page=2`

{% hint style="info" %}
By default if no payment\_status is set the API will return success (true) status.
{% endhint %}

## Data created date and time

Each data will have two types of format:\
1\. created\_at e.g: 2020-09-27T17:19:43.593+08:00\
2\. created\_at\_unixtime e.g: 1601198383

<div align="left"><img src="https://1585239032-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHFsN346MN-4Eibh12Q%2F-MIADYzriRPM9l4dcsR1%2F-MIDvPjStEFupUKv8-Uw%2FScreenshot%202020-09-27%20at%205.38.31%20PM.png?alt=media&#x26;token=8bf20b22-031d-4b38-a916-e920da2f3d3e" alt=""></div>

## Get daily transaction list

Below example set start\_date = 2020-09-27 and end\_date = 2020-09-27

```
https://sandbox.securepay.my/api/v1/payments/list?payment_status=all&per_page=50&end_date=2020-09-28&start_date=2020-09-27

```

## Search by date range

Below example set start\_date = 2020-09-15 and end\_date = 2020-09-27

```
https://sandbox.securepay.my/api/v1/payments/list?payment_status=false&per_page=5&end_date=2020-09-28&start_date=2020-09-15

```

## Example using curl

{% tabs %}
{% tab title="Example 1 print pretty JSON" %}

```bash
curl -u 2aaa1633-e63f-4371-9b85-91d936aa56a1:ZyUfF8EmyabcMWPcaocX https://sandbox.securepay.my/api/v1/payments/list?per_page=2 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1367    0  1367    0     0  14698      0 --:--:-- --:--:-- --:--:-- 14698
[
   {
      "payment_status" : true,
      "exchange_number" : "TCKVR1601378132",
      "client_ip" : "175.139.210.207",
      "payment_id" : 2171,
      "retry_url" : null,
      "status_url" : "https://sandbox.securepay.my/api/v1/status/TCKVR1601378130?uid=266c1e922692a8dc1187",
      "source" : "FPX",
      "created_at_unixtime" : "1601378142",
      "transaction_amount" : "50.00",
      "created_at" : "2020-09-29T19:15:42.419+08:00",
      "transaction_amount_received" : "50.00",
      "buyer_name" : "ADAM HARIS AHMAD",
      "merchant_reference_number" : "TCKVR1601378130",
      "receipt_url" : "https://sandbox.securepay.my/api/v1/receipt/TCKVR1601378130.pdf?uid=266c1e922692a8dc1187",
      "order_number" : "20200929111530266",
      "currency" : "MYR",
      "buyer_phone" : "+60123121977",
      "buyer_email" : "amir@localhost.my"
   },
   {
      "retry_url" : null,
      "exchange_number" : "KWATI1601198351",
      "payment_status" : true,
      "payment_id" : 2161,
      "client_ip" : "14.192.214.33",
      "created_at_unixtime" : "1601198383",
      "source" : "FPX",
      "transaction_amount" : "50.00",
      "status_url" : "https://sandbox.securepay.my/api/v1/status/KWATI1601198371?uid=201b7fa16595498091cb",
      "merchant_reference_number" : "KWATI1601198351",
      "buyer_name" : "AMIR DAUD AHMAD",
      "receipt_url" : "https://sandbox.securepay.my/api/v1/receipt/KWATI1601198371.pdf?uid=201b7fa16595498091cb",
      "transaction_amount_received" : "50.00",
      "created_at" : "2020-09-27T17:19:43.593+08:00",
      "buyer_phone" : "+60123121977",
      "currency" : "MYR",
      "buyer_email" : "amir@localhost.my",
      "order_number" : "20200927091930866"
   }
]

```

{% endtab %}

{% tab title="Example 2 with header" %}

```
curl -i -H "Application/json" -u 2aaa1633-e63f-4371-9b85-91d936aa56a1:ZyUfF8EmyabcMWPcaocX https://sandbox.securepay.my/api/v1/payments/list?per_page=2 
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 29 Sep 2020 11:36:24 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Total: 28
X-Total-Pages: 14
X-Per-Page: 2
X-Page: 1
X-Next-Page: 2
X-Prev-Page: 
X-Offset: 
ETag: W/"a2d73a83d773e66cc023fe31be19d70f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 276151ec-7fb4-4e62-b7da-6b44ff00f6ea
X-Runtime: 0.028449
Vary: Origin
X-XSS-Protection: 1; mode=block
Expect-CT: max-age=0
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

[{"source":"FPX","payment_status":true,"currency":"MYR","transaction_amount":"50.00","transaction_amount_received":"50.00","order_number":"20200929111530266","merchant_reference_number":"TCKVR1601378132","exchange_number":"TCKVR1601378132","buyer_name":"ADAM HARIS AHMAD","buyer_phone":"+60123121977","buyer_email":"amir@localhost.my","payment_id":2171,"client_ip":"175.139.210.207","status_url":"https://sandbox.securepay.my/api/v1/status/TCKVR1601378130?uid=266c1e922692a8dc1187","retry_url":null,"receipt_url":"https://sandbox.securepay.my/api/v1/receipt/TCKVR1601378130.pdf?uid=266c1e922692a8dc1187","created_at":"2020-09-29T19:15:42.419+08:00","created_at_unixtime":"1601378142"},{"source":"FPX","payment_status":true,"currency":"MYR","transaction_amount":"50.00","transaction_amount_received":"50.00","order_number":"20200927091930816","merchant_reference_number":"KWATI1601198371","exchange_number":"KWATI1601198371","buyer_name":"AMIR HARIS AHMAD","buyer_phone":"+60123121979","buyer_email":"amir@localhost.my","payment_id":2161,"client_ip":"14.192.214.33","status_url":"https://sandbox.securepay.my/api/v1/status/KWATI1601198371?uid=201b7fa16595498091cb","retry_url":null,"receipt_url":"https://sandbox.securepay.my/api/v1/receipt/KWATI1601198371.pdf?uid=201b7fa16595498091cb","created_at":"2020-09-27T17:19:43.593+08:00","created_at_unixtime":"1601198383"}]a
```

{% endtab %}
{% endtabs %}

## 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                                                |
| 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            |
