Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I'm using the Storefront API to create a checkout URL and fetch available shipping rates. For most addresses, this is working properly, however for addresses in the United Arab Emirates, it throws an error.
For context, UAE addresses contain an address1 line, a province (emirate), and the country, nothing else. However, the checkoutCreate mutation throws an error that says I need to enter a city. If I remove the province/emirate and enter a city, it throws an error that says I need to enter an emirate. The only way to not receive an error is to enter both the city and emirate.
I know that this is specific to UAE addresses because I also ship to Gibraltar, and even though Gibraltar does not have a city or state, the checkoutCreate mutation succeeds.
This is the format of the mutation I'm sending:
mutation checkoutCreate($input: CheckoutCreateInput!) { checkoutCreate(input: $input) { checkout { id availableShippingRates { ready shippingRates { handle price { amount currencyCode } title } } webUrl } checkoutUserErrors { message code } } }
This is the format of the input I'm sending:
const variables: CheckoutCreateMutationVariables = { input: { allowPartialAddresses: false, // setting this to true also throws the same error email, lineItems: lineItems.map((product) => ({ quantity: product.quantity, variantId: product.variantId, })), shippingAddress, }, };
And here is an example input for a UAE address that throws the BLANK error:
address: { city: null, // replacing this with "Dubai" fixes the error province: "Dubai", // removing this (with or without a defined city) throws a BLANK error zip: null, address2: null, address1: "119 6D St", country: "AE" }