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

Topic summary

Issue: A developer cannot place a Cash on Delivery (COD) order via the Storefront GraphQL API using the mutation checkoutCompleteWithTokenizedPaymentV2. The GraphQL response returns an error: “Field ‘checkoutCompleteWithTokenizedPaymentV2’ doesn’t exist on type 'Mutation’,” indicating the field isn’t available in the used API schema.

Context: The attempted mutation includes paymentData with type: CASH_ON_DELIVERY and standard checkout/order fields. Testing was done in Postman.

Latest guidance: Another participant asks which API version is being used and points to the 2023-07 Storefront API docs for checkoutCompleteWithTokenizedPaymentV3, implying that V2 may be deprecated or unavailable in the current API version and that V3 should be used instead.

Actions/Next steps:

  • Verify the Storefront API version being called.
  • Switch to the checkoutCompleteWithTokenizedPaymentV3 mutation per the linked 2023-07 documentation.

Status: Unresolved in-thread; awaiting the original poster’s confirmation after trying the V3 mutation.

Summarized with AI on January 14. AI used: gpt-5.

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

1 Like

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