Batches

Batches enable bulk loading of resource onto the Centrapay platform.

Attributes

  • id

    string

    The Batch’s unique identifier.

  • status

    string

    The current Lifecycle Stage of the batch.

  • type

    string

    Batch Type id used to describe the batch content.

  • totalCount

    bignumber

    The number of items processed.

  • errorCount

    bignumber

    Total Error counted.

  • errors

    array

    Error list for the batch.

  • test

    boolean

    true if the batch is for testing purposes only.

Batch Lifecycle

Different stages of a Batch’s lifecycle.

Batch Lifecycle

StatusDescription
createdThe batch has successfully been submitted.
copiedThe file has been transferred to Centrapay.
chunkedThe batch has been broken up for processing.
completeThe batch has been processed and may include errors.
errorThere is an error accessing or reading the file, preventing processing.

Batch Types

The following table describes the Batch Types supported for loading.

TypeDescription
farmlands-external-assetFarmlands External Asset Batch.
verifone-terminal-statusVerifone Terminal Status Batch.
ticketek-ticketTicketek Ticket Batch.

Error

FieldTypeDescription
messageStringA description of what caused the Error.
externalIdStringField used in debugging in reference to an id from the file.
indexBigNumberItem offset where the Error was identified in the file.

POST /api/batches

Initialize loading of entities from a batch file.

Attributes

  • type

    string required

    Batch Type used to describe the batch content.

  • url

    string required

    The url where the file is located.

  • accountId

    string required

    Centrapay Account Id that submitted the Batch.

  • test

    boolean

    true if the batch is for testing purposes only.

Errors

  • LIVENESS_MISMATCH

    403

    accountId test flag is not the same as submitted Batch’s test flag.

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": []
}

GET /api/batches/{batchId}

This endpoint allows you to retrieve a Batch by id.

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"
}
]
}