0

Reactor Formulas Create

by
Published Oct 17, 2025

Reactor Formulas Create

Script basis_theory Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Basistheory = {
3
  apiKey: string;
4
};
5
/**
6
 * Reactor Formulas Create
7
 * Reactor Formulas Create
8
 */
9
export async function main(
10
  auth: Basistheory,
11
  body: {
12
    code?: string;
13
    configuration?: { description?: string; name?: string; type?: string }[];
14
    description?: string;
15
    icon?: string;
16
    id?: string;
17
    name?: string;
18
    request_parameters?: {
19
      description?: string;
20
      name?: string;
21
      optional?: string;
22
      type?: string;
23
    }[];
24
    type?: string;
25
  },
26
) {
27
  const url = new URL(`https://api.basistheory.com/reactor-formulas`);
28

29
  const response = await fetch(url, {
30
    method: "POST",
31
    headers: {
32
      "Content-Type": "application/json",
33
      "BT-API-KEY": auth.apiKey,
34
    },
35
    body: JSON.stringify(body),
36
  });
37
  if (!response.ok) {
38
    const text = await response.text();
39
    throw new Error(`${response.status} ${text}`);
40
  }
41
  return await response.json();
42
}
43