Skip to main content
PUT
/
transactions
/
inflight
/
:txID
curl -X PUT https://api.blnkfinance.com/transactions/inflight/txn_inflight_xyz789 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "status": "commit"
  }'
{
  "transaction_id": "txn_commit_abc123",
  "parent_transaction": "txn_inflight_xyz789",
  "source": "bln_card123",
  "destination": "bln_merchant456",
  "reference": "auth-67890",
  "amount": 50.00,
  "precise_amount": "5000",
  "precision": 100,
  "currency": "USD",
  "description": "Card authorization",
  "status": "APPLIED",
  "hash": "committed_hash_123",
  "created_at": "2024-01-15T10:45:00Z",
  "meta_data": {
    "inflight": true,
    "committed_at": "2024-01-15T10:45:00Z"
  }
}
Commit or void an inflight transaction. Inflight transactions reserve funds without finalizing the transfer, allowing you to either commit (finalize) or void (cancel) them later.

Path Parameters

txID
string
required
The transaction ID of the inflight transaction to update.

Request Body

status
string
required
Action to perform on the inflight transaction:
  • commit - Finalize the transaction and transfer funds
  • void - Cancel the transaction and release reserved funds
amount
number
Amount to commit in major currency units. If not provided or set to 0, commits the full inflight amount.Note: Can only be used with status: "commit". Amount must not exceed the original inflight amount.
precise_amount
string
Amount to commit in minor units as a big integer string. Takes precedence over amount if both are provided.Use for high-precision amounts or to avoid floating-point errors.

Response

Returns the updated transaction object.
transaction_id
string
ID of the committed/voided transaction (child transaction created from the inflight transaction).
parent_transaction
string
ID of the original inflight transaction.
status
string
New transaction status:
  • APPLIED - For committed transactions
  • VOID - For voided transactions
amount
number
Final transaction amount.
precise_amount
string
Final transaction amount in minor units.
See Get Transaction for complete field documentation.
{
  "transaction_id": "txn_commit_abc123",
  "parent_transaction": "txn_inflight_xyz789",
  "source": "bln_card123",
  "destination": "bln_merchant456",
  "reference": "auth-67890",
  "amount": 50.00,
  "precise_amount": "5000",
  "precision": 100,
  "currency": "USD",
  "description": "Card authorization",
  "status": "APPLIED",
  "hash": "committed_hash_123",
  "created_at": "2024-01-15T10:45:00Z",
  "meta_data": {
    "inflight": true,
    "committed_at": "2024-01-15T10:45:00Z"
  }
}
curl -X PUT https://api.blnkfinance.com/transactions/inflight/txn_inflight_xyz789 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "status": "commit"
  }'

Inflight Transaction Workflow

1. Create Inflight Transaction

POST /transactions
{
  "amount": 50.00,
  "reference": "auth-67890",
  "currency": "USD",
  "description": "Card authorization",
  "source": "bln_card123",
  "destination": "bln_merchant456",
  "inflight": true,
  "inflight_expiry_date": "2024-01-20T10:30:00+00:00"
}
Balance Changes:
  • Source: inflight_debit_balance += 50.00
  • Destination: inflight_credit_balance += 50.00
  • No change to actual debit_balance or credit_balance

2a. Commit Transaction (Full)

PUT /transactions/inflight/txn_inflight_xyz789
{
  "status": "commit"
}
Balance Changes:
  • Source: inflight_debit_balance -= 50.00, debit_balance += 50.00
  • Destination: inflight_credit_balance -= 50.00, credit_balance += 50.00

2b. Commit Transaction (Partial)

PUT /transactions/inflight/txn_inflight_xyz789
{
  "status": "commit",
  "amount": 35.00
}
Balance Changes:
  • Source: inflight_debit_balance -= 35.00, debit_balance += 35.00
  • Destination: inflight_credit_balance -= 35.00, credit_balance += 35.00
  • Remaining 15.00 stays in inflight balances

2c. Void Transaction

PUT /transactions/inflight/txn_inflight_xyz789
{
  "status": "void"
}
Balance Changes:
  • Source: inflight_debit_balance -= 50.00
  • Destination: inflight_credit_balance -= 50.00
  • Funds released back to available balance

Partial Commits

You can commit less than the full inflight amount:
// Original inflight: $50.00
await commitInflight('txn_inflight_xyz789', {
  status: 'commit',
  amount: 35.00  // Only commit $35.00
});

// Remaining $15.00 stays inflight
// Can be committed or voided later
await commitInflight('txn_inflight_xyz789', {
  status: 'commit',
  amount: 10.00  // Commit another $10.00
});

// Final $5.00 can be voided
await commitInflight('txn_inflight_xyz789', {
  status: 'void'  // Void remaining $5.00
});
Important: When partially committing, track the remaining amount to avoid over-committing.

Error Responses

error
string
Error message describing what went wrong.

Common Errors

400 Bad Request - Missing ID
{
  "error": "id is required. pass id in the route /:id"
}
400 Bad Request - Invalid Status
{
  "error": "status not supported. use either commit or void"
}
400 Bad Request - Not Inflight
{
  "error": "transaction is not in inflight status"
}
400 Bad Request - No Transaction to Commit
{
  "error": "no transaction to commit"
}
This occurs when the inflight transaction doesn’t exist or has already been fully committed. 400 Bad Request - Amount Exceeds Inflight
{
  "error": "requested amount 75.00 exceeds remaining inflight amount 50.00"
}
400 Bad Request - Already Committed
{
  "error": "cannot commit. Transaction already committed"
}

Use Cases

Card Authorization and Capture

// 1. Create authorization (inflight)
const auth = await createTransaction({
  amount: 100.00,
  reference: `auth-${orderId}`,
  source: 'customer_card',
  destination: 'merchant_account',
  inflight: true,
  inflight_expiry_date: '2024-01-20T00:00:00Z'
});

// 2. Capture full amount when order ships
const capture = await updateInflight(auth.transaction_id, {
  status: 'commit'
});

// OR capture partial amount if order partially ships
const partialCapture = await updateInflight(auth.transaction_id, {
  status: 'commit',
  amount: 75.00  // Customer only ordered $75 worth
});

// 3. Void remaining authorization
await updateInflight(auth.transaction_id, {
  status: 'void'
});

Hotel Reservation with Incidentals

# Create hold for room + estimated incidentals
hold = create_transaction({
    'amount': 500.00,  # $400 room + $100 incidentals
    'reference': f'hotel-{reservation_id}',
    'source': 'guest_card',
    'destination': 'hotel_account',
    'inflight': True,
    'inflight_expiry_date': checkout_date
})

# At checkout, charge actual amount
actual_charges = room_rate + actual_incidentals  # e.g., $450

final_charge = update_inflight(hold['transaction_id'], {
    'status': 'commit',
    'amount': actual_charges
})

# Release remaining hold
if actual_charges < 500:
    release_hold(hold['transaction_id'], {
        'status': 'void'
    })

Pre-Authorization with Tip Adjustment

// Restaurant pre-auth for meal
const preauth = await createTransaction({
  amount: 50.00,
  reference: `restaurant-${tableId}`,
  source: 'customer_card',
  destination: 'restaurant_account',
  inflight: true
});

// Customer adds 20% tip at payment
const totalWithTip = 50.00 * 1.20;  // $60.00

// Commit with tip
const final = await updateInflight(preauth.transaction_id, {
  status: 'commit',
  amount: totalWithTip
});

Refundable Deposit

# Create deposit hold
deposit = create_transaction({
    'amount': 200.00,
    'reference': f'deposit-{rental_id}',
    'source': 'customer_account',
    'destination': 'deposit_holding',
    'inflight': True,
    'inflight_expiry_date': return_date
})

# Property returned undamaged - release deposit
release = update_inflight(deposit['transaction_id'], {
    'status': 'void'
})

# OR property damaged - commit deposit
if damages:
    charge = update_inflight(deposit['transaction_id'], {
        'status': 'commit',
        'amount': damage_amount  # e.g., $150
    })
    
    # Refund difference if damage < deposit
    if damage_amount < 200:
        refund_difference = 200 - damage_amount
        # Release remaining hold
        update_inflight(deposit['transaction_id'], {
            'status': 'void'
        })

Gas Station Authorization

// Pre-authorize $100 for gas purchase
const preauth = await createTransaction({
  amount: 100.00,
  reference: `gas-${pumpId}-${timestamp}`,
  source: 'customer_card',
  destination: 'gas_station',
  inflight: true
});

// Customer pumps $45 worth of gas
const actualPurchase = 45.00;

// Commit actual amount
const charge = await updateInflight(preauth.transaction_id, {
  status: 'commit',
  amount: actualPurchase
});

// Void remaining authorization ($55)
await updateInflight(preauth.transaction_id, {
  status: 'void'
});

Inflight Expiry

Inflight transactions can have an expiry date. After expiry:
  1. The transaction remains in INFLIGHT status
  2. You can still commit or void manually
  3. Consider implementing automatic expiry handling:
// Check and auto-void expired inflight transactions
async function autoVoidExpiredInflights() {
  const now = new Date();
  
  // Get all inflight transactions
  const inflights = await fetch(
    '/transactions?status_eq=INFLIGHT'
  ).then(r => r.json());
  
  for (const txn of inflights) {
    if (!txn.inflight_expiry_date) continue;
    
    const expiry = new Date(txn.inflight_expiry_date);
    
    if (now > expiry) {
      console.log(`Auto-voiding expired transaction ${txn.transaction_id}`);
      
      await updateInflight(txn.transaction_id, {
        status: 'void',
        meta_data: {
          void_reason: 'auto_expired',
          voided_at: now.toISOString()
        }
      });
    }
  }
}

// Run every hour
setInterval(autoVoidExpiredInflights, 60 * 60 * 1000);

Best Practices

  1. Set appropriate expiry dates - Match your business workflow (e.g., 7 days for hotel holds, 24 hours for restaurant tips)
  2. Handle partial commits carefully - Track how much has been committed to avoid over-committing
  3. Always void unused holds - Release customer funds promptly when authorization is no longer needed
  4. Store inflight transaction IDs - Keep reference to inflight transaction IDs for later commit/void operations
  5. Implement expiry monitoring - Monitor and handle expired inflight transactions
  6. Use precise_amount for accuracy - When committing specific amounts, use precise_amount to avoid rounding errors
  7. Add metadata for tracking - Include void reasons and timestamps in metadata for audit trails

Build docs developers (and LLMs) love