Transactions
Bulk void inflight
Void multiple independently-created inflight transactions with the Go SDK.
POST
/
transactions
/
inflight
/
bulk
/
void
Bulk void inflight
curl --request POST \
--url http://localhost:5001/transactions/inflight/bulk/void \
--header 'X-blnk-key: <api-key>'import requests
url = "http://localhost:5001/transactions/inflight/bulk/void"
headers = {"X-blnk-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-blnk-key': '<api-key>'}};
fetch('http://localhost:5001/transactions/inflight/bulk/void', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "5001",
CURLOPT_URL => "http://localhost:5001/transactions/inflight/bulk/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-blnk-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:5001/transactions/inflight/bulk/void"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-blnk-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:5001/transactions/inflight/bulk/void")
.header("X-blnk-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5001/transactions/inflight/bulk/void")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-blnk-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyUse
Go response (
client.Transaction.BulkVoidInflight to void multiple inflight transactions.
1
Call the method
- Queued void
- Synchronous void
client.Transaction.BulkVoidInflight
result, resp, err := 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.client.Transaction.BulkVoidInflight
result, resp, err := client.Transaction.BulkVoidInflight(
blnkgo.BulkVoidInflightRequest{
SkipQueue: true,
TransactionIDs: []string{
"txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
"txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d",
},
},
)
| Field | Type | Description |
|---|---|---|
TransactionIDs | []string | Up to 100 inflight transaction IDs to void. |
SkipQueue | bool | When true, process synchronously instead of queuing. |
2
Response
200 OK
{
"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)
| Field | Type | Description |
|---|---|---|
Succeeded | int | Number voided successfully. |
Failed | int | Number that failed. |
Results | []blnkgo.BulkVoidInflightResult | Per-transaction outcome in request order. |
Results.[].TransactionID | string | Transaction ID from the request. |
Results.[].Status | string | succeeded, failed, or queued (when SkipQueue is false). |
Results.[].Code | string | Failure code (for example NOT_FOUND, ALREADY_COMMITTED, NOT_INFLIGHT). |
Results.[].Message | string | Human-readable failure message. |
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.Was this page helpful?
⌘I