The capture and cancel API calls are only relevant to the Authorise and Capture flow.
Once you have determined that the customer order is ready to ship, you must [capture](🔗) the funds for the order. If there is an issue of any kind that prevents the order being fulfilled, the authorisation can instead be [cancelled](🔗).
This flow also supports partial capture if:
Only a part of the order can be fulfilled
There are multiple items for the order that will be shipped at different times
This API call will contain:
The amount to be captured
A flag to express if the capture is intended to be partial
This /capture API call should be made from your server and not directly from the client front end.
The charge <b>Id</b> returned in your original /purchaserequests API call will be passed in the capture API endpoint to identify the order being captured. For example:
Here is an example of how this information can be passed:
### Partial capture
When capturing an order it is possible to capture for individual items independently, or to capture less than the authorised amount if an item is unable to be fulfilled.
If, for example, this charge was for an order with 2 items, each to be shipped at different times, this would be passed as individual API calls as each item is shipped to the customer:
You may also have reason to capture less than the Authorised amount. This is generally relevant to 2 different scenarios:
When only some items on the order are unable to be fulfilled
When a quoted amount that was authorised comes in at a lesser amount
If an item is unable to be fulfilled for the customer, you must pass the "is_partial" flag as false when capturing the funds for the final item.
For example if Item 2 could not be delivered, the below would automatically cancel the remaining authorised funds and free them up on the customer account:
Item 1, when item 2 cannot be fulfilled:
The same is to be said for a quoted amount coming in at a lesser amount. For example, an order authorised for $150 that by the time of capture is actually only $120:
This will free up the remaining funds immediately to the customer account.
If an order can not be fulfilled in its entirety, a cancel API call should be made to free up the customer funds.
This API call will contain no request body.
This /cancel API call should be made from your server and not directly from the client front end.
The charge <b>Id</b> returned in your original /purchaserequests API call will be passed in the cancel API endpoint to identify the order being captured. For example: