Zone prices

These events are emitted by the Inventory API (btrz-api-inventory) when zone prices are created, updated, or deleted.

Events

Action Event name Endpoint
Create a zone price zoneprices.created POST /zone-prices
Update a zone price zoneprices.updated PUT /zone-prices/:zonePriceId
Delete a zone price zoneprices.deleted DELETE /zone-prices/:zonePriceId

Payload example created

{
  "attemptId": "230997cc-a346-438a-94f1-758b90816707",
  "created": 1623871688,
  "data": {
    "_id": "60ca50c08b8bf3199e511e8f",
    "accountId": "52a377ec430c7d4e220001fc",
    "arrivalZones": [
      "zone2"
    ],
    "createdAt": {
      "offset": 0,
      "value": "2021-06-16T19:28:00.223Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "departureZones": [
      "zone 1"
    ],
    "maxVolume": 123,
    "maxWeight": 123,
    "minVolume": 0,
    "minWeight": 0,
    "price": 10,
    "serviceTypeIds": [
      "605ba169ea6a729a8ab19c34"
    ],
    "updatedAt": {
      "offset": 0,
      "value": "2021-06-16T19:28:00.223Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "zoneprices.created",
  "id": "d778070d-02d9-448c-bc9d-d375e6f060d4",
  "livemode": true
}

Field descriptions — data (zoneprices.created / zoneprices.updated)

Field Type Description
_id string Zone price id (24 hex characters).
accountId string Account (provider) id that owns this resource.
serviceTypeIds array of string Service type ids associated to this price (at least one; each 24 hex).
departureZones array of string Departure zones associated to this price (at least one).
arrivalZones array of string Arrival zones associated to this price (at least one).
minWeight integer Minimum weight in grams for this price record.
maxWeight integer Maximum weight in grams for this price record (must be ≥ minWeight).
minVolume integer Minimum volume in cm³ for this price record.
maxVolume integer Maximum volume in cm³ for this price record (must be ≥ minVolume).
price number Price for each parcel that matches this record.
batchId string Id associated with a batch upload, or null if not from CSV.
createdBy string User id that created this resource (24 hex).
updatedBy string User id that last updated this resource (24 hex).
createdAt object BzDate: date the object was created.
updatedAt object BzDate: date the object was last updated.

Payload example updated

{
  "attemptId": "af31b301-addc-4685-9b9f-445171fda672",
  "created": 1623871665,
  "data": {
    "_id": "609ed2f589fda03dd95171a3",
    "accountId": "52a377ec430c7d4e220001fc",
    "arrivalZones": [
      "1",
      "2"
    ],
    "createdAt": {
      "offset": 0,
      "value": "2021-04-30T13:30:24.521Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "departureZones": [
      "1",
      "2"
    ],
    "maxVolume": 999999999,
    "maxWeight": 5000000,
    "minVolume": 0,
    "minWeight": 0,
    "price": 123.45,
    "sellEndDate": "2022-11-26T00:00:00.000Z",
    "sellStartDate": "2021-04-01T00:00:00.000Z",
    "serviceTypeIds": [
      "605ba169ea6a729a8ab19c34",
      "60a296835ecfc4facf3878a4"
    ],
    "updatedAt": {
      "offset": 0,
      "value": "2021-06-16T19:27:40.726Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "zoneprices.updated",
  "id": "0f50637a-8d82-4723-a6ad-e1e0b101fa21",
  "livemode": true
}

(Field descriptions for data are the same as for zoneprices.created; see table above.)

Payload example deleted

{
  "attemptId": "f3cd5c00-3ead-4121-9e48-56131b6c4727",
  "created": 1623871652,
  "data": {
    "zonePriceId": "608c06705f9dbf32f7b9a517"
  },
  "event": "zoneprices.deleted",
  "id": "24a854ea-28d1-407e-a421-23a76ceb0001",
  "livemode": true
}

Field descriptions — data (zoneprices.deleted)

Field Type Description
zonePriceId string Id of the deleted zone price (24 hex characters).