Transactions

Bulk void inflight

Void multiple independently-created inflight transactions with the Go SDK.

POST/transactions/inflight/bulk/void

Use client.Transaction.BulkVoidInflight to void multiple inflight transactions.

Call the method

result, _, _ := client.Transaction.BulkVoidInflight(
 blnkgo.BulkVoidInflightRequest{
	TransactionIDs: []string{
	 "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
	 "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d",
	},
 },
)

Pass SkipQueue: true to process each void synchronously instead of queuing.

result, _, _ := client.Transaction.BulkVoidInflight(
 blnkgo.BulkVoidInflightRequest{
	SkipQueue: true,
	TransactionIDs: []string{
	 "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
	 "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d",
	},
 },
)

Preview every void without releasing any hold. Use BulkVoidInflightDryRun. See Dry-run transactions.

preview, _, _ := client.Transaction.BulkVoidInflightDryRun(
	blnkgo.BulkVoidInflightRequest{
		TransactionIDs: []string{
			"txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
			"txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d",
		},
	},
)
FieldTypeDescription
TransactionIDs[]stringUp to 100 inflight transaction IDs to void.
SkipQueueboolWhen true, process synchronously instead of queuing.

Review per-item results

On a posted batch, check result.Results for each transaction’s outcome.

A dry run has no succeeded or failed counts. Check WouldApply and Results.

Response

{
  "succeeded": 2,
  "failed": 1,
  "results": [
    {
      "transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
      "status": "succeeded"
    },
    {
      "transaction_id": "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d",
      "status": "succeeded"
    },
    {
      "transaction_id": "txn_0b59f6e6-6c4a-4efa-915c-526f77ef61ab",
      "status": "failed",
      "code": "ALREADY_COMMITTED",
      "message": "cannot void. Transaction already committed"
    }
  ]
}

Go response (*blnkgo.BulkVoidInflightResponse)

FieldTypeDescription
SucceededintNumber voided successfully.
FailedintNumber that failed.
Results[]blnkgo.
BulkVoidInflightResult
Per-transaction outcome in request order.
Results.
[].TransactionID
stringTransaction ID from the request.
Results.
[].Status
stringsucceeded, failed, or queued (when SkipQueue is false).
Results.
[].Code
stringFailure code (for example NOT_FOUND, ALREADY_COMMITTED, NOT_INFLIGHT).
Results.
[].Message
stringHuman-readable failure message.
{
  "dry_run": true,
  "would_apply": true,
  "cumulative": false,
  "atomic": false,
  "results": [
    {
      "dry_run": true,
      "would_apply": true,
      "operation": "void",
      "status": "VOID",
      "reference": "ref_hold_001",
      "currency": "USD",
      "amount": 120,
      "precise_amount": "12000",
      "precision": 100
    }
  ]
}