{"openapi":"3.0.0","paths":{"/v1/notifications/unread-count":{"get":{"operationId":"NotificationsController_unreadCount","parameters":[],"responses":{"200":{"description":""}},"summary":"Unread notification count","tags":["notifications"]}},"/v1/notifications":{"get":{"operationId":"NotificationsController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"properties":{"notifications":{"type":"array","items":{"type":"object"}}}}}}}},"summary":"List recent merchant notifications","tags":["notifications"]}},"/v1/notifications/read-all":{"post":{"operationId":"NotificationsController_readAll","parameters":[],"responses":{"200":{"description":""}},"summary":"Mark all notifications read","tags":["notifications"]}},"/v1/drafts":{"get":{"operationId":"DraftsController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"example":"needs_review","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftListResponseDto"}}}}},"summary":"List draft orders","tags":["drafts"]}},"/v1/drafts/{id}":{"get":{"operationId":"DraftsController_one","parameters":[{"name":"id","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOneResponseDto"}}}}},"summary":"Get one draft","tags":["drafts"]}},"/v1/drafts/{id}/dispatch":{"post":{"operationId":"DraftsController_dispatch","parameters":[{"name":"id","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchResultDto"}}}}},"summary":"Human-approved courier dispatch","tags":["drafts"]}},"/v1/orders":{"get":{"operationId":"OrdersController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"invoice","required":false,"in":"query","schema":{"type":"string"}},{"name":"invoices","required":false,"in":"query","description":"Comma-separated invoices","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListResponseDto"}}}}},"summary":"List consignments","tags":["orders"]}},"/v1/orders/{id}/sync-courier":{"get":{"operationId":"OrdersController_syncCourier","parameters":[{"name":"id","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncCourierResponseDto"}}}}},"summary":"Manual courier status sync (15m cooldown)","tags":["orders"]}},"/v1/orders/{id}/events":{"get":{"operationId":"OrdersController_events","parameters":[{"name":"id","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEventsResponseDto"}}}}},"summary":"Append-only status events for one order","tags":["orders"]}}},"info":{"title":"CourierBD API","description":"OpenAPI 3.0 for merchant drafts and orders. Desk session today; partner API keys are a later gate.","version":"1.0","contact":{}},"tags":[],"servers":[{"url":"https://api.courierbd.com","description":"Production API"},{"url":"https://docs.courierbd.com","description":"Developer portal"},{"url":"http://localhost:4000","description":"Development"}],"components":{"schemas":{"DraftListResponseDto":{"type":"object","properties":{"drafts":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["drafts"]},"DraftOneResponseDto":{"type":"object","properties":{"draft":{"type":"object","additionalProperties":true}},"required":["draft"]},"DispatchItemDto":{"type":"object","properties":{"productName":{"type":"string","example":"StyleHub Kurti"},"quantity":{"type":"number","example":1,"minimum":1},"unitPrice":{"type":"number","example":1450}},"required":["productName","quantity","unitPrice"]},"DispatchRequestDto":{"type":"object","properties":{"draftId":{"type":"string","format":"uuid"},"customerName":{"type":"string","example":"Rafi Ahmed"},"customerPhone":{"type":"string","example":"01712345678"},"customerAddress":{"type":"string","example":"House 12, Road 4, Dhanmondi"},"city":{"type":"string","example":"Dhaka"},"codAmount":{"type":"number","example":1450},"items":{"type":"array","items":{"$ref":"#/components/schemas/DispatchItemDto"}},"note":{"type":"string"},"courierAccountId":{"type":"string","format":"uuid"},"allowDuplicate":{"type":"boolean"}},"required":["draftId","customerName","customerPhone","customerAddress","codAmount","items","courierAccountId"]},"DispatchResultDto":{"type":"object","properties":{"trackingCode":{"type":"string"},"invoice":{"type":"string"},"consignmentId":{"type":"string"}},"required":["trackingCode","invoice","consignmentId"]},"OrderListResponseDto":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["orders"]},"SyncCourierResponseDto":{"type":"object","properties":{"status":{"type":"string"},"syncedAt":{"type":"string"}},"required":["status","syncedAt"]},"OrderEventsResponseDto":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["events"]}}}}