How can I place an order with COD using storefront Qraphql API?

How can I place an order with COD using storefront Qraphql API?

-Husain-
Visitor
1 0 1

I am trying to place order by COD method and use bellow mutation 

 

 

 

 

 

 

mutation {
  checkoutCompleteWithTokenizedPaymentV2(checkoutId: "checkout-id", payment: {
    paymentAmount: {
      amount: "5009.1",
      currencyCode: "INR"
    },
    idempotencyKey: "key",
    billingAddress: {
      address1: "123 Main St",
      city: "City",
      province: "Province",
      country: "Country",
      zip: "12345"
    },
    paymentData: {
      type: CASH_ON_DELIVERY
    }
  }) {
    checkout {
      id
      order {
        id
      }
    }
    checkoutUserErrors {
      code
      field
      message
    }
  }
}

 

 

 

 

 

 

Whe I check above mutation on post man it through bellow error, 

What is the correct mutation or query to places order with payment method COD by store front qraphql api. 

 

 

 

 

 

 

    "errors": [
        {
            "message": "Field 'checkoutCompleteWithTokenizedPaymentV2' doesn't exist on type 'Mutation'",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "mutation",
                "checkoutCompleteWithTokenizedPaymentV2"
            ],
            "extensions": {
                "code": "undefinedField",
                "typeName": "Mutation",
                "fieldName": "checkoutCompleteWithTokenizedPaymentV2"
            }
        }
    ]
}

 

 

 

 

 

 

Please Help

Reply 1 (1)

Kalen_Jordan
Shopify Partner
758 34 135

Which version of the API are you on? It looks like you may want to be using v3:

https://shopify.dev/docs/api/storefront/2023-07/mutations/checkoutcompletewithtokenizedpaymentv3