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
| Header | Required | Description |
|---|---|---|
request-token | yes | Channel partner app token |
Content-Type | yes | application/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
| Status | Meaning |
|---|---|
draft | Draft; the partner can edit and schedule |
confirmed | Confirmed; warehouse has not confirmed yet, the partner can still edit the schedule |
warehouse_confirmed | Warehouse confirmed; the partner can no longer modify |
pickup_code_generated | Pickup code generated |
picked_up | Picked up |
completed | Completed |
cancel_requested | Cancellation requested |
cancelled | Cancelled |
/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_dateusesYYYY-MM-DDand is required by/dispatch/create,/dispatch/scheduleand/dispatch/schedule/create.- Pickup time formats are asymmetric: responses return
HH:MM:SS(databasetimecolumns), while submissions only acceptHH:MM;/dispatch/scheduleenforces the format and requires the start to be no later than the end./dispatch/createand/dispatch/schedule/createonly trim the value and do not validate format or ordering, but callers should still sendHH:MM. /dispatch/schedule,/dispatch/createand/dispatch/schedule/createdo 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/schedulewhen 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 becomesscanned; after expiry it becomesexpired. - Partners can only read pickup codes through this page; generation and redemption happen on the warehouse side.
List Dispatch Tasks
/channel/api/v1/dispatch/listAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
pageNumber | integer | no | Page number starting at 1; defaults to 1 |
page | integer | no | Alias of pageNumber; pageNumber wins when both are present |
pageSize | integer | no | Page size, default 20, clamped to 1–100 |
warehouse_id | integer | no | Filter by warehouse |
status | string | no | Filter by task status; see "Task status and locking" |
batch_id | integer | no | Filter by dispatch batch |
keyword | string | no | Keyword; 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.
metain the response is the raw JSON string and is not decoded.
Response
{
"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
}
}| Field | Type | Description |
|---|---|---|
data[] | array | Task rows with all t_dispatch_task columns |
total | integer | Total number of rows |
per_page | integer | Effective page size |
current_page | integer | Current page number |
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
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
/channel/api/v1/dispatch/detailAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Dispatch task ID |
Response
{
"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 addssku_codeandproduct_title.attachments[]are task-level attachments (t_dispatch_attachment,status = 1).batchis returned only whenbatch_idis set;carrieronly whencarrier_idis set.evidencecomes from the linked outbound order (outbound_id); it is an empty array whenoutbound_idis empty.pickup_codematchesbatch_id + carrier_idwith statusgenerated/scanned;nullwhen no code exists.metais the raw JSON string and is not decoded.
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Missing or non-positive id |
| 404 | Task not found or not owned by this partner |
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
/channel/api/v1/dispatch/pickup-codesAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
status | string | no | Filter by status: generated / scanned / expired; returns all when omitted |
Response
{
"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_coderows with no pagination. codeis a 6-digit PIN;expires_atis the generation time plus 24 hours.- A new
waveis 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
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
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
/channel/api/v1/dispatch/updateAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Dispatch task ID |
carrier_id | integer | no | Carrier authorization ID; an empty string is stored as null |
carrier_name_self | string | no | Self-arranged carrier name; an empty string is stored as null |
tracking_number | string | no | Tracking 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
{
"code": 200,
"msg": "success",
"data": {
"id": 3001
}
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Missing id, status locked (not draft / confirmed), or no updatable field |
| 404 | Task not found or not owned by this partner |
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
/channel/api/v1/dispatch/scheduleAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
ids | integer[] | yes* | Dispatch task IDs; an empty array is rejected |
id | integer | yes* | Single task ID, used when ids is absent |
scheduled_date | string | yes | Pickup date, YYYY-MM-DD; past dates are currently not rejected |
pickup_start_time | string | no | Pickup start time, HH:MM |
pickup_end_time | string | no | Pickup end time, HH:MM, not before the start time |
note | string | no | Schedule note |
carrier_id | integer | no | Carrier authorization ID; synced to the schedule and tasks when provided |
carrier_name_self | string | no | Carrier name; synced to the schedule and tasks when provided |
tracking_number | string | no | Tracking 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, andpickup_start_timemust not be later thanpickup_end_time. - Schedule resolution:
- All selected tasks have no schedule: after validating that they share one warehouse, a new schedule is created and
schedule_idis 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.
- All selected tasks have no schedule: after validating that they share one warehouse, a new schedule is created and
- The update overwrites the schedule fields: omitted start/end times and note become
null. tracking_numberonly updates the selected tasks and does not overwrite the other tasks in the same schedule.
Response
{
"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
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Empty ids, missing/malformed scheduled_date, time not HH:MM, start later than end, locked task/schedule, multiple schedules, or unscheduled tasks across warehouses |
| 404 | A task or schedule does not exist or is not owned by this partner |
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
/channel/api/v1/dispatch/eligible-outboundsAuth: 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
{
"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_idset to the current partner, statusstock_ready, and empty or0dispatch_task_id. item_countis the number of active outbound items (status = 1).- Results are ordered by
iddescending.
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
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
/channel/api/v1/dispatch/createAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
outbound_id | integer | yes | Outbound order ID; must belong to the current partner and be stock_ready |
scheduled_date | string | yes | Pickup date, YYYY-MM-DD |
pickup_start_time | string | no | Pickup start time, expected HH:MM (not validated by this endpoint) |
pickup_end_time | string | no | Pickup end time, expected HH:MM (not validated by this endpoint) |
note | string | no | Schedule 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_idis set), the existing task ID is returned withexisting: trueand nothing is created. This path returns beforescheduled_dateis validated, soscheduled_dateis 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_dateis in the past; call/dispatch/scheduleafterwards when strict validation is required.
Response
{
"code": 200,
"msg": "success",
"data": {
"id": 3001,
"existing": false
}
}| Field | Type | Description |
|---|---|---|
id | integer | Dispatch task ID |
existing | boolean | true when the order already had a task and nothing was created |
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Missing outbound_id, missing or malformed scheduled_date, order not stock_ready, or creation failed |
| 404 | Outbound order not found or not owned by this partner |
| 500 | Unexpected failure while creating the task |
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
/channel/api/v1/dispatch/unscheduledAuth: 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
{
"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'smeta.carrier_name_self, then toSELF. - The grouping key is
carrier_idwhen set, otherwise the carrier name, so self-arranged orders with the same name share a group. - Only orders with
owner_type = member,owner_idset to the current partner, statusstock_ready, and empty or0dispatch_task_idare included.
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
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
/channel/api/v1/dispatch/schedulesAuth: 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
{
"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_countcounts tasks in the schedule whose status is notcancelled.- Schedule statuses:
draft/confirmed/warehouse_confirmed/completed/cancelled. - No pagination.
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
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
/channel/api/v1/dispatch/schedule/detailAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Schedule ID |
Response
{
"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 taskidascending and contains summary fields only, not task items.attachments[]contains active attachments only (status = 1).- A missing
idis treated as0and returns 404.
Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 404 | Schedule not found or not owned by this partner |
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
/channel/api/v1/dispatch/schedule/createAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
outbound_ids | integer[] | yes | Outbound order IDs; must not be empty |
scheduled_date | string | yes | Pickup date, YYYY-MM-DD |
carrier_id | integer | no* | Carrier authorization ID; must exist when provided |
carrier_name | string | no* | Carrier name; required when carrier_id is absent |
pickup_start_time | string | no | Pickup start time, HH:MM |
pickup_end_time | string | no | Pickup end time, HH:MM |
note | string | no | Schedule note |
tracking_number | string | no | Tracking 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_dateis in the past, nor the pickup time format.
Response
{
"code": 200,
"msg": "success",
"data": {
"id": 4001,
"schedule_no": "DS20261111100000123"
}
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Empty outbound_ids, missing or malformed scheduled_date, missing carrier, unschedulable order, mixed warehouses, or order already dispatched |
| 404 | The carrier behind carrier_id does not exist |
| 500 | Failed to create the schedule |
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
/channel/api/v1/dispatch/schedule/add-tasksAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
schedule_id | integer | yes | Schedule ID |
outbound_ids | integer[] | no | Outbound 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
draftorconfirmedstatus, otherwise 400. - When
outbound_idsis 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
{
"code": 200,
"msg": "success",
"data": {
"schedule_id": 4001
}
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Schedule status locked (not draft / confirmed) |
| 404 | Schedule not found or not owned by this partner |
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
/channel/api/v1/dispatch/schedule/remove-taskAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
schedule_id | integer | yes | Schedule ID |
task_id | integer | yes | Dispatch 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_idanddispatch_batch_idare cleared so it can be dispatched again.
Response
{
"code": 200,
"msg": "success",
"data": {
"removed": 1
}
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Schedule or task status locked |
| 404 | Schedule not found, task not found, or not owned by this partner / schedule |
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
/channel/api/v1/dispatch/schedule/attachment/uploadAuth: 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
| Field | Type | Required | Description |
|---|---|---|---|
schedule_id | integer | yes | Schedule ID |
name | string | yes | File name; the extension determines file_type |
base64 | string | yes | Base64 content, data:*;base64, prefix accepted |
file_size | integer | no | File size in bytes, default 0 |
print_enabled | boolean | no | Whether to enqueue printing, default false |
print_copies | integer | no | Print 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
{
"code": 200,
"msg": "success",
"data": {
"id": 9101,
"file_url": "https://cdn.example.com/e2c/tmp/picking-list.pdf"
}
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 400 | Missing schedule_id, name or base64 |
| 404 | Schedule not found or not owned by this partner |
| 500 | File upload or persistence failed |
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
/channel/api/v1/dispatch/schedule/attachment/deleteAuth: request-token (channel_partner)
Soft delete a schedule attachment (status set to 0).
Required capability: outbound_submit
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
schedule_id | integer | yes | Schedule ID |
attachment_id | integer | yes | Attachment 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
UPDATEis scoped byid + schedule_id; rows that do not match are left untouched and the endpoint still returns 200 (idempotent). - Schedule status is not checked.
Response
{
"code": 200,
"msg": "success",
"data": null
}Error Codes
| code | Meaning |
|---|---|
| 909 | Unauthenticated, invalid token, or not a channel partner |
| 606 | Insufficient capability (outbound_submit required) |
| 404 | Schedule not found or not owned by this partner |
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
}'