Shopify Order Capture XML (GraphQL)
The XML format documented here is used to capture authorized payments on existing orders in Shopify, via the Capture Order Payments task.
We recommend that the ZynkExternalId field be populated with the unique ID of the capture from the external system. Zynk uses this field to track captures already processed, to prevent the same payment being captured more than once. The 'Prevent Reprocessing' setting is enabled by default on this task.
XML
Any fields not documented below are ignored by the task. Examples of where in the XML the fields should appear are shown in the samples below.
<?xml version="1.0" encoding="utf-8"?>
<OrderCaptures>
<OrderCapture>
<ZynkExternalId>54321</ZynkExternalId>
<Amount>600</Amount>
<Currency>GBP</Currency>
<FinalCapture>true</FinalCapture>
<Order>
<Id>gid://shopify/Order/6026572595289</Id>
<Name>#1117</Name>
</Order>
<ParentTransaction>
<Id>gid://shopify/OrderTransaction/7700884750425</Id>
<PaymentId>rC4rbK8RZazMHH2tg2Lt5hAse</PaymentId>
</ParentTransaction>
</OrderCapture>
</OrderCaptures>
In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the OrderCaptures schema is used above as a reference of where fields should be in the object model.
Order Capture
The following information can be provided at the capture level.
| Shopify Field | XML Field | Type | Input | Notes |
|---|---|---|---|---|
| - | ZynkExternalId | string | Optional | Stored in Zynk's internal DB and used in conjunction with the 'Prevent Reprocessing' setting |
| amount | Amount | decimal | Required | The amount to capture |
| currency | Currency | string | Optional | Three letter ISO currency code, e.g. GBP. Must be the order's presentment currency. Shopify requires this when the order's presentment currency differs from the shop currency |
| finalCapture | FinalCapture | bool | Optional | Whether this is the final capture for the authorization. Only applies to multi-capturable Shopify Payments authorizations |
| id | Order/Id | string | Dependant | Required if Order/Name is not provided. Accepts a GraphQL ID (gid://shopify/Order/123) or the numeric order ID |
| id | Order/Name | string | Dependant | Required if Order/Id is not provided, e.g. #1001. Only used to look up the order when Order/Id is empty |
<?xml version="1.0" encoding="utf-8"?>
<OrderCaptures>
<OrderCapture>
<ZynkExternalId>54321</ZynkExternalId>
<Amount>600</Amount>
<Currency>GBP</Currency>
<FinalCapture>true</FinalCapture>
<Order>
<Id>6026572595289</Id>
</Order>
</OrderCapture>
</OrderCaptures>
Parent Transaction
The authorization transaction to capture. It is matched against the capturable transactions on the order using Id, then PaymentId.
If the ParentTransaction element is omitted, the order must have exactly one capturable transaction, which will be captured. The record fails if the order has no capturable transactions, or more than one. If the ParentTransaction element is provided, it must contain an Id or PaymentId.
| Shopify Field | XML Field | Type | Input | Notes |
|---|---|---|---|---|
| parentTransactionId | Id | string | Dependant | Required if PaymentId is not provided and the element is present. Must be the full GraphQL ID, e.g. gid://shopify/OrderTransaction/123 |
| OrderTransaction.paymentId | PaymentId | string | Dependant | Required if Id is not provided and the element is present. The payment ID of the transaction, as shown in the order's transactions |