POST

Payments

POST /payments/external_accounts

const createExternalAccount = () => {
  const timestamp = Math.round(Date.now() / 1000)
  const body = {
    participant_code: 'ALI123',
    account_nickname: 'test1',
    account_number: '123456789',
    routing_number: '011401533',
    account_type: 'checking'
  }
  const payload = timestamp + 'POST' + '/payments/external_accounts' + JSON.stringify(body)
  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,
    body,
    json: true
  }

  return request.post(`https://api.ndax.in/payments/external_accounts`, options)
}

Sample response

{
  "request_id": "0f68333e-2114-469d-b505-c850d776e063",
  "participant_code": "ALI123",
  "platform_code": "TES123",
  "account_nickname": "test1",
  "account_type": "checking",
  "external_account_id": "0f68333e-2114-469d-b505-c850d776e063",
  "created_at": "1975-08-19T23:15:30.000Z"
}

Creates a new external account object that is required when generating payment transactions.

Request body:

Additional fields in response:

GET /payments/external_accounts

const getExternalAccounts = () => {
  const timestamp = Math.round(Date.now() / 1000)
  const participantCodes = 'ALI123,TES123'
  const payload = `${timestamp}GET/payments/external_accounts?participants=${participantCodes}&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-SCX-API-KEY': 'public_key',
    'X-SCX-SIGNED': signedPayload,
    'X-SCX-TIMESTAMP': timestamp,
    'X-SCX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    json: true
  }

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

Sample response

{
  "message": [
    {
      "request_id": "0f68333e-2114-469d-b505-c850d776e063",
      "account_number": "123456789",
      "routing_number": "011401533",
      "participant_code": "ALI123",
      "platform_code": "TES123",
      "account_nickname": "test1",
      "account_type": "checking",
      "external_account_id": "0f68333e-2114-469d-b505-c850d776e063",
      "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
}

Used to get a list of external_accounts associated with a Platform’s participants.

Query parameters include:

  • participants (optional) list of participant codes that can be used to filter for external accounts, example: ALI123,TES123.

  • page (optional) for paginating through the list of accounts.

  • size (optional) for paginating through the list of accounts.

Response:

Last updated