draft Order Complete
Requires access scope. Also: The user must have access to mark as paid, or set payment terms.
Completes a draft order and converts it into a regular order. The order appears in the merchant's orders list, and the customer can be notified about their order.
Use the mutation when a merchant is ready to finalize a draft order and create a real
order in their store. The
mutation also supports sales channel attribution for tracking
order sources using the
argument, cart validation
controls for app integrations, and detailed error reporting for failed completions.
You can complete a draft order with different payment scenarios:
- Mark the order as paid immediately.
- Set the order as payment pending using payment terms.
- Specify a custom payment amount.
- Select a specific payment gateway.
When completing a draft order, inventory is reserved for the items in the order. This means the items will no longer be available for other customers to purchase. Make sure to verify inventory availability before completing the draft order.
Arguments
- •ID!required
The draft order to complete.
- Anchor to paymentGatewayIdpayment•ID
Gateway Id The gateway for the completed draft order.
- Anchor to sourceNamesource•String
Name A channel definition handle used for sales channel attribution.
- Anchor to paymentPendingpayment•BooleanDeprecatedDefault:false
Pending
- Anchor to draftOrderdraft•Draft
Order Order The completed draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.