Transaction Batches

Any user with the available permissions can perform a request to manually settle a transaction batch. This is done by using the transactionbatches endpoint with an action of "settle".

 

Endpoint Actions

Get Transaction Batches

GET /v2/transactionbatches

Note: It may be useful to include sort=-created_ts as a query string parameter so that the most recent Transaction Batch is first in the list.

{
  "transactionbatches": [
    {
      "id": "11ex83jf7skd04fxxxbd0efc",
      "batch_num": 3,
      "product_transaction_id": "11e85xx83gh75js8863c14ea",
      "created_ts": 1526051483,
      "processing_status_id": 1,
      "is_open": 1,
      "batch_close_ts": null
    },
    {
      "id": "11e85xx883ng0sdaac9814db",
      "batch_num": 2,
      "product_transaction_id": "11e855xx93jf03jd863c14ea",
      "created_ts": 1526048228,
      "processing_status_id": 2,
      "is_open": 0,
      "batch_close_ts": 1526051458
    },
    {
      "id": "11e85xx093jd7gj2b3eff99b",
      "batch_num": 1,
      "product_transaction_id": "11e85fhg903jf0aklb8863c14ea",
      "created_ts": 1526047654,
      "processing_status_id": 2,
      "is_open": 0,
      "batch_close_ts": 1526047665
    }
  ],
  "meta": {
    "pagination": {
      "links": {
        "self": {
          "href": "https://api.domain.com/v2/transactionbatches"
        }
      },
      "totalCount": 3,
      "pageCount": 1,
      "currentPage": 0,
      "perPage": 15
    },
    "sort": {
      "attributes": {
        "created_ts": "desc"
      }
    }
  }
}

Get Specific Transaction Batch

GET /v2/transactionbatches/{id}

{
  "transactionbatch": {
      "id": "11ex83jf7skd04fxxxbd0efc",
      "batch_num": 3,
      "product_transaction_id": "11e85xx83gh75js8863c14ea",
      "created_ts": 1526051483,
      "processing_status_id": 1,
      "is_open": 1,
      "batch_close_ts": null
    }
}

Settle a Transaction Batch

POST /v2/transactionbatches/{id}/settle

{
    "transactionbatch":{
        "id":"11e88609b8516bc0c0e4c88b",
        "batch_num":4,
        "is_open":0,
        "processing_status_id":2,
        "product_transaction_id":"11e7c00dbe23c68cb218232c",
        "created_ts":1531423693,
        "settlement_file_name":null,
        "batch_close_ts":1531427071
    }
}

Processing Status Ids

There are only 5 processing status ids that can be returned in the response when the action is "settle". They are listed in the table below.

Status Id Description
1 To Settle
2 Settled
3 Error
4 Re-process
5 Processing

Filters

In contrary to using expands to get extra data, you can use filters to limit record results. Most fields listed in the fields section can be used to filter results.

Say, for example, that you only wanted to find the open batch. You could include that filter in the URL of the GET request like so:

/v2/transactionbatches?is_open=1

Additional filters include: processing_status_id, and product_transaction_id.

There is additional functionality that allows searching and filtering on timestamp fields. If you are looking for transaction from today, you can simply search on the created_ts field as follows:

/v2/transactionbatches?created_ts=today

And for yesterday you could do the following:

/v2/transactionbatches?created_ts=yesterday

If you need more flexibility on dates, you can set the timestamp filter to custom and supply a custom from and to date like so:

/v2/transactionbatches?created_ts=custom&created_ts_from=1511382234&created_ts_to=1511385997

You can do the same thing with batch_close_ts like so:

/v2/transactionbatches?batch_close_ts=custom&batch_close_ts_from=1511382234&batch_close_ts_to=1511385997

When searching on timestamp fields, the list below contains all the predefined values that can be used:

  • today
  • yesterday
  • this week
  • last week
  • last 30 days
  • this month
  • last month
  • custom