Batches enable bulk loading of resource onto the Centrapay platform.
Batch Lifecycle
Different stages of a Batch’s lifecycle.
Status | Description |
---|---|
created | The batch has successfully been submitted. |
copied | The file has been transferred to Centrapay. |
chunked | The batch has been broken up for processing. |
complete | The batch has been processed and may include errors. |
error | There is an error accessing or reading the file, preventing processing. |
Batch Types
The following table describes the Batch Types supported for loading.
Type | Description |
---|---|
farmlands-external-asset API | Farmlands External Asset Batch. |
verifone-terminal-status API | Verifone Terminal Status Batch. |
ticketek-ticket API | Ticketek Ticket Batch. |
Error
Field | Type | Description |
---|---|---|
message | String | A description of what caused the Error. |
externalId | String | Field used in debugging in reference to an id from the file. |
index | BigNumber | Item offset where the Error was identified in the file. |
/api/batches
Initialize loading of entities from a batch file.
Attributes
-
type
-
url
-
accountId
-
test
Errors
-
LIVENESS_MISMATCH
Request
curl -X POST \
https://service.centrapay.com/api/batches \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"type": "farmlands-external-asset",
"url": "https://azurebuckets.com/1234",
"accountId": "C4QnjXvj8At6SMsEN4LRi9",
"test": true
}
'
Response
{
"id": "AVH5uG4gRLYK6YR8JyrViN",
"accountId": "1mdj7bj95gjo92r0ux6wfy69gj3h77",
"status": "created",
"type": "farmlands-external-asset",
"url": "https://azurebuckets.com/1234",
"test": true,
"count": "0",
"errorCount": "0",
"errors": []
}
Request
curl -X GET \
https://service.centrapay.com/api/batches/AVH5uG4gRLYK6YR8JyrViN \
-H 'x-api-key: <TOKEN>'
Response
{
"id": "AVH5uG4gRLYK6YR8JyrViN",
"accountId": "1mdj7bj95gjo92r0ux6wfy69gj3h77",
"status": "complete",
"type": "farmlands-external-asset",
"url": "https://azurebuckets.com/1234",
"test": true,
"count": "160000",
"errorCount": "1",
"errors": [
{
"externalId": "69d64d80-f9bd-4057-bc5b-1c55685d995b",
"index": "1954",
"message": "INVALID_BARCODE_LENGTH"
}
]
}