422 returned during partial capture for transaction in 2023-04 REST Order API

Topic summary

A developer is encountering a 422 error when attempting multiple partial captures on a Shopify order using the 2023-04 REST API.

Workflow:

  • Order created with successful authorization transaction via POST to /orders.json
  • First partial capture (amount less than authorized total) succeeds with 201 response
  • Second partial capture attempt fails with 422 error: “Can only capture successful authorizations”

Key Issue:
The developer suspects the first partial capture may be inadvertently closing out the original authorization transaction, despite capturing less than the full authorized amount.

Question Raised:
Should partial capture transactions be handled differently to allow multiple captures against a single authorization?

Status: The issue remains unresolved with no responses yet. The developer is seeking guidance on proper implementation of sequential partial captures in the 2023-04 API version.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Good Morning!

Hoping someone can shed some light on an issue we’re facing. We are attempting to make partial captures on an order with a successful authorization, the first transaction/partial capture is successful, but subsequent ones fail.

Here are some details;

  1. We first create the order through POST api/2023-04/orders.json with a single transaction that is authorized

  2. A call to GET api/2023-04/transactions.json confirms there is a single, successful authorized transaction for this order.

GET /admin/api/2023-04/orders/6015472500898/transactions.json
status: 200
body: {"transactions":[{"id":6966709223586,"order_id":6015472500898,"kind":"authorization","gateway":"PaypalCommercePlatform","status":"success","message":null,"created_at":"2023-12-19T17:59:27-06:00","test":false,"authorization":"","location_id":null,"user_id":null,"parent_id":null,"processed_at":"2023-12-19T17:59:27-06:00","device_id":null,"error_code":null,"source_name":"5021135","amount":"90.05","currency":"USD","payment_id":"#1152.1","total_unsettled_set":{"presentment_money":{"amount":"90.05","currency":"USD"},"shop_money":{"amount":"90.05","currency":"USD"}},"admin_graphql_api_id":"gid:\/\/shopify\/OrderTransaction\/6966709223586"}]}

2.1. We call POST api/2023-04/transactions.json to create the first partial capture transaction. It has amount less than the first transaction, its kind is capture, and the parent_id is the id of the authorization transaction. This request returns a 201.

POST /admin/api/2023-04/orders/6015472500898/transactions.json
body: {"transaction":{"order_id":"6015472500898","amount":68.19,"kind":"capture","currency":"USD","parent_id":"6966709223586"}}

status: 201
body: {"transaction":{"id":6966716629154,"order_id":6015472500898,"kind":"capture","gateway":"PaypalCommercePlatform","status":"success","message":"Marked the PaypalCommercePlatform payment as received","created_at":"2023-12-19T18:03:05-06:00","test":true,"authorization":null,"location_id":null,"user_id":null,"parent_id":6966709223586,"processed_at":"2023-12-19T18:03:05-06:00","device_id":null,"error_code":null,"source_name":"5021135","receipt":{},"amount":"68.19","currency":"USD","payment_id":"#1152.2","total_unsettled_set":{"presentment_money":{"amount":"0.0","currency":"USD"},"shop_money":{"amount":"0.0","currency":"USD"}},"admin_graphql_api_id":"gid:\/\/shopify\/OrderTransaction\/6966716629154"}}

2.2. Later, we POST api/2023-04/transactions.json again to do a second partial capture transaction for a different line item. The amount is the balance of the order, kind is capture, and the parent_id is the id of the first authorization created at order creation time. This request returns a 422.

POST https://bold-eric-dufault.myshopify.com/admin/api/2023-04/orders/6015472500898/transactions.json
body: {"transaction":{"order_id":"6015472500898","amount":21.86,"kind":"capture","currency":"USD","parent_id":"6966709223586"}}

status: 422
body: {"errors":{"base":["Can only capture successful authorizations"]}}

Should we be handling partial capture transactions differently? I can only guess that the first partial capture is closing out the original authorization transaction despite its amount being less than the full amount.

Thank you in advance!