---
title: "Reserves a single occupancy by automatic packing and flexible time scope."
method: POST
path: "/hub-management/occupancies/reserve/automatic-packing/flexible-time-scope"
tags: ["hub-management"]
---

# Reserves a single occupancy by automatic packing and flexible time scope.

`POST /hub-management/occupancies/reserve/automatic-packing/flexible-time-scope`

## Request

- Base URL: `https://api.ganje.net/v1.1`
- URL: `https://api.ganje.net/v1.1/hub-management/occupancies/reserve/automatic-packing/flexible-time-scope`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/ganje/apis/ganje-external-api/docs/hub-management/occupancies/reserve/automatic-packing/flexible-time-scope/post.ts> (a function with typed inputs; its response is checked against the schema)

Must be authenticated as a supplier.
Automatic packing means needed lockers to accomedate parcels are specified by the server.

## Request body

- object
  - `station` string, uuid
  - `station_slug` string, slug
  - `time_scope` object
    - `expected_check_in` string, date-time, required
    - `expected_duration` string, required: Input can be either in seconds or 'D HH:MM:SS' format Output is always in 'D HH:MM:SS' format
  - `time_scope_date` object
    - `expected_check_in_date` string, date, required
    - `expected_check_out_date` string, date
    - `expected_duration_days` integer
  - `supplier` string, uuid
  - `package` object, required
    - `parcels` object[], required
      - `external_id` string, nullable, required: Parcel ID in Supplier System
      - `dimension` object, required
        - `width` number, required: In meter
        - `height` number, required: In meter
        - `length` number, required: In meter
      - `value` number, nullable: Parcel Value for Using in Insurance - unit: Rial
      - `promised_date` string, date
    - `external_id` string, required
    - `shop` string
  - `uuid` string, uuid
  - `order_date` string, date-time
  - `process` 'firstmile' | 'middlemile' | 'lastmile' | 'warehouse' | 'manual_lastmile' | 'personal_lastmile' | 'safe_box' | 'manual_firstmile', required
  - `logistic_company` string, uuid: Logistic Company UUID
  - `picker` string: Picker Phone Number in +98xxxxxxxxxx format
  - `dropper` string: Dropper Phone Number in +98xxxxxxxxxx format
  - `verbose_id` string: Any id to verbally represent occupancy, for example order_id in supplier system.
  - `password` string
  - `random` boolean
  - `picker_full_name` string
  - `cancel` boolean

## Response `200`

successful occupancy reservation

- object
  - `pk` integer
  - `uuid` string, uuid
  - `verbose_id` string
  - `status` string
  - `process` string
  - `station` object
    - `uuid` string
    - `address` string, nullable: Full address
    - `location` string
    - `nickname` string, nullable: A name for users to remeber this station with.
    - `postal_code` string, nullable
    - `images` string[]
    - `districts` object, nullable
  - `shipment_external_id` string
  - `picker_phone_number` string
  - `picker_first_name` string
  - `picker_last_name` string
  - `picker_full_name` string
  - `dropper_phone_number` string
  - `dropper_first_name` string
  - `dropper_last_name` string
  - `users` object
    - `supplier` string, uuid
    - `picker` string, uuid
    - `dropper` string, uuid
  - `dates` object
    - `time_scope` object
      - `expected_check_in` string, date-time, required
      - `expected_duration` string, required: Input can be either in seconds or 'D HH:MM:SS' format Output is always in 'D HH:MM:SS' format
    - `order_date` string, date-time
    - `check_in` string, date-time
    - `check_out` string, date-time
    - `cancel_date` string, date-time
    - `extend_date` string, date-time

## Other responses

- `400`: unsuccessful occupancy reservation

---

[API](https://skmtc.dev/ganje/apis/ganje-external-api.md) - [All operations](https://skmtc.dev/ganje/apis/ganje-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ganje/apis/ganje-external-api/revisions/709eb3fdf716?raw)
