I am using magento graphQL api to build mobile app of magento site. In checkout process we have to set billing address. So I used one of mutation setBillingAddressOnCart to set billing address on checkout. And I want to use billing address same as shipping so I passed same_as_shipping: true
in billing_address
. But when it's run, I am getting error :
Error: GraphQL error: The billing address must contain either "customer_address_id" or "address".
Here is mutation I used to set billing address :
mutation setBillingAddressSameAsShipping($cartId: String!) {
setBillingAddressOnCart(input: { cart_id: $cartId, billing_address: { same_as_shipping: true } }) {
cart {
id
email
shipping_addresses {
selected_shipping_method {
method_code
method_title
}
}
}
}
}
Please anyone can tell me why I am getting this error ? Why I have to pass customer_address_id
even if I want to use billing address same as shipping ? And if I customer_address_id
is really required than what for guest user ?