BoxLatviaDevelopers
Get access
API reference

Boxes

A box is a storage unit you rent out: a size, a price and a number of identical units. Boxes live in a location.

Note
Boxes start as DRAFT. The API can only ask for a review (submit); BoxLatvia staff publish. See Publishing.

#The Box object

NameTypeDescription
iduuidBoxLatvia's identifier.
external_idstring | nullYour identifier.
location_iduuid | nullThe location it belongs to.
namestringName.
descriptionstring | nullDescription.
statusstringDRAFT, REVIEW, PUBLISHED or UNPUBLISHED. Read-only: use submit and withdraw.
price promotional_pricenumber | nullPrice per period, and the discounted price if there is one.
price_period_1 _3 _6 _12number | nullFixed totals for renting 1, 3, 6 or 12 periods, if set.
price_unitstring | nullPrice unit code.
size size_length size_width size_height door_width door_heightnumber | nullFloor area in m², inner dimensions and door size in metres.
total_units available_unitsinteger | nullNumber of identical units, and how many are free to book.
max_advance_daysinteger | nullHow many days ahead a customer may book.
featuresstring[]Amenity codes.
missingstring[]What is still needed before the box can be submitted for review: any of description, price, price_unit, size, features.
created_at updated_atdatetimeISO 8601, UTC.
Example
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 29.9,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 10,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T09:30:12.418Z"
}

#Endpoints

#List boxes

GET/v1/boxesboxes:read

Your boxes, oldest first, one page at a time.

Query parameters

NameTypeDescription
limitintegerPage size, 1 to 200. Default 50.
cursorstringThe next_cursor of the previous page. Do not build cursors yourself.
location_iduuidOnly boxes of this location.
external_idstringOnly the box with this identifier of yours.
statusstringDRAFT, REVIEW, PUBLISHED or UNPUBLISHED.

Example

Boxes of one location, one per page
curl "$API/v1/boxes?location_id=9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3&limit=1" \
  -u "$CLIENT_ID:$CLIENT_SECRET"
200 OK
{
  "data": [
    {
      "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
      "external_id": "SKU-3M",
      "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
      "name": "Box 3 m²",
      "description": "Sausa un apsildāma telpa pirmajā stāvā",
      "status": "DRAFT",
      "price": 29.9,
      "promotional_price": null,
      "price_period_1": null,
      "price_period_3": 79,
      "price_period_6": null,
      "price_period_12": 290,
      "price_unit": "menesi",
      "size": 3,
      "size_length": 2,
      "size_width": 1.5,
      "size_height": 2.4,
      "door_width": 0.9,
      "door_height": 2,
      "total_units": 10,
      "available_units": 10,
      "max_advance_days": 60,
      "features": [
        "apkure",
        "viedatslega"
      ],
      "missing": [],
      "created_at": "2026-11-07T09:30:12.418Z",
      "updated_at": "2026-11-07T09:30:12.418Z"
    }
  ],
  "next_cursor": "WyIyMDI2LTExLTA2IDEwOjAwOjAwLjAwMDAxMyswMCIsIjdiOGEzODI3LTI2M2UtNGMyMC1iNDQ3LWFkMjE5YmU1NWE0YyJd"
}

Errors

StatusWhen
422location_id or status is not valid.

#Create a box

POST/v1/boxesboxes:write

Creates a box as a DRAFT. It needs a name and a location; the rest can follow.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Headers

NameTypeDescription
Idempotency-KeystringOptional. 1 to 200 printable characters. A retry with the same key returns the original result instead of creating a duplicate. See safe retries.

Request body

NameTypeDescription
name requiredstringUp to 255 characters. Required when creating.
location_iduuidThe location the box is in. One of location_id or location_external_id is required when creating; later it moves the box to another of your locations.
location_external_idstringThe same, by your own id for the location. Not together with location_id.
descriptionstring | nullUp to 255 characters.
external_idstringYour own identifier, up to 100 characters, unique among your boxes. Set once.
pricenumber | nullPrice per period, more than 0, at most 2 decimals (never rounded for you).
promotional_pricenumber | nullDiscounted price. Must be lower than price.
price_period_1 _3 _6 _12number | nullOptional fixed total for renting 1, 3, 6 or 12 periods. When set, the customer pays exactly this amount for that period.
price_unitstring | nullPrice unit code (per month, per week), see Reference data.
sizenumber | nullFloor area in m², more than 0, rounded to 2 decimals.
size_length size_width size_heightnumber | nullInner dimensions in metres.
door_width door_heightnumber | nullDoor dimensions in metres.
total_unitsinteger | nullHow many identical boxes you have, 0 or more.
available_unitsinteger | nullHow many are free to rent right now. Cannot exceed total_units.
max_advance_daysinteger | nullHow many days ahead a customer may book, 1 to 730.
featuresstring[]Amenity codes, see Reference data. Replaces the whole set.

Examples

A complete box
curl -X POST "$API/v1/boxes" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "location_external_id": "WH-IMANTA",
  "external_id": "SKU-3M",
  "price": 29.9,
  "price_unit": "menesi",
  "price_period_3": 79,
  "price_period_12": 290,
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 10,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ]
}'
201 CreatedETag: W/"2daf00d492dd4f4cd82f2113"Location: https://api.boxlatvia.lv/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 29.9,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 10,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T09:30:12.418Z"
}
Only a name and a location

missing lists what the box needs before it can be submitted.

curl -X POST "$API/v1/boxes" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box 5 m²",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3"
}'
201 CreatedETag: W/"9c02eeec9c920097d539244a"Location: https://api.boxlatvia.lv/v1/boxes/9d7f53d3-a9cd-4ee1-b9cf-470a572f8b4e
{
  "id": "9d7f53d3-a9cd-4ee1-b9cf-470a572f8b4e",
  "external_id": null,
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 5 m²",
  "description": null,
  "status": "DRAFT",
  "price": null,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": null,
  "price_period_6": null,
  "price_period_12": null,
  "price_unit": null,
  "size": null,
  "size_length": null,
  "size_width": null,
  "size_height": null,
  "door_width": null,
  "door_height": null,
  "total_units": null,
  "available_units": null,
  "max_advance_days": null,
  "features": [],
  "missing": [
    "description",
    "price",
    "price_unit",
    "size",
    "features"
  ],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T09:30:12.418Z"
}
Invalid values
curl -X POST "$API/v1/boxes" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box 2 m²",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "price": 10.005,
  "total_units": 1.5
}'
422 Unprocessable Content
{
  "type": "https://api.boxlatvia.lv/problems/validation-failed",
  "title": "Validation failed",
  "status": 422,
  "detail": "One or more fields are invalid.",
  "request_id": "88e536cb-521e-4728-802c-8a7b667fa4af",
  "errors": [
    {
      "field": "price",
      "message": "must have at most 2 decimals"
    },
    {
      "field": "total_units",
      "message": "Expected integer, received float"
    }
  ]
}
Rules between fields and unknown codes

These checks look at the final values together: the promotional price, the stock figures, the codes.

curl -X POST "$API/v1/boxes" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box 2 m²",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "price": 10,
  "promotional_price": 12,
  "total_units": 5,
  "available_units": 8,
  "price_unit": "gadsimts",
  "features": [
    "sauna"
  ]
}'
422 Unprocessable Content
{
  "type": "https://api.boxlatvia.lv/problems/validation-failed",
  "title": "Validation failed",
  "status": 422,
  "detail": "One or more fields are invalid.",
  "request_id": "ce26822d-d546-4254-a374-08549ad6e04b",
  "errors": [
    {
      "field": "price_unit",
      "message": "is not a known price unit code"
    },
    {
      "field": "features",
      "message": "unknown or inactive feature code(s): sauna"
    },
    {
      "field": "promotional_price",
      "message": "must be lower than price"
    },
    {
      "field": "available_units",
      "message": "cannot be greater than total_units"
    }
  ]
}
The status cannot be set
curl -X POST "$API/v1/boxes" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box 2 m²",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "status": "PUBLISHED"
}'
422 Unprocessable Content
{
  "type": "https://api.boxlatvia.lv/problems/validation-failed",
  "title": "Validation failed",
  "status": 422,
  "detail": "One or more fields are invalid.",
  "request_id": "921b4ebd-4e17-4232-9475-c3e76ac97f43",
  "errors": [
    {
      "field": "status",
      "message": "cannot be set directly; use POST /v1/boxes/{id}/submit (or /withdraw)"
    }
  ]
}

Errors

StatusWhen
409external_id is already used by another of your boxes.
422A value is invalid, a code is unknown, or the location is not yours.

#Retrieve a box

GET/v1/boxes/{id}boxes:read

One box, with the ETag you need to change or delete it.

Path parameters

NameTypeDescription
iduuidThe box's BoxLatvia id.

Example

Retrieve
curl "$API/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022" \
  -u "$CLIENT_ID:$CLIENT_SECRET"
200 OKETag: W/"2daf00d492dd4f4cd82f2113"
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 29.9,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 10,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T09:30:12.418Z"
}

Errors

StatusWhen
404No such box of yours.

#Update a box

PATCH/v1/boxes/{id}boxes:write

Changes only the fields you send, including stock (available_units) and prices. Changes to a published box are visible on the website straight away.

Path parameters

NameTypeDescription
iduuidThe box's BoxLatvia id.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Headers

NameTypeDescription
If-Match requiredstringThe ETag from a previous GET, exactly as received. 428 if missing, 412 if the object changed since. See conditional updates.

Request body (any of the fields)

NameTypeDescription
name requiredstringUp to 255 characters. Required when creating.
location_iduuidThe location the box is in. One of location_id or location_external_id is required when creating; later it moves the box to another of your locations.
location_external_idstringThe same, by your own id for the location. Not together with location_id.
descriptionstring | nullUp to 255 characters.
external_idstringYour own identifier, up to 100 characters, unique among your boxes. Set once.
pricenumber | nullPrice per period, more than 0, at most 2 decimals (never rounded for you).
promotional_pricenumber | nullDiscounted price. Must be lower than price.
price_period_1 _3 _6 _12number | nullOptional fixed total for renting 1, 3, 6 or 12 periods. When set, the customer pays exactly this amount for that period.
price_unitstring | nullPrice unit code (per month, per week), see Reference data.
sizenumber | nullFloor area in m², more than 0, rounded to 2 decimals.
size_length size_width size_heightnumber | nullInner dimensions in metres.
door_width door_heightnumber | nullDoor dimensions in metres.
total_unitsinteger | nullHow many identical boxes you have, 0 or more.
available_unitsinteger | nullHow many are free to rent right now. Cannot exceed total_units.
max_advance_daysinteger | nullHow many days ahead a customer may book, 1 to 730.
featuresstring[]Amenity codes, see Reference data. Replaces the whole set.

Example

Update stock and price
curl -X PATCH "$API/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -H "If-Match: W/\"2daf00d492dd4f4cd82f2113\"" \
  -d '{
  "available_units": 7,
  "price": 31.5
}'
200 OKETag: W/"0a057478c432265c169ba82b"
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 31.5,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 7,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T14:05:41.092Z"
}

Errors

StatusWhen
404No such box of yours.
412The box changed since you read it.
422A value is invalid or breaks a rule between fields.
428If-Match is missing.

#Create or update by your own id

PUT/v1/boxes/by-external-id/{external_id}boxes:write

Creates the box if your id is new (then name and a location are required), otherwise updates the fields you send. No If-Match: ideal for stock and price feeds.

Path parameters

NameTypeDescription
external_idstringYour identifier for the box.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Request body

NameTypeDescription
name requiredstringUp to 255 characters. Required when creating.
location_iduuidThe location the box is in. One of location_id or location_external_id is required when creating; later it moves the box to another of your locations.
location_external_idstringThe same, by your own id for the location. Not together with location_id.
descriptionstring | nullUp to 255 characters.
external_idstringYour own identifier, up to 100 characters, unique among your boxes. Set once.
pricenumber | nullPrice per period, more than 0, at most 2 decimals (never rounded for you).
promotional_pricenumber | nullDiscounted price. Must be lower than price.
price_period_1 _3 _6 _12number | nullOptional fixed total for renting 1, 3, 6 or 12 periods. When set, the customer pays exactly this amount for that period.
price_unitstring | nullPrice unit code (per month, per week), see Reference data.
sizenumber | nullFloor area in m², more than 0, rounded to 2 decimals.
size_length size_width size_heightnumber | nullInner dimensions in metres.
door_width door_heightnumber | nullDoor dimensions in metres.
total_unitsinteger | nullHow many identical boxes you have, 0 or more.
available_unitsinteger | nullHow many are free to rent right now. Cannot exceed total_units.
max_advance_daysinteger | nullHow many days ahead a customer may book, 1 to 730.
featuresstring[]Amenity codes, see Reference data. Replaces the whole set.

Example

A stock update from your system

Send the full current figure each time, never “minus one”: customers may book while your feed runs.

curl -X PUT "$API/v1/boxes/by-external-id/SKU-3M" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "available_units": 6
}'
200 OKETag: W/"52a099edb61a3e0853024325"
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 31.5,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 6,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T14:05:41.092Z"
}

Errors

StatusWhen
422A value is invalid, or a new box is missing its name or location.

#Submit for review

POST/v1/boxes/{id}/submitboxes:write

Asks BoxLatvia to review and publish the box (DRAFT → REVIEW). The API never publishes: BoxLatvia staff do.

Submitting a box that is already in review changes nothing (200). If-Match is optional here.

Path parameters

NameTypeDescription
iduuidThe box's BoxLatvia id.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Examples

Not ready yet
curl -X POST "$API/v1/boxes/9d7f53d3-a9cd-4ee1-b9cf-470a572f8b4e/submit" \
  -u "$CLIENT_ID:$CLIENT_SECRET"
422 Unprocessable Content
{
  "type": "https://api.boxlatvia.lv/problems/box-incomplete",
  "title": "Box is incomplete",
  "status": 422,
  "detail": "Fill in description, price, price_unit, size, features before submitting this box for review.",
  "request_id": "f48c9ebd-fa4f-4b14-be21-b98154de2c1e",
  "missing": [
    "description",
    "price",
    "price_unit",
    "size",
    "features"
  ]
}
Submitted
curl -X POST "$API/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022/submit" \
  -u "$CLIENT_ID:$CLIENT_SECRET"
200 OKETag: W/"052468fbc2a710d35f026e30"
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "REVIEW",
  "price": 31.5,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 6,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T14:05:41.092Z"
}

Errors

StatusWhen
404No such box of yours.
409The box is already published: withdraw it first.
422The box is incomplete: missing lists what it needs.

#Withdraw

POST/v1/boxes/{id}/withdrawboxes:write

Takes the box out of review or off the website and back to DRAFT. A draft stays a draft (200).

Path parameters

NameTypeDescription
iduuidThe box's BoxLatvia id.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Example

Back to draft
curl -X POST "$API/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022/withdraw" \
  -u "$CLIENT_ID:$CLIENT_SECRET"
200 OKETag: W/"f1fa55a0c2e2fd1d06f83296"
{
  "id": "c4883b4a-4e38-47bf-8a69-ef025917e022",
  "external_id": "SKU-3M",
  "location_id": "9d80d5f4-d17a-4f3e-99f6-4ab43b132bc3",
  "name": "Box 3 m²",
  "description": "Sausa un apsildāma telpa pirmajā stāvā",
  "status": "DRAFT",
  "price": 31.5,
  "promotional_price": null,
  "price_period_1": null,
  "price_period_3": 79,
  "price_period_6": null,
  "price_period_12": 290,
  "price_unit": "menesi",
  "size": 3,
  "size_length": 2,
  "size_width": 1.5,
  "size_height": 2.4,
  "door_width": 0.9,
  "door_height": 2,
  "total_units": 10,
  "available_units": 6,
  "max_advance_days": 60,
  "features": [
    "apkure",
    "viedatslega"
  ],
  "missing": [],
  "created_at": "2026-11-07T09:30:12.418Z",
  "updated_at": "2026-11-07T14:05:41.092Z"
}

Errors

StatusWhen
404No such box of yours.

#Delete a box

DELETE/v1/boxes/{id}boxes:write

Deletes the box and its pictures. A box that has orders cannot be deleted: set available_units to 0 to stop new bookings.

Path parameters

NameTypeDescription
iduuidThe box's BoxLatvia id.

Query parameters

NameTypeDescription
validate_onlybooleantrue runs every check and returns what would happen, but saves nothing. See dry runs.

Headers

NameTypeDescription
If-Match requiredstringThe ETag from a previous GET, exactly as received. 428 if missing, 412 if the object changed since. See conditional updates.

Examples

Deleted
curl -X DELETE "$API/v1/boxes/9d7f53d3-a9cd-4ee1-b9cf-470a572f8b4e" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "If-Match: W/\"9c02eeec9c920097d539244a\""
204 No Content
No response body
The box has orders
curl -X DELETE "$API/v1/boxes/c4883b4a-4e38-47bf-8a69-ef025917e022" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "If-Match: W/\"f1fa55a0c2e2fd1d06f83296\""
409 Conflict
{
  "type": "https://api.boxlatvia.lv/problems/box-has-orders",
  "title": "Conflict",
  "status": 409,
  "detail": "This box has orders and cannot be deleted. Set available_units to 0 to stop new bookings.",
  "request_id": "d1f30eca-8286-4c7d-8244-c8f0cf9a56c3"
}

Errors

StatusWhen
404No such box of yours.
409The box has orders.
412The box changed since you read it.
428If-Match is missing.