Skip to main content

Endpoint

POST /reconciliation/upload
Uploads external transaction data (e.g., from bank statements or payment providers) for reconciliation against your Blnk transactions. The file is processed and stored with a unique upload ID that can be used to start a reconciliation process.

Request

This endpoint accepts multipart/form-data.
file
file
required
The file containing external transaction data. Supported formats:
  • CSV: With headers for transaction fields
  • JSON: Array of transaction objects
The file should include transaction details such as ID, amount, date, reference, and description
source
string
required
The source identifier for the external data (e.g., “stripe”, “bank_statement”, “paypal”)

Response

upload_id
string
Unique identifier for this upload. Use this ID to start a reconciliation process
record_count
integer
The total number of transaction records found in the uploaded file
source
string
The source identifier provided in the request

Example Request

curl -X POST "https://api.blnk.io/reconciliation/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@transactions.csv" \
  -F "source=stripe"

CSV File Format Example

id,amount,reference,currency,description,date,source
txn_ext_001,100.50,REF123,USD,Payment from customer,2024-03-04T10:00:00Z,stripe
txn_ext_002,250.00,REF124,USD,Subscription payment,2024-03-04T11:30:00Z,stripe
txn_ext_003,75.25,REF125,USD,One-time purchase,2024-03-04T14:15:00Z,stripe

JSON File Format Example

[
  {
    "id": "txn_ext_001",
    "amount": 100.50,
    "reference": "REF123",
    "currency": "USD",
    "description": "Payment from customer",
    "date": "2024-03-04T10:00:00Z",
    "source": "stripe"
  },
  {
    "id": "txn_ext_002",
    "amount": 250.00,
    "reference": "REF124",
    "currency": "USD",
    "description": "Subscription payment",
    "date": "2024-03-04T11:30:00Z",
    "source": "stripe"
  }
]

Example Response

{
  "upload_id": "upl_abc123def456",
  "record_count": 3,
  "source": "stripe"
}

Error Responses

error
string
Error message describing what went wrong

Common Errors

  • 400 Bad Request: File upload failed or invalid file format
  • 500 Internal Server Error: Failed to process the upload

Next Steps

After uploading external data:
  1. Create matching rules using the Create Matching Rule endpoint
  2. Start the reconciliation process using the Start Reconciliation endpoint with the upload_id from this response

Build docs developers (and LLMs) love