//native
type Pinterest = {
token: string;
};
/**
* Get commerce integration
* Get commerce integration metadata associated with the given external business ID.
Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.
*/
export async function main(auth: Pinterest, external_business_id: string) {
const url = new URL(
`https://api.pinterest.com/v5/integrations/commerce/${external_business_id}`,
);
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.json();
}
Submitted by hugo697 537 days ago