Scenario: Company Location with Net Payment Terms we plan to invoice later via NetSuite ERP. Shopify allows customer to checkout on the Net Payment Terms with a saved/vaulted credit card.
Expected behaviour should be we charge the card automatically when invoice is due.
We need a mechanism for differentiating Net Term orders that the customer chose the Vaulted Card vs the choose payment method later option, so we can monitor and charge the card (and tell NetSuite its a Credit Card Payment Method order).
We cannot find a way via graphql to identify the difference between these two scenarios, however in admin, you can see the order has the credit card linked in small font. See comparison screen shots.
I’d try querying order.paymentCollectionDetails.vaultedPaymentMethods (needs read_orders). If a card is attached to the order it should show up there, and it should be empty for the choose-later case. Worth testing on both of your sample orders to confirm.
1. Query order-linked vaulted payment methods
query NetTermsPaymentMethod($id: ID!) {
order(id: $id) {
id
paymentCollectionDetails {
vaultedPaymentMethods {
id
paymentInstrument {
__typename
}
}
}
}
}
This will give you some inputs to proceed to next steps.
Thanks for your guidance - but the issue still remains!
I tested this on a brand new company location (Net 7 terms, no saved cards) to see whether vaultedPaymentMethods reflects the buyer’s choice:
- Order 1: “Choose payment method later”, no saved card on the location. The list is empty.
- Order 2: entered a card and ticked save. The list shows the Visa 1111.
- Order 3: “Choose payment method later” again, now that the location has a saved card. The list still shows the Visa 1111, each order with its own mandate ID.
So the field reflects the location’s saved cards, not the card the buyer selected for that order. It tells us a charge is possible, but not that the buyer elected to pay by card, so we can’t use it to decide which orders to charge.
The admin does show the selected card under the balance on the order that chose it, so Shopify knows. Is there a field, or a relationship on the payment terms, payment schedule or mandate, that exposes the card the buyer chose at checkout? Failing that, is selectedPaymentOptions in checkout UI extensions the supported way to capture it?
Also, for anyone finding this later: reading the field needs read_payment_mandate, not just read_orders.
Hey @Tim_Reid, thanks for sharing this. I have been testing this scenario as well and I also can’t find the field that shows the customers selection.
When I compare orders in the admin, the orders where I select the payment method do show the card whereas the ones where I opt to select that later do not show any card.
I’m going to dig in to this to see if I can find an alternative field that will return this in the API and will follow up here with what I find.
Hey @Tim_Reid, I’ve looked into this further and I can confirm that we don’t currently have a field within the admin API that will return the information we need. I am going to pass this on as a feature request on your behalf. I can see how useful it would be.