User Tools

Site Tools


developers:api:batch

Batches

/v1/batch/id/get

Fetch a batch and return the details

    $ curl -u user:pass -d "" \
    >      https://api.snapbill.com/v1/batch/1500/get.json

File: examples/batch.txt-1.json -

    {
      "code": 200,
      "type": "item",
      "class": "batch",
      "batch": {
        "depth": 0,
        "id": 1500,
        "xid": "Clw:Xc",
        "state": "build",
        "action_date": "2014-08-21",
        "submit_date": null,
        "payment_method": {
          "depth": 1,
          "code": "netcash",
          "name": "Netcash Collect",
          "enabled": true
        },
        "number": "001",
        "options": {
          "type": "two-day",
          "account": ""
        },
        "account": {
          "depth": 1,
          "id": 10608,
          "xid": "Clw:Clw",
          "username": "demo"
        },
        "currency": {
          "code": "ZAR",
          "format": "R%.2f",
          "enabled": true
        },
        "totals": {
          "total": 10,
          "bounce": 0,
          "refuted": 0,
          "pending": "10",
          "paid": 0
        },
        "amounts": {
          "total": "500.00",
          "bounce": "0.00",
          "refuted": "0.00",
          "pending": "500.00",
          "paid": "0.00"
        },
        "amounts_cents": {
          "total": 50000,
          "bounce": 0,
          "refuted": 0,
          "pending": "50000",
          "paid": 0
        }
      }
    }

Available states

Name Description
ready The batch has been prepared. From here it can either be moved into submit, or will be automatically changed to build if any clients are added.
build Batch is busy being built, this is a temporary state and will be automatically changed to ready once the build is complete.
submit Batch is queued for submission to the bank. The state will automatically be changed to submitted once this is complete.
submitted Batch has been submitted to the bank but we have not yet received a response confirming any payments
error There was a problem and the entire batch was cancelled (all payments inside it will receive an error state too)
ok The batch was submitted to the bank, and we have begun receiving recon reports
dead The batch has been deleted and is no longer displayed in the interface

Parameter listing

Name Availability Description
depth get The depth parameter signals the amount of data for the batch was provided. depth=0 is the highest level that provides full detail, while lower depths provide less.
id get The id of the batch in the system. This is guaranteed to be unique only over a single account.
xid get The xid of the batch in the system. This is guaranteed to be unique over all accounts (see Concepts - Xid)
state get update The state of the batch in our system. The available states are build, ready, submit and submitted, error, ok, and dead. For more details see States.
action_date add get update This is the date at which the batch is intended to go through. When adding clients to a batch, only unpaid invoices that are due on this date or before will be included.
submit_date get This is the date on which the batch was physically submitted to a bank.
payment_method get An object representing the payment method for the batch. Use payment_method_code when adding.
payment_method_code add A short code representing one of the payment methods used by SnapBill.
reseller get An object representing the account that the batch falls under

/v1/batch/list

List all batches belonging to the current account.

Results can optionally be filtered by the filters listed below.

List Batches Filters

Name Availability Description
submit_date get The date the batches were submitted.
state get The state of the batches.
payment_method get The payment methods of the batches.
page get The page of results to be returned.
perpage get The number of results per page to return.
developers/api/batch.txt · Last modified: 2014/10/18 07:11 by Jaco van Wyk