User Tools

Site Tools


developers:api:service

Services

/v1/client/id/add_service

Adds a service to a client.

    $ curl -u user:pass -d "service_type_id=596&package=Delicious%20Pancakes&term=1" \
    >      https://api.snapbill.com/v1/client/158958/add_service.json

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

    {
      "code": 200,
      "type": "item",
      "class": "service",
      "service": {
        "id": 155688,
        "xid": "Clw:mAo",
        "state": "active",
        "name": "Pancake Delivery",
        "username": null,
        "created": "2014-08-22 09:55:19",
        "renewal": "2014-08-22 09:55:19",
        "package": {
          "depth": 1,
          "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
        },
        "term": 1,
        "service_type": {
          "id": 596,
          "xid": "Clw:JU",
          "name": "Pancake Delivery"
        },
        "client": {
          "depth": 1,
          "id": 158958,
          "xid": "Clw:mzu",
          "state": "active",
          "number": "001",
          "name": "test4128",
          "account": {
            "depth": 1,
            "id": 10608,
            "xid": "Clw:Clw",
            "username": "demo"
          },
          "cell": "",
          "company": "",
          "country": {
            "code": "ZA",
            "iso2": "ZA",
            "iso3": "ZAF",
            "name": "South Africa"
          },
          "credit": "0.00",
          "credit_cents": 0,
          "currency": {
            "code": "ZAR",
            "format": "R%.2f",
            "enabled": true
          },
          "discount": "0.00",
          "email": "",
          "firstname": "test4128",
          "payment": "netcash",
          "payment_method": {
            "depth": 2,
            "code": "netcash",
            "name": "Netcash Collect",
            "enabled": true
          },
          "surname": "",
          "totals": {
            "unpaid_invoices": "401.34",
            "unpaid_invoices_cents": 40134,
            "paid_payments": "0.00",
            "paid_payments_cents": 0
          },
          "urls": {
            "statement": "https://demo.snapbill.com/statement/Clw:mzu/=NTYxY2UyN2E5",
            "payment": "https://demo.snapbill.com/payment/client/Clw:mzu/=YjE5YTM0YWNm"
          },
          "data": {
            "public_city": null,
            "public_country": null,
            "public_fax": null,
            "public_phone": null,
            "public_postal": null,
            "public_postcode": null,
            "public_province": null,
            "public_street": null,
            "vat_number": null
          }
        },
        "variables": [],
        "data": {
          "created": "2014-08-22 09:55:19",
          "package_name": "Delicious Pancakes",
          "renewal": "2014-08-22 09:55:19",
          "term": 1
        }
      }
    }

Add Service Parameters

Name Availability Description
service_type_id add The id of the service to add. This field is required
package add The name of the package to use in the service. This field is required
term add The renewal term. This field is required
data-*customfieldname* add Optionally specify custom fields for a package.

/v1/service/id/remove

Removes a service from a client.

    $ curl -u user:pass -d "" https://api.snapbill.com/v1/service/155685/remove.json

File: examples/service.txt-2.json -

    {
      "code": 200,
      "type": "result",
      "status": "ok"
    }

Parameter listing

Name Availability Description
depth get The depth parameter signals the amount of data for the service that was provided. depth=0 is the highest level that provides full detail.
id get The id of the service in the system. This is guaranteed to be unique only over a single account.
xid get The xid of the service in the system. This is guaranteed to be unique over all accounts (see Concepts - Xid)

/v1/service/list

List all services associated with this account.

Results can optionally be filtered by the filters listed below.

List Service Filters

Name Availability Description
service_type get The service_type of the services.
name get The name of the services.
page get The page of results to return.
perpage get The number of results per page to return.
developers/api/service.txt · Last modified: 2014/10/18 12:11 by Jaco van Wyk

Page Tools