Discussing APIs and development related to customers, discounts, and order management.
How can I enable COD payment option on custom shipping method selected using draft order API and other API?
As long as you have COD enabled in the shop (under Settings > Payments) it will appear as an option at checkout when the customer is sent the invoice for the order. If you're not planning to send the invoice to the customer, you can complete the order and mark it as pending, in order to collect payment from the customer at a later time.
You can read more and see an example here:
https://shopify.dev/api/admin/rest/reference/orders/draftorder#complete-unstable
The following flows are supported:
- Create a draft order that calculates taxes and totals but accept payment from the customer outside of Shopify.
- Create a draft order and send an invoice to the customer.
To learn more visit the Shopify Help Center or the Community Blog.