# GET Status

#### `GET /payments/history` <a href="#get-payments-history" id="get-payments-history"></a>

```
const getPaymentHistory = () => {
  const timestamp = Math.round(Date.now() / 1000)
  const participantCode = 'ALI123'
  const payload = `${timestamp}GET/payments/history?participant=${participantCode}&page=1&size=20{}`
  const decodedSecret = Buffer.from(apiSecret, 'base64')
  const hmac = crypto.createHmac('sha256', decodedSecret)
  const signedPayload = hmac.update(payload).digest('base64')

  // SET HEADERS
  const headers = {
    'X-NDAX-API-KEY': 'public_key',
    'X-NDAX-SIGNED': signedPayload,
    'X-NDAX-TIMESTAMP': timestamp,
    'X-NDAX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    json: true
  }

  return request.get(`https://api.ndax.in/payments/history?participant=ALI123&page=1&size=20`, options)
}
```

> Sample response

```
{
  "message": [
    {
      "transaction_id": "0f68333e-2114-469d-b505-c850d776e061",
      "participant_code": "ALI123",
      "external_account_id": "0f68333e-2114-469d-b505-c850d776e063",
      "amount": "12.01",
      "bank_fee": "12.01",
      "ach_network": "ach",
      "transfer_type": "credit",
      "status_history": [
        {
          "status": "posted",
          "timestamp": "1975-08-19T23:15:30.000Z"
        }
      ],
      "trade_id": "0f34533e-2114-469d-b505-c850d776e061",
      "bank_transfer_id": "0f68333e-2114-469d-b505-c850d776e061",
      "created_at": "1975-08-19T23:15:30.000Z",
      "updated_at": "1975-08-19T23:15:30.000Z"
    }
  ],
  "page": 1,
  "total_pages": 1,
  "page_size": 20,
  "count": 10
}
```

Platforms can use this endpoint to get extended details about payment transactions which includes the full status change history.

Query parameters include:

* `participant` (optional) takes a participant\_code that the Platform has a relationship with.
* `page` (optional) - for paginating through the list of accounts
* `size` (optional) - for paginating through the list of accounts
* `transfer_type` (optional) accepts the following values: credit or debit

Response:

<table><thead><tr><th width="179.33333333333331">Parameter</th><th width="433">Description</th><th>Type</th></tr></thead><tbody><tr><td>transaction_id</td><td>The unique identifier generated by NDAX for the transaction.</td><td>string</td></tr><tr><td>trade_id</td><td>Is returned if the payment is associated with a trade otherwise will be <code>Null</code>.</td><td>string</td></tr><tr><td>participant_code</td><td>The Platform’s participant that the payment is associated with.</td><td>string</td></tr><tr><td>external_account_id</td><td>The external account that is associated with the payment.</td><td>string</td></tr><tr><td>amount</td><td>The final amount of the ACH transaction.</td><td>string</td></tr><tr><td>bank_fee</td><td>The fee amount that the Platform is wanting to charge the participant for the payment.</td><td>string</td></tr><tr><td>ach_network</td><td>The network that the payment is being transmitted.</td><td>string</td></tr><tr><td>status_history</td><td><p>The list of status objects, showing the history of status changes.</p><ul><li>Status - the current status of the payment transaction. More details on payment transaction statuses available in documentation here.</li><li>Timestamp - the timestamp that the status change occurred.</li></ul></td><td>array</td></tr><tr><td>transfer_type</td><td>Indicates if the payment is a credit or a debit.</td><td>string</td></tr><tr><td>bank_transfer_id</td><td>The unique identifier that can be used to trace the transaction.</td><td>string</td></tr><tr><td>created_at</td><td>The timestamp when the payment was created.</td><td>timestamp</td></tr><tr><td>updated_at</td><td>The timestamp when the payment status was last changed.</td><td>timestamp</td></tr></tbody></table>

**Payments Transaction Status**

<table><thead><tr><th width="138">Status</th><th>Description</th></tr></thead><tbody><tr><td>submitted</td><td>Payment transaction request has been successfully received by NDAX.</td></tr><tr><td>pending</td><td>The payment has been created and is awaiting confirmation by the appropriate payment network that it has settled. Depending on the payment network the transaction can sit in a pending status for different periods of time.</td></tr><tr><td>posted</td><td>The payment has been successfully sent to the receiving bank account.</td></tr><tr><td>failed</td><td>The sending of the payment failed. This status would only occur after the transaction goes to a pending status.</td></tr><tr><td>reversed</td><td>The payment was returned which can happen for different reasons such as inaccurate receiving bank details or the transaction was deemed unauthorized. This would only follow a transaction that has gone to a posted status.</td></tr></tbody></table>
