So I am using the magento graphql api to go through the cart workflow. I am using the braintree payment method. Everything goes smoothly until I use the placeOrder mutation. It returns the error saying
Unable to place order: A server error stopped your order from being placed. Please try to place your order again
According to these docs https://devdocs.magento.com/guides/v2.3/graphql/mutations/place-order.html that means
The shopper tried to place an order when no products are in the shopping cart.
However I know this is false because I fetch and log the cart details before the placeOrder mutation. The cart details are below.
{
"id": "9CDxLEFLMBDdbdqdDKk6oVPoeE32ZNVi",
"email": "[email protected]",
"items": [
{
"product": {
"uid": "MzYw",
"sku": "mask-child-1",
"name": "Kids' Face Mask",
"price_range": {
"minimum_price": {
"regular_price": {
"value": 18.5,
"currency": "CAD"
}
}
},
"id": 360,
"__typename": "SimpleProduct"
},
"quantity": 1,
"id": "69",
"__typename": "SimpleCartItem"
},
{
"product": {
"uid": "MzYx",
"sku": "mask-adult-1",
"name": "Adult Face Mask",
"price_range": {
"minimum_price": {
"regular_price": {
"value": 18.5,
"currency": "CAD"
}
}
},
"id": 361,
"__typename": "SimpleProduct"
},
"quantity": 1,
"id": "70",
"__typename": "SimpleCartItem"
}
],
"shipping_addresses": [
{
"firstname": "Antonio",
"lastname": "Bennett",
"company": "Redacted",
"street": [
"Redacted"
],
"city": "Redacted",
"region": {
"code": "ON",
"label": "Ontario"
},
"postcode": "Redacted",
"telephone": "Redacted",
"country": {
"code": "CA",
"label": "CA"
},
"available_shipping_methods": [
{
"carrier_code": "cadstd",
"carrier_title": "Free Standard Canada, This shipping method is not trackable",
"method_code": "cadstd",
"method_title": "Canada Post (3-9 business days). Please allow an additional 1-2 weeks for production."
},
{
"carrier_code": "cadexp",
"carrier_title": "Express Canada, Tracked",
"method_code": "cadexp",
"method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production."
},
{
"carrier_code": "cadpri",
"carrier_title": "Priority Canada, Tracked",
"method_code": "cadpri",
"method_title": "FedEx (1-2 business days). Please allow an additional 1-2 business days for production."
}
],
"selected_shipping_method": {
"carrier_code": "cadexp",
"method_code": "cadexp",
"carrier_title": "Express Canada, Tracked",
"method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production."
}
}
],
"billing_address": {
"firstname": "Antonio",
"lastname": "Bennett",
"company": "Redacted",
"street": [
"Redacted"
],
"city": "Redacted",
"region": {
"code": "ON",
"label": "Ontario"
},
"postcode": "Redacted",
"telephone": "Redacted",
"country": {
"code": "CA",
"label": "CA"
}
},
"selected_payment_method": {
"code": "braintree"
}
}
The kicker as well is that although the placeOrder mutation returns that error, I am able to see the order in the admin with a status of payment processed. Any Ideas??