Describe the bug
I have a checkout form, which allows the user to set a different shipping address, compared to his billing address. The object I am sending via fetch() to the server is:
const orderData = {
billing: {
address1: "109 Hills Road Valley",
address2: "Station Road",
city: "Example City",
company: "Other Company GmbH",
country: "DE",
email: "[email protected]",
firstName: "Firstname",
lastName: "Lastname",
phone: "089123456789",
postcode: "80808",
state: "Bavaria",
},
clientMutationId: "50e75f32-9f72-4e16-a5a4-41f4ff76ff2c",
isPaid: false,
paymentMethod: "paypal",
shipToDifferentAddress: true,
shipping: {
address1: "Beispielstrasse 14",
address2: "2. Aptartment",
city: "Berlin",
company: "D Company GmbH",
country: "DE",
email: "[email protected]",
firstName: "Peter",
lastName: "Pan",
phone: "089123456789",
postcode: "12342",
state: "Berlin",
},
transactionId: "b1605b91-1d3a-4008-aa7b-290a098631bd",
}
````
**Then I am sending the orderData via the checkout mutation to the WordPress server**
(async () => {
await fetch(SiteConfig.graphqlUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"woocommerce-session": Session ${ cart.wooSession }
},
body: JSON.stringify({
query: CHECKOUT_CART,
variables: {
input: {
...orderData,
},
},
}),
})
.then((res) => res.json())
.then((res) => {
setCart(() => {
return {
...finalStoreState,
order: res.data
};
});
})
.catch(function(error) {
setCart((prevState) => {
return {
...prevState,
error,
checkoutProcessing: false
};
});
});
})();
```
The order appears in WordPress, but without the additional shipping information. Also the transaction ID won't be saved:

To Reproduce
I am working with:
Expected behavior
@MobyDigg Can you update to WooGraphQL v0.7.0 and retry? I'm having trouble recreating your issue.
@kidunot89 I did update to WooGraphQL 0.7.0, used gatsby clean. Now the company shows in the billing address, but still nothing for the shipping data and the transaction ID.
@kidunot89 I found out when this happens and found another bug:

null. I think it should return an error instead. In the case of the image above: The customer selected U.S.A. as a shipping destination, but WooCommerce only handles all countries in Europe.It works as expected, when you add a shipping zone with all selectable countries from the checkout form AND a shipping method. For instance, if you have a customer with a shipping country in Europe, like:

Most helpful comment
@kidunot89 I found out when this happens and found another bug:
null. I think it should return an error instead. In the case of the image above: The customer selected U.S.A. as a shipping destination, but WooCommerce only handles all countries in Europe.It works as expected, when you add a shipping zone with all selectable countries from the checkout form AND a shipping method. For instance, if you have a customer with a shipping country in Europe, like: