Skip to main content

G2G Transfer Manifest Items — Bulk Scan

6 API calls in this section.

Search Manifest Items

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
GET/delivery/transfer-manifest-items/search?q=BC-001&limit=20

Tenant-wide manifest item search for autocomplete / barcode scanner input. Returns only actionable post-pickup items with status picked_up, in_transit, received, or processing and no existing delivery_id. Excludes scanned, order_created, and void items. Returns enriched rows including manifest context (manifest_number, manifest_status), institution user, and source branch.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/transfer-manifest-items/search?q=BC-001&limit=20" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

qOptional
query string

BC-001

Search term. If a valid UUID, performs an exact id match. Otherwise, performs a case-insensitive partial match on barcode_value. Leave empty to list recent items.

limitOptional
query string

20

Max results to return. Range 1–100. Default 20.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success200OK
Response body
json
1{2  "success": true,3  "message": "Data retrieved successfully",4  "data": [5    {6      "manifest_item_id": "item-uuid",7      "barcode_value": "BC-001",8      "status": "received",9      "manifest_id": "manifest-uuid",10      "manifest_number": "MF-2026-0042",11      "manifest_status": "received",12      "institution": {13        "id": "user-uuid",14        "full_name": "City Hospital",15        "phone": "+9647001234567"16      },17      "source_branch": {18        "id": "branch-uuid",19        "name": "Main Branch",20        "code": "MB-01"21      },22      "destination_branch_id": null,23      "destination_address_id": null,24      "delivery_id": null,25      "already_has_order": false26    }27  ]28}

Bulk Validate — using object identifiers

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
POST/delivery/transfer-manifest-items/bulk/validate

Same as the plain-string variant but uses the { type, value } object shape. Useful when the client tracks identifier type explicitly. The type field is ignored server-side; routing (UUID vs barcode) is determined solely by the value format. Validation only accepts actionable post-pickup items with status picked_up, in_transit, received, or processing and no existing delivery_id.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/transfer-manifest-items/bulk/validate" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "identifiers": [7    {8      "type": "barcode",9      "value": "BC-001"10    },11    {12      "type": "id",13      "value": "item-uuid-003"14    }15  ]16}'
Request body
json
1{2  "identifiers": [3    {4      "type": "barcode",5      "value": "BC-001"6    },7    {8      "type": "id",9      "value": "item-uuid-003"10    }11  ]12}

Request body fields

identifiersExample
array<object>

Example field from the request body.

identifiers.typeExample
string

Example field from the request body.

identifiers.valueExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Bulk Set Destination & Create Orders

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
POST/delivery/transfer-manifest-items/bulk/set-destination

Tenant-wide bulk destination/order creation endpoint. It accepts manifest item IDs from any manifest under the tenant and creates delivery orders with institution wallet payment and payer_type=sender. COD is not used. Request Body: - item_ids — required array of manifest item UUID strings. At least 1. Duplicates are deduplicated. - delivery_service_id — Optional when G2G settings has default_delivery_service_id; otherwise required. If provided, it must belong to the tenant and be active. - One of: - destination_branch_id — UUID of an active institution branch. The branch configured address_id is used as the delivery destination. - destination_address_id — UUID of an address record directly. Eligible items: - status in (picked_up, in_transit, received, processing) - delivery_id is null - Excludes scanned, order_created, void, and any item that already has an order. Processing logic: 1. Resolves destination address and delivery service. 2. Loads only the manifest and item fields required for order promotion. 3. Creates delivery orders with bounded parallel processing. 4. Finalizes all successful promotions in one database operation: links deliveries, items, and barcodes; recalculates order counts; and updates each affected manifest state and bulk event once. 5. If no eligible rows are found, returns no_ready_items. Response shape: { created_count, failed_count, created, failed }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/transfer-manifest-items/bulk/set-destination" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "item_ids": [7    "{{item_id}}"8  ],9  "destination_address_id": "{{destination_address_id}}",10  "delivery_service_id": "{{delivery_service_id}}",11  "destination_branch_id": "{{destination_branch_id}}"12}'
Request body
json
1{2  "item_ids": [3    "{{item_id}}"4  ],5  "destination_address_id": "{{destination_address_id}}",6  "delivery_service_id": "{{delivery_service_id}}",7  "destination_branch_id": "{{destination_branch_id}}"8}

Request body fields

item_idsExample
array<string>

Example field from the request body.

destination_address_idExample
string

Example field from the request body.

delivery_service_idExample
string

Example field from the request body.

destination_branch_idExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success — all items promoted200OK
Response body
json
1{2  "success": true,3  "message": "Orders created successfully",4  "data": {5    "created_count": 2,6    "failed_count": 0,7    "created": [8      {9        "item_id": "item-uuid-1",10        "delivery": {11          "id": "delivery-uuid",12          "delivery_code": "2501",13          "status": "pending"14        }15      },16      {17        "item_id": "item-uuid-2",18        "delivery": {19          "id": "delivery-uuid-2",20          "delivery_code": "2502",21          "status": "pending"22        }23      }24    ],25    "failed": []26  }27}
Partial — order creation failed for some updated items200OK
Response body
json
1{2  "success": false,3  "message": "Bulk manifest item operation completed",4  "data": {5    "created_count": 1,6    "failed_count": 1,7    "created": [8      {9        "item_id": "item-uuid-1",10        "delivery": {11          "id": "delivery-uuid",12          "delivery_code": "2501",13          "status": "pending"14        }15      }16    ],17    "failed": [18      {19        "item_id": "item-uuid-2",20        "error": "order_creation_failed"21      }22    ]23  }24}
400 — destination missing400Bad Request
Response body
json
1{2  "success": false,3  "message": "Validation error",4  "details": [5    {6      "field": "destination_address_id",7      "message": "destination_address_or_branch_required"8    }9  ]10}
400 — delivery service not found400Bad Request
Response body
json
1{2  "success": false,3  "message": "Delivery service not found"4}

Bulk Set Destination — with address ID directly

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
POST/delivery/transfer-manifest-items/bulk/set-destination

Same endpoint, passing destination_address_id directly instead of destination_branch_id. delivery_service_id can be omitted when G2G settings has default_delivery_service_id configured. Only actionable post-pickup items are updated. Orders are created with institution wallet payment and payer_type=sender.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/transfer-manifest-items/bulk/set-destination" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "item_ids": [7    "item-uuid-1",8    "item-uuid-2"9  ],10  "destination_address_id": "address-uuid"11}'
Request body
json
1{2  "item_ids": [3    "item-uuid-1",4    "item-uuid-2"5  ],6  "destination_address_id": "address-uuid"7}

Request body fields

item_idsExample
array<string>

Example field from the request body.

destination_address_idExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Bulk Resolve Exceptions

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
POST/delivery/transfer-manifest-items/bulk/resolve-exceptions

Bulk resolution endpoint for dispatcher exception queues. The user can resolve selected exception item IDs from GET /delivery/transfer-manifest-exceptions, or resolve all exception items under one manifest. Selected items body: - item_ids — array of transfer manifest item UUIDs. - resolution — optional, reprocess or void. Defaults to reprocess. - notes — optional note stored on the resolved items. All exceptions under manifest body: - manifest_id — transfer manifest UUID. - all_exceptions — must be true to explicitly resolve every current exception under the manifest. - resolution — optional, reprocess or void. Defaults to reprocess. - notes — optional note stored on the resolved items. Behavior: - Only items currently in exception status are resolved. - reprocess moves item and barcode back to received, clears exception_reason, and makes the item eligible for bulk destination/order creation. - void moves item and barcode to void, terminally excluding it from order creation, and may auto-complete the manifest when all items are terminal. - Non-exception selected items are returned in skipped; missing selected IDs are returned in not_found.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/transfer-manifest-items/bulk/resolve-exceptions" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "item_ids": [7    "{{exception_item_id}}"8  ],9  "resolution": "reprocess",10  "notes": "Resolved from dispatcher exception queue"11}'
Request body
json
1{2  "item_ids": [3    "{{exception_item_id}}"4  ],5  "resolution": "reprocess",6  "notes": "Resolved from dispatcher exception queue"7}

Request body fields

item_idsExample
array<string>

Example field from the request body.

resolutionExample
string

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success — reprocess selected exceptions200OK
Response body
json
1{2  "success": true,3  "message": "Updated successfully",4  "data": {5    "resolved_count": 2,6    "resolved": [7      {8        "item_id": "item-uuid-1",9        "from_status": "exception",10        "to_status": "received"11      },12      {13        "item_id": "item-uuid-2",14        "from_status": "exception",15        "to_status": "received"16      }17    ],18    "skipped": [],19    "not_found": []20  }21}

Bulk Resolve All Exceptions Under Manifest

Delivery & Last-Mile / G2G Transfer Manifest Items — Bulk Scan
POST/delivery/transfer-manifest-items/bulk/resolve-exceptions

Resolves every current exception item under one transfer manifest. Requires all_exceptions: true so the client cannot accidentally resolve a whole manifest when it meant to send selected item IDs.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/transfer-manifest-items/bulk/resolve-exceptions" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "manifest_id": "{{manifest_id}}",7  "all_exceptions": true,8  "resolution": "void",9  "notes": "Void all unresolved exceptions under this manifest"10}'
Request body
json
1{2  "manifest_id": "{{manifest_id}}",3  "all_exceptions": true,4  "resolution": "void",5  "notes": "Void all unresolved exceptions under this manifest"6}

Request body fields

manifest_idExample
string

Example field from the request body.

all_exceptionsExample
boolean

Example field from the request body.

resolutionExample
string

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.