Skip to main content

Delivery prices API

Content

Delivery prices collection:

Single Delivery price

Delivery prices collection

Delivery prices index

GET /api/v0/delivery-prices

Request

Index behaviourDefinition
Paginated by defaultNo
Sortingid, price, currency_id, valid_from, valid_to, created_at, updated_at
Filtersid:int, price:Monetary, currency_id:string, valid_from:date, valid_to:date, created_at:date, updated_at:date
Embedded-
GET /api/v0/delivery-prices HTTP/1.1
Content-Type: application/json

Response

200 OK

GET /api/v0/delivery-prices HTTP/1.1
Content-Type: application/json

{
"items": [
{
"id": 1,
"price": {
"CZK": {
"value": 200,
"formatted": "200,00 Kč"
}
},
"valid_from": "2020-12-31T23:00:00.000000Z",
"valid_to": null,
"created_at": "2022-12-05T13:34:10+0100",
"updated_at": "2022-12-05T13:34:10+0100",
"_links": [
{
"href": "/api/v0/delivery-prices/1",
"rel": "self",
"type": "GET"
}
]
}
]
}

Delivery price detail

GET /api/v0/delivery-prices/{delivery_price_detail}

Request

Index behaviourDefinition
Paginated by defaultNo
Sortingid, price, currency_id, valid_from, valid_to, created_at, updated_at
Filtersid:int, price:Monetary, currency_id:string, valid_from:date, valid_to:date, created_at:date, updated_at:date
Embedded-
GET /api/v0/delivery-prices/1 HTTP/1.1
Content-Type: application/json

Response

200 OK

GET /api/v0/delivery-prices/1 HTTP/1.1
Content-Type: application/json

{
"id": 1,
"price": {
"CZK": {
"value": 20,
"formatted": "20,00 Kč"
}
},
"valid_from": "2020-12-31T23:00:00.000000Z",
"valid_to": null,
"created_at": "2022-12-05T13:34:10+0100",
"updated_at": "2022-12-05T13:34:10+0100",
"_links": [
{
"href": "/api/v0/delivery-prices/1",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND

Delivery price was not found.

GET /api/v0/delivery-prices/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}

Create delivery price

POST /api/v0/hourly-pays/{model}/{model_id}

Request

ParamTypeDescriptionRequirements
priceMonetaryPrice for 1 kmRequired. Must be minimum 0 digits, max 20 digits
currency_idstringCurrency IDRequired. Must be string of 3 characters
valid_fromdateDate from delivery price is validRequired.
valid_todateDate to delivery price is validPresent. Could be empty. this means that this hourly pay is current.
POST /api/v0/delivery-prices HTTP/1.1
Content-Type: application/json

{
"price": {
"CZK": 120
},
"valid_from": "01.11.2022",
"valid_to": "30.11.2022"
}

Response

200 OK

POST /api/v0/delivery-prices HTTP/1.1
Content-Type: application/json

{
"id": 1,
"price": {
"CZK": {
"value": 200,
"formatted": "200,00 Kč"
}
},
"valid_from": "2020-12-31T23:00:00.000000Z",
"valid_to": null,
"created_at": "2022-12-05T13:34:10+0100",
"updated_at": "2022-12-05T14:01:16+0100",
"_links": [
{
"href": "/api/v0/delivery-prices/1",
"rel": "self",
"type": "GET"
}
]
}

Update delivery price

PUT/PATCH /api/v0/hourly-pays/{model}/{model_id}

Request

ParamTypeDescriptionRequirements
priceMonetaryPrice for 1 kmRequired. Must be minimum 0 digits, max 20 digits
currency_idstringCurrency IDRequired. Must be string of 3 characters
valid_fromdateDate from delivery price is validRequired.
valid_todateDate to delivery price is validPresent. Could be empty. this means that this hourly pay is current.
PATCH /api/v0/delivery-prices/1 HTTP/1.1
Content-Type: application/json

{
"price": {
"CZK": 120
}
}

Response

200 OK

PATCH /api/v0/delivery-prices/1 HTTP/1.1
Content-Type: application/json

{
"id": 1,
"price": {
"CZK": {
"value": 200,
"formatted": "200,00 Kč"
}
},
"valid_from": "2020-12-31T23:00:00.000000Z",
"valid_to": null,
"created_at": "2022-12-05T13:34:10+0100",
"updated_at": "2022-12-05T14:01:16+0100",
"_links": [
{
"href": "/api/v0/delivery-prices/1",
"rel": "self",
"type": "GET"
}
]
}

Delete delivery price

DELETE /api/v0/delivery-prices/1

Request

DELETE /api/v0/delivery-prices/1 HTTP/1.1
Content-Type: application/json

Response

204 No content