How to use the default address when post checkout data via glue
Hey spryker,
Your example "Request sample: submit checkout data with a split shipment and addresses passed as IDs". Does not work.
The Response ist always:
{
"errors": [
{
"code": "901",
"status": 422,
"detail": "shipments.0.items => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.salutation => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.firstName => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.lastName => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.address1 => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.address2 => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.zipCode => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.city => This field is missing."
},
{
"code": "901",
"status": 422,
"detail": "billingAddress.iso2Code => This field is missing."
}
]
}
Answers
-
Hi @Robson ! For such question it would really help if you provide more information, like the payload you are sending to the api which shop setup you're testing this against (custom local, based on template, online demo shop?) etc.
Did you try with the public b2b demo shop?0 -
Hi @victor.vanherpt ,
I'm using my local development which based on the spryker b2b shop.
I've tried to checkout with the given spryker example.See here:
Request sample: submit checkout data with the logged-in customer's cart data.But its leading to the error message that I've already posted.
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,052 ⚖️ - Guardians (admin)
Heyhey @Robson ,
Request sample: submit checkout data with the logged-in customer's cart data.
But its leading to the error message that I've already posted.
I tried to reproduce it on the 202404.0 b2b-demo-shop and for me the behaviour looks expected:
I am using an auth-token for the customer sonia@spryker.com and I am doing the following request (fetched the carts before to get the proper cart-uuid):POST /checkout-data?include=carts HTTP/1.1
Host: glue.de.spryker.local
Content-Type: application/json
Authorization: Bearer ************
Content-Length: 230 {
"data": {
"type": "checkout-data",
"attributes": {
"idCart": "9b18aeaf-4625-5f64-8b3a-c82cda1ba27d",
"shipment": {
"idShipmentMethod": 1
}
}
}
}And with this I get the response:
{ "data": { "type": "checkout-data", "id": null, "attributes": { "addresses": [], "paymentProviders": [], "shipmentMethods": [], "selectedShipmentMethods": [ { "id": 1, "name": "Standard", "carrierName": "DHL", "price": 490, "taxRate": null, "deliveryTime": null, "currencyIsoCode": "EUR" } ], "selectedPaymentMethods": [] }, "links": { "self": "http://glue.de.spryker.local/checkout-data?include=carts" }, "relationships": { "carts": { "data": [ { "type": "carts", "id": "9b18aeaf-4625-5f64-8b3a-c82cda1ba27d" } ] } } }, "included": [ { "type": "carts", "id": "9b18aeaf-4625-5f64-8b3a-c82cda1ba27d", "attributes": { "priceMode": "GROSS_MODE", "currency": "EUR", "store": "DE", "name": "Dmexco event", "isDefault": false, "totals": { "expenseTotal": 490, "discountTotal": 17983, "taxTotal": 15057, "subtotal": 111799, "grandTotal": 94306, "priceToPay": 94306, "shipmentTotal": 490 }, "discounts": [ { "displayName": "20% off storage", "amount": 7014, "code": null }, { "displayName": "10% off minimum order", "amount": 10479, "code": null }, { "displayName": "Free standard delivery", "amount": 490, "code": null } ], "thresholds": [] }, "links": { "self": "http://glue.de.spryker.local/carts/9b18aeaf-4625-5f64-8b3a-c82cda1ba27d" } } ] }
Should I try something else to reproduce your case?
All the best,
Florian
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 68 Spryker News
- 890 Developer Corner
- 753 Spryker Development
- 83 Spryker Dev Environment
- 360 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 22 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random