{"components":{"schemas":{"JobInput":{"properties":{"address":{"type":"string"},"city":{"type":"string"},"date":{"format":"date","type":"string"},"external_id":{"type":"string"},"notes":{"type":"string"},"packages":{"type":"integer"},"phone":{"type":"string"},"postal":{"example":"M5V 2T6","type":"string"},"province":{"example":"ON","type":"string"},"recipient":{"type":"string"},"unit":{"type":"string"},"window_end":{"description":"Local 24 h time, after window_start","example":"12:00","pattern":"^(([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?|24:00(:00)?)$","type":"string"},"window_start":{"example":"09:00","pattern":"^(([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?|24:00(:00)?)$","type":"string"}},"required":["date","address"],"type":"object"},"RouteInput":{"properties":{"date":{"format":"date","type":"string"},"dispatch":{"description":"Send the route to the driver app now","type":"boolean"},"driver_id":{"type":"integer"},"name":{"type":"string"},"stops":{"items":{"properties":{"address":{"type":"string"},"city":{"type":"string"},"cod_amount":{"description":"CAD to collect at the door","type":"number"},"customer":{"type":"string"},"external_id":{"type":"string"},"lat":{"type":"number"},"lon":{"description":"Send both or neither; without them our geocoder places the stop","type":"number"},"notes":{"type":"string"},"parcels":{"description":"No parcels = one numbered label","items":{"oneOf":[{"type":"string"},{"properties":{"code":{"description":"Barcode / tracking number; empty = numbered label R<route>-S<stop>-<n>","type":"string"},"description":{"description":"Item name shown to the driver, e.g. \"Queen bed - box 1/3\"","maxLength":80,"type":"string"},"flags":{"items":{"enum":["cod","cold","fragile","heavy"],"type":"string"},"type":"array"},"size":{"maxLength":30,"type":"string"},"volume_m3":{"maximum":500,"minimum":0,"type":"number"},"weight_kg":{"maximum":5000,"minimum":0,"type":"number"}},"type":"object"}]},"maxItems":999,"type":"array"},"phone":{"type":"string"},"postal":{"type":"string"},"province":{"enum":["AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"],"type":"string"},"recipient":{"type":"string"},"shipper_email":{"type":"string"},"unit":{"type":"string"},"window_end":{"description":"Local 24 h time, after window_start","example":"12:00","pattern":"^(([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?|24:00(:00)?)$","type":"string"},"window_start":{"example":"09:00","pattern":"^(([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?|24:00(:00)?)$","type":"string"}},"required":["address"],"type":"object"},"maxItems":2000,"type":"array"},"vehicle_id":{"type":"integer"}},"required":["date"],"type":"object"}},"securitySchemes":{"key":{"scheme":"bearer","type":"http"}}},"info":{"title":"DeliverPoint Company API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/addresses":{"get":{"parameters":[{"in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"problems","schema":{"enum":["1"],"type":"string"}},{"in":"query","name":"limit","schema":{"default":200,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"next_after of the previous page (opaque string)","in":"query","name":"after","schema":{"type":"string"}}],"summary":"Address book: one row per building with visits / delivered / failed (q= search, problems=1), newest visit first, in pages (follow next_after or the Link rel=\"next\" header)"}},"/addresses/{id}":{"get":{"summary":"One building: notebook (notes, access codes) + every visit across days with POD details"}},"/drivers":{"get":{"summary":"List drivers of the company"}},"/invoices":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"default":500,"maximum":500,"minimum":1,"type":"integer"}},{"description":"next_after of the previous page","in":"query","name":"after","schema":{"minimum":0,"type":"integer"}}],"summary":"Client invoices issued in the cabinet (frozen lines, taxes, stop ids), newest first, in pages"}},"/jobs":{"get":{"parameters":[{"in":"query","name":"date","schema":{"format":"date","type":"string"}},{"in":"query","name":"status","schema":{"enum":["pending","assigned","delivered","failed","canceled"],"type":"string"}},{"in":"query","name":"limit","schema":{"default":1000,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"next_after of the previous page","in":"query","name":"after","schema":{"minimum":0,"type":"integer"}}],"summary":"List jobs, oldest first, in pages (follow next_after or the Link rel=\"next\" header)"},"post":{"description":"A retry with the same Idempotency-Key and the same body returns the first answer and creates nothing. Keys are scoped to the company and endpoint. The same key with a different body returns 422 idempotency_key_reused (use a new key for a new request).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobInput"}}}},"summary":"Create a job (send Idempotency-Key to retry safely)"}},"/jobs/{id}":{"delete":{"summary":"Cancel a job (again on a canceled job: unchanged, no new event)"},"get":{"summary":"Get a job"},"patch":{"description":"A delivered or canceled job is final: sending the same status again returns it unchanged (no new event); any other change returns 409 final_state.","summary":"Update fields, assign (driver_id) or set status (delivered/failed/canceled + reason)"}},"/pay/statement":{"get":{"summary":"Driver pay statement from your pay rules: per route-day, delivered stop, failed attempt and delivered parcel; nothing per km or per hour (from=, to= dates)"}},"/routes":{"get":{"parameters":[{"in":"query","name":"date","schema":{"format":"date","type":"string"}},{"in":"query","name":"limit","schema":{"default":500,"maximum":500,"minimum":1,"type":"integer"}},{"in":"query","name":"after","schema":{"minimum":0,"type":"integer"}}],"summary":"List routes, oldest first, in pages (same limit/after/next_after/has_more as /jobs)"},"post":{"description":"All or nothing: any invalid field answers 422 {\"error\", \"field\"} and nothing is written. A retry with the same Idempotency-Key and the same body returns the first answer and creates nothing. Keys are scoped to the company and endpoint. The same key with a different body returns 422 idempotency_key_reused (use a new key for a new request).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteInput"}}}},"summary":"Create a route with its stops and parcels in one call (send Idempotency-Key to retry safely)"}},"/routes/{id}":{"get":{"summary":"Get a route with stops, parcels, POD and pin status"}},"/webhooks/test":{"post":{"summary":"Send a ping event to every endpoint"}}},"security":[{"key":[]}],"servers":[{"url":"https://app.deliverpoint.app/account/api/v1"}],"x-webhooks":{"events":["job.created","job.assigned","job.delivered","job.failed","job.canceled","route.dispatched","route.started","route.finished","parcel.exception","pod.media","driver.offline","driver.back"],"retries":"up to 6 attempts: after 1, 5, 25, 125, 625 minutes","signature":"X-Tracker-Signature: t=<unix>,v1=hex(HMAC_SHA256(secret, \"<t>.<raw body>\"))"}}
