Skip to content
This page is not yet translated. Showing English content.

Dispatch & Pickup ​

Manage 3PL dispatch tasks and pickup schedules: find outbound orders ready for dispatch, create and update tasks, build schedules, maintain schedule attachments, and read pickup codes.

Tasks, schedules and attachments are scoped by member_id, so every endpoint returns only data owned by the authenticated channel partner. Batches and pickup codes are read through the batches that the partner's tasks belong to; a batch is a warehouse + day unit. Tasks stay editable until warehouse confirmation, after which they are locked for the partner.

Common Conventions ​

Authentication ​

HeaderRequiredDescription
request-tokenyesChannel partner app token
Content-Typeyesapplication/json

All endpoints are POST with a JSON body.

Required capability: outbound_submit (the middleware matches the api/v1/dispatch/ prefix, so every endpoint on this page requires it).

Task status and locking ​

StatusMeaning
draftDraft; the partner can edit and schedule
confirmedConfirmed; warehouse has not confirmed yet, the partner can still edit the schedule
warehouse_confirmedWarehouse confirmed; the partner can no longer modify
pickup_code_generatedPickup code generated
picked_upPicked up
completedCompleted
cancel_requestedCancellation requested
cancelledCancelled

/dispatch/update and /dispatch/schedule only operate on draft or confirmed tasks; any other status returns 400 (dispatch task is locked after warehouse confirmation).

/dispatch/schedule/remove-task uses a different message per object: a locked schedule returns 400 (schedule is locked after warehouse confirmation), a locked task returns 400 (task is locked after warehouse confirmation).

/dispatch/schedule/add-tasks returns 400 when the schedule status is not draft / confirmed (schedule is locked after warehouse confirmation).

Time and warehouse constraints ​

  • scheduled_date uses YYYY-MM-DD and is required by /dispatch/create, /dispatch/schedule and /dispatch/schedule/create.
  • Pickup time formats are asymmetric: responses return HH:MM:SS (database time columns), while submissions only accept HH:MM; /dispatch/schedule enforces the format and requires the start to be no later than the end. /dispatch/create and /dispatch/schedule/create only trim the value and do not validate format or ordering, but callers should still send HH:MM.
  • /dispatch/schedule, /dispatch/create and /dispatch/schedule/create do not check for past dates.
  • All outbound orders in one schedule must belong to the same warehouse; this is enforced by /dispatch/schedule/create, and by /dispatch/schedule when it creates a schedule from unscheduled tasks.

Pickup codes ​

  • A pickup code is a 6-digit PIN generated per batch + carrier + stack + wave; only one code is active for a batch/carrier/stack at a time.
  • A pickup code is valid for 24 hours from generation (expires_at). After scanning its status becomes scanned; after expiry it becomes expired.
  • Partners can only read pickup codes through this page; generation and redemption happen on the warehouse side.

List Dispatch Tasks ​

POST/channel/api/v1/dispatch/list

Auth: request-token (channel_partner)

Page through the current channel partner's dispatch tasks, filtered by warehouse, status, batch and keyword. Results are ordered by creation time descending.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
pageNumberintegernoPage number starting at 1; defaults to 1
pageintegernoAlias of pageNumber; pageNumber wins when both are present
pageSizeintegernoPage size, default 20, clamped to 1–100
warehouse_idintegernoFilter by warehouse
statusstringnoFilter by task status; see "Task status and locking"
batch_idintegernoFilter by dispatch batch
keywordstringnoKeyword; matches task ID (numeric), tracking number, self-arranged carrier name, batch number, warehouse name, pickup code, and item SKU ID / SKU code / EAN / original SKU / shop SKU

Notes:

  • Pickup-code and SKU matches use subqueries; a task is returned when any condition matches.
  • meta in the response is the raw JSON string and is not decoded.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "data": [
      {
        "id": 3001,
        "outbound_id": 5001,
        "schedule_id": 0,
        "batch_id": 88,
        "warehouse_id": 1,
        "carrier_id": 12,
        "carrier_name_self": null,
        "address_id": 3001,
        "delivery_mode": "e2c_carrier",
        "tracking_number": null,
        "status": "draft",
        "progress": 0,
        "member_id": 42,
        "staff_id": null,
        "remark": "outbound #5001",
        "meta": "{\"outbound_id\":5001}",
        "scheduled_date": "2026-11-12",
        "pickup_start_time": "09:00:00",
        "pickup_end_time": "11:00:00",
        "schedule_note": "Call before arrival",
        "scheduled_at": "2026-11-11 10:00:00",
        "created_at": "2026-11-11 10:00:00",
        "updated_at": "2026-11-11 10:00:00"
      }
    ],
    "total": 1,
    "per_page": 20,
    "current_page": 1
  }
}
FieldTypeDescription
data[]arrayTask rows with all t_dispatch_task columns
totalintegerTotal number of rows
per_pageintegerEffective page size
current_pageintegerCurrent page number

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/list' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "pageNumber": 1,
  "pageSize": 20,
  "status": "draft",
  "keyword": "SKU-789"
}'

Dispatch & Pickup Task Detail ​

POST/channel/api/v1/dispatch/detail

Auth: request-token (channel_partner)

Return a single dispatch task with items, attachments, batch, carrier, outbound evidence and pickup code. Only tasks owned by the current channel partner are readable.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
idintegeryesDispatch task ID

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 3001,
    "outbound_id": 5001,
    "schedule_id": 0,
    "batch_id": 88,
    "warehouse_id": 1,
    "carrier_id": 12,
    "carrier_name_self": null,
    "address_id": 3001,
    "delivery_mode": "e2c_carrier",
    "tracking_number": null,
    "status": "draft",
    "progress": 0,
    "member_id": 42,
    "staff_id": null,
    "remark": "outbound #5001",
    "meta": "{\"outbound_id\":5001}",
    "scheduled_date": "2026-11-12",
    "pickup_start_time": "09:00:00",
    "pickup_end_time": "11:00:00",
    "schedule_note": "Call before arrival",
    "scheduled_at": "2026-11-11 10:00:00",
    "created_at": "2026-11-11 10:00:00",
    "updated_at": "2026-11-11 10:00:00",
    "items": [
      {
        "id": 7001,
        "dispatch_task_id": 3001,
        "sku_id": 789,
        "quantity": 10,
        "deducted_quantity": 10,
        "tray_id": null,
        "cost_log_id": null,
        "status": 1,
        "remark": null,
        "created_at": "2026-11-11 10:00:00",
        "updated_at": "2026-11-11 10:00:00",
        "sku_code": "SKU-789",
        "product_title": "Portable Power Station 500W"
      }
    ],
    "attachments": [
      {
        "id": 9001,
        "dispatch_task_id": 3001,
        "attach_level": "task",
        "level_key": "",
        "code": "packing_list",
        "name": "packing-list.pdf",
        "spec": null,
        "url": "https://cdn.example.com/e2c/tmp/packing-list.pdf",
        "print_enabled": 1,
        "print_copies": 1,
        "print_types": "[\"print\"]",
        "sort_order": 0,
        "status": 1,
        "created_at": "2026-11-11 10:00:00",
        "updated_at": "2026-11-11 10:00:00"
      }
    ],
    "batch": {
      "id": 88,
      "batch_no": "B-20261111-WH01-001",
      "warehouse_id": 1,
      "status": "open",
      "created_at": "2026-11-11 00:00:00",
      "updated_at": "2026-11-11 00:00:00"
    },
    "carrier": null,
    "evidence": [],
    "pickup_code": null
  }
}

Notes:

  • items[] contains active items only (status = 1) and adds sku_code and product_title.
  • attachments[] are task-level attachments (t_dispatch_attachment, status = 1).
  • batch is returned only when batch_id is set; carrier only when carrier_id is set.
  • evidence comes from the linked outbound order (outbound_id); it is an empty array when outbound_id is empty.
  • pickup_code matches batch_id + carrier_id with status generated / scanned; null when no code exists.
  • meta is the raw JSON string and is not decoded.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Missing or non-positive id
404Task not found or not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/detail' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 3001
}'

List Pickup Codes ​

POST/channel/api/v1/dispatch/pickup-codes

Auth: request-token (channel_partner)

List pickup codes for all batches that contain the current channel partner's dispatch tasks, newest first. Used by the partner to relay the pickup PIN to the carrier.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
statusstringnoFilter by status: generated / scanned / expired; returns all when omitted

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "data": [
      {
        "id": 6001,
        "batch_id": 88,
        "carrier_id": 12,
        "carrier_code": "DHL",
        "carrier_name": "DHL Express",
        "stack_no": "BATCH88",
        "delivery_mode": "e2c_carrier",
        "wave": 1,
        "code": "483920",
        "status": "generated",
        "attempts": 0,
        "expires_at": "2026-11-12 10:00:00",
        "scanned_at": null,
        "scanned_by": null,
        "scanned_ip": null,
        "scanned_device": null,
        "created_at": "2026-11-11 10:00:00",
        "updated_at": "2026-11-11 10:00:00"
      }
    ]
  }
}

Notes:

  • Returns raw t_pickup_code rows with no pagination.
  • code is a 6-digit PIN; expires_at is the generation time plus 24 hours.
  • A new wave is generated for the same batch/carrier after the previous code is scanned or expires.
  • This endpoint is read-only; codes only change status when generated or scanned.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/pickup-codes' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "generated"
}'

Update Dispatch Task ​

POST/channel/api/v1/dispatch/update

Auth: request-token (channel_partner)

Update the carrier and tracking information of a dispatch task. Only draft / confirmed tasks can be updated; the task is locked after warehouse confirmation.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
idintegeryesDispatch task ID
carrier_idintegernoCarrier authorization ID; an empty string is stored as null
carrier_name_selfstringnoSelf-arranged carrier name; an empty string is stored as null
tracking_numberstringnoTracking number; an empty string is stored as null

Notes:

  • Only fields present in the body are updated; providing none returns 400 (nothing to update).
  • This endpoint does not validate that the carrier fields match delivery_mode.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 3001
  }
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Missing id, status locked (not draft / confirmed), or no updatable field
404Task not found or not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/update' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 3001,
  "carrier_id": 12,
  "tracking_number": "1Z999AA10123456784"
}'

Schedule Dispatch Tasks ​

POST/channel/api/v1/dispatch/schedule

Auth: request-token (channel_partner)

Set the pickup date and time window on one or more existing dispatch tasks. The endpoint automatically creates or reuses a pickup schedule (dispatch_schedule) and writes the schedule ID back to the tasks. Every task must belong to the current channel partner and be in draft or confirmed status.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
idsinteger[]yes*Dispatch task IDs; an empty array is rejected
idintegeryes*Single task ID, used when ids is absent
scheduled_datestringyesPickup date, YYYY-MM-DD; past dates are currently not rejected
pickup_start_timestringnoPickup start time, HH:MM
pickup_end_timestringnoPickup end time, HH:MM, not before the start time
notestringnoSchedule note
carrier_idintegernoCarrier authorization ID; synced to the schedule and tasks when provided
carrier_name_selfstringnoCarrier name; synced to the schedule and tasks when provided
tracking_numberstringnoTracking number; applied only to the selected tasks

* Provide at least one of ids and id; invalid entries in ids are filtered out.

Notes:

  • If any task ID does not exist or is not owned by the partner, the whole request fails with 404 and nothing is updated.
  • Time validation: the format must be HH:MM, and pickup_start_time must not be later than pickup_end_time.
  • Schedule resolution:
    • All selected tasks have no schedule: after validating that they share one warehouse, a new schedule is created and schedule_id is written back to the tasks.
    • All selected tasks belong to the same schedule: that schedule is reused, and the new date/time/note is synced to every task in the schedule.
    • Selected tasks span multiple schedules, or mix scheduled and unscheduled tasks: 400 tasks belong to different schedules.
    • Unscheduled tasks span multiple warehouses: 400 all tasks in one schedule must share the same warehouse.
  • The update overwrites the schedule fields: omitted start/end times and note become null.
  • tracking_number only updates the selected tasks and does not overwrite the other tasks in the same schedule.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "schedule_id": 4001,
    "updated": 2,
    "scheduled_date": "2026-11-12"
  }
}

updated is the number of tasks synced in the schedule (including tasks in the same schedule that were not selected this time).

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Empty ids, missing/malformed scheduled_date, time not HH:MM, start later than end, locked task/schedule, multiple schedules, or unscheduled tasks across warehouses
404A task or schedule does not exist or is not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    3001,
    3002
  ],
  "scheduled_date": "2026-11-12",
  "pickup_start_time": "09:00",
  "pickup_end_time": "11:00",
  "note": "Call before arrival"
}'

Eligible Outbound Orders ​

POST/channel/api/v1/dispatch/eligible-outbounds

Auth: request-token (channel_partner)

List the current channel partner's outbound orders that are stock ready (stock_ready) and not yet linked to a dispatch task, for task creation.

Required capability: outbound_submit

Request Body ​

No request parameters.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "id": 5001,
      "outbound_no": "OB20261111001",
      "warehouse_id": 1,
      "source_type": "partner_outbound",
      "source_id": 1001,
      "stock_ready_at": "2026-11-11 09:00:00",
      "warehouse_name": "Hamburg Warehouse",
      "item_count": 3
    }
  ]
}

Notes:

  • Returns only orders with owner_type = member, owner_id set to the current partner, status stock_ready, and empty or 0 dispatch_task_id.
  • item_count is the number of active outbound items (status = 1).
  • Results are ordered by id descending.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/eligible-outbounds' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

Create Dispatch Task ​

POST/channel/api/v1/dispatch/create

Auth: request-token (channel_partner)

Create a dispatch task for a stock-ready outbound order and store the pickup date and time window. The task starts in draft status.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
outbound_idintegeryesOutbound order ID; must belong to the current partner and be stock_ready
scheduled_datestringyesPickup date, YYYY-MM-DD
pickup_start_timestringnoPickup start time, expected HH:MM (not validated by this endpoint)
pickup_end_timestringnoPickup end time, expected HH:MM (not validated by this endpoint)
notestringnoSchedule note, stored as the task's schedule_note

Notes:

  • Returns 404 when the outbound order does not exist or is not owned by the partner; returns 400 when its status is not stock_ready.
  • Idempotent: when the order already has a dispatch task (its dispatch_task_id is set), the existing task ID is returned with existing: true and nothing is created. This path returns before scheduled_date is validated, so scheduled_date is not checked when it is hit.
  • The task joins the warehouse's open batch for the day (a new batch is created when missing), and items are copied from the outbound order.
  • This endpoint does not validate time format or ordering, nor whether scheduled_date is in the past; call /dispatch/schedule afterwards when strict validation is required.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 3001,
    "existing": false
  }
}
FieldTypeDescription
idintegerDispatch task ID
existingbooleantrue when the order already had a task and nothing was created

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Missing outbound_id, missing or malformed scheduled_date, order not stock_ready, or creation failed
404Outbound order not found or not owned by this partner
500Unexpected failure while creating the task

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/create' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "outbound_id": 5001,
  "scheduled_date": "2026-11-12",
  "pickup_start_time": "09:00",
  "pickup_end_time": "11:00",
  "note": "Call before arrival"
}'

Unscheduled Outbound Orders ​

POST/channel/api/v1/dispatch/unscheduled

Auth: request-token (channel_partner)

List the current partner's stock-ready outbound orders that have no dispatch task yet, grouped by carrier, for the bulk scheduling screen.

Required capability: outbound_submit

Request Body ​

No request parameters.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "carrier_id": 12,
      "carrier_name": "DHL Express",
      "outbounds": [
        {
          "id": 5001,
          "outbound_no": "OB20261111001",
          "warehouse_id": 1,
          "warehouse_name": "Hamburg Warehouse",
          "delivery_mode": "e2c_carrier"
        }
      ]
    }
  ]
}

Notes:

  • The carrier comes from the linked outbound request (carrier_id / carrier_name_self), then falls back to the outbound order's meta.carrier_name_self, then to SELF.
  • The grouping key is carrier_id when set, otherwise the carrier name, so self-arranged orders with the same name share a group.
  • Only orders with owner_type = member, owner_id set to the current partner, status stock_ready, and empty or 0 dispatch_task_id are included.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/unscheduled' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

List Schedules ​

POST/channel/api/v1/dispatch/schedules

Auth: request-token (channel_partner)

List the current channel partner's pickup schedules, newest first, with the count of non-cancelled tasks.

Required capability: outbound_submit

Request Body ​

No request parameters.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "id": 4001,
      "schedule_no": "DS20261111100000123",
      "member_id": 42,
      "warehouse_id": 1,
      "carrier_id": 12,
      "carrier_name": "DHL Express",
      "scheduled_date": "2026-11-12",
      "pickup_start_time": "09:00:00",
      "pickup_end_time": "11:00:00",
      "note": "Call before arrival",
      "status": "draft",
      "created_at": "2026-11-11 10:00:00",
      "updated_at": "2026-11-11 10:00:00",
      "task_count": 2
    }
  ]
}

Notes:

  • task_count counts tasks in the schedule whose status is not cancelled.
  • Schedule statuses: draft / confirmed / warehouse_confirmed / completed / cancelled.
  • No pagination.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedules' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

Schedule Detail ​

POST/channel/api/v1/dispatch/schedule/detail

Auth: request-token (channel_partner)

Return a single schedule with its tasks and attachments. Only schedules owned by the current channel partner are readable.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
idintegeryesSchedule ID

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 4001,
    "schedule_no": "DS20261111100000123",
    "member_id": 42,
    "warehouse_id": 1,
    "carrier_id": 12,
    "carrier_name": "DHL Express",
    "scheduled_date": "2026-11-12",
    "pickup_start_time": "09:00:00",
    "pickup_end_time": "11:00:00",
    "note": "Call before arrival",
    "status": "draft",
    "created_at": "2026-11-11 10:00:00",
    "updated_at": "2026-11-11 10:00:00",
    "tasks": [
      {
        "id": 3001,
        "outbound_id": 5001,
        "status": "draft",
        "tracking_number": null,
        "carrier_name_self": "DHL Express",
        "warehouse_id": 1,
        "outbound_no": "OB20261111001",
        "warehouse_name": "Hamburg Warehouse"
      }
    ],
    "attachments": [
      {
        "id": 9101,
        "schedule_id": 4001,
        "name": "picking-list.pdf",
        "file_url": "https://cdn.example.com/e2c/tmp/picking-list.pdf",
        "file_type": "pdf",
        "file_size": 204800,
        "print_enabled": 1,
        "print_copies": 1,
        "uploaded_by_type": "partner",
        "uploaded_by_id": 42,
        "status": 1,
        "created_at": "2026-11-11 10:00:00",
        "updated_at": "2026-11-11 10:00:00"
      }
    ]
  }
}

Notes:

  • tasks[] is ordered by task id ascending and contains summary fields only, not task items.
  • attachments[] contains active attachments only (status = 1).
  • A missing id is treated as 0 and returns 404.

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
404Schedule not found or not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/detail' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 4001
}'

Create Schedule ​

POST/channel/api/v1/dispatch/schedule/create

Auth: request-token (channel_partner)

Group outbound orders into a single pickup schedule and create their dispatch tasks. The schedule starts in draft status.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
outbound_idsinteger[]yesOutbound order IDs; must not be empty
scheduled_datestringyesPickup date, YYYY-MM-DD
carrier_idintegerno*Carrier authorization ID; must exist when provided
carrier_namestringno*Carrier name; required when carrier_id is absent
pickup_start_timestringnoPickup start time, HH:MM
pickup_end_timestringnoPickup end time, HH:MM
notestringnoSchedule note
tracking_numberstringnoTracking number copied to the newly created tasks

* Provide at least one of carrier_id and carrier_name. When carrier_id is provided, the carrier name is taken from the authorize table.

Notes:

  • Every outbound order must belong to the current partner and be stock_ready, otherwise 400 (some outbound orders are not schedulable).
  • Same-warehouse constraint: all outbound orders in one schedule must share the same warehouse, otherwise 400 (all tasks in one schedule must share the same warehouse).
  • Any order that already has a dispatch task returns 400 (outbound order already has a dispatch task).
  • The schedule number format is DS{YYYYMMDDHHmmss}{3 random digits}.
  • This endpoint does not validate whether scheduled_date is in the past, nor the pickup time format.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 4001,
    "schedule_no": "DS20261111100000123"
  }
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Empty outbound_ids, missing or malformed scheduled_date, missing carrier, unschedulable order, mixed warehouses, or order already dispatched
404The carrier behind carrier_id does not exist
500Failed to create the schedule

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/create' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "outbound_ids": [
    5001,
    5002
  ],
  "scheduled_date": "2026-11-12",
  "carrier_id": 12,
  "pickup_start_time": "09:00",
  "pickup_end_time": "11:00",
  "note": "Call before arrival"
}'

Add Tasks to Schedule ​

POST/channel/api/v1/dispatch/schedule/add-tasks

Auth: request-token (channel_partner)

Add extra outbound orders to an existing schedule, inheriting its carrier, date and time window.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
schedule_idintegeryesSchedule ID
outbound_idsinteger[]noOutbound order IDs; when missing or empty, nothing is done and the call still succeeds

Notes:

  • The schedule must belong to the current partner and be in draft or confirmed status, otherwise 400.
  • When outbound_ids is missing or an empty array, the loop does not run, nothing is changed, and the endpoint returns 200.
  • Outbound orders that do not exist, are not owned by the partner, are not stock_ready, or already have a dispatch task are silently skipped.
  • This endpoint does not validate that the added outbound orders belong to the same warehouse as the schedule; the caller must enforce the same-warehouse rule.
  • The response does not report how many tasks were actually added.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "schedule_id": 4001
  }
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Schedule status locked (not draft / confirmed)
404Schedule not found or not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/add-tasks' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "schedule_id": 4001,
  "outbound_ids": [
    5003
  ]
}'

Remove Task from Schedule ​

POST/channel/api/v1/dispatch/schedule/remove-task

Auth: request-token (channel_partner)

Remove a dispatch task from a schedule and unlink the outbound order from the task and batch.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
schedule_idintegeryesSchedule ID
task_idintegeryesDispatch task ID

Notes:

  • The schedule must belong to the current partner and be draft / confirmed, otherwise 400.
  • The task must belong to that schedule and to the current partner, otherwise 404.
  • The task status must be draft / confirmed, otherwise 400.
  • On success the task and its items are deleted, and the outbound order's dispatch_task_id and dispatch_batch_id are cleared so it can be dispatched again.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "removed": 1
  }
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Schedule or task status locked
404Schedule not found, task not found, or not owned by this partner / schedule

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/remove-task' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "schedule_id": 4001,
  "task_id": 3001
}'

Upload Schedule Attachment ​

POST/channel/api/v1/dispatch/schedule/attachment/upload

Auth: request-token (channel_partner)

Upload a schedule-level attachment (for example a picking list) as Base64. The attachment belongs to the current partner and its uploader type is always partner.

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
schedule_idintegeryesSchedule ID
namestringyesFile name; the extension determines file_type
base64stringyesBase64 content, data:*;base64, prefix accepted
file_sizeintegernoFile size in bytes, default 0
print_enabledbooleannoWhether to enqueue printing, default false
print_copiesintegernoPrint copies, minimum 1, default 1

Notes:

  • The schedule must belong to the current partner, otherwise 404.
  • Upload does not check the schedule status; attachments can be added after draft.
  • Returns 500 when the storage service fails or the record cannot be saved.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 9101,
    "file_url": "https://cdn.example.com/e2c/tmp/picking-list.pdf"
  }
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
400Missing schedule_id, name or base64
404Schedule not found or not owned by this partner
500File upload or persistence failed

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/attachment/upload' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "schedule_id": 4001,
  "name": "picking-list.pdf",
  "base64": "JVBERi0xLjQK...",
  "print_enabled": true,
  "print_copies": 1
}'

Delete Schedule Attachment ​

POST/channel/api/v1/dispatch/schedule/attachment/delete

Auth: request-token (channel_partner)

Soft delete a schedule attachment (status set to 0).

Required capability: outbound_submit

Request Body ​

FieldTypeRequiredDescription
schedule_idintegeryesSchedule ID
attachment_idintegeryesAttachment ID

Notes:

  • The schedule must belong to the current partner, otherwise 404.
  • The endpoint does not check whether the attachment exists, has already been deleted, or belongs to the schedule, and never fails because of it.
  • The UPDATE is scoped by id + schedule_id; rows that do not match are left untouched and the endpoint still returns 200 (idempotent).
  • Schedule status is not checked.

Response ​

json
{
  "code": 200,
  "msg": "success",
  "data": null
}

Error Codes ​

codeMeaning
909Unauthenticated, invalid token, or not a channel partner
606Insufficient capability (outbound_submit required)
404Schedule not found or not owned by this partner

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/dispatch/schedule/attachment/delete' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "schedule_id": 4001,
  "attachment_id": 9101
}'