Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to identify COD orders?(Orders API)

Solved

How to identify COD orders?(Orders API)

sanjeev_kmr
Tourist
7 0 1

I want to figure out whether a particular order is of COD type. As of now I am checking whether the gateway field in the order data contains the value "Cash on Delivery (COD)". But for some stores, the value changes.(like cash_on_delivery). Any  suggestions on how to do this?

Accepted Solution (1)

Busfox
Shopify Staff (Retired)
628 49 110

This is an accepted solution.

Hi @sanjeev_kmr,

 

Those are two different payment gateways. The "Cash on Deliver (COD)" gateway is the default cash on delivery option that exists in all shops. The "cash_on_delivery" gateway is from "Advanced Cash on Delivery" app, available to Indian merchants. Check it out here: https://help.shopify.com/en/manual/apps/apps-by-shopify/advanced-cash-on-delivery/.

 

Depending on what you're looking at, you may need to watch out for both.

 

Cheers,

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 3 (3)

Busfox
Shopify Staff (Retired)
628 49 110

This is an accepted solution.

Hi @sanjeev_kmr,

 

Those are two different payment gateways. The "Cash on Deliver (COD)" gateway is the default cash on delivery option that exists in all shops. The "cash_on_delivery" gateway is from "Advanced Cash on Delivery" app, available to Indian merchants. Check it out here: https://help.shopify.com/en/manual/apps/apps-by-shopify/advanced-cash-on-delivery/.

 

Depending on what you're looking at, you may need to watch out for both.

 

Cheers,

To learn more visit the Shopify Help Center or the Community Blog.

zac_husky
Shopify Partner
16 2 1

@sanjeev_kmr You can simply check if order financial_status has paid or pending. If it is pending, it's a COD order. You don't need to check gateway field as they may differ.

 

Check this: https://shopify.dev/api/admin-rest/2021-10/resources/order#resource_object

Zac Husky
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
MathewsJoseph
Shopify Partner
7 0 4

In the case of B2B orders where we would have net 30 terms etc, the financial_status will still be in pending state. So, relying on that may not be an ideal solution.