0

I am using a headless magento 2 for my store, and am having some data consistency problems with shipping addresses.

To troubleshoot this, I was thinking about saving the POST body whenever these API are hit:

rest/V1/guest-carts/:cartId/shipping-information

rest/V1/carts/mine/shipping-information

The POST data would obviously be in the following format:

{
"addressInformation": {
    "shippingAddress": {
        "country_id": "IN",
        "street": ["ABC Street"],
        "company": "HOME",
        "telephone": "12314234",
        "postcode": "12312",
        "city": "Cityi",
        "firstname": "Customer",
        "lastname": "Name",
        "email": "example@gmail.com",
        "sameAsBilling": 1,
        "regionId" : 542
    },
    "billingAddress": {
        "country_id": "IN",
        "street": ["ABC Street"],
        "company": "HOME",
        "telephone": "12314234",
        "postcode": "12312",
        "city": "Cityi",
        "firstname": "Customer",
        "lastname": "Name",
        "email": "example@gmail.com",
        "regionId" : 542
    },
    "shipping_method_code": "code",
    "shipping_carrier_code": "code"
}
}

along with some extra information.

Is there any way to do this? using observers or plugins?

I am using magento on a NGNIX server.

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.