Deletes a fulfillment event
1
type Shopify = {
2
token: string;
3
store_name: string;
4
};
5
/**
6
* Deletes a fulfillment event
7
8
*/
9
export async function main(
10
auth: Shopify,
11
api_version: string = "2023-10",
12
order_id: string,
13
fulfillment_id: string,
14
event_id: string
15
) {
16
const url = new URL(
17
`https://${auth.store_name}.myshopify.com/admin/api/${api_version}/orders/${order_id}/fulfillments/${fulfillment_id}/events/${event_id}.json`
18
);
19
20
const response = await fetch(url, {
21
method: "DELETE",
22
headers: {
23
"X-Shopify-Access-Token": auth.token,
24
},
25
body: undefined,
26
});
27
if (!response.ok) {
28
const text = await response.text();
29
throw new Error(`${response.status} ${text}`);
30
}
31
return await response.json();
32
33