Get Transactions

Endpoint: BASE_URL/bass/transactions

To obtain all the transactions of an account, the Get All Transaction History endpoint is being used.

Example response:

{
  "status_code": 0,
  "status": "Success",
  "processing_time": 0.577,
  "response_data": {
    "transaction_count": 1,
    "page": 1,
    "total_record_count": 1,
    "number_of_pages": 1,
    "start_date": "2020-06-15 00:00:00",
    "end_date": "2020-07-16 23:59:59",
    "sums": {
      "unsettled": 6.52,
      "settled": 23.55,
      "adjustment": 0,
      "fee": -1.57,
      "payment": 0
    },
    "transactions": [
      {
        "is_savings": true,
        "deny_code": null,
        "disputable": false,
        "details": "Pending Payment",
        "act_type": "PE",
        "act_type_description": "Pending Payment",
        "post_ts": "2020-07-15 14:13:26",
        "amt": 1,
        "source_id": "7353070",
        "type": "VL",
        "type_description": "Visa Load",
        "trans_code": "PEVL",
        "arn": "",
        "merchant_id": null,
        "external_trans_id": "",
        "calculated_balance": 30.11,
        "ach_trans_id": null,
        "auth_ts": null,
        "prior_id": "0",
        "card_id": "N/A",
        "formatted_merchant_desc": null,
        "network_code": null,
        "auth_id": null,
        "local_amt": null,
        "local_curr_code": null,
        "settle_amt": null,
        "settle_curr_code": null,
        "billing_amt": null,
        "billing_curr_code": null,
        "pmt_ref_no": "005461522202",
        "mcc_code": null,
        "iac_tax": "0",
        "iva_tax": "0"
      },
    ],
    "beginning_balance": 0
  },
  "echo": {
    "provider_transaction_id": "",
    "provider_timestamp": null,
    "transaction_id": "681a5fab-9570-4b40-a531-69ae657d3264"
  },
  "rtoken": "8cc16de0-5eda-4e2a-968e-3b08fce6f778",
  "system_timestamp": "2020-07-15 14:13:28"
}

In the API, you can see that many things are handled through numeric codes, alphanumeric or through an alphabetic code.

For example, act_type refers to an activity type. This field is returned in the Linker's response template. But to make it more readable for a user, an enumeration was created, which contains the equivalence of each code:

export enum ActivityTypeCodesHumanize {
  'AB' = 'Allpoint Backout',
  'AD' = 'Adjustment',
  'AP' = 'Allpoint Authorization',
  'AS' = 'Allpoint Settlement',
  'AU' = 'MasterCard Authorization',
  'AX' = 'Allpoint Auth Expiration',
  .......,
  'SX' = 'Star Expired Authorization',
  'TE' = 'Transaction Expired',
  'TH' = 'Transaction Hold',
  'VI' = 'Visa Authorization',
  'VS' = 'Visa Settlement',
  'VX' = 'Visa Expired Auth',
}

In the src/baas/galileo/galileo.utils.ts file, in the function formatTransactionInfo, we transform the response we receive from Galileo to the response expected by our Linker client:

public async formatTransactionInfo(
  transaction: GalileoTransactionResponse,
): Promise<Transaction> {
  return {
    id: transaction.source_id,
    amount: this.removeDashSign(transaction.amt),
    description: transaction.description,
    createdAt: transaction.post_ts.toString(),
    currencyCode: CurrencyCode.USD,
    type: ActivityTypeCodesHumanize[transaction.act_type],
    status: TransferStatus.SETTLED,
    direction: this.returnTransactionDirection(parseFloat(transaction.amt)),
  };
}
type: ActivityTypeCodesHumanize[transaction.act_type],

In this line we take the code that is sent by Galileo, and we get its equivalence from ActivityTypeCodesHumanize.

amount: this.removeDashSign(transaction.amt),

Within this function we also remove the negative sign of transactions, since the direction field will indicate the sign of the amount.

direction: this.returnTransactionDirection(parseFloat(transaction.amt)),

The returnTransctionDirection function will return debit if the amount is negative, and credit if the amount is positive.

In the transaction state, settled is always being returned. because if an account transfer fails for some reason (for example, 445-06 Sender Insufficient Balance), the transaction won't even be created, but if a successful response is returned, the transaction will complete. (This only happens on internal Galileo transfers).

ACH transactions are stateful because they go through the clearinghouse and out of the Galileo system.

Linker example response:

{
    "statusCode": 200,
    "data": {
        "totalCount": 2,
        "count": 2,
        "limit": 1,
        "offset": 1,
        "transactions": [
            {
                "id": "1002",
                "amount": "3.99",
                "description": "Adjustment",
                "createdAt": "2022-10-05 08:49:21",
                "currencyCode": "USD",
                "type": "Adjustment",
                "status": "settled",
                "direction": "debit"
            },
            {
                "id": "801",
                "amount": "100",
                "description": "Payment",
                "createdAt": "2022-09-18 12:05:39",
                "currencyCode": "USD",
                "type": "Payment",
                "status": "settled",
                "direction": "credit"
            }
        ]
    }
}

Last updated