Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

On this page

 

The DispatchOrderPriceList resource has the following attributes:

AttributeType

Description

total_success_countInteger

Number of correctly processed shipments

total_error_countInteger

Number of incorrectly processed shipments

total_priceHash

Total amount for courier pick-up

price_listHash

Courier pick-up pricelist

invalid_shipmentsHash

Unprocessed shipment errors

Sample DispatchOrderPriceList resource in the 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 and its methods requires provision of the correct and valid access token.


Recalculating collection order prices

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

Parameters

ParameterType

Description

Validation

dispatch_point_idInteger

ID of the dispatch point which the shipment is to be collected from (the dispatch point address will become the collection order address).

The attribute is not required.

shipmentsArray[Integer]

List of shipment IDs which the collection order is to be created for.

The attribute is required.

• Parcels must be in confirmed status and cannot be assigned to a different collection order in the new, sent, accepted or done status.

Sample request

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"
        ]
    }
}

Information about errors

The server may return the following errors

  • • validation_failed - validation error
  • • forbidden - the user does not have access rights to the specified organization
  • • token_invalid - the token is incorrect



  • No labels