Skip to main content

Batch Process Transactions

Batch process transactions allow you to process multiple transactions at once. This is particularly useful when you need to handle a large volume of transactions.

How to Use

Creating a Batch

To create a new batch:

curl -X POST --location "https://sandbox-api.payfurl.com/batch/transaction/payment_method" \
-H "x-secretkey: <secret_key>" \
-H "Content-Type: application/json" \
-d '{
"Count": 2,
"Description": "Test",
"Batch": "PaymentMethodId,Amount,Currency,Reference
fc3fb5ff9e3b42c290c740c8772b40aa,123.3,AUD,reference
fc3fb5ff9e3b42c290c740c8772b40aa,13.3,AUD,reference2",
"Webhook": {
"Url": "https://webhook.site/1752c235-7693-466b-9710-f6ca4e0f8255",
"Authorization": "Basic dXNlcjpwYXNzd29yZA=="
}
}'

Get Status of Batch

The Status field can have one of the following values: RECEIVED, CREATED, IN_PROGRESS, SUCCESS, FAILED.

  • RECEIVED: The batch was received by the server.
  • CREATED: The batch transactions were prepared for processing.
  • IN_PROGRESS: The batch transactions are currently being processed.
  • SUCCESS: The batch transactions were processed successfully.
  • FAILED: The batch transactions processing failed. Contact support for more information.

The Progress field indicates the percentage of the batch processing. Its value ranges from 0 to 1.

To get the status of a batch:

curl -X GET --location "https://sandbox-api.payfurl.com/batch/{{batchId}}/status" \
-H "x-secretkey: <secret_key>" \
-H "Content-Type: application/json"

Get Batch Information

The received batch information includes Results field with information about batch transactions. Results is a csv-like string with the following format: PaymentMethodId,Amount,Currency,Reference,Status,TransactionId,FailureReason,GatewayErrorCode,GatewayErrorResponse,IsRetryable. The Status field can have one of the following values: RECEIVED, CREATED, IN_PROGRESS, SUCCESS, FAILED.

  • CREATED: The batch transactions were prepared for processing.
  • IN_PROGRESS: The batch transactions are currently being processed.
  • SUCCESS: The batch transactions were processed successfully. TransactionId field contains the transaction ID.
  • FAILED: The batch transactions processing failed. FailureReason field contains the reason for the failure. GatewayErrorCode,GatewayErrorResponse,IsRetryable fields contain information about the gateway error.

To get batch information:

curl -X GET --location "https://sandbox-api.payfurl.com/batch/{{batchId}}" \
-H "x-secretkey: <secret_key>" \
-H "Content-Type: application/json"

To explore more about batch processing, refer to the API documentation.