General

Transactions

General Transactions API documentation

Introduction

The transactions API call is used to get all the transactions in a given time frame.

Transactions

List Transactions

This API will retrieve a list of transactions.

Path
GET /transactions

Query Parameters:

ParameterExample
start_dateyyyy-mm-dd
end_dateyyyy-mm-dd
Please note this API will only pull data through for a given agent set in the API Key settings

Response:

{
    "status": true,
    "total": 30862,
    "records": [
        {
            "transaction_number": "c2e8dfd5-5cb8-46f7-dede-8c96df15df1f",
            "amount": "150.00",
            "status": "Paid",
            "transaction_date": "2023-11-04T00:00:00.000Z",
            "id_number": "8812345678901",
            "company_name": "",
            "response_reason": "",
            "reference_number": "B457",
            "member_number": "MEM450045",
            "workflow_reference": "1234-1234"
        },
        ...
    ]
}

Fields:

NameExampleDescription
transaction_numberc2e8dfd5-5cb8-46f7-dede-8c96df15df1fSystem generated transaction number
amount150.00Transaction Amount
statusPaidPlease see list below of statuses
transaction_date2023-11-04T00:00:00.000ZDate the transaction occurred
id_number8812345678901ID number of person associated to the transaction
company_nameInc CorpCompany name associated to the transaction
response_reasonTransaction DisputedDescription of reason transaction was declined
reference_numberB457Reference number of transaction assigned, can be statement reference too
member_numberMEM450045Customer or member number assigned to person or company
workflow_reference1234-1234Referenced passed through from contact centre

Transactions Statuses:

  • Pending
  • Generated
  • Unpaid
  • Updated/Pending
  • Transmission Accepted
  • Transmission Rejected
  • Account Type Corrected
  • Redirected
  • Paid
  • Sent
  • Undelivered
  • Reversed
  • Transmission Accepted (with warnings)
  • Unpaid (Permanent Failure)

All lookup values can be found under: Lookups API

Error Response:

{
    "status": false,
    "error": "Not authorized to make this API call. Requesting Read on General."
}

When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys

Get Transaction Details

View transactions by user id or public id. All lookup values can be found under: Lookups API

Path
GET /transactions/{people record_id|companies record_id|people public_id|companies public_id}

Success Response:

{
    "status": true,
    "records": [{
        "id": "{unique record_id}",
        "people_id": "{people record_id}",
        "companies_id": "{companies record_id}",
        "transaction_id": "{custom transaction id}",
        "transaction_time": "YYYY-MM-DD HH:mm:ss",
        "transaction_reference": "{reference as seen on bank statements}","transaction_status_lookups_id": "5c4a9234-c5f4-4bab-9868-b1120df89d96",
        "amount": "100.25",
        "is_debit": true,
        "payment_methods_id": "{payment_methods record_id}",
        "subscriptions_id": "{subscriptions record_id}",
        "cards_id": "{cards record_id}",
        "bank_accounts_id": "{bank_accounts record_id}",
        "interval_lookups_id": "04f6c27d-1eba-4ef1-a023-3baa79cff571",
        "response_reason": "Auth Done",
        "response_code": "990017",
        "response_raw": "{json body of 3rd party payments}",
        "is_reversed": false,
        "is_dispute": false,
        "notes": "notes about this subscription",
        "batches_accounts_id": "{batches_accounts record_id}",
        "documents_id": "{documents id}",
        "fee": "{fee amounts applicable to 3rd party payments}","accounts_currencies_id": "{accounts_currencies record_id}",
        "date_status_updated": "{date payment status updated YYYY-MM-DD HH:mm:ss}"
    }, ...]
}
FieldTypeDescriptionOptionsExample
statusbooleantrue - API request was a success, false - API request failed
recordsArray of ObjectsTransaction records
records .idstringUnique ID associated with the recordUUID"{unique record_id}"
records .people_idstringPeople ID associated with the transactionUUID"{people record_id}"
records .companies_idstringCompanies ID associated with the transactionUUID"{companies record_id}"
records .transaction_idstringCustom ID provided to the transactionABC123
records .transaction_timedatetimeAt what date and time this transaction took place"YYYY-MM-DD HH:mm:ss"2024-09-01 17:15:34
records .transaction_referencestringReference number as seen on bank statementsTST24090100001
transaction_status_lookups_idstringStatus lookups ID of the transactionUUID"5c4a9234-c5f4-4bab-9868-b1120df89d96"
records .amountdecimalAmount that was paid during the transaction100.25
records .is_debitbooleanIf this transaction was debited from the person/company's accounttrue, falsetrue
records .payment_methods_idstringPayment Methods ID related to the transactionUUID"{payment_methods record_id}"
records .subscriptions_idstringSubscription ID related to the transactionUUID"{subscriptions record_id}"
records .cards_idstringCards ID related to the transactionUUID"{cards record_id}"
records .bank_accounts_idstringBank accounts ID related to the transactionUUID"{bank_accounts record_id}"
records .interval_lookups_idstringInterval lookups ID of the transactionUUID"04f6c27d-1eba-4ef1-a023-3baa79cff571"
records .response_reasonstringReason for the payment status (if applicable)"Auth Done"
records .response_codestringResponse code related to the response reason (if applicable)"990017"
records .response_rawStringRaw response received by the payment method (if applicalbe)max 8192 characters"{json body of 3rd party payments}"
records .is_reversedbooleantrue - if this transaction payment has been reversedtrue, falsefalse
records .is_disputebooleantrue - if this transaction has been disputed at the banktrue, falsefalse
records .notesstringNotes associated with this transaction"some notes about this subscription"
records .batches_accounts_idstringBatch Account ID associated with this transactionUUID"{batches_accounts record_id}"
records .documents_idstringDocuments ID associated with this transaction, if a document was uploaded along with this transactionUUID"{documents id}"
records .feedecimalFee paid to the payment method (if applicable)3.24
records .accounts_currencies_idstringAccount currency associated with this transactionUUID"{accounts_currencies record_id}"
records .date_status_updateddateWhen the payment status of this transaction changed"YYYY-MM-DD HH:mm:ss""2024-09-01 14:34:23"

Copyright © 2024 SwitchTransact