Invoke Reactors
Invoke Synchronous
Invoke a reactor by ID.
POST
https://api.basistheory.com/reactors/{id}/reactPermissions
reactor:invoke
For existing reactors and to maintain backward compatibility we are also supporting
token:use, however we recommend updating the permissions since that will be deprecated soon.Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/reactors/5b493235-6917-4307-906a-2cd6f1a90b13/react" \
-H "BT-API-KEY: <PRIVATE_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"args": {
"card": "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
"customer_id": "myCustomerId1234"
}
}'
await client.reactors.react(
reactorId,
{
args: {
card: "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
customer_id: "myCustomerId1234"
}
}
);
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<PRIVATE_API_KEY>");
const reactResponse = await bt.reactors.react(
"5b493235-6917-4307-906a-2cd6f1a90b13",
{
args: {
card: "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
customer_id: "myCustomerId1234",
},
}
);
await client.Reactors.ReactAsync(
reactorId,
new ReactRequest
{
Args = new
{
card = "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
customer_id = "myCustomerId1234"
}
}
);
new ReactorsClient(ClientOptions.builder().build()).react("id", ReactRequest.builder()
.args(new HashMap() {{
put("args", new HashMap() {{
put("card", "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}");
put("customer_id", "myCustomerId1234");
}});
}})
.build());
client.reactors.react(
id=reactor_id,
args={
"card": "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
"customer_id": "myCustomerId1234"
}
)
response, err := client.Reactors.React(ctx, reactorId, &basistheory.ReactRequest{
Args: map[string]interface{}{
"card": "{{fe7c0a36-eb45-4f68-b0a0-791de28b29e4}}",
"customer_id": "myCustomerId1234",
},
})
URI Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | true | uuid | null | The ID of the Reactor |
Request Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
args | false | object | null | Arguments to provide to the reactor. |
callback_url | false | string | null | Indicates that the reactor should be invoked asynchronously and the result delivered as a webhook to this URL. See Asynchronous Reactors for more info. Enterprise DEPRECATED |
Reactor Request Parameters
The reactor will be executed with a req object that contains the following properties
| Parameter | Description |
|---|---|
args | Detokenized arguments to provided to the reactor. |
configuration | A string key and string value map of all configuration name and values defined when creating the Reactor |
bt | A pre-configured Basis Theory JS instance for the application defined with the Reactor. This will be null if no application was defined. |
Response
Returns a Reactor Response if the Reactor completed successfully. Returns an error if the Reactor failed. Errors generated from Reactors will be translated to the common Basis Theory Error format. See Reactor Error Codes below for more details.
Reactor Response Object
| Attribute | Type | Description |
|---|---|---|
tokens | object | (Optional) Token(s) created from the tokenize block of the Reactor code response |
raw | object | (Optional) Raw output returned from the Reactor |