Table of Contents

Packages

/v1/package/id/get

Retrieve a package by id and return it's details.

Parameter listing

Name Availability Description
depth get The depth parameter signals the amount of data for the package that was provided. depth=0 is the highest level that provides full detail.
name get The name of the package. This is used as the reference and must be unique over a given account for a specific service type and currency.
setup get The setup fee of the package as a string in the currency of the package.
setup_cents get An integer value of the setup fee in cents.
terms get An array of the different available terms for the package
↳ type get The type of term. Only option at the moment is “daymonth”.
↳ day get The day at which the package is due. Always '1' at the moment.
↳ interval get The number of months between renewals of the package. Monthly renewals will be set to 1, quarterly is 3, annually 12, …
↳ description get A neat description explaining the terms recurrence (Monthly / Two months / Annual / …)
↳ fee get The recurring fee for the package as a string.
↳ fee_cents get An integer value of the fee measured in cents.
currency get A currency object for the package.
service_type get A service type that the package belongs to.
available get A boolean value indicating if the package is available on the signup form or not.
state get The state the package is in. Usually “active” but will be set to “dead” if it is removed.

/v1/package/list

List all the packages of all the clients of this account.

Results can optionally be filtered by the filters listed below.

    $ curl -u user:pass -d "service_type_id=596" \
    >      https://api.snapbill.com/v1/package/list.json

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

    {
      "code": 200,
      "type": "list",
      "page": 1,
      "numpages": 1,
      "class": "package",
      "list": [
        {
          "depth": 0,
          "id": 25756,
          "name": "Delicious Pancakes",
          "setup": "50.00",
          "setup_cents": 5000,
          "terms": [
            {
              "type": "daymonth",
              "day": 1,
              "interval": 1,
              "description": "Monthly",
              "fee": "240.00",
              "fee_cents": 24000
            }
          ],
          "currency": {
            "code": "ZAR",
            "format": "R%.2f",
            "enabled": true
          },
          "service_type": {
            "id": 596,
            "xid": "Clw:JU",
            "name": "Pancake Delivery"
          },
          "flags": {
            "hide-signup": false,
            "hide-all": false
          },
          "state": "active",
          "available": false
        }
      ]
    }

List Packages Filters

Name Availability Description
service_type get The service type of the packages.
name get The name of the packages.
page get The page of results to return.
perpage get The number of results per page to return.