Page tree
Skip to end of metadata
Go to start of metadata

Warning!

Resource available only in the following countries: PL

Warning Debit clients!

Dispatch order price calculation is available only for prepaid clients. Prices are not returned for postpaid (debit) clients.

On this page

 

Structure

DispatchOrderPriceList resource has the following attributes:

AttributeTypeDescriptionAvailability
total_success_countIntegerAmount of correctly processed shipmentsPL
total_error_countIntegerAmount of incorrectly processed shipmentsPL
total_priceHashTotal price for courier pick-upPL
price_listHashCourier pick-up price listPL
invalid_shipmentsHashUnprocessed shipment errorsPL

DispatchOrderPriceList resource in JSON format:

{
    "total_success_count": 3,
    "total_error_count": 1,
    "total_price": {
        "amount": 20.3,
        "currency": "PLN"
    },
    "price_list": {
        "courier": {
            "count": 1,
            "price": {
                "amount": "12",
                "currency": "PLN"
            },
            "shipments": [
                24921
            ]
        },
        "locker": {
            "count": 1,
            "price": {
                "amount": "4.30",
                "currency": "PLN"
            },
            "shipments": [
                24907
            ]
        }
        "allegro": {
            "count": 1,
            "price": {
                "amount": "4.30",
                "currency": "PLN"
            },
            "shipments": [
                24908
            ]
        }
    },
    "invalid_shipments": {
        "24906": [
            "already_dispatched"
        ]
    }
}


Authentication

Access to the resource requires a valid access token.



Dispatch Order price calculation

POST /v1/organizations/:organization_id/dispatch_orders/calculate

Parameters

ParameterTypeDescriptionValidationAvailability
dispatch_point_idIntegerDispatch point identifier, from which the shipment is to be collected from (the dispatch point address will become the dispatch order address).Attribute not required.PL
shipmentsArray[Integer]List of shipment IDs for which the dispatch order is to be created for.. 

Required attribute.

  • Shipments have to be in confirmed status and not belong to another dispatch order in the following statuses newsentaccepted or done.
PL

Request example

curl -X POST https://api-shipx-pl.easypack24.net/v1/organizations/1/dispatch_orders/calculate -H 'Authorization: Bearer token' -H 'Content-Type: application/json' -d '{
  "dispatch_point_id": 10,
  "shipments": [24907, 24908, 24906, 24918, 24921]
}'

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
    "total_success_count": 3,
    "total_error_count": 2,
    "total_price": {
        "amount": 16.3,
        "currency": "PLN"
    },
    "price_list": {
        "courier": {
            "count": 1,
            "price": {
                "amount": "12",
                "currency": "PLN"
            },
            "shipments": [
                24921
            ]
        },
        "locker": {
            "count": 2,
            "price": {
                "amount": "4.30",
                "currency": "PLN"
            },
            "shipments": [
                24907,
                24908
            ]
        }
    },
    "invalid_shipments": {
        "24906": [
            "already_dispatched"
        ],
        "24918": [
            "invalid_status"
        ]
    }
}

Error Information

  • validation_failed - validation error
  • forbidden -  user does not have access to the given organisation
  • token_invalid - token is invalid



  • No labels