response = await fetch(
`https://${shop}/admin/api/2024-01/draft_orders/${draftOrderId}/send_invoice.json`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Shopify-Access-Token': accessToken,
},
body: JSON.stringify({
draft_order_invoice: {
to: toEmail,
subject: subject,
custom_message:
message,
},
}),
}
);
when I am accessing the invoice send on the email I am getting “This invoice is not available”
But If I try to resend the invoice from the Shopify admin it works and the main difference is
- from the api the invoice is something like : x/invoices/0f900ede263e993ef7fb5f7fc8a0d0db
- from shopify admin the invoice url is : x/invoices/2cb0258415e9e3bf895505f7694d20dd
same x but different value after invoices/
why? thank you!