How can I create a payment and resolve errors with checkout on an e-commerce platform?

Topic summary

A developer is encountering GraphQL mutation errors while attempting to complete a Shopify checkout using the checkoutCompleteWithCreditCardV2 mutation.

Primary Issues:

  • The mutation rejects the vaultId parameter at the field level
  • The CreditCardPaymentInputV2 input object doesn’t accept a creditCard argument
  • A required vaultId argument of type String! is missing from the CreditCardPaymentInputV2 object

Key Problems:

  • Incorrect mutation structure with misplaced or unsupported parameters
  • The developer is unsure how to properly create or obtain a vaultId
  • Multiple schema validation errors indicate the payment input object is malformed

Current Status:
The question remains unanswered with no solutions provided. The developer needs guidance on the correct mutation syntax and the process for generating/obtaining a valid vaultId for Shopify’s checkout API.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

mutation {
checkoutCompleteWithCreditCardV2(
checkoutId: “gid://shopify/Checkout/eb6d03825ad479d2d92bba993a2a7704?key=9282da4901528da4de3afd1ddcef6108”,
vaultId:“682281968a007d4af32cd648cee44sb9”,
payment: {
idempotencyKey: “682281968a007d4af32cd648cee44db9”,
paymentAmount: {
amount: 1539.60,
currencyCode: INR
},
billingAddress: {
lastName: “abc”,
address1: “Abc circle”,
city: “surat”,
province: “GJ”,
country: “IN”,
zip: “395006”
},
creditCard: {
number: “1”,
name: “shavitri dhameliya”,
verification_value: “111”,
year: 2024,
month: 5
}
}
) {
checkout {
id
order {
id
}
shippingAddress {
address1
city
country
firstName
lastName
phone
province
zip
}
lineItems(first: 5) {
edges {
node {
quantity
variant {
id
title
priceV2 {
amount
currencyCode
}
}
}
}
}
subtotalPriceV2 {
amount
currencyCode
}
totalTaxV2 {
amount
currencyCode
}
totalPriceV2 {
amount
currencyCode
}
}
userErrors {
field
message
}
payment {
creditCard {
brand
expiryMonth
expiryYear
firstName
lastName
}
transaction {
amount {
amount
currencyCode
}
test
statusV2
}
}
}
}

it gives me error and how to create vault id

{
“errors”: [
{
“message”: “Field ‘checkoutCompleteWithCreditCardV2’ doesn’t accept argument ‘vaultId’”,
“locations”: [
{
“line”: 7,
“column”: 5
}
],
“path”: [
“mutation”,
“checkoutCompleteWithCreditCardV2”,
“vaultId”
],
“extensions”: {
“code”: “argumentNotAccepted”,
“name”: “checkoutCompleteWithCreditCardV2”,
“typeName”: “Field”,
“argumentName”: “vaultId”
}
},
{
“message”: “Argument ‘vaultId’ on InputObject ‘CreditCardPaymentInputV2’ is required. Expected type String!”,
“locations”: [
{
“line”: 9,
“column”: 14
}
],
“path”: [
“mutation”,
“checkoutCompleteWithCreditCardV2”,
“payment”,
“vaultId”
],
“extensions”: {
“code”: “missingRequiredInputObjectAttribute”,
“argumentName”: “vaultId”,
“argumentType”: “String!”,
“inputObjectType”: “CreditCardPaymentInputV2”
}
},
{
“message”: “InputObject ‘CreditCardPaymentInputV2’ doesn’t accept argument ‘creditCard’”,
“locations”: [
{
“line”: 37,
“column”: 7
}
],
“path”: [
“mutation”,
“checkoutCompleteWithCreditCardV2”,
“payment”,
“creditCard”
],
“extensions”: {
“code”: “argumentNotAccepted”,
“name”: “CreditCardPaymentInputV2”,
“typeName”: “InputObject”,
“argumentName”: “creditCard”
}
}
]
}