//native
type Mollie = {
token: string;
};
/**
* List payment routes
* Retrieve a list of all routes created for a specific payment.
> 🔑 Access with
>
> API key
*/
export async function main(auth: Mollie, paymentId: string) {
const url = new URL(`https://api.mollie.com/v2/payments/${paymentId}/routes`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 428 days ago