Delivery Times Slots Management

Manage delivery time slots

Getting all the delivery time slots

get

Retrieves all the slots for a given delivery time.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-404002: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

Required scopes

  • shipping.shipping_read

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
Responses
200
OK
application/json
get
GET /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "5bb01144-7c72-4659-9ca2-f1f435108c63",
    "shippingMethod": "method1",
    "deliveryTimeRange": {
      "timeFrom": "10:00",
      "timeTo": "12:00"
    },
    "cutOffTime": {
      "time": "2023-06-12T06:00:00.000Z",
      "cutOffDayShift": 1,
      "deliveryCycleName": "morning"
    },
    "capacity": 100
  }
]

Creating a delivery time slot

post

Creates a new time slot for the given delivery time.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-400003: Delivery time of weekday type overlaps on existing one

  • DELIVERY-TIME-400004: Delivery time of singleDay type overlaps on existing one

  • DELIVERY-TIME-400005: Slot overlaps delivery time of another slots in given delivery time

  • DELIVERY-TIME-400006: Delivery time of datePeriod type overlaps on existing one

  • DELIVERY-TIME-400007: Duplicated time ranges and cutOff time different slots

  • DELIVERY-TIME-400010: Provided shipping method does not belong to the given zone

  • DELIVERY-TIME-400011: Delivery 'timeFrom' cannot be after 'timeTo'

  • DELIVERY-TIME-400015: There are duplicated slot ids in the slots array

  • DELIVERY-TIME-400018: Delivery cutOffTime cannot be after 'timeTo'

  • DELIVERY-TIME-404001: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

  • DELIVERY-TIME-SLOT-400001: There are overlapping slot id in the request

  • DELIVERY-TIME-SLOT-400002: The slot id from the payload must match the id from the url

  • DELIVERY-TIME-SLOT-400003: Slot with provided id already exists in the given delivery time

  • DELIVERY-TIME-SLOT-400004: Duplicated time ranges and cutOff time in the existing slots

  • DELIVERY-TIME-SLOT-400005: The slot cut off day is set when the delivery time date or period is set

  • DELIVERY-TIME-SLOT-400006: The slot cut off day is set when the delivery day shift is set

Required scopes

  • shipping.shipping_manage

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
Query parameters
validateOverlapbooleanOptional

The flag allows to enable or disable the validation which checks if the delivery time ranges from slots of the same shipping method overlap each other.

Default: true
Body
idstringOptional

Delivery Time Slot ID: Autogenerated (if not provided in request) or User-Defined

shippingMethodstringRequired

Selected shipping method which is available for the Delivery Time in the given Time Slot

capacityintegerRequired

A capacity determines how many orders the given Delivery Time Slot can handle

Responses
201
Created
application/json
post
POST /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "shippingMethod": "method2",
  "deliveryTimeRange": {
    "timeFrom": "10:00",
    "timeTo": "12:00"
  },
  "cutOffTime": {
    "time": "2023-06-12T06:00:00.000Z",
    "cutOffDayShift": 1,
    "deliveryCycleName": "evening"
  },
  "capacity": 100
}
{
  "id": "800c4f51-035d-43b4-bbbb-b9ba0c630242"
}

Deleting all the delivery time slots

delete

Deletes all the time slots for the given delivery time.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-404002: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

Required scopes

  • shipping.shipping_manage

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
Responses
204
No Content
delete
DELETE /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Getting a delivery time slot

get

Retrieves the given delivery time slot's details.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-500001: Internal problem with the service

  • DELIVERY-TIME-404002: Delivery time with given id doesn't exists in the system

  • DELIVERY-TIME-SLOT-404001: Slot with provided id doesn't exists in the given delivery time

Required scopes

  • shipping.shipping_read

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
slotIdstringRequired
Responses
200
OK
application/json
get
GET /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots/{slotId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "800c4f51-035d-43b4-bbbb-b9ba0c630242",
  "shippingMethod": "method2",
  "deliveryTimeRange": {
    "timeFrom": "10:00",
    "timeTo": "12:00"
  },
  "cutOffTime": {
    "time": "2023-06-12T06:00:00.000Z",
    "cutOffDayShift": 1,
    "deliveryCycleName": "evening"
  },
  "capacity": 100
}

Updating a delivery time slot

put

Updates a single delivery time slot with given information.

Note:

Depending on a case, a different set of fields is allowed.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-400003: Delivery time of weekday type overlaps on existing one

  • DELIVERY-TIME-400004: Delivery time of singleDay type overlaps on existing one

  • DELIVERY-TIME-400005: Slot overlaps delivery time of another slots in given delivery time

  • DELIVERY-TIME-400006: Delivery time of datePeriod type overlaps on existing one

  • DELIVERY-TIME-400007: Duplicated time ranges and cutOff time different slots

  • DELIVERY-TIME-400010: Provided shipping method does not belong to the given zone

  • DELIVERY-TIME-400011: Delivery 'timeFrom' cannot be after 'timeTo'

  • DELIVERY-TIME-400015: There are duplicated slot ids in the slots array

  • DELIVERY-TIME-400018: Delivery cutOffTime cannot be after 'timeTo'

  • DELIVERY-TIME-404002: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

  • DELIVERY-TIME-SLOT-400001: There are overlapping slot id in the request

  • DELIVERY-TIME-SLOT-400002: The slot id from the payload must match the id from the url

  • DELIVERY-TIME-SLOT-400003: Slot with provided id already exists in the given delivery time

  • DELIVERY-TIME-SLOT-400004: Duplicated time ranges and cutOff time in the existing slots

  • DELIVERY-TIME-SLOT-404001: Slot with provided id doesn't exists in the given delivery time

  • DELIVERY-TIME-SLOT-400005: The slot cut off day is set when the delivery time date or period is set

  • DELIVERY-TIME-SLOT-400006: The slot cut off day is set when the delivery day shift is set

Required scopes

  • shipping.shipping_manage

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
slotIdstringRequired
Query parameters
validateOverlapbooleanOptional

The flag allows to enable or disable the validation which checks if the delivery time ranges from slots of the same shipping method overlap each other.

Default: true
Body
idstringOptional

Delivery Time Slot ID: Autogenerated (if not provided in request) or User-Defined

shippingMethodstringRequired

Selected shipping method which is available for the Delivery Time in the given Time Slot

capacityintegerRequired

A capacity determines how many orders the given Delivery Time Slot can handle

Responses
200
OK
put
PUT /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots/{slotId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "shippingMethod": "method2",
  "deliveryTimeRange": {
    "timeFrom": "10:00",
    "timeTo": "12:00"
  },
  "cutOffTime": {
    "time": "2023-06-12T06:00:00.000Z",
    "cutOffDayShift": 1,
    "deliveryCycleName": "evening"
  },
  "capacity": 100
}

No content

Deleting a delivery time slot

delete

Deletes a single delivery time slot.

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-404002: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

  • DELIVERY-TIME-SLOT-404001: Slot with provided id doesn't exists in the given delivery time

Required scopes

  • shipping.shipping_manage

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
slotIdstringRequired
Responses
204
No Content
delete
DELETE /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots/{slotId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Partial updating of a delivery time slot

patch

Partially updates a single delivery time slot with given information. Note: Depending on a case, a different set of fields is allowed.

The patch request consists of a set of operations, that should be defined according to RFC-6902 standard

In case of any validation problem, the below errorCodes can be returned:

  • DELIVERY-TIME-400003: Delivery time of weekday type overlaps on existing one

  • DELIVERY-TIME-400004: Delivery time of singleDay type overlaps on existing one

  • DELIVERY-TIME-400005: Slot overlaps delivery time of another slots in given delivery time

  • DELIVERY-TIME-400006: Delivery time of datePeriod type overlaps on existing one

  • DELIVERY-TIME-400007: Duplicated time ranges and cutOff time different slots

  • DELIVERY-TIME-400010: Provided shipping method does not belong to the given zone

  • DELIVERY-TIME-400011: Delivery 'timeFrom' cannot be after 'timeTo'

  • DELIVERY-TIME-400015: There are duplicated slot ids in the slots array

  • DELIVERY-TIME-400018: Delivery cutOffTime cannot be after 'timeTo'

  • DELIVERY-TIME-404002: Delivery time with given id does not exist

  • DELIVERY-TIME-500001: Internal problem with the service

  • DELIVERY-TIME-SLOT-400001: There are overlapping slot id in the request

  • DELIVERY-TIME-SLOT-400002: The slot id from the payload must match the id from the url

  • DELIVERY-TIME-SLOT-400003: Slot with provided id already exists in the given delivery time

  • DELIVERY-TIME-SLOT-400004: Duplicated time ranges and cutOff time in the existing slots

  • DELIVERY-TIME-SLOT-404001: Slot with provided id doesn't exists in the given delivery time

  • DELIVERY-TIME-SLOT-400005: The slot cut off day is set when the delivery time date or period is set

  • DELIVERY-TIME-SLOT-400006: The slot cut off day is set when the delivery day shift is set

Required scopes

  • shipping.shipping_manage

Authorizations
Path parameters
tenantstringRequired
deliveryTimeIdstringRequired
slotIdstringRequired
Query parameters
validateOverlapbooleanOptional

The flag allows to enable or disable the validation which checks if the delivery time ranges from slots of the same shipping method overlap each other.

Default: true
Bodyobject[]
opstringOptional

Indicates an operation which should be done. Available operations: add, remove and replace

pathstringOptional

Indicates a path for which the value should be applied. For example: /shippingMethod, /cutOffTime/day

valueone ofOptional

Indicates a value that should be changed or added. The value can be of a primitive type, like string, number, boolean or it can be an object or an array.

stringOptional
or
objectOptional
Responses
200
OK
patch
PATCH /shipping/{tenant}/delivery-times/{deliveryTimeId}/slots/{slotId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 64

[
  {
    "op": "replace",
    "path": "/shippingMethod",
    "value": "testMethod"
  }
]

No content

Was this helpful?