Developer Guide

Customers

Returns a list of all the Customers linked to the logged in account, subject to paging as defined in pagination section

URL

GET https://api.billagain.com/v1/customers

URL PARAMETERS

None - optional paging values can be passed through

OUTPUT PARAMETERS (37 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Current customer balance
autoSendInvoice Boolean Indicates if Customer should automatically receive Invoices
autoSendStatement Boolean Indicates if Customer should automatically receive Customer Statement
StatementLastSentDate Date Indicates on what date the Customer has received the last Customer Statement
PrimaryPaymentMethodInfo Object Indicates the Primary Payment Method for a customer
paymentMethodID Numeric Primary payment method identifier
Token Numeric Primary payment method token

EXAMPLES

JSON Output

HTTP CODE: 200 OK
[
  {
    "customerID": 302,
    "Reference": "12343453454",
    "isCompany": false,
    "Name": "Brielle Barnett",
    "LastName": null,
    "RegistrationNumber": "245",
    "Company": null,
    "Email": "poqo@hotmail.com",
    "EmailCC": "cobojufypy@yahoo.com",
    "Cell": "+616-72-9711058",
    "Tel": "+616-72-9711058",
    "Fax": "+227-94-8405032",
    "VatNo": "554",
    "Address1": "50 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "Eastern Cape",
    "countryStateID": "1",
    "ZipCode": "6000",
    "PrimaryGatewayID": 99,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T16:34:53.8018224+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": false,
    "SuspendedDate": null,
    "PaymentMethod": "credit_card",
    "ActiveSubs": 5,
    "Balance": 500.5000,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    }
  },
  {
    "customerID": 300,
    "Reference": "123123111",
    "isCompany": true,
    "Name": "Vaughan Lawrence",
    "LastName": "3245",
    "RegistrationNumber": null,
    "Company": "345",
    "Email": "vlaw@gmail.com",
    "EmailCC": "lixuxy@yahoo.com",
    "Cell": "+883-50-8150528",
    "Tel": "+883-50-8150528",
    "Fax": "+328-41-2588271",
    "VatNo": null,
    "Address1": "51 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "",
    "countryStateID": null,
    "ZipCode": "87925",
    "PrimaryGatewayID": 97,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T10:41:44.5698058+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": true,
    "SuspendedDate": null,
    "PaymentMethod": "bank_account",
    "ActiveSubs": 0,
    "Balance": 0,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    }
  }
]

Returns a list of all the Customers linked to the logged in account filter by customerIDs supplied, subject to paging as defined in pagination section

URL

POST https://api.billagain.com/v1/by_customer_ids

URL PARAMETERS (1 Field)

Parameter Format Description
Optional Numeric Optional paging values can be passed through

INPUT PARAMETERS (1 Field)

Parameter Format Description
ids req Numeric List List of unique customer identifier

OUTPUT PARAMETERS (39 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card , debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Current customer balance
autoSendInvoice Boolean Indicates if Customer should automatically receive Invoices
autoSendStatement Boolean Indicates if Customer should automatically receive Customer Statement
StatementDate Date Indicate on with date the customer should receive the automatic Customer Statement
StatementLastSentDate Date Indicates on what date the Customer has received the last Customer Statement
PrimaryPaymentMethod Boolean Indicates the Primary Payment Method for a customer
PrimaryPaymentMethodInfo Object Indicates the Primary Payment Method for a customer
paymentMethodID Numeric Primary payment method identifier
Token Numeric Primary payment method token

EXAMPLES

JSON Input

{
  "ids": [
    300,
    302
  ]
}

JSON Output

HTTP CODE: 200 OK
[
  {
    "customerID": 302,
    "Reference": "12343453454",
    "isCompany": false,
    "Name": "Brielle Barnett",
    "LastName": null,
    "RegistrationNumber": "245",
    "Company": null,
    "Email": "poqo@hotmail.com",
    "EmailCC": "cobojufypy@yahoo.com",
    "Cell": "+616-72-9711058",
    "Tel": "+616-72-9711058",
    "Fax": "+227-94-8405032",
    "VatNo": "554",
    "Address1": "50 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "Eastern Cape",
    "countryStateID": "1",
    "ZipCode": "6000",
    "PrimaryGatewayID": 99,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T16:34:53.8018224+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": false,
    "SuspendedDate": null,
    "PaymentMethod": "credit_card",
    "ActiveSubs": 5,
    "Balance": 500.5000,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    }
  },
  {
    "customerID": 300,
    "Reference": "123123111",
    "isCompany": true,
    "Name": "Vaughan Lawrence",
    "LastName": "3245",
    "RegistrationNumber": null,
    "Company": "345",
    "Email": "vlaw@gmail.com",
    "EmailCC": "lixuxy@yahoo.com",
    "Cell": "+883-50-8150528",
    "Tel": "+883-50-8150528",
    "Fax": "+328-41-2588271",
    "VatNo": null,
    "Address1": "51 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "",
    "countryStateID": null,
    "ZipCode": "87925",
    "PrimaryGatewayID": 97,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T10:41:44.5698058+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": true,
    "SuspendedDate": null,
    "PaymentMethod": "bank_account",
    "ActiveSubs": 0,
    "Balance": 0,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    }
  }
]

Returns a list of all the Customers (with their custom field values) linked to the logged in account, subject to paging as defined in pagination section

URL

GET https://api.billagain.com/v1/customers/with_customfields

URL PARAMETERS

None - optional paging values can be passed through

OUTPUT PARAMETERS (38 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Current customer balance
autoSendInvoice Boolean Indicates if Customer should automatically receive Invoices
autoSendStatement Boolean Indicates if Customer should automatically receive Customer Statement
StatementLastSentDate Date Indicates on what date the Customer has received the last Customer Statement
PrimaryPaymentMethodInfo Object Indicates the Primary Payment Method for a customer
paymentMethodID Numeric Primary payment method identifier
Token Numeric Primary payment method token
CustomFields Object List A list of key-value pairs
Key Alpha Numeric The label of the custom field
Value Alpha Numeric The value of the custom field

EXAMPLES

JSON Output

HTTP CODE: 200 OK
[
  {
    "customerID": 302,
    "Reference": "12343453454",
    "isCompany": false,
    "Name": "Brielle Barnett",
    "LastName": null,
    "RegistrationNumber": "245",
    "Company": null,
    "Email": "poqo@hotmail.com",
    "EmailCC": "cobojufypy@yahoo.com",
    "Cell": "+616-72-9711058",
    "Tel": "+616-72-9711058",
    "Fax": "+227-94-8405032",
    "VatNo": "554",
    "Address1": "50 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "Eastern Cape",
    "countryStateID": "1",
    "ZipCode": "6000",
    "PrimaryGatewayID": 99,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T16:34:53.8018224+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": false,
    "SuspendedDate": null,
    "PaymentMethod": "credit_card",
    "ActiveSubs": 5,
    "Balance": 500.5000,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    },
    "CustomFields": [
      {
        "Key": "Select your income range?",
        "Value": "0-50000"
      },
      {
        "Key": "What languages are you fluent in?",
        "Value": "English:Spanish"
      },
      {
        "Key": "Do you have any form of identification?",
        "Value": "Yes"
      }
    ]
  },
  {
    "customerID": 300,
    "Reference": "123123111",
    "isCompany": true,
    "Name": "Vaughan Lawrence",
    "LastName": "3245",
    "RegistrationNumber": null,
    "Company": "345",
    "Email": "vlaw@gmail.com",
    "EmailCC": "lixuxy@yahoo.com",
    "Cell": "+883-50-8150528",
    "Tel": "+883-50-8150528",
    "Fax": "+328-41-2588271",
    "VatNo": null,
    "Address1": "51 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "Country": "South Africa",
    "countryID": 71,
    "CountryState": "",
    "countryStateID": null,
    "ZipCode": "87925",
    "PrimaryGatewayID": 97,
    "CurrencyCode": "ZAR",
    "CreatedDate": "2016-03-11T10:41:44.5698058+02:00",
    "isSuspended": false,
    "isActive": true,
    "comp_status": "Active",
    "isWaiveTaxes": true,
    "SuspendedDate": null,
    "PaymentMethod": "bank_account",
    "ActiveSubs": 0,
    "Balance": 0,
    "autoSendInvoice": false,
    "autoSendStatement": false,
    "StatementDate": null,
    "StatementLastSentDate": null,
    "PrimaryPaymentMethodInfo": {
      "paymentMethodID": 20406,
      "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
    },
    "CustomFields": [
      {
        "Key": "Select your income range?",
        "Value": "50000-100000"
      },
      {
        "Key": "What languages are you fluent in?",
        "Value": null
      },
      {
        "Key": "Do you have any form of identification?",
        "Value": "No"
      }
    ]
  }
]

Returns a specific customer

URL

GET https://api.billagain.com/v1/customers/{customerID}

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

OUTPUT PARAMETERS (37 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Customer balance owing
autoSendInvoice Boolean Indicates if Customer should automatically receive Invoices
autoSendStatement Boolean Indicates if Customer should automatically receive Customer Statement
StatementLastSentDate Date Indicates on what date the Customer has received the last Customer Statement
PrimaryPaymentMethodInfo Object Indicates the Primary Payment Method for a customer
paymentMethodID Numeric Primary payment method identifier
Token Numeric Primary payment method token

EXAMPLES

JSON Output

HTTP CODE: 200 OK
{
  "customerID": 10622,
  "Reference": null,
  "isCompany": true,
  "Name": "Biscuits Biscuits ",
  "LastName": null,
  "RegistrationNumber": "Reg Num Cust",
  "Company": null,
  "Email": "",
  "EmailCC": "",
  "Cell": "",
  "Tel": "",
  "Fax": "",
  "VatNo": "Vat Num Cust",
  "Address1": "",
  "Address2": "",
  "City": "",
  "State": "",
  "Country": "South Africa",
  "countryID": 71,
  "CountryState": "",
  "countryStateID": null,
  "ZipCode": "",
  "PrimaryGatewayID": null,
  "CurrencyCode": "ZAR",
  "CreatedDate": "2016-09-14T12:22:48.4214398+02:00",
  "isSuspended": false,
  "isActive": true,
  "comp_status": "Active",
  "isWaiveTaxes": false,
  "SuspendedDate": null,
  "PaymentMethod": null,
  "ActiveSubs": 2,
  "Balance": 1728.0667,
  "autoSendInvoice": false,
  "autoSendStatement": false,
  "StatementDate": null,
  "StatementLastSentDate": null,
  "PrimaryPaymentMethodInfo": {
    "paymentMethodID": 20406,
    "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
  }
}

Returns a specific customer with their custom fields

URL

GET https://api.billagain.com/v1/customers/with_customfields/{customerID}

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

OUTPUT PARAMETERS (38 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Customer balance owing
autoSendInvoice Boolean Indicates if Customer should automatically receive Invoices
autoSendStatement Boolean Indicates if Customer should automatically receive Customer Statement
StatementLastSentDate Date Indicates on what date the Customer has received the last Customer Statement
PrimaryPaymentMethodInfo Object Indicates the Primary Payment Method for a customer
paymentMethodID Numeric Primary payment method identifier
Token Numeric Primary payment method token
CustomFields Object List A list of key-value pairs
Key Alpha Numeric The label of the custom field
Value Alpha Numeric The value of the custom field

EXAMPLES

JSON Output

HTTP CODE: 200 OK
{
  "customerID": 10622,
  "Reference": null,
  "isCompany": true,
  "Name": "Biscuits Biscuits ",
  "LastName": null,
  "RegistrationNumber": "Reg Num Cust",
  "Company": null,
  "Email": "",
  "EmailCC": "",
  "Cell": "",
  "Tel": "",
  "Fax": "",
  "VatNo": "Vat Num Cust",
  "Address1": "",
  "Address2": "",
  "City": "",
  "State": "",
  "Country": "South Africa",
  "countryID": 71,
  "CountryState": "",
  "countryStateID": null,
  "ZipCode": "",
  "PrimaryGatewayID": null,
  "CurrencyCode": "ZAR",
  "CreatedDate": "2016-09-14T12:22:48.4214398+02:00",
  "isSuspended": false,
  "isActive": true,
  "comp_status": "Active",
  "isWaiveTaxes": false,
  "SuspendedDate": null,
  "PaymentMethod": null,
  "ActiveSubs": 2,
  "Balance": 1728.0667,
  "autoSendInvoice": false,
  "autoSendStatement": false,
  "StatementDate": null,
  "StatementLastSentDate": null,
  "PrimaryPaymentMethodInfo": {
    "paymentMethodID": 20406,
    "Token": "f8f3b996-6fa6-4140-af73-df688af6365a"
  },
  "CustomFields": [
    {
      "Key": "Select your income range?",
      "Value": "100000-150000"
    },
    {
      "Key": "What languages are you fluent in?",
      "Value": "English:Afrikaans"
    },
    {
      "Key": "Do you have any form of identification?",
      "Value": "Yes"
    }
  ]
}

Adds a customer to your account

URL

POST https://api.billagain.com/v1/customers

INPUT PARAMETERS (30 Fields)

Parameter Format Description
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
CountryCode Alpha Country code
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode req Alpha 3 letter currency code, eg. ZAR, USD
isWaiveTaxes req Boolean An indicator to indicate if customer is tax exempt
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
autoSendInvoice Boolean Specify if customer should receive Invoices via email
autoSendStatement Boolean Specify if customer should receive Statements via email
StatementDay Numeric Specify the date the Statement Email will be send on. Valid options is 1-25 or leave null for last day of month.
Contact Object Details for adding Customer Contact, could be used to login into portal.
See here for more details
Subscriptions Object List Add subscriptions for current customer. Till a maximum of 5 subscriptions.
See here for more details
PrimaryPaymentMethod Object Add a primary payment method. Additional payments can be added at a later stage.
See here for more details

OUTPUT PARAMETERS (40 Fields)

Parameter Format Description
customerID Numeric Unique customer identifier
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
VatNo Numeric Customer Value Added Tax Number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
Country Alpha Numeric Address country
CountryState Alpha Numeric Address country tax state
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode Alpha 3 letter currency code, eg. ZAR, USD
CreatedDate Date Date added
isSuspended Numeric An indicator to indicate if customer is suspended
isActive Boolean An indicator to indicate if customer is not archived
comp_status Alpha Computed customer status
isWaiveTaxes Boolean An indicator to indicate if customer is tax exempt
SuspendedDate Date Date customer was suspended if suspended
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
ActiveSubs Numeric Number of active subscriptions
Balance Numeric Customer balance owing
autoSendInvoice Boolean Specify if customer should receive Invoices via email
autoSendStatement Boolean Specify if customer should receive Statements via email
StatementDate Numeric Specify the date the Statement Email will be send on. Valid options is 1-25 or leave null for last day of month.
StatementLastSentDate Numeric Specify the date the Statement Email will be send on. Valid options is 1-25 or leave null for last day of month.
Contact Object Details for adding Customer Contact, could be used to login into portal.
See here for more details
PrimaryPaymentMethod Object Add a primary payment method. Additional payments can be added at a later stage.
See here for more details
gatewayID Numeric Current gatewayID

EXAMPLES

JSON Input

{
  "isCompany": true,
  "Name": "Bricks Inc",
  "LastName": null,
  "RegistrationNumber": 123123,
  "Company": "Comp Inc ",
  "Email": "tester@api.co.za",
  "EmailCC": null,
  "Cell": "+271-111-API",
  "Tel": "+211-111-API",
  "Fax": "+227-94-API",
  "VatNo": "123 VatNo",
  "Address1": "Golden Street",
  "Address2": "Park 2",
  "City": "Port Elizabeth",
  "State": "Eastern Cape",
  "CountryCode": "ZA",
  "countryID": 71,
  "countryStateID": "1",
  "ZipCode": "6000",
  "PrimaryGatewayID": 99,
  "CurrencyCode": "ZAR",
  "isWaiveTaxes": true,
  "PaymentMethod": "credit_card",
  "autoSendInvoice": true,
  "autoSendStatement": true,
  "StatementDay": 1,
  "Contact": {
    "Name": "Joe",
    "LastName": "Soap",
    "Cell": "+27 789 789",
    "Email": "soap@comp.com",
    "isActive": true,
    "Password": "Pa$$123"
  },"Subscriptions": [
    {
      "packageID": 305,
      "packageVersionID": null,
      "packageVersionNumber": null,
      "packageRateTermID": 10843,
      "componentUsage": [
        {
          "componentID": 10111,
          "componentVersionID": null,
          "componentVersionNumber": 1,
          "NumUnits": 1

        }
      ],
      "StartDate": "15 Dec 2016",
      "firstProrataSyncDate": null,
      "EndDate": null,
      "numDaysBeforeToInv": 1,
      "Term": 1,
      "TermType": "months"
    }
  ],
  "PrimaryPaymentMethod":
    {
      "isPrimary": true,
      "PaymentMethodType": "credit_card",
      "CreditCard": {
        "NameOnCard": "John",
        "LastNameOnCard": "Doe",
        "Number": 42424242424242,
        "CardType": "VISA",
        "ExpiryMonth": "08",
        "ExpiryYear": "2020"
      },
      "ExternalGateways": [ { "gatewayID": "115" } ]
    }
}

JSON Output

HTTP CODE: 201 Created
{
  "customerID": 10659,
  "Reference": null,
  "isCompany": true,
  "Name": "Bricks Inc",
  "LastName": null,
  "RegistrationNumber": "123123",
  "Company": "Comp Inc ",
  "Email": "tester@api.co.za",
  "EmailCC": null,
  "Cell": "+271-111-API",
  "Tel": "+211-111-API",
  "Fax": "+227-94-API",
  "VatNo": "123 VatNo",
  "Address1": "Golden Street",
  "Address2": "Park 2",
  "City": "Port Elizabeth",
  "State": "Eastern Cape",
  "Country": "South Africa",
  "countryID": 71,
  "CountryState": "Western Cape",
  "countryStateID": 1,
  "ZipCode": "6000",
  "PrimaryGatewayID": 99,
  "CurrencyCode": "ZAR",
  "CreatedDate": "2016-09-27T12:00:34.4259616+02:00",
  "isSuspended": false,
  "isActive": true,
  "comp_status": "Active",
  "isWaiveTaxes": true,
  "SuspendedDate": null,
  "PaymentMethod": "credit_card",
  "ActiveSubs": 1,
  "Balance": 0,
  "autoSendInvoice": true,
  "autoSendStatement": true,
  "StatementDate": 1,
  "StatementLastSentDate": null,
  "Contact": {
    "customerID": 10659,
    "customerContactID": 10139,
    "Name": "Joe",
    "LastName": "Soep",
    "Email": "soep@comp.com",
    "Cell": "+27 789 789",
    "Username": "SoeJ7tn",
    "isActive": true
  },
  "PrimaryPaymentMethod": {
    "customerID": 10659,
    "paymentMethodID": 20269,
    "PaymentMethodType": "credit_card",
    "isPrimary": true,
    "isValid": true,
    "CreditCard": {
      "NameOnCard": "John",
      "LastNameOnCard": "Doe",
      "CardType": "VISA",
      "ExpiryMonth": 8,
      "ExpiryYear": 2020,
      "LastFourDigits": "42424242424242"
    },
    "gatewayID": null
  }
}

Edits a specific customer details

URL

PUT https://api.billagain.com/v1/customers/{customerID}

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

INPUT PARAMETERS (26 Fields)

Parameter Format Description
Reference Alpha Numeric Unique customer reference
isCompany Boolean An indicator of whether a customer is an individual or a company
Name Alpha Numeric The customers name if individual or the company name if customer is company
LastName Alpha Numeric The customers last name if individual
RegistrationNumber Alpha Numeric Company registration number
VatNo Numeric Customer Value Added Tax Number
Company Alpha Numeric If individual, the company the individual belongs to
Email Email The customers email address
EmailCC Email An alternate email address for customer
Cell Alpha Numeric Mobile number
Tel Alpha Numeric Telephone number
Fax Alpha Numeric Facsimile number
Address1 Alpha Numeric First line of address
Address2 Alpha Numeric Second line of address
City Alpha Numeric Address city
State Alpha Numeric Address state / province
countryID Numeric Billagain country identifier for taxation
countryStateID Numeric Billagain country state identifier for taxation
ZipCode Alpha Numeric Address zip or area code
PrimaryGatewayID Numeric Billagain primary gateway identifier
CurrencyCode req Alpha 3 letter currency code, eg. ZAR, USD
isWaiveTaxes req Boolean An indicator to indicate if customer is tax exempt
PaymentMethod Alpha Customers payment method (Options: cash, cheque, credit_card, debit_order, eft)
autoSendInvoice Boolean Address zip or area code
autoSendStatement Boolean Address zip or area code
StatementDay Numeric Address zip or area code

EXAMPLES

JSON Input

{
    "Reference": "cust-00001",
    "isCompany": false,
    "Name": "Jason",
    "LastName": "Lee",
    "RegistrationNumber": null,
    "Company": null,
    "Email": "jasonlee@hotmail.com",
    "EmailCC": "jasonl@yahoo.com",
    "Cell": "+271-111-1235",
    "Tel": "+211-111-1235",
    "Fax": "+227-94-8405032",
    "VatNo": null,
    "Address1": "50 Pickering Street",
    "Address2": "Newton Park",
    "City": "Port Elizabeth",
    "State": "Eastern Cape",
    "countryID": 71,
    "countryStateID": "1",
    "ZipCode": "6000",
    "PrimaryGatewayID": 99,
    "CurrencyCode": "ZAR",
    "isWaiveTaxes": false,
    "PaymentMethod": "credit_card",
    "autoSendInvoice": true,
  	"autoSendStatement": true,
  	"StatementDay":1
   
}

JSON Output

HTTP CODE: 204 No Content

Delete a customer from your account

URL

DELETE https://api.billagain.com/v1/customers/{customerID}

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

EXAMPLES

JSON Output

HTTP CODE: 204 No Content

Archive a customer from your account

URL

PUT https://api.billagain.com/v1/customers/{customerID}/archive

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

EXAMPLES

JSON Output

HTTP CODE: 204 No Content

Reopen a customer from your account

URL

PUT https://api.billagain.com/v1/customers/{customerID}/reopen

URL PARAMETERS (1 Field)

Parameter Format Description
customerID req Numeric Unique customer identifier

EXAMPLES

JSON Output

HTTP CODE: 204 No Content