Request Correlation
Basis Theory utilizes Correlation IDs to assist with request tracing, logging, and debugging.
All API endpoints accept a client-provided Correlation ID if sent with the BT-TRACE-ID
HTTP header within POST, PUT, PATCH, DELETE methods.
If a BT-TRACE-ID
Correlation ID is not provided by the client, a new Correlation ID will be generated by the Basis Theory API.
Example
- cURL
- JavaScript
- C#
- Python
- Go
curl "https://api.basistheory.com" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-H "BT-TRACE-ID: aa5d3379-6385-4ef4-9fdb-ca1341572153"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("key_N88mVGsp3sCXkykyN2EFED");
const applications = await bt.applications.list(
{},
{
correlationId: "aa5d3379-6385-4ef4-9fdb-ca1341572153",
}
);
using BasisTheory.net.Tokens;
var client = new TokenClient("key_N88mVGsp3sCXkykyN2EFED");
client.GetAsync(requestOptions: new RequestOptions {
CorrelationId = "aa5d3379-6385-4ef4-9fdb-ca1341572153"
});
import basistheory
from basistheory.api import tokens_api
# At instance
api_client = basistheory.ApiClient(configuration=basistheory.Configuration(api_key="key_N88mVGsp3sCXkykyN2EFED"))
client = tokens_api.TokensApi(api_client)
# Per call
client.list(request_options=basistheory.RequestOptions(correlation_id="aa5d3379-6385-4ef4-9fdb-ca1341572153"))