Products
retry_product_tube_centre_line
writeRetry product tube centre line
Recover a neon order line item whose tube centre-line DXF was refused with timeout or trace_failed, as get_order reports it.
Overview
Starts the tube centre-line trace of a neon product again, as Try again does on the product in the merchant admin, so its tube centre-line DXF can still arrive on the order line item. Only a trace that ended with timeout or trace_failed, of an order whose cart is stored, starts again; retried is then true and the status is pending. A trace that is pending already is left as it stands, with retried false. Any other product is refused because nothing can run again. Each connection can make six retry attempts a minute, refused ones included; a replay does not count. It requires the products:write scope and an idempotency_key.
Permission
Requires theproducts:writepermission. A connection without it answersinsufficient_scopenaming the permission to approve.
Annotations
Prerequisites
- The product id: the order line item id from get_order, or an id from list_integration_products.
- A merchant has connected this store and approved the products:write scope.
Side effects
- Sets the tube centre-line trace of the product back to pending and queues it to run again from the stored order cart. A trace that is pending already is not changed.
- Uses one of the six retry attempts this connection may make in a minute, even when the attempt is refused. A replay uses none.
- Claims the idempotency_key for at least 24 hours.
Arguments
The product id: the order line item id from get_order, or an id from list_integration_products.
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
Whether the trace started again, and the tube centre-line state as it now stands: its status, the refusal reason and whether another retry could start it.
True when the trace started again; false when a trace was pending already and was left as it stands.
none (no trace was requested), pending, ready (the file is present) or refused (read refusal_reason). Expected to grow.
One of: none, pending, ready, refused
Why the file was not made; null unless status is refused. Only timeout and trace_failed can change on another run. Expected to grow.
One of: ai_design, icon, no_physical_size, no_tubes, timeout, trace_failed, unsupported_characters
Whether another retry would start the trace again.
True when this call replayed a previously recorded response for the same idempotency_key instead of applying the write again.
Error cases
That key was used for another call. Re-send the original arguments or issue a new key.
The connection was approved without products:write.
This connection has made six retry attempts in the last minute. Wait retry_after seconds.
No product with that id belongs to this store. Call list_integration_products to find a valid id.
The trace cannot run again: the refusal reason is final, the order cart is not stored, the file exists or no trace was requested.
Start a failed trace again
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "retry_product_tube_centre_line",
"arguments": {
"product_id": 731,
"idempotency_key": "3f4b8e21-6a0c-4d1e-9b77-2c5d8a9e0f13"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
"store": {
"id": 12,
"name": "Demo Signs"
},
"product_id": 731,
"retried": true,
"tube_centre_line": {
"status": "pending",
"refusal_reason": null,
"can_retry": false
},
"idempotent_replay": false
}
}
}A trace with a final reason (error)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "retry_product_tube_centre_line",
"arguments": {
"product_id": 732,
"idempotency_key": "4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"isError": true,
"structuredContent": {
"error": {
"code": "tube_centre_line_not_retryable",
"title": "Tube centre line not retryable",
"detail": "This product has no tube centre-line trace that can run again.",
"recovery": "The tube centre-line trace cannot run again: its reason is final, the order cart is not stored, the file exists or no trace was requested. Read tube_centre_line_status and refusal_reason on the order line item; only timeout and trace_failed can be tried again."
}
}
}
}