0

Reactor Formulas Update

by
Published Oct 17, 2025

Reactor Formulas Update

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 Update
7
 * Reactor Formulas Update
8
 */
9
export async function main(
10
  auth: Basistheory,
11
  id: string,
12
  body: {
13
    code?: string;
14
    configuration?: { description?: string; name?: string; type?: string }[];
15
    description?: string;
16
    icon?: 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/${id}`);
28

29
  const response = await fetch(url, {
30
    method: "PUT",
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