smartsendio / woocommerce

Smart Send module for WooCommerce
GNU General Public License v3.0
0 stars 2 forks source link

Fix Latvian postcode format when creating a shipment #24

Open Saggre opened 2 years ago

Saggre commented 2 years ago

Should fix the following error response from Smart Send API when trying to create a shipment to a Latvian pick-up point:

{
    "links": {
        "about": "https://app.smartsend.io/docs/errors/ValidationException",
        "status": "https://app.smartsend.io/status"
    },
    "id": null,
    "code": "ValidationException",
    "message": "The given data was invalid.",
    "errors": {
        "agent.postal_code": [
            "The agent.postal code must be a valid postal code in LV (examples LV-1073)."
        ]
    }
}

Although the real solution is for the API endpoint called by findClosestAgentByAddress to return valid postal codes. Let me know if you need more info about this issue.