When a B2B order is “submitted as draft for review” the customer selects a payment method for the order at checkout. This payment method is noted in the admin attached to the draft order as “Selected at checkout”.
When using draftOrderComplete mutation to process the draft order into an order, it does NOT maintain the selected payment method. A fair assumption would be that the draft order would abide by the company/location payment terms AND the store payment capture settings when processing the draft order to an order.
For example, if the payment terms for the company/location are “none” and the store payment capture settings are “Automatically at checkout” we would expect the order to use the method selected at checkout and immediate authenticate and capture when the draft becomes an order.
Since we don’t know the selected method at checkout we can’t attach it to net terms, due on fulfillment, or due at checkout orders. It’s a complete miss on API functionality for B2B merchants.
Since paymentPending is deprecated, Shopify recommends using payment terms. But, payment terms “none” also isn’t really a viable option.
Our next assumption is that we would need to use the paymentGatewayId to specify the payment gateway to process the payment auth and capture, but it’s still unclear if this will maintain the selected method at checkout.
Problems:
- paymentGatewayId is an argument for draftOrderComplete (public API), but paymentGatewayId seems to be complete unavailable. This makes the argument on draftOrderComplete useless.
- If we could convert the draft order to an order using the deprecated paymentPending: true, we could at least use a vaulted card to authorize and capture payment… But, there are a handful of API limitation that make this not possible. Any of the follow could potentially make this possible:
- paymentPending is deprecated and potentially unreliable
- draftOrder doesn’t surface select payment method at check (even though it’s visibile in the admin)
- vaulted cards on company/location aren’t available unless the location has an order
- Not available on the location like it is on the customer for DTC
- Not available on the draft order
- Not possible to capture the last 4 digits of the selected card during checkout, post checkout, via Flow, or via API after the draft order is created. This would be useful to match the vaulted method to the chosen method at checkout since Shopify doesn’t specify which card was selected.
- Shopify exposes each customer’s vaulted payment methods, and each
CustomerPaymentMethodhas amandatesconnection. Those mandate records include both aresourceTypeandresourceId. One valid resource type is specifically DRAFT_ORDER. BUT, this doesn’t work on company/locations nor does it specifically say which draft order the payment mandate is connected to.