Graphql API orderCreate toUpsert a customer don't work

Topic summary

Issue Identified:
A developer encountered an error when attempting to use the OrderCreateCustomerInput with the toUpsert field in Shopify’s GraphQL orderCreate mutation. The error indicated that the customer field was not defined on OrderCreateOrderInput.

Error Message:
Variable $order of type OrderCreateOrderInput! was provided invalid value for customer (Field is not defined on OrderCreateOrderInput)

Resolution:
The issue was resolved by updating to the latest Shopify API version. The toUpsert functionality for customer creation during order creation appears to be available only in newer API versions.

Status: Resolved - no further action needed.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi,

I would like to use the OrderCreateCustomerInput when using the mutation orderCreate of the graphQL api.
For example, when using the example shown in the documentation:

const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {
      orderCreate(order: $order, options: $options) {
        userErrors {
          field
          message
        }
        order {
          id
          displayFinancialStatus
          customer {
            email
            firstName
            lastName
          }
        }
      }
    }`,
    "variables": {
      "order": {
        "lineItems": [
          {
            "variantId": "gid://shopify/ProductVariant/43729076",
            "quantity": 1
          }
        ],
        "customer": {
          "toUpsert": {
            "email": "foo.bar@shopify.com",
            "firstName": "Foo",
            "lastName": "Bar"
          }
        },
        "financialStatus": "PAID"
      }
    },
  },
});

an error is thrown:

Error: Variable $order of type OrderCreateOrderInput! was provided invalid value for customer (Field is not defined on OrderCreateOrderInput)

Can you provide more details about how to use this fields?

Best,

Solved.
I wasn’t using the last API version