Request
| T-WEB Server | T-WEB Login URL | API Endpoint |
| www | https://www.tweb.com.au/v2/ |
https://publicapi.tweb.com.au/v1/SettleTerminal |
| www2 | https://www2.tweb.com.au/v2/ |
https://publicapi2.tweb.com.au/v1/SettleTerminal |
| test | https://test.tweb.ttfuel.com/v2/ |
https://test-publicapi.tweb.ttfuel.com/v1/SettleTerminal |
Parameters
The endpoint only accepts HTTP POST requests. The following POST parameters must be included with the request:
| Field | Type | Required Field | Description |
| SettlementDate | string | Yes | A date in the format 'yyyy-mm-dd hh:mm:ss' |
| Amount | decimal | Yes | The settlement amount with 3 decimal places precision |
| CurrencyCode | string | Yes | Three character ISO 4217 currency code (I.e. 'AUD' for Australian dollars) |
| NumberOfDebits | integer | Yes | The number of debits |
| SequenceNumber | string | No | The terminal's settlement sequence number (aka batch number) |
| LocationID | integer | Yes | The refuelling site's location Id |
| TerminalID | string | Yes | The terminal Id (8 characters max.) (Terminal serial number) |
| TargetID | string | No | Optional client reference Id (100 characters max.) Must only contain characters a-z, A-Z, 0-9 and _ |
Request Examples
json
curl -X POST https://test-publicapi.tweb.ttfuel.com/v1/SettleTerminal
-H 'Content-Type: application/json'
-d '{
"AccessToken":"8B2E3355EC424FD01A01DBF043DA9C7016098502",
"SettlementDate":"2023-05-26 21:53:10",
"Amount":"123456.78",
"CurrencyCode":"AUD",
"NumberOfDebits":"31",
"SequenceNumber":"586",
"LocationID":"97538",
"TerminalID":"24987516",
"TargetID":"c4Kv_jsV_6DeIuDuR"
}'
x-www-form-urlencoded
curl -X POST https://test-publicapi.tweb.ttfuel.com/v1/SettleTerminal -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'AccessToken=8B2E3355EC424FD01A01DBF043DA9C7016098502' --data-urlencode 'SettlementDate=2023-05-26 21:53:10' --data-urlencode 'Amount=123456.78' --data-urlencode 'CurrencyCode=AUD' --data-urlencode 'NumberOfDebits=31' --data-urlencode 'SequenceNumber=586' --data-urlencode 'LocationID=97538' --data-urlencode 'TerminalID=24987516' --data-urlencode 'TargetID=c4Kv_jsV_6DeIuDuR'
Response
The response from the authorisation endpoint has the following JSON format:
Example 1:
Method: SettleTerminal
{
"Error": {
"Code": 0,
"Status": "OK"
},
"Data": {
"Meta": {
"Title": "Terminal Settlement",
"TotalRecords": 1,
"Endpoint": "/v1/SettleTerminal",
"TargetID": "c4Kv_jsV_6DeIuDuR",
"Hash": "1DB559C5CB35230C9DCAE3274932DD4D01EC4294"
},
"Items": [
{
"SettlementDate": "2023-05-26 21:53:10",
"Amount": 123456.78,
"CurrencyCode": "AUD",
"NumberOfDebits": 31,
"SequenceNumber": "586",
"LocationID": 97538,
"TerminalID": "24987516"
}
]
}
}
Example 2:
Method: SettleTerminal
{
"Error": {
"Code": 4920,
"Status": "Terminal ID Cant Be Blank"
},
"Data": {
"Meta": {
"Title": "Terminal Settlement",
"Endpoint": "/v1/SettleTerminal",
"TargetID": "c4Kv_jsV_6DeIuDuR",
"Hash": "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
},
"Items": []
}
}
Response Format
| Field | Type | Description |
| Error | ||
| Code | integer | 0 if the call to FinalizePaymentWithFuelCard was successful otherwise an error code in the range 4900-4999 representing a specific error |
| Status | string | Description of error |
| Meta | ||
| Title | string | Endpoint Title |
| TargetID | string | Optional client reference Id (100 characters max.) Must only contain characters a-z, A-Z, 0-9 and _ |
| Items | ||
| SettlementDate | string | A date in the format 'yyyy-mm-dd hh:mm:ss' |
| Amount | decimal | The settlement amount with 3 decimal places precision |
| CurrencyCode | string | Three character ISO 4217 currency code (I.e. 'AUD' for Australian dollars) |
| NumberOfDebits | integer | The number of debits |
| SequenceNumber | string | The terminal's settlement sequence number (aka batch number) |
| LocationID | integer | The refuelling site's location Id |
| TerminalID | string | The terminal Id (8 characters max.) (Terminal serial number) |
The Error JSON property is included in all responses from the TWeb Public API. The possible responses during authorisation are:
| Error Code | Error Name | Notes |
| 0 | OK | |
| 1 | Server Error | Unhandled error occurs during processing |
| 4000 | Rate Limit Exceeded | This is the second request within a 1 second period. |
| 4911 | Location Id can't be blank | |
| 4912 | No refuelling site found for this location Id | |
| 4918 | Gateway request timeout | |
| 4920 | Terminal Id can't be blank | |
| 4928 | Invalid Currency Code | The currency code must be a valid ISO 4217 code |