Retrieve Enabled Payment Providers By API

Retrieve Enabled Payment Providers By API

7 0 1



i'm in need of an api or workaround to fetch the payment provider id for a store


i'm developing an app that basically bulk import a list of order, and i need the payment provider gateway id in order to complete the order, for now my usecase is only for COD / manual payments


i'm using the  draftOrderComplete graphql endpoint

how are we supposed to fetch the paymentGatewayId for that endpoint? it is supposed to be like:

Thank you in advance
Replies 4 (4)

Shopify Staff
2873 312 821

Hi FabioP,


As of now, Shopify does not provide an API endpoint that directly exposes the payment provider's gateway ID. The paymentGatewayId you mentioned (gid://shopify/PaymentGateway/11xxxxxx) is a global ID that is generated by Shopify and isn't available through any public API endpoints.


However, you can use a workaround to accomplish your goal. When you create a new order through the GraphQL API, you don't need to specify a paymentGatewayId for Cash on Delivery (COD) or manual payments. Instead, you can set the financialStatus field to paid or pending depending on whether you want to mark the order as paid or unpaid.


After creating the draft order, you can complete it without specifying paymentGatewayId:

mutation {
  draftOrderComplete(id: "gid://shopify/DraftOrder/1", paymentPending: false) {
    draftOrder {
    userErrors {

In this example, replace "gid://shopify/ProductVariant/1" and "gid://shopify/DraftOrder/" with the actual IDs of your product variant and draft order. Set paymentPending to true if you want to mark the order as unpaid (COD), or false if you want to mark it as paid.


Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog

7 0 1

Hello Liam, thank you for your response


i tried as you said, this is the result of the order created:



whereas this is an order created specified the COD payment gateway:




so they look equivalent except one is marked as "manual" and the other as "COD", i am afraid that down the line this little but subtle difference could cause trouble to the merchant, could you confirm me that both orders are legit, from a logistic/merchant/client perspective, in other words no loss of money from any side can occur from this difference (manual vs COD gateway), as i said i'm afraid of the implications of being unable to set it explictly as COD


Thank you very much

7 0 1

i consulted about this with the merchant shipping manager, and she said that order created with the manual gateway are not handled correctly as COD orders by their software (

is there really any other way to access the cod gateway ID? i can see there is an internal graphql api already (used by the UI), this feature would be critical for my application

Thanks in advance

Shopify Partner
1 0 1

Hey, did you ever figure this out? I'm running into a similar issue.