Skip to main content
POST
Create Batch Transactions

Overview

Creates multiple transactions in a single batch operation. This endpoint is optimized for high-throughput scenarios. Limits:
  • Single batch: Up to 100,000 transactions per request; request body must not exceed 50 MB.
  • Multiple files in one call: Use POST /transactions/batch/background-multi with a sources array (up to 5 files, 100,000 transactions each); body limit 150 MB.
  • File upload (multipart): Use POST /transactions/batch/upload to send CSV, Excel, or JSON files directly; max 5 files per request. The per-file transaction limit depends on your plan.
Execution behavior (sync endpoint):
  • The API keeps the connection open for up to 30 seconds.
  • If the batch finishes within 30 seconds, the API returns 200 with the full summary (created, skipped, rules executed, processing time, etc.).
  • If processing exceeds 30 seconds, the API returns 202 with a jobId and continues processing in the background. When finished, the client is notified in the dashboard (and via real-time socket if connected). The response message indicates that the process may take longer and that they will be notified when it is done.
Background endpoints (always asynchronous):
  • POST /transactions/batch/background β€” Single batch; returns 202 immediately and notifies via socket when done.
  • POST /transactions/batch/background-multi β€” Multiple files in one request (max 5); returns 202 and one socket notification when all files are processed.
  • POST /transactions/batch/upload β€” Multipart form-data: send one or more files (CSV, Excel, JSON) in the file field; server parses and runs the same batch flow. Ideal when the client has files instead of a JSON body.
Ideal for:
  • Importing historical transactions
  • Processing large transaction files (CSV, Excel, JSON)
  • High-volume payment processors
  • Data migration scenarios

Endpoints

File Upload (Multipart)

Use POST /transactions/batch/upload when you have CSV, Excel, or JSON files and want the server to parse them. You must send the request as multipart/form-data (FormData), not JSON.
  • Max 5 files per request.
  • Accepted formats: CSV (.csv), Excel (.xlsx, .xls), JSON (.json).
  • Per-file transaction limit depends on your organization plan (see Limits by plan).
  • Query parameter: validateGap (default false). If you set validateGap=true and send multiple files, the API checks that there is no time gap of 30 minutes or more between the end of one file and the start of the next (by transactedAt). If there is, it returns 400 with code: "GAP_VALIDATION_REQUIRED" and a list of all gaps. By default the check is off; use ?validateGap=true to enable it.

Form Fields

Example: Upload with FormData (JavaScript)

Example: Upload with cURL

Limits by Plan

The maximum number of transactions per file (for both the upload endpoint and background-multi) depends on your organization’s plan: If batch upload is disabled for your organization, the upload and background endpoints return 403. Contact support to enable it or change plan.

Templates

To build CSV, Excel, or JSON files that match the expected schema:
  1. Dashboard: In Transaction Monitoring, open the Batch upload modal. Use the Download CSV, Download Excel, or Download JSON buttons to get templates with the correct headers and a sample row. This is the easiest way to get started.
  2. Required fields per row: Each transaction must include at least externalId, type, amount, and currency. Optional but recommended: transactedAt, status, originName, destinationName, description. For the full schema see Create Transaction.
  3. CSV/Excel: Column names can be camelCase (externalId, transactedAt) or snake_case (external_id, transacted_at); the server normalizes them. Date format: ISO 8601 (e.g. 2025-01-15T10:30:00.000Z).
There is no public URL to download templates outside the dashboard; use the batch upload modal to get the latest templates.

Authentication

Requires a valid API key in the Authorization header:

Request Body (Sync and Background)

array
required
Array of transaction objects to create (minimum 1, maximum 100,000 per request).Each transaction object has the same structure as the Create Transaction endpoint. Request body must not exceed 50 MB.Optional exchangeRate per row: used only when automatic conversion fails; see Currency conversion.
boolean
default:"true"
Whether to execute rules engine for all transactions in the batch
boolean
default:"true"
Skip transactions with duplicate externalId instead of failing the entire batch
Optional override. true: hard-fail if entity refs missing. false: soft-link (create unlinked if missing). When omitted, behavior follows validateExistingEntity.Also accepted as query ?linkEntityStrict=true|false.
boolean
default:"true"
Batch default true (unchanged for clients that omit the field): unresolved refs β†’ 400 INVALID_ENTITY_REFERENCES.With false: Gu1 still auto-links when found and continues without a link if not. Prefer setting linkEntityStrict=false when you want soft-link explicitly.
If a match in step 2 or 3 succeeds, the service sets *EntityId and, when not provided, may fill *Name and *Country from the entity, like single create. When a side is linked (including rows where you already sent *EntityId), originTaxId / originExternalId and destinationTaxId / destinationExternalId are always synced from the matched entity before insert β€” same canonical denormalization as Create Transaction β€” origin entity fields. Each created row also receives the server-owned linkedEntityGu1 field inside both originDetails and destinationDetails. Its value is linked, unresolved, or not_requested. Any value supplied in the uploaded file is ignored and overwritten by Gu1.

Request Body (Background-Multi Only)

array
required
Array of objects: { "fileName": "optional string", "transactions": [ ... ] }. Minimum 1, maximum 5 sources. Each transactions array: max 100,000 items (or your plan limit per file). Total request body must not exceed 150 MB.
boolean
default:"true"
Whether to execute rules for all transactions in every source
boolean
default:"true"
Skip transactions with duplicate externalId
Same override as above (omit β†’ validateExistingEntity).
boolean
default:"true"
Same as the sync/background field above (batch default true).

Response (200 When Completed Within 30s)

boolean
Indicates if the batch operation completed successfully
number
Number of transactions successfully created
number
Number of transactions skipped (duplicates or validation errors)
number
Number of transactions that failed to create
array
Array of created transaction objects
array
Array of error objects for failed transactions, including:
  • index - Index of the failed transaction in the input array
  • externalId - External ID of the failed transaction
  • error - Error message
  • code - Error code
string
Total processing time (e.g. β€œ3.45s”)
object
When rules are executed: total, created, skipped, failed, autoLinked, validationEnabled

Response (202 When Processing Exceeds 30s or Background)

When the batch is processed in the background (either because it exceeded 30 seconds on the sync endpoint or because you called the background endpoint), the API returns:
string
Unique job identifier; use it to correlate with the real-time notification when the job completes
string
"processing"
string
Human-readable message indicating that the process is running in the background and the client will be notified in the dashboard when it finishes
number
(Only for background-multi.) Number of files being processed
When the job completes, a real-time event is emitted (e.g. transaction:batch-completed or transaction:batch-failed) so the dashboard can show a toast and refresh the transaction list.

Examples

Batch Import with 100 Transactions

Large Import with Chunking (100,000 per batch)

Batch with Device and Location Details

Response Example

Error Handling

Partial Success

The batch endpoint uses a partial success model:
  • Successfully created transactions are committed
  • Failed transactions are skipped
  • The response includes both successes and errors

400 Bad Request - Batch Too Large

413 Payload Too Large

Request body exceeds 50 MB (single batch) or 150 MB (multi-file). Split into smaller batches or use multiple requests.

400 Bad Request - Empty Batch

Performance Considerations

Throughput and Limits

  • Maximum batch size: 100,000 transactions per request (single batch); body max 50 MB
  • Multi-file: Up to 5 files, 100,000 transactions each (or plan limit per file); body max 150 MB
  • Sync endpoint: Waits up to 30 seconds; if the batch completes in time, returns 200 with full result; otherwise returns 202 and continues in background with dashboard/socket notification when done
  • Typical processing time: Depends on volume and rules; for large batches, expect 202 and wait for the completion notification

Optimization Tips

  1. Disable rules for bulk imports: Set executeRules: false for faster processing
  2. Skip entity validation: Set validateExistingEntity: false for bulk import without entity matching
  3. Use chunking: For over 100k transactions, send multiple batches (e.g. 100k per request) or use background-multi with up to 5 files
  4. Handle 202: If you receive 202, keep the connection or poll; the dashboard will show a notification when the job completes (and socket event if connected)
  5. Handle duplicates: Always set skipDuplicates: true to avoid failures on duplicate externalId

Example: Optimized Bulk Import

Use Cases

Historical Data Migration

Import past transactions from legacy system:

Daily Transaction Import

Schedule daily batch imports:

Best Practices

  1. Respect limits: Max 100,000 transactions per request and 50 MB body (150 MB for multi-file)
  2. Always enable skipDuplicates: Prevents batch failures from duplicates
  3. Disable rules for historical imports: Set executeRules: false to save time
  4. Handle 200 vs 202: On sync endpoint, 200 = result in body; 202 = job in background, wait for dashboard/socket notification
  5. Validate data before sending: Ensure required fields (externalId, type, amount, currency) per Create Transaction
  6. Use background-multi or upload for files: Up to 5 files in one request; use POST /transactions/batch/upload with FormData to send CSV/Excel/JSON directly

Next Steps