Orders
resend_order_email
destructive writeResend order email
Send the production hand-off for an existing order to its manufacturer again.
Overview
Queues the order email for one order again, marked as a resend. It goes to the recipient each customiser on the order is configured for: the customiser order email, its assigned manufacturer, or the Store email. The caller cannot choose or change the recipient. The email reaches a party outside Sign Customiser and cannot be recalled, so the call needs confirm: true and an idempotency_key that makes an exact repeat replay the original response without a second email. Each connection can queue two resends a minute. It requires the orders:write scope.
Permission
Requires theorders:writepermission. A connection without it answersinsufficient_scopenaming the permission to approve.
Annotations
Prerequisites
- An order id from list_orders or get_order.
- A merchant has connected this store and approved the orders:write scope.
Side effects
- Queues the order email again, marked as a resend, for the recipient each customiser on the order is configured for.
- The email reaches a party outside Sign Customiser and cannot be recalled.
- Changes no order.
- Uses one of the two resends this connection may queue in a minute. A replay uses none.
- Claims the idempotency_key for at least 24 hours.
Arguments
The order id, from list_orders.
Must be true to apply the change, because the order email reaches its manufacturer again, and an email that has been sent cannot be recalled. Without it the call returns a confirmation_required error and changes nothing.
A client-generated key unique to this logical write, such as a UUID. Required: repeating the call with the same key and the same arguments replays the original result instead of writing twice, and the same key with different arguments is an idempotency_key_conflict.
Result
The order id and the queued status. The response does not name the recipient, and queued does not mean delivered.
Always queued: the email is sent by a background job.
One of: queued
True when this call replayed a previously recorded response for the same idempotency_key instead of applying the write again.
Error cases
Send confirm: true. The email cannot be recalled.
The connection was approved without orders:write.
This connection has queued two resends in the last minute. Wait retry_after seconds.
No order with that id belongs to this store. Call list_orders to find a valid id.
Resend an order to its manufacturer
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "resend_order_email",
"arguments": {
"order_id": 8801,
"confirm": true,
"idempotency_key": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
"store": {
"id": 12,
"name": "Demo Signs"
},
"order_id": 8801,
"status": "queued",
"idempotent_replay": false
}
}
}Without confirmation no email is queued (error)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "resend_order_email",
"arguments": {
"order_id": 8801,
"confirm": false,
"idempotency_key": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"isError": true,
"structuredContent": {
"error": {
"code": "confirmation_required",
"title": "Confirmation required",
"detail": "Resending order 8801 emails its manufacturer again, and an email that has been sent cannot be recalled.",
"recovery": "This operation changes something consequential. Send confirm: true once the merchant has agreed to it.",
"parameter": "confirm",
"allowed_values": [
"true"
]
}
}
}
}