type Shopify = {
token: string;
store_name: string;
};
/**
* Creates an account activation URL for a customer
* Generate an account activation URL for a customer whose account is not yet enabled.
*/
export async function main(
auth: Shopify,
api_version: string = "2023-10",
customer_id: string,
body: { [k: string]: unknown }
) {
const url = new URL(
`https://${auth.store_name}.myshopify.com/admin/api/${api_version}/customers/${customer_id}/account_activation_url.json`
);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Shopify-Access-Token": auth.token,
},
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 40 days ago
type Shopify = {
token: string;
store_name: string;
};
/**
* Creates an account activation URL for a customer
* Generate an account activation URL for a customer whose account is not yet enabled.
*/
export async function main(
auth: Shopify,
api_version: string = "2023-10",
customer_id: string,
body: { [k: string]: unknown }
) {
const url = new URL(
`https://${auth.store_name}.myshopify.com/admin/api/${api_version}/customers/${customer_id}/account_activation_url.json`
);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Shopify-Access-Token": auth.token,
},
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 585 days ago