Get a list of batches account related
GET https://api.billagain.com/v1/batches
Parameter | Format | Description |
---|---|---|
BatchToken | GUID | Unique batch identifier |
CurrencyCode | Alpha | 3 letter currency code, eg. ZAR, USD |
GatewayToken | GUID | Unique gateway identifier |
CreatedDate | Date | Date batch was created |
SubmitDate | Date | Date batch was submitted if submitted |
ActionDate | Date | Date batch should go off |
BuildError | Alpha Numeric | Build error if batch not successful |
State | Alpha Numeric | Current batch state |
NumberOfPayments | Alpha Numeric | Number of lines in batch |
PaymentsTotal | Alpha Numeric | Total amount paid |
Notes | Alpha Numeric | Any additional notes |
HTTP CODE: 200 OK
[
{
"BatchToken": "b7243c6b-4ff9-4bf2-9e91-e2970329ed1d",
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"CreatedDate": "2016-04-03T17:25:46.2089071+02:00",
"SubmitDate": null,
"ActionDate": "2016-04-03T00:00:00+02:00",
"State": "open",
"BuildError": null,
"NumberOfPayments": 1,
"PaymentsTotal": "200.00",
"Notes": "My Notes"
},
{
"BatchToken": "d075aec2-5b36-47d3-843d-1792401f3356",
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"CreatedDate": "2016-04-03T17:01:24.2101247+02:00",
"SubmitDate": "2016-04-03T17:01:36.027985+02:00",
"ActionDate": "2016-04-11T00:00:00+02:00",
"State": "build",
"BuildError": null,
"NumberOfPayments": 1,
"PaymentsTotal": "100.00",
"Notes": "My Notes"
}
]
Returns a specific batch
GET https://api.billagain.com/v1/batches/{BatchToken}
Parameter | Format | Description |
---|---|---|
BatchToken req | Numeric | Unique batch identifier |
Parameter | Format | Description | ||||||
---|---|---|---|---|---|---|---|---|
BatchToken | GUID | Unique batch identifier | ||||||
CurrencyCode | Alpha | 3 letter currency code, eg. ZAR, USD | ||||||
GatewayToken | GUID | Unique gateway identifier | ||||||
CreatedDate | Date | Date batch was created | ||||||
SubmitDate | Date | Date batch was submitted if submitted | ||||||
ActionDate | Date | Date batch should go off | ||||||
State | Alpha Numeric | Current batch state | ||||||
BuildError | Alpha Numeric | Build error if batch not successful | ||||||
NumberOfPayments | Alpha Numeric | Number of lines in batch | ||||||
Notes | Alpha Numeric | Any additional notes | ||||||
Payments | Object List | |||||||
|
HTTP CODE: 200 OK
{
"BatchToken": "b7243c6b-4ff9-4bf2-9e91-e2970329ed1d",
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"CreatedDate": "2016-04-03T17:25:46.2089071+02:00",
"SubmitDate": null,
"ActionDate": "2016-04-03T00:00:00+02:00",
"State": "open",
"BuildError": null,
"NumberOfPayments": 1,
"PaymentsTotal": "200.00",
"Notes": "My Notes"
}
Creates a batch
POST https://api.billagain.com/v1/batches
Parameter | Format | Description |
---|---|---|
CurrencyCode req | Alpha | 3 letter currency code, eg. ZAR, USD |
GatewayToken req | Alpha | Unique gateway identifier |
ActionDate req | date | Date batch should go off |
Notes | Alpha Numeric | Any additional notes |
Parameter | Format | Description |
---|---|---|
BatchToken | GUID | Unique batch identifier |
CurrencyCode | Alpha | 3 letter currency code, eg. ZAR, USD |
GatewayToken | GUID | Unique gateway identifier |
CreatedDate | Date | Date batch was created |
SubmitDate | Date | Date batch was submitted if submitted |
ActionDate | Date | Date batch should go off |
State | Alpha Numeric | Current batch state |
BuildError | Alpha Numeric | Build error if batch not successful |
NumberOfPayments | Alpha Numeric | Number of lines in batch |
Notes | Alpha Numeric | Any additional notes |
{
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"ActionDate": "23 April 2016",
"Notes": "My notes"
}
HTTP CODE: 201 Created
{
"BatchToken": "fecbd21e-2967-4128-8d8c-171c43faa35c",
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"CreatedDate": "2016-04-08T11:37:01.4113161+02:00",
"SubmitDate": null,
"ActionDate": "2016-04-23T00:00:00+02:00",
"State": "open",
"BuildError": null,
"NumberOfPayments": 0,
"Notes": "My notes"
}
Edit a specific batch
PUT https://api.billagain.com/v1/batches
Parameter | Format | Description |
---|---|---|
BatchToken req | GUID | Unique batch identifier |
CurrencyCode req | Alpha | 3 letter currency code, eg. ZAR, USD |
GatewayToken req | Alpha | Unique gateway identifier |
ActionDate req | date | Date batch should go off |
Notes | Alpha Numeric | Any additional notes |
{
"BatchToken" : "fecbd21e-2967-4128-8d8c-171c43faa35c",
"CurrencyCode": "ZAR",
"GatewayToken": "d9308a66-66be-4b2a-87d6-fc0cbd2fde13",
"CreatedDate": "2016-04-08T11:37:01.4113161+02:00",
"ActionDate": "2016-04-23T00:00:00+02:00",
"Notes": "My Notes Edited"
}
HTTP CODE: 204 No Content
Submits a specific batch
PUT https://api.billagain.com/v1/batches/submit
Parameter | Format | Description |
---|---|---|
BatchToken req | GUID | Unique batch identifier |
ActionDate req | date | Date batch should go off |
Notes | Alpha Numeric | Any additional notes |
{
"BatchToken" : "283533e9-df13-4590-88bf-c98a60dfc008",
"ActionDate": "2017-04-23T00:00:00+02:00",
"Notes": "My Notes Edited"
}
HTTP CODE: 204 No Content
Cancels a batch
PUT https://api.billagain.com/v1/batches/cancel
Parameter | Format | Description |
---|---|---|
BatchToken req | GUID | Unique batch identifier |
HTTP CODE: 204 No Content
Adds a payment line to batch
POST https://api.billagain.com/v1/batches/payments
Parameter | Format | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BatchToken req | GUID | Unique batch identifier | |||||||||
customerID req | Numeric | Unique customer identifier | |||||||||
Amount req | Numeric | Payment amount | |||||||||
Ref | Alpha Numeric | Reference of payment | |||||||||
Memo | Alpha Numeric | Payment Memo | |||||||||
paymentMethodID req | Numeric | Billagain payment method identifier | |||||||||
isAutoApply | Boolean |
AutoApply conditions:
|
|||||||||
PaymentApplied req | Object List |
Alternative field options:
|
|||||||||
|
Parameter | Format | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
paymentID | Numeric | Unique payment identifier | |||||||||
customerID | Numeric | Unique customer identifier | |||||||||
Amount | Numeric | The Amount paid by customer | |||||||||
CurrencyCode | Alpha | 3 letter currency code, eg. ZAR, USD | |||||||||
Date | Date | The date of payment | |||||||||
Memo | Alpha Numeric | Payment Memo | |||||||||
Method | Alpha | Customers payment method (Options: cash, cheque, credit_card, bank_account, eft) | |||||||||
Ref | Alpha Numeric | Reference of payment | |||||||||
Status | Alpha | The payment status (Options : Pending, Allocated, Partial, Unallocated, Failed ) | |||||||||
PaymentApplied req | Object List |
Alternative field options:
|
|||||||||
|
{
"BatchToken" : "fecbd21e-2967-4128-8d8c-171c43faa35c",
"customerID": 269,
"Amount": 200,
"Ref": "My invoice payments 11351, 11352",
"isAutoApply" : false,
"Memo": "My Memo",
"paymentMethodID": 10106,
"PaymentApplied": [
{
"invoiceID": 11351,
"amount": 100
},
{
"invoiceID": 11352,
"amount": 100
}
]
}
HTTP CODE: 201 Created
{
"paymentID": 10806,
"customerID": 269,
"Status": "Allocated",
"Date": "2016-04-08T10:18:30.483551Z",
"CurrencyCode": "ZAR",
"Amount": 200,
"Method": "debit_order",
"Ref": "My invoice payments 11351, 11352",
"Memo": "My Memo",
"PaymentApplied": [
{
"allocationID": 10385,
"invoiceID": 11351,
"paymentID": 10817,
"amount": 100
},
{
"allocationID": 10386,
"invoiceID": 11352,
"paymentID": 10817,
"amount": 100
}
]
}
Edits a payment line
PUT https://api.billagain.com/v1/batches/payments
Parameter | Format | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
paymentID req | Numeric | Unique payment identifier | |||||||||
BatchToken req | GUID | Unique batch identifier | |||||||||
customerID req | Numeric | Unique customer identifier | |||||||||
Amount req | Numeric | The Amount paid by customer | |||||||||
CurrencyCode req | Alpha | 3 letter currency code, eg. ZAR, USD | |||||||||
Date req | Date | The date of payment | |||||||||
Memo | Alpha Numeric | Payment Memo | |||||||||
Method req | Alpha | Customers payment method (Options: cash, cheque, credit_card, bank_account, eft) | |||||||||
Ref | Alpha Numeric | Reference of payment | |||||||||
PaymentApplied req | Object List |
List of payment allocations - options:
|
|||||||||
|
{
"paymentID": 10814,
"BatchToken": "fecbd21e-2967-4128-8d8c-171c43faa35c",
"customerID": 269,
"Amount": 500,
"Ref": "My invoice payments",
"Memo": "My Memo 2",
"paymentMethodID": 10106,
"PaymentApplied": [
{
"invoiceID": 11351,
"amount": 200
},
{
"invoiceID": 11352,
"amount": 200
},
{
"invoiceNumber": 957,
"amount": 100
}
]
}
HTTP CODE: 204 No Content
Deletes a payment line
DELETE https://api.billagain.com/v1/batches/payments/{paymentid}
Parameter | Format | Description |
---|---|---|
paymentID req | Numeric | Unique payment identifier |
HTTP CODE: 204 No Content