User Tools

Site Tools


developers:api:payment

Payments

/v1/payment/id/get

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

Parameter listing

Name Availability Description
depth get The depth parameter signals the amount of data for the payment that was provided. depth=0 is the highest level that provides full detail.
id get The id of the payment in the system. This is guaranteed to be unique only over a single account.
xid get The xid of the payment in the system. This is guaranteed to be unique over all accounts.
client get The client the payment was for.
currency get A currency object the payment was made in.
batch get A batch object if the payment was on a batch.
payment_method get A payment_method object through which the payment was made.
amount get The payment amount as a string.
amount_cents get The payment amount as an integer number of cents.
reference get The reference code that was submitted with the payment.
state get The current state of the payment.

/v1/payment/list

List payments.

Results can optionally be filtered by the filters listed below.

    $ curl -u user:pass -d "perpage=2" \
    >      https://api.snapbill.com/v1/payment/list.json

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

    {
      "code": 200,
      "type": "list",
      "page": 1,
      "numpages": 5,
      "class": "payment",
      "list": [
        {
          "id": 932850,
          "xid": "Clw:Djvy",
          "client": {
            "depth": 0,
            "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": 1,
              "code": "netcash",
              "name": "Netcash Collect",
              "enabled": true
            },
            "surname": "",
            "totals": {
              "unpaid_invoices": "555.58",
              "unpaid_invoices_cents": 55558,
              "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
            },
            "services": {
              "155686": {
                "id": 155686,
                "xid": "Clw:mAm",
                "state": "active",
                "name": "Pancake Delivery",
                "username": null,
                "created": "2014-08-22 09:45:24",
                "renewal": "2014-09-01 00:00:00",
                "package": {
                  "depth": 2,
                  "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": 2,
                  "id": 158958,
                  "xid": "Clw:mzu",
                  "state": "active",
                  "number": "001",
                  "name": "test4128"
                },
                "variables": [],
                "data": {
                  "created": "2014-08-22 09:45:24",
                  "package_name": "Delicious Pancakes",
                  "renewal": "2014-09-01 00:00:00",
                  "term": 1
                }
              },
              "155687": {
                "id": 155687,
                "xid": "Clw:mAn",
                "state": "active",
                "name": "Pancake Delivery",
                "username": null,
                "created": "2014-08-22 09:50:39",
                "renewal": "2014-09-01 00:00:00",
                "package": {
                  "depth": 2,
                  "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": 2,
                  "id": 158958,
                  "xid": "Clw:mzu",
                  "state": "active",
                  "number": "001",
                  "name": "test4128"
                },
                "variables": [],
                "data": {
                  "created": "2014-08-22 09:50:39",
                  "package_name": "Delicious Pancakes",
                  "renewal": "2014-09-01 00:00:00",
                  "term": 1
                }
              },
              "155688": {
                "id": 155688,
                "xid": "Clw:mAo",
                "state": "active",
                "name": "Pancake Delivery",
                "username": null,
                "created": "2014-08-22 09:55:19",
                "renewal": "2014-09-01 00:00:00",
                "package": {
                  "depth": 2,
                  "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": 2,
                  "id": 158958,
                  "xid": "Clw:mzu",
                  "state": "active",
                  "number": "001",
                  "name": "test4128"
                },
                "variables": [],
                "data": {
                  "created": "2014-08-22 09:55:19",
                  "package_name": "Delicious Pancakes",
                  "renewal": "2014-09-01 00:00:00",
                  "term": 1
                }
              }
            }
          },
          "batch": {
            "depth": 1,
            "id": 1500,
            "xid": "Clw:Xc",
            "state": "build",
            "action_date": "2014-08-21",
            "submit_date": null,
            "payment_method": {
              "depth": 2,
              "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
            }
          },
          "currency": {
            "code": "ZAR",
            "format": "R%.2f",
            "enabled": true
          },
          "amount": "50.00",
          "amount_cents": 5000,
          "reference": "Debit order payment (Batch #001)",
          "payment_method": {
            "depth": 1,
            "code": "netcash",
            "name": "Netcash Collect",
            "enabled": true
          },
          "payment_details": {
            "id": 143475,
            "xid": "Clw:jBz",
            "type": "bank_account",
            "bank": "ABSA BANK",
            "number": "************7015",
            "last4": "7015",
            "expiry": null,
            "created": "2014-08-21 16:23:40",
            "tokens": [],
            "client": {
              "depth": 2,
              "id": 158958,
              "xid": "Clw:mzu",
              "state": "active",
              "number": "001",
              "name": "test4128"
            }
          },
          "state": "pending"
        },
        {
          "id": 932851,
          "xid": "Clw:Djvz",
          "client": {
            "depth": 0,
            "id": 158959,
            "xid": "Clw:mzv",
            "state": "active",
            "number": "002",
            "name": "test8587",
            "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": "test8587",
            "payment": "netcash",
            "payment_method": {
              "depth": 1,
              "code": "netcash",
              "name": "Netcash Collect",
              "enabled": true
            },
            "surname": "",
            "totals": {
              "unpaid_invoices": "0.00",
              "unpaid_invoices_cents": 0,
              "paid_payments": "0.00",
              "paid_payments_cents": 0
            },
            "urls": {
              "statement": "https://demo.snapbill.com/statement/Clw:mzv/=NTk0M2I0MjI4",
              "payment": "https://demo.snapbill.com/payment/client/Clw:mzv/=NTA5MmY3MzU3"
            },
            "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
            },
            "services": []
          },
          "batch": {
            "depth": 1,
            "id": 1500,
            "xid": "Clw:Xc",
            "state": "build",
            "action_date": "2014-08-21",
            "submit_date": null,
            "payment_method": {
              "depth": 2,
              "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
            }
          },
          "currency": {
            "code": "ZAR",
            "format": "R%.2f",
            "enabled": true
          },
          "amount": "50.00",
          "amount_cents": 5000,
          "reference": "Debit order payment (Batch #001)",
          "payment_method": {
            "depth": 1,
            "code": "netcash",
            "name": "Netcash Collect",
            "enabled": true
          },
          "payment_details": {
            "id": 143476,
            "xid": "Clw:jB0",
            "type": "credit_card",
            "bank": "mastercard",
            "number": "****-****-****-1064",
            "last4": "1064",
            "expiry": "2015-04",
            "created": "2014-08-21 16:23:42",
            "tokens": [],
            "client": {
              "depth": 2,
              "id": 158959,
              "xid": "Clw:mzv",
              "state": "active",
              "number": "002",
              "name": "test8587"
            }
          },
          "state": "pending"
        }
      ]
    }

List Payments Filters

Name Availability Description
client_id get The client associated with the payments.
batch_id get The batch associated with the payments.
state get The state of the payments.
page get The page of results to return.
perpage get The number of results per page to return.
developers/api/payment.txt · Last modified: 2014/10/18 07:54 by Jaco van Wyk

Page Tools