{"templateId":"api_docs","sharedDataIds":{"apiDocsStore":"api-docs-apis/lastmile.yaml","sidebar":"sidebar-sidebars.yaml"},"props":{"definitionId":"apis/lastmile.yaml","settings":{"baseUrlPath":"/apis/lastmile"},"disableAutoScroll":true,"seo":{"title":"Last-mile API"},"dynamicMarkdocComponents":[],"metadata":{"type":"openapi","title":"Last-mile API","version":"1.0","description":"This is the last-mile API: collection from a pickup point and delivery to a\ncustomer. If Quiqup holds your stock and picks it, you want the Fulfilment API instead. See\n[Which API do I need](/docs/choose).\n\nThe object you work with is the `order`. You will be creating orders through our Order API, these orders will follow a certain status life cycle, documented in [Order lifecycle](/docs/order-lifecycle).\n\n## The basics\nOur APIs are RESTful based and follow the below principles:\n\n* Accessible on staging through: https://api.staging.quiqup.com and on production through: https://api-ae.quiqup.com\n* It uses standard HTTP verbs like GET, POST, PUT and DELETE\n* Uses standard HTTP error responses to describe errors, for example: \n```json\n{\n    \"api_error\": {\n        \"id\": 1002,\n        \"code\": \"Error Code\",\n        \"message\": \"Error Message\",\n        \"human\": \"Human readable error message\",\n        \"description\": \"Detailed human readable error description\",\n        \"http_status_code\": 400,\n        \"attribute_errors\": [\n            { \"detail\": \"additional error code\" }\n        ]\n    }\n}\n```\n\n* Authentication and authorization are based on the OAuth 2.0 standard\n* All communication with our servers must be over SSL (https://), otherwise it will fail\n* POST data must be encoded as application/json\n* Most responses are encoded as application/json. Two are not: `GET /order_label/{order_id}` returns\na PDF, and `PUT /orders/{order_id}` returns the literal `true` with no `Content-Type` header at all.\nCheck the content type before parsing.\n\n## Typical flow\nA typical order flow:\n1. Get a Bearer token. Generate one yourself in Quiqdash, or, if you hold a `client_id` and `client_secret`, exchange them at `POST /oauth/token`, see the Auth reference.\n2. Create a pending order using `POST /orders`, see details in this reference.\n3. Mark the order as `ready_for_collection` using `PUT /orders/{order_id}/ready_for_collection`, see details in this reference. \n    1. There is an option to skip this step and directly create the orders in a ready for collection state, however the orders do actually need to be ready for collection. \n    2. Using this step option will thus depend on how the picking and packing process works.\n4. Request an order label by using: `GET /order_label/{order_id}` see details in this reference. This label needs to be saved as a PDF document, printed and used to label the order. The barcode on this label will be used by the couriers and our warehouse staff to scan the orders and keep you updated on the order status. The label can be downloaded before or after step 3.\n5. Order state updates, once the order has been placed it will go through various states (see [Order lifecycle](/docs/order-lifecycle)). There are two options on how you can receive updates on this:\n    1. These can be received in realtime through webhooks, see [Webhooks](/docs/webhooks)\n    2. Alternatively you can get the order state from GET /orders/{order_id}, see in this reference for details. "},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"developer-docs.quiqup.com","port":4000,"ipAddress":"216.73.216.69"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"main"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/apis/lastmile","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}