Popular

↑↓ move ↵ open All results →

Storefront API · Shipping

Choose the city and branch

PUThttps://{store}/api/v1/cart/shipping-delivery

For a carrier method: the city and, for a branch or locker, the point. The service is accepted only when the method allows it and the carrier’s directory has it in that city.

Cart token from POST /carts: X-Cart-Token: {token}.

Request body application/json

shipping_method_codestringrequired
code of the method (shipping_methods in carriers).
carrierstringrequired
Carrier code.
service_typestringrequired
branch, parcel_locker or courier.
city_refstringrequired
ref of the city.
delivery_point_refstring
ref of the branch or locker; required for those services.

Example

{
    "shipping_method_code": "NOVA_POSHTA",
    "carrier": "nova_poshta",
    "service_type": "branch",
    "city_ref": "8d5a980d-391c-11dd-90d9-001a92567626",
    "delivery_point_ref": "1ec09d88-e1c2-11e3-8c4a-0050568002cf"
}

Responses

200The cart with shipping_delivery filled.
{
    "data": {
        "id": "42",
        "currency": "UAH",
        "lines": [
            {
                "id": "7",
                "purchasable_id": "15",
                "quantity": 1,
                "unit_price": 599900,
                "total": 599900
            }
        ],
        "totals": {
            "subtotal": 599900,
            "shipping": 0,
            "tax": 0,
            "discount": 0,
            "total": 599900
        },
        "shipping_option": "NOVA_POSHTA",
        "shipping_paid_by": "customer",
        "shipping_delivery": {
            "shipping_method_id": 1,
            "shipping_method_code": "NOVA_POSHTA",
            "shipping_method_name": "Нова пошта",
            "carrier": "nova_poshta",
            "carrier_name": "Нова пошта",
            "service_type": "branch",
            "city_ref": "8d5a980d-391c-11dd-90d9-001a92567626",
            "delivery_point_ref": "1ec09d88-e1c2-11e3-8c4a-0050568002cf",
            "city_name": "Київ",
            "delivery_point_name": "Відділення №12"
        }
    }
}
422The carrier, service or point is not available.
{
    "message": "Цей перевізник зараз недоступний.",
    "errors": {
        "carrier": [
            "Цей перевізник зараз недоступний."
        ]
    }
}
401No X-Cart-Token, an expired token, or a cart that is already ordered.
{
    "message": "A valid X-Cart-Token header is required.",
    "errors": {
        "cart_token": [
            "Кошик не знайдено, строк доступу минув або його вже оформлено."
        ]
    }
}
429Too many requests (cart creation 20/min per IP, cart calls 120/min, checkout 10/min).
{
    "message": "Too Many Attempts."
}