{"openapi":"3.0.0","paths":{"/assignment/single":{"post":{"operationId":"SingleController_createSingle","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSingle"},"examples":{"shipment":{"summary":"Synthetic package example (grams / centimetres)","value":{"serviceLevel":"economy","distributionChannel":"package","labelsSettings":{"layout":"a4_portrait","mode":"separate","positioning":"single"},"item":{"invoiceReference":"DEMO-DELIVERY-1001","weight":250,"height":3,"length":20,"width":15,"recipient":{"firstName":"Alex","lastName":"Example","countryCode":"SE","postalCode":"11122","city":"Stockholm","addressLine":"Exempelgatan 1","email":"recipient@example.com"}}}}}}}},"responses":{"201":{"description":"The assignment has been created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleResponse"}}}},"400":{"description":"When provided input is not valid","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"401":{"description":"Unauthenticated: missing, invalid or revoked API key, or wrong environment/account. Company keys have no timed expiry or public refresh-token flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"403":{"description":"Forbidden: check the company linked to the key and resource ownership. There is no OAuth scope or refresh flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"422":{"description":"Validation failed. Inspect the error body for field-level details and correct the request before retrying.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"429":{"description":"Throttled: honour Retry-After if supplied; otherwise use bounded backoff with jitter. A numeric quota and burst allowance are not confirmed for publication. See [the rate-limits guide](/guides/rate-limits). Infrastructure response formats and headers may vary.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"500":{"description":"Server error. Retry reads with backoff; reconcile an uncertain creation before retrying POST. See [the retries guide](/guides/retries).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}}},"security":[{"bearer":[]}],"summary":"Create single-address assignment","tags":["Single"]}},"/assignment/single/{id}":{"get":{"operationId":"SingleController_getSingle","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Assignment object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleResponse"}}}},"401":{"description":"Unauthenticated: missing, invalid or revoked API key, or wrong environment/account. Company keys have no timed expiry or public refresh-token flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"403":{"description":"Forbidden: check the company linked to the key and resource ownership. There is no OAuth scope or refresh flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"404":{"description":"When assignment with requested ID is not found in our system or does not belong to your account","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"429":{"description":"Throttled: honour Retry-After if supplied; otherwise use bounded backoff with jitter. A numeric quota and burst allowance are not confirmed for publication. See [the rate-limits guide](/guides/rate-limits). Infrastructure response formats and headers may vary.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"500":{"description":"Server error. Retry reads with backoff; reconcile an uncertain creation before retrying POST. See [the retries guide](/guides/retries).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}}},"security":[{"bearer":[]}],"summary":"Get single-address assignment","tags":["Single"]}},"/health/api":{"get":{"operationId":"HealthController_getApiHealth","parameters":[],"responses":{"200":{"description":"Status data on API health","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"API is not operable","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}}},"summary":"Check health of the API","tags":["Health"]}},"/health/auth":{"get":{"operationId":"HealthController_getAuthHealth","parameters":[],"responses":{"200":{"description":"Status data on authentication credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"401":{"description":"Unauthenticated: missing, invalid or revoked API key, or wrong environment/account. Company keys have no timed expiry or public refresh-token flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"403":{"description":"Forbidden: check the company linked to the key and resource ownership. There is no OAuth scope or refresh flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"429":{"description":"Throttled: honour Retry-After if supplied; otherwise use bounded backoff with jitter. A numeric quota and burst allowance are not confirmed for publication. See [the rate-limits guide](/guides/rate-limits). Infrastructure response formats and headers may vary.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"500":{"description":"Server error. Retry reads with backoff; reconcile an uncertain creation before retrying POST. See [the retries guide](/guides/retries).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}}},"security":[{"bearer":[]}],"summary":"Check health of the authentication credentials","tags":["Health"]}},"/tracking/{shipmentNumber}":{"get":{"operationId":"TrackingController_get","parameters":[{"name":"shipmentNumber","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Tracking data object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackingResponse"}}}},"401":{"description":"Unauthenticated: missing, invalid or revoked API key, or wrong environment/account. Company keys have no timed expiry or public refresh-token flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"403":{"description":"Forbidden: check the company linked to the key and resource ownership. There is no OAuth scope or refresh flow. See [the authentication guide](/guides/authentication).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"404":{"description":"Package with requested shipmentNumber is not found in our system or does not belong to your account","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"429":{"description":"Throttled: honour Retry-After if supplied; otherwise use bounded backoff with jitter. A numeric quota and burst allowance are not confirmed for publication. See [the rate-limits guide](/guides/rate-limits). Infrastructure response formats and headers may vary.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}},"500":{"description":"Server error. Retry reads with backoff; reconcile an uncertain creation before retrying POST. See [the retries guide](/guides/retries).","content":{"application/json":{"schema":{"type":"object","required":["statusCode","message","timestamp","path"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string"}}}}}}},"security":[{"bearer":[]}],"summary":"Get tracking information for a package","tags":["Tracking"]}}},"info":{"title":"PacSort Online","description":"[← Back to the integration guide](/) · [Download example JSON](/examples/shipment.json)\n\nCreate shipment assignments, retrieve labels and track packages. Click **Authorize** and paste your API key **without** the Bearer prefix. The reference sends the Authorization header automatically. Start with **GET /health/auth**. Executing POST /assignment/single creates an assignment.\n\nUse the key issued for this environment. See the [guide](/#integration) for external reference mapping, contact requirements and safe retries.","version":"1.4","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"Paste your PacSort Online API key only. Do not include the word Bearer. Obtain an active key for your company and environment from your PacSort Online contact."}},"schemas":{"LabelsSettings":{"type":"object","properties":{"layout":{"type":"string","enum":["a4_landscape","a4_portrait","zebra_big","zebra_small","letter_window"]},"mode":{"type":"string","enum":["separate","consolidated"]},"positioning":{"type":"string","enum":["single","pairs"]}},"required":["layout","mode"]},"PickupSettings":{"type":"object","properties":{"date":{"type":"string","description":"Pickup date in Y-m-d format","example":"2024-12-01"},"instructions":{"type":"string"}},"required":["date"]},"AddressRequest":{"type":"object","properties":{"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"company":{"type":"string","example":"Example Company"},"countryCode":{"type":"string","example":"SE"},"postalCode":{"type":"string","example":"46134"},"region":{"type":"string","nullable":true,"example":null},"city":{"type":"string","example":"Trollhättan"},"addressLine":{"type":"string","example":"Kungsgatan 53"},"addressLine2":{"type":"string","nullable":true,"example":null},"phoneNumber":{"type":"string","nullable":true,"example":null},"email":{"type":"string","example":"recipient@example.com"}},"required":["firstName","lastName","countryCode","postalCode","city","addressLine","email"]},"ItemRequest":{"type":"object","properties":{"description":{"type":"string","example":null},"invoiceReference":{"type":"string","example":"DEMO-DELIVERY-1001","maxLength":34,"description":"Optional business reference. Not unique and not an idempotency key; repeated POST requests can create duplicates."},"estimatedCost":{"type":"number","example":null},"weight":{"type":"number","example":250,"description":"Weight in grams. Documented range: 1–5000 g; service limits may vary."},"height":{"type":"number","example":7,"description":"Dimension in centimetres. Documented range: 1–60 cm; service limits may vary."},"length":{"type":"number","example":10,"description":"Dimension in centimetres. Documented range: 1–60 cm; service limits may vary."},"width":{"type":"number","example":20,"description":"Dimension in centimetres. Documented range: 1–60 cm; service limits may vary."},"recipient":{"$ref":"#/components/schemas/AddressRequest"}},"required":["weight","height","length","width","recipient"]},"CreateSingle":{"type":"object","properties":{"serviceLevel":{"type":"string","enum":["priority","economy"]},"distributionChannel":{"type":"string","enum":["package","parcel"],"default":"package"},"labelsSettings":{"description":"Settings on label format","allOf":[{"$ref":"#/components/schemas/LabelsSettings"}]},"pickupSettings":{"description":"Pickup settings. Is required for distributionChannel=parcel","allOf":[{"$ref":"#/components/schemas/PickupSettings"}]},"item":{"description":"Information about item to ship","allOf":[{"$ref":"#/components/schemas/ItemRequest"}]}},"required":["serviceLevel","labelsSettings","item"]},"AddressResponse":{"type":"object","properties":{"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"company":{"type":"string","example":"21 Grams AB"},"countryCode":{"type":"string","example":"SE"},"postalCode":{"type":"string","example":"46134"},"region":{"type":"string","example":null},"city":{"type":"string","example":"Trollhättan"},"addressLine":{"type":"string","example":"Kungsgatan 53"},"addressLine2":{"type":"string","example":null},"phoneNumber":{"type":"string","example":"+4670123456"},"email":{"type":"string","example":"john.doe@example.com"}},"required":["firstName","lastName","countryCode","postalCode","city","addressLine","email"]},"ItemResponse":{"type":"object","properties":{"carrierHandle":{"type":"string","nullable":true,"example":"earlybird","description":"Carrier handle used for shipment"},"shipmentNumber":{"type":"string","nullable":true,"example":"830293829383823"},"description":{"type":"string","nullable":true,"example":null},"estimatedCost":{"type":"number","example":250},"weight":{"type":"number","example":250,"description":"Weight (g)"},"height":{"type":"number","example":7},"length":{"type":"number","example":10},"width":{"type":"number","example":20},"recipient":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/AddressResponse"}]}},"required":["weight","height","length","width","recipient"]},"SingleResponse":{"type":"object","properties":{"id":{"type":"string","example":"868f4fa1-3916-4d83-9a76-5d5dbb1e3490"},"status":{"type":"string","example":"labels_released","description":"Status of assignment"},"labelsUrl":{"type":"string","nullable":true,"example":"https://example.com/demo-label.pdf","description":"Download URL for prepared label PDF"},"serviceLevel":{"type":"string","example":"priority"},"distributionChannel":{"type":"string","example":"package"},"mode":{"type":"string","example":"optimised","description":"Optimisation mode"},"pickupDate":{"type":"string","nullable":true,"example":"2024-12-01","description":"Pickup date (Y-m-d) or null"},"pickupInstructions":{"type":"string","nullable":true,"example":"Ring door bell","description":"Pickup instructions or null"},"item":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/ItemResponse"}]}},"required":["id","status","serviceLevel","distributionChannel","mode","item"]},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok"],"example":"ok","description":"Status value, currently the only possible status is OK"}},"required":["status"]},"TrackingEventSwagger":{"type":"object","properties":{"id":{"type":"number","example":1},"status":{"type":"string","example":"DELIVERED_BY_SERVICEPOINT"},"type":{"type":"string","example":"DELIVERED"},"identifierPrimary":{"type":"string","example":"DELIVERED_BY_SERVICEPOINT"},"identifierSecondary":{"type":"string","example":null},"countryCode":{"type":"string","example":"SE"},"country":{"type":"string","example":"Sweden"},"postalCode":{"type":"string","example":"46134"},"city":{"type":"string","example":"Trollhättan"},"locationName":{"type":"string","example":"Service Point 123"},"description":{"type":"string","example":"Delivered to service point"},"eventTime":{"type":"string","example":"2024-10-29T09:12:35.000Z"}},"required":["id","status","type","identifierPrimary","countryCode","country","postalCode","city","eventTime"]},"ShipmentSwagger":{"type":"object","properties":{"id":{"type":"string","example":"1"},"type":{"type":"string","example":"PACKAGE"},"runningNumber":{"type":"number","example":1},"carrierHandle":{"type":"string","example":"earlybird"},"shipmentNumber":{"type":"string","example":"830293829383823"},"lastTrackingEventTime":{"type":"string","example":"2024-10-29T09:12:35.000Z"},"lastTrackingEventStatus":{"type":"string","example":"DELIVERED"},"lastTrackingEventDescription":{"type":"string","example":"Delivered to service point"},"trackingLatestInteractionAt":{"type":"string","example":"2024-10-29T09:12:35.000Z"},"trackingError":{"type":"string","example":null},"trackingErrorTime":{"type":"string","example":null},"trackingEvents":{"type":"array","items":{"$ref":"#/components/schemas/TrackingEventSwagger"}}},"required":["id","type","runningNumber","carrierHandle","trackingEvents"]},"TrackingResponse":{"type":"object","properties":{"id":{"type":"string","example":"4cd07385-fd34-411b-b1c8-34fa217db40d"},"estimatedCost":{"type":"number","example":250},"service":{"type":"string","example":"PRIORITY"},"senderReference":{"type":"string","example":"INV-2024-01"},"weight":{"type":"number","example":250},"height":{"type":"number","example":7},"length":{"type":"number","example":10},"width":{"type":"number","example":20},"deliveryType":{"type":"string","example":"HOME"},"distributionChannel":{"type":"string","example":"PACKAGE"},"sender":{"$ref":"#/components/schemas/AddressResponse"},"recipient":{"$ref":"#/components/schemas/AddressResponse"},"shipments":{"description":"List of shipments with tracking events","type":"array","items":{"$ref":"#/components/schemas/ShipmentSwagger"}}},"required":["id","sender","recipient","shipments"]}}}}