Batches
Batches enable bulk loading of resource onto the Centrapay platform.
Batch Model
Attributes
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 | Farmlands External Asset Batch. |
| ticketek-ticket | Ticketek Ticket Batch. |
| business-onboard | Business Onboard 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. |
Create Batch
Initialize loading of entities from a batch file.
Attributes
-
type
string required -
url
string required -
accountId
string required -
test
boolean
Errors
-
LIVENESS_MISMATCH
403
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}'{ "id": "AVH5uG4gRLYK6YR8JyrViN", "accountId": "1mdj7bj95gjo92r0ux6wfy69gj3h77", "status": "created", "type": "farmlands-external-asset", "url": "https://azurebuckets.com/1234", "test": true, "count": "0", "errorCount": "0", "errors": []}Get Batch
This endpoint allows you to retrieve a Batch by id.
curl -X GET \ https://service.centrapay.com/api/batches/AVH5uG4gRLYK6YR8JyrViN \ -H 'x-api-key: <TOKEN>'{ "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" } ]}