max_attempts_reached — chunk retry attempts used up
What happened
The bulk retry went through, but without this chunk. The chunk came back in skipped[] of the 202 response to POST /orders/{order}/items/retry-failed with reason: "max_attempts_reached" and a reason_label text.
Why
The limit is 5 attempts per chunk, and it is used up. There will be no sixth retry, bulk or single: POST /orders/{order}/items/{item}/retry on such a chunk returns 422 with the same reason.
What to do right now
Build your logic on reason, not on reason_label. reason_label is text in the account language or the X-Locale language, and it can change. The can_retry flag in OrderItem looks only at the chunk status, not at the number of attempts. So can_retry: true is possible with all attempts used up. This chunk cannot be retried any more. What remains is a separate order for its text. Other codes in the same skipped[]. superseded means the chunk already has a successful version and nothing needs to be done. active_retry_exists means a retry is already running, so wait for it. policy_flagged means corrected text is needed. insufficient_funds means no held amount is left (price_units − consumed_units).
Which request to send next
GET /orders/{order}/items/{item}/text, then POST /orders with that text as a new order. The new order is paid: the amount held for the original order does not carry over to it.
Where to go next
This page for AI
API version 1.0.0