Create Batch Transactions
API Reference
Create Batch Transactions
Create multiple transactions in a single API call for high-throughput scenarios β in the gu1 transaction monitoring API for fraud and AML.
POST
Create Batch Transactions
Documentation Index
Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
Use this file to discover all available pages before exploring further.
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-multiwith asourcesarray (up to 5 files, 100,000 transactions each); body limit 150 MB. - File upload (multipart): Use
POST /transactions/batch/uploadto send CSV, Excel, or JSON files directly; max 5 files per request. The per-file transaction limit depends on your plan.
- 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
jobIdand 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.
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 thefilefield; server parses and runs the same batch flow. Ideal when the client has files instead of a JSON body.
- Importing historical transactions
- Processing large transaction files (CSV, Excel, JSON)
- High-volume payment processors
- Data migration scenarios
Endpoints
File upload (multipart)
UsePOST /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(defaultfalse). If you setvalidateGap=trueand 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 (bytransactedAt). If there is, it returns 400 withcode: "GAP_VALIDATION_REQUIRED"and a list of all gaps. By default the check is off; use?validateGap=trueto enable it.
Form fields
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | One or more files (CSV, Excel, JSON). Send multiple files by repeating the file field. |
executeRules | string | No | "true" (default) or "false" |
skipDuplicates | string | No | "true" (default) or "false" |
validateExistingEntity | string | No | "true" (default) or "false" |
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:| Plan | Max transactions per file |
|---|---|
| Freemium | 4,000 |
| Startup | 12,000 |
| Growth | 30,000 |
| Enterprise | 100,000 |
| Usage Based (pay-as-you-go) | 100,000 |
Templates
To build CSV, Excel, or JSON files that match the expected schema:- 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.
- Required fields per row: Each transaction must include at least
externalId,type,amount, andcurrency. Optional but recommended:transactedAt,status,originName,destinationName,description. For the full schema see Create Transaction. - 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).
Authentication
Requires a valid API key in the Authorization header:Request Body (sync and background)
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.
Whether to execute rules engine for all transactions in the batch
Skip transactions with duplicate
externalId instead of failing the entire batchWith
true (batch default): for each row, each side (origin/destination) is validated only when you send at least one identifier for that side (*EntityId, *ExternalId, or root *TaxId). Every field you send must resolve to an existing person/company; otherwise 400 INVALID_ENTITY_REFERENCES and no rows are created (per batchErrorHandling). Auto-link order remains: entityId β externalId β taxId.With false: permissive behavior like Create Transaction (default false there).*EntityId and, when not provided, may fill *Name and *Country from the entity, like single create.
Request Body (background-multi only)
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.Whether to execute rules for all transactions in every source
Skip transactions with duplicate
externalIdSame as the sync/background field above (default true for batch; set false for permissive bulk import).
Response (200 when completed within 30s)
Indicates if the batch operation completed successfully
Number of transactions successfully created
Number of transactions skipped (duplicates or validation errors)
Number of transactions that failed to create
Array of created transaction objects
Array of error objects for failed transactions, including:
index- Index of the failed transaction in the input arrayexternalId- External ID of the failed transactionerror- Error messagecode- Error code
Total processing time (e.g. β3.45sβ)
When rules are executed:
total, created, skipped, failed, autoLinked, validationEnabledResponse (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:Unique job identifier; use it to correlate with the real-time notification when the job completes
"processing"Human-readable message indicating that the process is running in the background and the client will be notified in the dashboard when it finishes
(Only for background-multi.) Number of files being processed
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
- Disable rules for bulk imports: Set
executeRules: falsefor faster processing - Skip entity validation: Set
validateExistingEntity: falsefor bulk import without entity matching - Use chunking: For over 100k transactions, send multiple batches (e.g. 100k per request) or use background-multi with up to 5 files
- 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)
- Handle duplicates: Always set
skipDuplicates: trueto avoid failures on duplicateexternalId
Example: Optimized Bulk Import
Use Cases
Historical Data Migration
Import past transactions from legacy system:Daily Transaction Import
Schedule daily batch imports:Best Practices
- Respect limits: Max 100,000 transactions per request and 50 MB body (150 MB for multi-file)
- Always enable skipDuplicates: Prevents batch failures from duplicates
- Disable rules for historical imports: Set
executeRules: falseto save time - Handle 200 vs 202: On sync endpoint, 200 = result in body; 202 = job in background, wait for dashboard/socket notification
- Validate data before sending: Ensure required fields (externalId, type, amount, currency) per Create Transaction
- Use background-multi or upload for files: Up to 5 files in one request; use
POST /transactions/batch/uploadwith FormData to send CSV/Excel/JSON directly
Next Steps
- Create Single Transaction - Create individual transactions
- Change transaction status - Change status
- Transaction Monitoring - Learn about fraud detection