//native
type Basistheory = {
apiKey: string;
};
/**
* Reactor Formulas Create
* Reactor Formulas Create
*/
export async function main(
auth: Basistheory,
body: {
code?: string;
configuration?: { description?: string; name?: string; type?: string }[];
description?: string;
icon?: string;
id?: string;
name?: string;
request_parameters?: {
description?: string;
name?: string;
optional?: string;
type?: string;
}[];
type?: string;
},
) {
const url = new URL(`https://api.basistheory.com/reactor-formulas`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"BT-API-KEY": auth.apiKey,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago