{"info":{"_postman_id":"5b772caa-2356-47e2-bc2f-d47f4f5ea1d6","name":"Picup API Integration","description":"<html><head></head><body><p>Picup uses dedicated API tokens, passed over HTTP basic auth, to authenticate users.</p>\n<p>You'll find this set up in a global variable here for the 'Integration Company', a sandbox environment open for you to test in our QA environment.</p>\n<p>This is loaded as an API request header as follows:<br>Header Name: api-key<br>Header Value: your sandbox api-key (set the business-abc15fdb-fd15-4b3a-a52c-aec367702d05 collection variable)</p>\n<p>You can use a variety of (desktop or web-based) tools to test the API. A quick way to do it is through the command-line tool cURL. For more information on using cURL to run these calls, please see <a href=\"https://www.baeldung.com/curl-rest\">using cURL</a>.</p>\n<p>Successfully created orders are viewable on the sandbox/QA dashboard.</p>\n<p>URL: <a href=\"https://staging.picup.co.za\">https://staging.picup.co.za</a><br>Email Address: <a href=\"https://mailto:integrator@picup.co.za\">integrator@picup.co.za</a><br>Password: integration!</p>\n<p>Your orders will be viewable in the menu on the left under the 'Post Dispatch' menu, or in 'Buckets'.</p>\n<p><strong>Tracking and Order Updates</strong><br>Tracking and order updates are to be sent via generic webhook structure.<br>Details can be found using the following link:</p>\n<p><a href=\"https://drive.google.com/file/d/12JdpCa-7LoQTLWeO83RjN-rSSIrCHrwL/view?usp=sharing\">Integration Document</a></p>\n<p>Should you have any questions, please don't hesitate to contact us at <a href=\"https://mailto:info@picup.co.za\">info@picup.co.za</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"55457127","collectionId":"5b772caa-2356-47e2-bc2f-d47f4f5ea1d6","publishedId":"2sBYAxRVy6","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-09-09T20:09:24.000Z"},"item":[{"name":"Business Details","event":[{"listen":"test","script":{"type":"text/javascript","exec":["pm.test(\"Status code is 200\", () => pm.response.to.have.status(200));","pm.test(\"Is Key Valid\", () => pm.expect(pm.response.json().is_key_valid).to.eql(true));","// Auto-save first active warehouse for downstream calls","const json = pm.response.json();","const warehouses = json.warehouses || [];","const active = warehouses.find(w => !w.is_deleted) || warehouses[0];","if (active) {","  pm.collectionVariables.set(\"warehouse-id\", active.warehouse_id);","  pm.collectionVariables.set(\"warehouse-code\", active.warehouse_code || \"\");","  console.log(\"Saved warehouse:\", active.warehouse_id, active.warehouse_code);","}"],"id":"96702e7a-cbfd-44f9-a632-9672d175499c"}}],"id":"aeb87f48-aaca-4029-b1e8-bf28cb5d1e1f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/details","description":"<p>The Business Details call is a simple call, often useful to test your settings. When successful, this call will return your authorization request, as well as our standard <code>parcel sizes</code>.</p>\n<p>This can also be used to retrieve your <code>warehouse_id</code> after adding one in the Picup UI for your business. Our example business shows a <code>warehouse_name</code> and <code>warehouse_id</code>.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","business-abc15fdb-fd15-4b3a-a52c-aec367702d05","details"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"7be5a673-8940-41b7-b8e5-35ad11ad4918","name":"Business Details","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/details"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Fri, 27 Mar 2020 13:44:19 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"is_key_valid\": true,\n  \"is_key_valid_message\": \"Your key is valid\",\n  \"warehouses\": [\n    {\n      \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n      \"warehouse_name\": \"Woodstock Warehouse\",\n      \"warehouse_email\": \"warehouse@picup.co.za\",\n      \"warehouse_phone\": \"0821112223\",\n      \"warehouse_code\": \"WH001\"\n    }\n  ],\n  \"parcel_sizes\": [\n    {\n      \"display_name\": \"A4 Envelope\",\n      \"parcel_id\": \"parcel-a4-envelope\",\n      \"dimensions\": {\n        \"height\": 6,\n        \"width\": 3,\n        \"length\": 8\n      },\n      \"weight\": 0\n    },\n    {\n      \"display_name\": \"Small\",\n      \"parcel_id\": \"parcel-small\",\n      \"dimensions\": {\n        \"height\": 10,\n        \"width\": 15,\n        \"length\": 20\n      },\n      \"weight\": 1\n    }\n  ]\n}"}],"_postman_id":"aeb87f48-aaca-4029-b1e8-bf28cb5d1e1f"},{"name":"Quote One-to-Many","id":"2c19c3cc-88c4-4626-bd7a-3ff98fd47636","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"customer_ref\": \"Quote Example New\",\n  \"is_for_contract_driver\": false,\n  \"scheduled_date\": \"\",\n  \"courier_costing\": \"COL\",\n  \"sender\": {\n    \"address\": {\n      \"warehouse_id\": null,\n      \"unit_no\": null,\n      \"complex\": \"Picup Technologies\",\n      \"street_or_farm_no\": 6,\n      \"street_or_farm\": \"Beach Road\",\n      \"suburb\": \"Woodstock\",\n      \"city\": \"Cape Town\",\n      \"postal_code\": \"7915\",\n      \"country\": \"South Africa\",\n      \"latitude\": -33.9247137,\n      \"longitude\": 18.4487146,\n      \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n    },\n    \"contact\": {\n      \"name\": \"Sender Contact Name\",\n      \"email\": \"quotetest@example.com\",\n      \"cellphone\": \"0211234567\"\n    },\n    \"special_instructions\": \"Use back door\"\n  },\n  \"receivers\": [\n    {\n      \"address\": {\n        \"warehouse_id\": null,\n        \"unit_no\": null,\n        \"complex\": null,\n        \"street_or_farm_no\": null,\n        \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n        \"suburb\": null,\n        \"city\": \"cape town\",\n        \"postal_code\": null,\n        \"country\": null,\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.4545767,\n        \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n      },\n      \"contact\": {\n        \"name\": \"Test\",\n        \"email\": \"123@email.com\",\n        \"cellphone\": \"0211111234\"\n      },\n      \"parcels\": [\n        {\n          \"reference\": \"quote-ref\",\n          \"size\": \"parcel-small\",\n          \"length\": null,\n          \"width\": null,\n          \"height\": null,\n          \"weight\": null\n        }\n      ],\n      \"special_instructions\": \"Mind the dog\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/quote/one-to-many","description":"<p>Returns pricing for a one-to-many delivery (one sender, one or more receivers). Pass a sender and an array of receivers, each with an address, contact, and parcels.</p>\n<p>The response contains a <code>request</code> object, which is your order with the addresses geocoded and normalised, and <code>picup.service_types</code>, which lists the available vehicle types with their prices, distance, and estimated duration.</p>\n<p>This is a pricing call only. To place the delivery, take the <code>request</code> object from the response and POST it to Create One-to-Many.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","quote","one-to-many"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"4002f07e-768b-42fd-9537-3f480666601f","name":"Quote One-to-Many","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"api-key","value":"business-7c8350fa-0393-4c58-ba0c-3e547bf8834f","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"customer_ref\": \"Quote Example New\",\n    \"is_for_contract_driver\": false,\n    \"scheduled_date\": \"2022-11-22T13:17:11.680476Z\",\n    \"courier_costing\": \"ALL\",\n    \"sender\": {\n        \"address\": {\n            \"warehouse_id\": null,\n            \"unit_no\": null,\n            \"complex\": \"Picup Technologies\",\n            \"street_or_farm_no\": 6,\n            \"street_or_farm\": \"Beach Road, \",\n            \"suburb\": \"Woodstock\",\n            \"city\": \"Cape Town\",\n            \"postal_code\": \"7915\",\n            \"country\": \"South Africa\",\n            \"latitude\": -33.9247137,\n            \"longitude\": 18.4487146,\n            //formatted_address must be comma delimited with at least 2 parts\n            \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n        },\n        \"contact\": {\n            \"name\": \"Sender Contact Name\",\n            \"email\": \"quotetest@example.com\",\n            \"cellphone\": \"0211234567\"\n        },\n        \"special_instructions\": \"Use back door\"\n    },\n    \"receivers\": [\n        {\n            \"address\": {\n                \"unit_no\": null,\n                \"complex\": null,\n                \"street_or_farm_no\": null,\n                \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n                \"suburb\": null,\n                \"city\": \"cape town\",\n                \"postal_code\": null,\n                \"country\": null,\n                \"latitude\": null,\n                \"longitude\": null\n            },\n            \"contact\": {\n                \"name\": \"Test\",\n                \"email\": \"123@email.com\",\n                \"cellphone\": \"0211111234\"\n            },\n            \"special_instructions\": \"Mind the dog\",\n            \"parcels\": [\n                {\n                    \"size\": \"parcel-small\",\n                    \"reference\": \"quote-ref\",\n                    \"tracking_number\": null\n                }\n            ]\n        }\n    ],\n    \"optimize_waypoints\": true\n}"},"url":"https://picupstaging-webapi.azurewebsites.net/v1/integration/quote/one-to-many"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Fri, 27 Mar 2020 14:48:12 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"request\": {\n    \"order_id\": null,\n    \"split_order\": null,\n    \"receivers\": [\n      {\n        \"parcels\": [\n          {\n            \"reference\": \"quote-ref\",\n            \"barcode\": null,\n            \"size\": \"parcel-small\",\n            \"length_mm\": null,\n            \"width_mm\": null,\n            \"height_mm\": null,\n            \"weight_kg\": null,\n            \"parcel_value\": null,\n            \"required_capabilities\": null\n          }\n        ],\n        \"warehouse_id\": null,\n        \"warehouse_code\": null,\n        \"address\": {\n          \"unit_no\": null,\n          \"complex\": null,\n          \"street_or_farm_no\": null,\n          \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n          \"suburb\": null,\n          \"city\": \"cape town\",\n          \"postal_code\": null,\n          \"country\": null,\n          \"country_code\": null,\n          \"latitude\": -33.9292364,\n          \"longitude\": 18.4545767,\n          \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n        },\n        \"contact\": {\n          \"name\": \"Test\",\n          \"email\": \"123@email.com\",\n          \"cellphone\": \"0211111234\",\n          \"business_reference\": null,\n          \"tip_amount\": null,\n          \"requires_id_verification\": false,\n          \"otp\": null,\n          \"requires_one_time_pin\": null\n        },\n        \"special_instructions\": \"Mind the dog\"\n      }\n    ],\n    \"quote_id\": null,\n    \"payment_type\": null,\n    \"courier_id\": null,\n    \"courier_service_type_uid\": null,\n    \"sender\": {\n      \"warehouse_id\": null,\n      \"warehouse_code\": null,\n      \"address\": {\n        \"unit_no\": null,\n        \"complex\": \"Picup Technologies\",\n        \"street_or_farm_no\": \"6\",\n        \"street_or_farm\": \"Beach Road\",\n        \"suburb\": \"Woodstock\",\n        \"city\": \"Cape Town\",\n        \"postal_code\": \"7915\",\n        \"country\": \"South Africa\",\n        \"country_code\": null,\n        \"latitude\": -33.9247137,\n        \"longitude\": 18.4487146,\n        \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n      },\n      \"contact\": {\n        \"name\": \"Sender Contact Name\",\n        \"email\": \"quotetest@example.com\",\n        \"cellphone\": \"0211234567\",\n        \"business_reference\": null,\n        \"tip_amount\": null,\n        \"requires_id_verification\": false,\n        \"otp\": null,\n        \"requires_one_time_pin\": null\n      },\n      \"special_instructions\": \"Use back door\"\n    },\n    \"customer_ref\": \"Quote Example New\",\n    \"time_at_waypoint_minutes\": null,\n    \"payment_options\": null,\n    \"merchant_id\": \"merchant-d827f668-d434-4ce5-b853-878f874ae746\",\n    \"vehicle_id\": null,\n    \"fleet_allocation\": \"Picup\",\n    \"scheduled_date\": \"2026-06-08T09:49:07.694+00:00\",\n    \"should_run_lottery\": null\n  },\n  \"picup\": {\n    \"valid\": true,\n    \"error\": null,\n    \"service_types\": [\n      {\n        \"quote_id\": -1,\n        \"description\": \"vehicle-motorcycle\",\n        \"price_incl_vat\": 45,\n        \"price_ex_vat\": 39.13,\n        \"distance\": 1.2464,\n        \"duration\": \"00:20:00\"\n      }\n    ]\n  }\n}"}],"_postman_id":"2c19c3cc-88c4-4626-bd7a-3ff98fd47636"},{"name":"Create One-to-Many (New)","id":"20e7b369-c414-4441-b2d5-ad25abb5feeb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"customer_ref\": \"Quote Example132\",\n  \"is_round_trip\" : true,\n  \"vehicle_id\": \"vehicle-car\",\n  \"is_for_contract_driver\": false,\n  \"scheduled_date\": \"\",\n  \"sender\": {\n    \"warehouse_id\": null,\n    \"address\": {\n      \"unit_no\": null,\n      \"complex\": \"Picup Technologies\",\n      \"street_or_farm_no\": 6,\n      \"street_or_farm\": \"Beach Road\",\n      \"suburb\": \"Woodstock\",\n      \"city\": \"Cape Town\",\n      \"postal_code\": \"7915\",\n      \"country\": \"South Africa\",\n      \"latitude\": -33.9247137,\n      \"longitude\": 18.4487146,\n      \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n    },\n    \"contact\": {\n      \"name\": \"Sender Contact Name\",\n      \"email\": \"quotetest@example.com\",\n      \"cellphone\": \"0211234567\"\n    },\n    \"special_instructions\": \"Use back door\"\n  },\n  \"receivers\": [\n    {\n      \"address\": {\n        \"warehouse_id\": null,\n        \"unit_no\": null,\n        \"complex\": null,\n        \"street_or_farm_no\": null,\n        \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n        \"suburb\": null,\n        \"city\": \"cape town\",\n        \"postal_code\": null,\n        \"country\": null,\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.4545767,\n        \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n      },\n      \"contact\": {\n        \"name\": \"Test\",\n        \"email\": \"123@email.com\",\n        \"cellphone\": \"0211111234\"\n      },\n      \"parcels\": [\n        {\n          \"reference\": \"quote-ref\",\n          \"size\": \"parcel-small\",\n          \"length\": null,\n          \"width\": null,\n          \"height\": null,\n          \"weight\": null\n        }\n      ],\n      \"special_instructions\": \"Mind the dog\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://karooooodev-orderingestion.azurewebsites.net/legacy/one-to-many","description":"<p>Creates a one-to-many delivery (one sender, one or more receivers). This is the endpoint to use after quoting.</p>\n<p>Send the <code>request</code> object returned by Quote One-to-Many as the body, and add the <code>vehicle_id</code> you picked from that quote's <code>service_types</code>, along with <code>scheduled_date</code> and <code>customer_ref</code>. Each receiver needs an address, contact, and parcels.</p>\n<p>This request goes to the order-ingestion service (<code>/legacy/one-to-many</code>), not the Picup web API. On success it returns <code>request_id</code> and <code>picup_id</code>. The <code>picup_id</code> is the identifier for the created delivery; use it for tracking and follow-up calls. The order then appears on the post-dispatch dashboard.</p>\n","urlObject":{"protocol":"https","path":["legacy","one-to-many"],"host":["karooooodev-orderingestion.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"7a5914f5-f21a-4559-9b75-482da8dcca5b","name":"Create One-to-Many (New)","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"api-key","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"receivers\": [\n        {\n            \"parcels\": [\n                {\n                    \"reference\": \"quote-ref\",\n                    \"size\": \"parcel-small\",\n                    \"length\": null,\n                    \"width\": null,\n                    \"height\": null,\n                    \"weight\": null\n                }\n            ],\n            \"address\": {\n                \"warehouse_id\": null,\n                \"unit_no\": null,\n                \"complex\": null,\n                \"street_or_farm_no\": null,\n                \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n                \"suburb\": null,\n                \"city\": \"cape town\",\n                \"postal_code\": null,\n                \"country\": null,\n                \"latitude\": -33.9292364,\n                \"longitude\": 18.4545767,\n                //formatted_address must be comma delimited with at least 2 parts\n                \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n            },\n            \"contact\": {\n                \"name\": \"Test\",\n                \"email\": \"123@em12ail.com\",\n                \"cellphone\": \"0211111234\"\n            },\n            \"special_instructions\": \"Mind the dog\"\n        }\n    ],\n    \"sender\": {\n        \"warehouse_id\": null,\n        \"address\": {\n            \"unit_no\": null,\n            \"complex\": \"Picup Technologies\",\n            \"street_or_farm_no\": 6,\n            \"street_or_farm\": \"Beach Road, \",\n            \"suburb\": \"Woodstock\",\n            \"city\": \"Cape Town\",\n            \"postal_code\": \"7915\",\n            \"country\": \"South Africa\",\n            \"latitude\": -33.9247137,\n            \"longitude\": 18.4487146,\n            //formatted_address must be comma delimited with at least 2 parts\n            \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n        },\n        \"contact\": {\n            \"name\": \"Sender Contact Name\",\n            \"email\": \"quotetest@example.com\",\n            \"cellphone\": \"0211234567\"\n        },\n        \"special_instructions\": \"Use back door\"\n    },\n    \"customer_ref\": \"Quote Example132\",\n    \"vehicle_id\": \"vehicle-car\",\n    \"is_for_contract_driver\": false,\n    \"scheduled_date\": \"2020-08-22T13:17:11.680476Z\"\n}","options":{"raw":{"language":"json"}}},"url":"https://karoooooprod-apimanagementservice.azure-api.net"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Wed, 08 Jan 2020 07:28:03 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"order_id\": \"order-9b0e6a83-2a8f-4737-b3fd-3cb3115dfc4e\",\n  \"parcels\": [\n    {\n      \"business_reference\": \"Unknown\",\n      \"parcel_reference\": \"quote-ref\",\n      \"customer_reference\": \"Unknown\"\n    }\n  ],\n  \"planned_distance_in_meters\": 0,\n  \"planned_time_in_minutes\": 0,\n  \"split_order\": null\n}"}],"_postman_id":"20e7b369-c414-4441-b2d5-ad25abb5feeb"},{"name":"Create One-to-Many (Current)","event":[{"listen":"test","script":{"type":"text/javascript","exec":["pm.test('Status code is 200', () => pm.response.to.have.status(200));","pm.test('Body has order_id', () => pm.expect(pm.response.text()).to.include('order_id'));","const j = pm.response.json();","const wb = j.parcels && j.parcels[0] && j.parcels[0].order_waybill;","if (wb) { pm.collectionVariables.set('waybill-number', wb); console.log('Saved waybill-number:', wb); }"],"id":"afb8738d-78b7-4a94-a178-c855f9c95879"}}],"id":"97dadaf9-1115-4ac4-9272-97d5ffd0c708","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"customer_ref\": \"Quote Example132\",\n  \"vehicle_id\": \"vehicle-car\",\n  \"is_for_contract_driver\": false,\n  \"scheduled_date\": \"\",\n  \"sender\": {\n    \"warehouse_id\": null,\n    \"address\": {\n      \"unit_no\": null,\n      \"complex\": \"Picup Technologies\",\n      \"street_or_farm_no\": 6,\n      \"street_or_farm\": \"Beach Road\",\n      \"suburb\": \"Woodstock\",\n      \"city\": \"Cape Town\",\n      \"postal_code\": \"7915\",\n      \"country\": \"South Africa\",\n      \"latitude\": -33.9247137,\n      \"longitude\": 18.4487146,\n      \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n    },\n    \"contact\": {\n      \"name\": \"Sender Contact Name\",\n      \"email\": \"quotetest@example.com\",\n      \"cellphone\": \"0211234567\"\n    },\n    \"special_instructions\": \"Use back door\"\n  },\n  \"receivers\": [\n    {\n      \"address\": {\n        \"warehouse_id\": null,\n        \"unit_no\": null,\n        \"complex\": null,\n        \"street_or_farm_no\": null,\n        \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n        \"suburb\": null,\n        \"city\": \"cape town\",\n        \"postal_code\": null,\n        \"country\": null,\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.4545767,\n        \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n      },\n      \"contact\": {\n        \"name\": \"Test\",\n        \"email\": \"123@email.com\",\n        \"cellphone\": \"0211111234\"\n      },\n      \"parcels\": [\n        {\n          \"reference\": \"quote-ref\",\n          \"size\": \"parcel-small\",\n          \"length\": null,\n          \"width\": null,\n          \"height\": null,\n          \"weight\": null\n        }\n      ],\n      \"special_instructions\": \"Mind the dog\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/create/one-to-many","description":"<p>The <code>Create One-to-Many</code> call will create a picup trip. The following example takes the same sender and receiver from our previous quote, and creates the picup as quoted for the <code>vehicle-id</code> provided. In this case, we've selected <code>vehicle-motorcycle</code>. A customer reference is also provided to help with the tracking, as well as any communication provided. When successful, you'll receive a <code>request_id</code> back from our API.</p>\n<p>The <em>Request</em> body of the quote becomes the body of the create call, this can be used to create a picup after having quoted for it.</p>\n<p>Once created, the picup's will be available for viewing at <a href=\"http://staging.picup.co.za/dashboard/post-dispatch\">http://staging.picup.co.za/dashboard/post-dispatch</a>. This will also add the addresses created to the Geocoder module.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","create","one-to-many"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"bb104028-dbfe-49c5-9b4e-e345860a4c49","name":"Create One-to-Many (Deprecated)","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"api-key","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"receivers\": [\n        {\n            \"parcels\": [\n                {\n                    \"reference\": \"quote-ref\",\n                    \"size\": \"parcel-small\",\n                    \"length\": null,\n                    \"width\": null,\n                    \"height\": null,\n                    \"weight\": null\n                }\n            ],\n            \"address\": {\n                \"warehouse_id\": null,\n                \"unit_no\": null,\n                \"complex\": null,\n                \"street_or_farm_no\": null,\n                \"street_or_farm\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n                \"suburb\": null,\n                \"city\": \"cape town\",\n                \"postal_code\": null,\n                \"country\": null,\n                \"latitude\": -33.9292364,\n                \"longitude\": 18.4545767,\n                //formatted_address must be comma delimited with at least 2 parts\n                \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\"\n            },\n            \"contact\": {\n                \"name\": \"Test\",\n                \"email\": \"123@em12ail.com\",\n                \"cellphone\": \"0211111234\"\n            },\n            \"special_instructions\": \"Mind the dog\"\n        }\n    ],\n    \"sender\": {\n        \"warehouse_id\": null,\n        \"address\": {\n            \"unit_no\": null,\n            \"complex\": \"Picup Technologies\",\n            \"street_or_farm_no\": 6,\n            \"street_or_farm\": \"Beach Road, \",\n            \"suburb\": \"Woodstock\",\n            \"city\": \"Cape Town\",\n            \"postal_code\": \"7915\",\n            \"country\": \"South Africa\",\n            \"latitude\": -33.9247137,\n            \"longitude\": 18.4487146,\n            //formatted_address must be comma delimited with at least 2 parts\n            \"formatted_address\": \"6 Beach Rd, Woodstock, Cape Town, 7915, South Africa\"\n        },\n        \"contact\": {\n            \"name\": \"Sender Contact Name\",\n            \"email\": \"quotetest@example.com\",\n            \"cellphone\": \"0211234567\"\n        },\n        \"special_instructions\": \"Use back door\"\n    },\n    \"customer_ref\": \"Quote Example132\",\n    \"vehicle_id\": \"vehicle-car\",\n    \"is_for_contract_driver\": false,\n    \"scheduled_date\": \"2020-08-22T13:17:11.680476Z\"\n}"},"url":"https://picupstaging-webapi.azurewebsites.net/v1/integration/create/one-to-many"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Wed, 08 Jan 2020 07:28:03 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"order_id\": \"order-5e05d7e2-9cbb-43e2-bdb9-b2ab89f38918\",\n  \"parcels\": [\n    {\n      \"parcel_waybill\": \"PCW000208251_1\",\n      \"order_waybill\": \"PCW000208251\",\n      \"business_reference\": \"PCW000208251\",\n      \"parcel_reference\": \"quote-ref\",\n      \"customer_reference\": \"Quote Example132\",\n      \"barcode\": null\n    }\n  ]\n}"}],"_postman_id":"97dadaf9-1115-4ac4-9272-97d5ffd0c708"},{"name":"Get Buckets","id":"6075177c-e6d7-4464-a0fc-0e40ec5a346f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"warehouse_id\": \"\",\n  \"from\": \"2020-06-10T00:00:00.000Z\",\n  \"to\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/get-buckets","description":"<p>The <code>get-buckets</code> call will return a list of buckets for a given time frame and given warehouse_id. \nThe returning object is an array of all buckets that match the criteria, with a state as well as any relevant counts.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","business-abc15fdb-fd15-4b3a-a52c-aec367702d05","get-buckets"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"4f8ae353-c130-477c-83ee-80f163f7ac0a","name":"Get Buckets","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"warehouse_id\": \"warehouse-9a4145af-f5b5-423c-ab38-d0ad870604ff\",\r\n    \"from\":\"2020-04-13T13:41:36.292Z\",\r\n    \"to\": \"2020-08-13T13:41:36.292Z\"\r\n}","options":{"raw":{"language":"json"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/get-buckets"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Content-Length","value":"266"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/10.0"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"Request-Context","value":"appId=cid-v1:6fc40a28-ded9-474d-9431-194206b95549"},{"key":"Access-Control-Expose-Headers","value":"Request-Context"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Mon, 13 Jul 2020 13:48:02 GMT"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"bucket_id\": 1337,\n    \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n    \"warehouse\": \"Woodstock Warehouse\",\n    \"order_count\": 5,\n    \"current_state\": \"PreRouteManagement\",\n    \"trip_count\": 0,\n    \"courier_count\": 0\n  },\n  {\n    \"bucket_id\": 1338,\n    \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n    \"warehouse\": \"Woodstock Warehouse\",\n    \"order_count\": 5,\n    \"current_state\": \"Dispatching\",\n    \"trip_count\": 1,\n    \"courier_count\": 0\n  }\n]"}],"_postman_id":"6075177c-e6d7-4464-a0fc-0e40ec5a346f"},{"name":"Add to Bucket","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["// fresh unique business reference for this run, reused by Delete Order From Bucket","pm.collectionVariables.set('addbucket-ref', 'cld-' + pm.variables.replaceIn('cdeec7b2-4502-4779-81d3-ab2674b278aa'));"],"id":"3fcf5f93-41bf-4fb6-9452-c63da97f2043"}},{"listen":"test","script":{"type":"text/javascript","exec":["pm.test('Status code is 200', () => pm.response.to.have.status(200));","// response shape: { \"<bucketId>\": [\"<waybill>\"] }","const json = pm.response.json();","const key = Object.keys(json)[0];","if (key) { pm.collectionVariables.set('bucketId', key); console.log('Saved bucketId:', key); }"],"id":"1d78c43f-79d7-4f52-b268-eb560e970779"}}],"id":"7fd3d890-b9a1-400b-9043-df7596d70a46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"bucket_details\": {\n    \"delivery_date\": \"\",\n    \"shift_start\": \"09:00\",\n    \"shift_end\": \"17:00\",\n    \"warehouse_id\": \"\"\n  },\n  \"shipments\": [\n    {\n      \"consignment\": \"First Suburb\",\n      \"business_reference\": \"\",\n      \"address\": {\n        \"address_line_1\": \"1\",\n        \"address_line_2\": \"2\",\n        \"address_line_3\": \"3\",\n        \"address_line_4\": \"4\",\n        \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.45457669999996,\n        \"street_or_farm_no\": \"62\",\n        \"street_or_farm\": \"Greatmore St\",\n        \"suburb\": \"Woodstock\",\n        \"city\": \"Cape Town\",\n        \"country\": \"South Africa\",\n        \"postal_code\": \"7915\"\n      },\n      \"contact\": {\n        \"customer_name\": \"Delivery Contact 1\",\n        \"customer_phone\": \"0821112223\",\n        \"email_address\": \"integrator@picup.co.za\",\n        \"special_instructions\": \"Special Instructions go here\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-small\",\n          \"tracking_number\": \"455d18fa-83fa-4a92-9dff-9c16c202e41d\",\n          \"parcel_reference\": \"f9bdbf19-4ad2-48aa-9e1e-0d9ae05511d2\",\n          \"description\": \"This is the first parcel\"\n        }\n      ]\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/add-to-bucket","description":"<p>Picup Enterprise is able to group multiple orders for a delivery into a \"bucket\" for processing. A bucket allows for multiple confirgurations of picup routes to be set, preferences and scheduling. Orders can be added to a bucket through a CSV upload or by using the <code>Add to Bucket</code> API. Each order requires a unique <code>Business Reference</code>. If the bucket details vary, a new bucket will be created. The <code>warehouse_id</code> corresponds to the collection warehouse which will be set up during the enterprise business creation. </p>\n<p>Buckets can be dispatched when ready, after processing, costing and routing. Created buckets are available for viewing at: <a href=\"http://staging.picup.co.za/dashboard/buckets\">http://staging.picup.co.za/dashboard/buckets</a></p>\n<p>A correct response will return a <code>200 OK</code> and return the <code>bucket_id</code>.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","add-to-bucket"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"4b0332ee-4e1b-42f0-abcd-ed4cb8ffe73a","name":"Add to Bucket","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"api-key","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"bucket_details\": {\n    \"delivery_date\": \"2020-06-10\",\n    \"shift_start\": \"09:00\",\n    \"shift_end\": \"17:00\",\n    \"warehouse_id\": \"warehouse-9cc07864-0255-4f84-b3f2-5697e21529e9\"\n  },\n  \"shipments\": [\n  \t{\n    \"consignment\": \"First Suburb\",\n    \"business_reference\": \"Order Number 7\",\n    \"address\": {\n    \t\"address_line_1\": \"1\",\n    \t\"address_line_2\": \"2\",\n    \t\"address_line_3\": \"3\",\n    \t\"address_line_4\": \"4\",\n      //formatted_address must be comma delimited with at least 2 parts\n      \"formatted_address\": \"62 Greatmore St, Woodstock, Cape Town, 7915, South Africa\",\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.45457669999996,\n        \"street_or_farm_no\": \"62\",\n        \"street_or_farm\": \"Greatmore St\",\n        \"suburb\": \"Woodstock\",\n        \"city\": \"Cape Town\",\n        \"country\": \"South Africa\",\n        \"postal_code\": \"7915\"\n    },\n    \"contact\": {\n      \"customer_name\": \"Delivery Contact 1\",\n      \"customer_phone\": \"0821112223\",\n      \"email_address\": \"integrator@picup.co.za\",\n      \"special_instructions\": \"Special Instructions go here\"\n    },\n    \"parcels\": [\n      {\n        \"size\": \"parcel-small\",\n        \"tracking_number\": \"777-888-999\",\n        \"parcel_reference\": \"Parcel Number 1\",\n        \"description\": \"This is the first parcel\"\n      }\n     ]\n  \t}\n    ]\n  }\n"},"url":"https://picupstaging-webapi.azurewebsites.net/v1/integration/add-to-bucket"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Wed, 08 Jan 2020 07:37:23 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"1767\": [\n    \"PCW000208252\"\n  ]\n}"}],"_postman_id":"7fd3d890-b9a1-400b-9043-df7596d70a46"},{"name":"Get Manifest By Bucket ID","id":"3e62716d-08df-49fe-9cad-f67f2ccac364","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"bucket_id\": 219\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/get-manifest-by-bucket-id","description":"<p>Once retrieving our <code>bucket_id</code>, we can use the <code>get-manifest-by-bucket-id</code> call to retrieve any orders relating to the specified bucket. \nThe call returns an array of all orders within the bucket. This includes: </p>\n<ul>\n<li>Customer Information</li>\n<li>Tracking Numbers</li>\n<li>Reference Numbers</li>\n</ul>\n<p>Please note, information received may be null, depending on the state of the bucket. For example, <code>trip_id</code> will return as <code>null</code> if the bucket has not yet proceeded through trip selection.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","business-abc15fdb-fd15-4b3a-a52c-aec367702d05","get-manifest-by-bucket-id"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"0b963cdb-12f4-4d18-b38d-1aaaa71dcd56","name":"Get Manifest By Bucket ID","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"bucket_id\":  219\r\n}","options":{"raw":{"language":"json"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/get-manifest-by-bucket-id"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Content-Length","value":"567"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/10.0"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"Request-Context","value":"appId=cid-v1:6fc40a28-ded9-474d-9431-194206b95549"},{"key":"Access-Control-Expose-Headers","value":"Request-Context"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Mon, 13 Jul 2020 13:53:53 GMT"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"bucket_id\": 1767,\n    \"trip_id\": null,\n    \"sequence\": null,\n    \"business_reference\": \"Order Number 723423\",\n    \"parcel_waybill\": \"PCW000208252_1\",\n    \"order_waybill\": \"PCW000208252\",\n    \"tracking_number\": \"Parcel Number 1\",\n    \"description\": \"This is the first parcel\",\n    \"delivery_date\": \"2026-06-08T00:00:00\",\n    \"shift_start\": \"09:00:00\",\n    \"shift_end\": \"17:00:00\",\n    \"special_instructions\": \"Special Instructions go here\",\n    \"customer_name\": \"Delivery Contact 1\",\n    \"customer_phone\": \"0821112223\",\n    \"trip_type\": null,\n    \"courier_id\": null,\n    \"courier_code\": null,\n    \"courier_service_type_as_int\": null,\n    \"courier_service_type_as_string\": null,\n    \"courier_service_type_description\": null,\n    \"courier_service_type_uid\": null,\n    \"is_last_mile\": true,\n    \"leg_index\": 1\n  }\n]"}],"_postman_id":"3e62716d-08df-49fe-9cad-f67f2ccac364"},{"name":"Delete Order From Bucket","id":"cdf5db13-c66e-4381-a43e-e612f38fbc8f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"bucket_id\": 219,\n  \"business_references\": [\n    \"\"\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/delete-order","description":"<p>Picup Enterprise is able to group multiple orders for a delivery into a \"bucket\" for processing. A bucket allows for multiple confirgurations of picup routes to be set, preferences and scheduling.</p>\n<p>Orders can be deleted from a bucket using this API. Each order (upon ingestion) as a unique <code>Business Reference</code>. Passing in this reference, along with the BucketId, will result in the order being deleted from the system.</p>\n<p>Buckets can be seen at: <a href=\"http://staging.picup.co.za/dashboard/buckets\">http://staging.picup.co.za/dashboard/buckets</a></p>\n<p>A successfull request will return a <code>200 OK.</code></p>\n<p>An important note here, is that only orders that <em>have not yet been dispatched</em> should be deleted.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","delete-order"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"ac9eb8b3-f5db-43f0-bbcf-77fa88cd7d19","name":"Delete Order From Bucket","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"bucket_id\": 123,\r\n    \"business_references\": [\r\n        \"BusinessReference\"\r\n    ]\r\n}","options":{"raw":{"language":"text"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/delete-order"},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"cdf5db13-c66e-4381-a43e-e612f38fbc8f"},{"name":"Stage-Order","id":"051a8c38-cdef-449b-bd0e-7d6303d8366e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"warehouse_id\": \"\",\n  \"shipments\": [\n    {\n      \"business_reference\": \"a681d5e9-97d4-4b52-b6db-e4272b37d895\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -33.9247137,\n        \"longitude\": 18.4487146\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"0821112223\",\n        \"email_address\": \"customer@example.com\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"0f2b92f5-a998-4ff4-b38f-e4a169ba3fc3\"\n        }\n      ]\n    },\n    {\n      \"business_reference\": \"e6fca41b-b167-460a-baa7-2cc71e3880e7\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -33.9292364,\n        \"longitude\": 18.4545767\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"0821112223\",\n        \"email_address\": \"customer@example.com\",\n        \"special_instructions\": \"Give to Mpho at Reception\",\n        \"delivery_window_start\": \"10:00\",\n        \"delivery_window_end\": \"12:00\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"f23fe086-bbf4-47de-8a56-011d80c5cc4f\"\n        },\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"6e14d690-61bf-40de-b7d4-9852ed24c381\"\n        }\n      ]\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/stage-order","description":"<p>Stages orders on the system without adding them to a bucket. They can be retrieved and added to a bucket later.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","stage-order"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"41830fb7-b286-4a21-86ea-866d72843756","name":"Stage-Order","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"api-key","type":"text","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"warehouse_id\": \"warehouse-9cc07864-0255-4f84-b3f2-5697e21529e9\",\n  \"shipments\": [\n    {\n      \"business_reference\": \"INV002.1\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -28.632746799225856,\n        \"longitude\": 23.1591796875\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"phone\",\n        \"email_address\": \" email  \"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"INV001.1.1\"\n        }\n      ]\n    },\n    {\n      \"business_reference\": \"INV001.2\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -21.432616864477335,\n        \"longitude\": 24.49951171875\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"phone\",\n        \"email_address\": \" email  \",\n        \"special_instructions\": \"Give to Mpho at Reception\",\n        \"delivery_window_start\": \"10:00\",\n        \"delivery_window_end\": \"12:00\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"string\"\n        },\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"string\"\n        },\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"INV001.2.1\"\n        }\n      ]\n    },\n    {\n      \"business_reference\": \"INV001.3\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -28.246327971048842,\n        \"longitude\": 34.25537109375\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"phone\",\n        \"email_address\": \" email  \",\n        \"special_instructions\": \"Give to Mpho at Reception\",\n        \"delivery_window_start\": \"10:00\",\n        \"delivery_window_end\": \"12:00\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"INV001.3.1\"\n        },\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"string2\"\n        }\n      ]\n    },\n    {\n      \"business_reference\": \"INV001.4\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -36.33282808737917,\n        \"longitude\": 23.752441406249996\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"phone\",\n        \"email_address\": \" email  \",\n        \"special_instructions\": \"Give to Mpho at Reception\",\n        \"delivery_window_start\": \"10:00\",\n        \"delivery_window_end\": \"12:00\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"INV001.4.1\"\n        }\n      ]\n    },\n    {\n      \"business_reference\": \"INV001.5\",\n      \"visit_type\": \"DELIVERY\",\n      \"address\": {\n        \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n        \"latitude\": -29.171348850951507,\n        \"longitude\": 14.78759765625\n      },\n      \"contact\": {\n        \"customer_name\": \"customer\",\n        \"customer_phone\": \"phone\",\n        \"email_address\": \" email  \",\n        \"special_instructions\": \"Give to Mpho at Reception\",\n        \"delivery_window_start\": \"10:00\",\n        \"delivery_window_end\": \"12:00\"\n      },\n      \"parcels\": [\n        {\n          \"size\": \"parcel-a4-envelope\",\n          \"parcel_reference\": \"INV001.5.1\"\n        }\n      ]\n    }\n  ]\n}"},"url":"picupdev-webapi.azurewebsites.net/v1/integration/stage-order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Tue, 07 Jan 2020 09:19:28 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"status_code\": 0,\n  \"validations\": [\n    {\n      \"index\": 0,\n      \"business_reference\": \"INV002.1\",\n      \"waybill_number\": \"PCW000208253\",\n      \"action\": \"insert\",\n      \"parcels\": [\n        {\n          \"action\": \"insert\",\n          \"parcel_reference\": \"INV002.1.1\"\n        }\n      ]\n    },\n    {\n      \"index\": 1,\n      \"business_reference\": \"INV001.2\",\n      \"waybill_number\": \"PCW000208254\",\n      \"action\": \"insert\",\n      \"parcels\": [\n        {\n          \"action\": \"insert\",\n          \"parcel_reference\": \"INV001.2.1\"\n        },\n        {\n          \"action\": \"insert\",\n          \"parcel_reference\": \"INV001.2.2\"\n        }\n      ]\n    }\n  ]\n}"}],"_postman_id":"051a8c38-cdef-449b-bd0e-7d6303d8366e"},{"name":"Get Staged Orders","event":[{"listen":"test","script":{"type":"text/javascript","exec":["pm.test('Status code is 200', () => pm.response.to.have.status(200));","const j = pm.response.json();","if (Array.isArray(j) && j.length) {","  if (j[0].waybill_number) pm.collectionVariables.set('staged-waybill-number', j[0].waybill_number);","  // For Change Bucket: pick a staged order that is currently sitting in a bucket.","  const inBucket = j.find(o => Array.isArray(o.legs) && o.legs.some(l => l.bucket_id));","  if (inBucket) {","    const leg = inBucket.legs.find(l => l.bucket_id);","    pm.collectionVariables.set('change-bucket-source-id', leg.bucket_id);","    pm.collectionVariables.set('change-bucket-order-id', inBucket.order_id);","    console.log('Change Bucket: will move order', inBucket.order_id, 'off bucket', leg.bucket_id);","  } else {","    console.warn('No staged order is currently in a bucket - Change Bucket will 400 until change-bucket-order-id is set manually.');","  }","}"],"id":"e6fc61da-bf42-41e7-8311-8b9677f98729"}}],"id":"729becfb-2223-4869-b192-674cbf5af8ed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"from\": \"2020-06-10\",\n  \"to\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/get-orders","description":"<p>The <code>get-staged-orders</code> call can be used to return the orders currently in <em>staging</em>.</p>\n<p>The body takes in a to and from parameter, referring to the date the order was <em>created</em>.</p>\n<p>The response example shows the various orders as well as all of the information provided when the order was created or updated.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","get-orders"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"c6f61d81-3406-478c-a2b7-80539756219c","name":"Get Staged Orders","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"api-key","type":"text","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n    \"from\": \"2019-12-01\",\n    \"to\": \"2020-12-30\"\n}","options":{"raw":{"language":"json"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/get-staged-orders"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Wed, 08 Jan 2020 07:33:01 GMT"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"order_id\": 44727,\n    \"waybill_number\": \"PCW000208242\",\n    \"date_created\": \"2026-06-08T07:02:16\",\n    \"is_expedited_order\": false,\n    \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n    \"business_reference\": \"Order Number 722\",\n    \"visit_type\": \"Delivery\",\n    \"address\": {\n      \"formatted_address\": null,\n      \"latitude\": -33.92924,\n      \"longitude\": 18.45458,\n      \"postal_code\": \"7915\",\n      \"suburb\": \"Woodstock\",\n      \"address_line_1\": null,\n      \"address\": \"1\",\n      \"street_or_farm_no\": null,\n      \"street_or_farm\": null,\n      \"city\": null,\n      \"country\": null,\n      \"country_short_code\": \"ZA\",\n      \"address_id\": null,\n      \"client_address\": null,\n      \"is_modified\": false,\n      \"geocoded_suburb\": null,\n      \"geocoded_postal_code\": null,\n      \"geocoded_address\": null,\n      \"building_or_complex_name\": null,\n      \"unit_or_floor\": null\n    },\n    \"contact\": {\n      \"customer_name\": \"Delivery Contact 1\",\n      \"customer_phone\": \"0821112223\",\n      \"email_address\": \"integrator@picup.co.za\",\n      \"special_instructions\": \"Special Instructions go here\"\n    },\n    \"payment_options\": null,\n    \"parcels\": [\n      {\n        \"size\": \"parcel-small\",\n        \"parcel_reference\": \"Parcel Number 1\",\n        \"parcel_value\": null,\n        \"length_mm\": null,\n        \"width_mm\": null,\n        \"height_mm\": null,\n        \"weight_kg\": null\n      }\n    ],\n    \"legs\": [\n      {\n        \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n        \"bucket_id\": 1766,\n        \"leg_index\": 1,\n        \"is_middle_mile\": false,\n        \"received_date\": \"2026-06-08T07:02:16.487\",\n        \"dispatched_date\": null\n      }\n    ]\n  },\n  {\n    \"order_id\": 44723,\n    \"waybill_number\": \"PCW000208236\",\n    \"date_created\": \"2026-06-08T08:40:02\",\n    \"is_expedited_order\": false,\n    \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n    \"business_reference\": \"INV002.1\",\n    \"visit_type\": \"Delivery\",\n    \"address\": {\n      \"formatted_address\": null,\n      \"latitude\": -33.92471,\n      \"longitude\": 18.44871,\n      \"postal_code\": \"\",\n      \"suburb\": \"\",\n      \"address_line_1\": null,\n      \"address\": \"Picup Technologies, 6 Beach Road, Woodstock, Cape Town, South Africa\",\n      \"street_or_farm_no\": null,\n      \"street_or_farm\": null,\n      \"city\": null,\n      \"country\": null,\n      \"country_short_code\": \"ZA\",\n      \"address_id\": null,\n      \"client_address\": null,\n      \"is_modified\": false,\n      \"geocoded_suburb\": null,\n      \"geocoded_postal_code\": null,\n      \"geocoded_address\": null,\n      \"building_or_complex_name\": null,\n      \"unit_or_floor\": null\n    },\n    \"contact\": {\n      \"customer_name\": \"customer\",\n      \"customer_phone\": \"+27 82 111 2223\",\n      \"email_address\": \"customer@example.com\"\n    },\n    \"payment_options\": null,\n    \"parcels\": [\n      {\n        \"size\": \"parcel-a4-envelope\",\n        \"parcel_reference\": \"INV002.1.1\",\n        \"parcel_value\": null,\n        \"length_mm\": null,\n        \"width_mm\": null,\n        \"height_mm\": null,\n        \"weight_kg\": null\n      }\n    ],\n    \"legs\": [\n      {\n        \"warehouse_id\": \"warehouse-3eb3acb0-f4ce-479c-9a16-243f3968e686\",\n        \"leg_index\": 0,\n        \"is_middle_mile\": false,\n        \"received_date\": null,\n        \"dispatched_date\": null\n      }\n    ]\n  }\n]"}],"_postman_id":"729becfb-2223-4869-b192-674cbf5af8ed"},{"name":"Waybill Info (Get CQRS Order ID)","event":[{"listen":"test","script":{"type":"text/javascript","exec":["const json = pm.response.json();","const entry = Array.isArray(json) ? json[0] : json;","if (entry && entry.OrderId && entry.OrderId.startsWith(\"order-\")) {","  pm.collectionVariables.set(\"orderId\", entry.OrderId);","  console.log(\"Saved orderId:\", entry.OrderId);","} else {","  console.warn(\"OrderId not found — set order-00000000-0000-0000-0000-000000000000 manually in collection variables\");","}"],"id":"44e2a659-d98f-4d75-8aee-9a74ac57e792"}}],"id":"c18951d5-fbb7-4d8e-bc7c-f55f7140414a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/waybill-info/PCW000208235","description":"<p>Returns the CQRS aggregate OrderId for a given PCW waybill number.</p>\n<p>PRE-CONDITION: Run Get Staged Orders first to auto-populate PCW000208235, or set it manually (e.g. PCW000208235).</p>\n<p>The test script saves the OrderId into order-00000000-0000-0000-0000-000000000000 — run this before Re-Schedule Order or Cancel Picup.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","waybill-info","PCW000208235"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"5f98117e-287c-4c3c-9f5b-293ea98082dc","name":"Waybill Info","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/waybill-info/PCW000208235","description":"Returns the CQRS aggregate OrderId for a given PCW waybill number.\n\nPRE-CONDITION: Run Get Staged Orders first to auto-populate PCW000208235, or set it manually (e.g. PCW000208235).\n\nThe test script saves the OrderId into order-00000000-0000-0000-0000-000000000000 — run this before Re-Schedule Order or Cancel Picup."},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"BusinessId\": \"business-65689f93-3cba-4282-9ef7-e346c6afce7d\",\n    \"OrderId\": \"order-5e05d7e2-9cbb-43e2-bdb9-b2ab89f38918\",\n    \"OrderWaybill\": \"PCW000208251\",\n    \"CourierCode\": null\n  }\n]"}],"_postman_id":"c18951d5-fbb7-4d8e-bc7c-f55f7140414a"},{"name":"Re-Schedule Order","id":"2fc46279-ede1-4621-9f53-21d515769a57","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"scheduled_date\": \"\",\n  \"fleet_allocation\": \"Picup\",\n  \"reset_lottery_attempts\": true\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/order-00000000-0000-0000-0000-000000000000/schedule-order","description":"<p>This call can be made to cancel a order that has been created and reschedule.</p>\n<p>Should the order already have been collected, we will failed the delivery with the reason \"order-cancelled\" and mark it off to be returned to the origin by default.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","order-00000000-0000-0000-0000-000000000000","schedule-order"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"509c25a6-db42-461b-9469-79cc331b6137","name":"Re-Schedule Order","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"scheduled_date\": \"2023-07-05T06:59:22.852Z\",\r\n  \"fleet_allocation\": \"Picup\", //Picup or Contractor\r\n  \"reset_lottery_attempts\": true\r\n}","options":{"raw":{"language":"text"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/update-warehouse"},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"2fc46279-ede1-4621-9f53-21d515769a57"},{"name":"Cancel Picup","id":"40e37367-0900-4dda-829b-b10dd2a1acf2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/order-00000000-0000-0000-0000-000000000000/cancel-order","description":"<p>This call can be made to cancel a picup that has been created. It takes in the picup ID and returns a 200 OK</p>\n","urlObject":{"protocol":"https","path":["v1","integration","order-00000000-0000-0000-0000-000000000000","cancel-order"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"90271397-0551-44e5-88a4-c6e1c6094797","name":"Cancel Picup","originalRequest":{"method":"POST","header":[{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/javascript","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"javascript"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/{{picup-id}}/cancel"},"status":"OK","code":200,"_postman_previewlanguage":"plain","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Expires","value":"-1"},{"key":"Server","value":"Microsoft-IIS/8.5"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Wed, 02 Sep 2020 13:32:21 GMT"},{"key":"Content-Length","value":"0"}],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"40e37367-0900-4dda-829b-b10dd2a1acf2"},{"name":"Get Order by Business Reference","event":[{"listen":"test","script":{"type":"text/javascript","exec":["const json = pm.response.json();","// The response may be a single object or array — handle both","const order = Array.isArray(json) ? json[0] : json;","if (order && order.order_id && String(order.order_id).startsWith(\"order-\")) {","  pm.collectionVariables.set(\"orderId\", order.order_id);","  console.log(\"Saved orderId:\", order.order_id);","} else {","  console.warn(\"Could not find CQRS order_id in response — set order-00000000-0000-0000-0000-000000000000 manually\");","}"],"id":"7011383a-751d-480f-b0c6-cff31e655d2a"}}],"id":"9b8c551a-16f3-4c4a-b73e-c6eee8ec1cbb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/order-by-business-reference/20200710-180831-ABC831-c","description":"<p>Should you need to look up an order on our system, you can lookup using the <code>business-reference</code>. </p>\n<p><code>order-by-business-reference</code> call returns the order object, shwoing any details you might need, as well as the bucket for that order.</p>\n<p>This response includes the order's <code>waybill_number</code> which can be used for tracking</p>\n","urlObject":{"protocol":"https","path":["v1","integration","order-by-business-reference","20200710-180831-ABC831-c"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"b8d55783-d7c1-4733-af22-d4d0f5b8d9a0","name":"Get Order by Business Reference","originalRequest":{"method":"GET","header":[],"url":"picupdev-webapi.azurewebsites.net/v1/integration/order-by-business-reference/20200710-180831-ABC831-c"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Content-Length","value":"501"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Encoding","value":"gzip"},{"key":"Expires","value":"-1"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"Microsoft-IIS/10.0"},{"key":"X-AspNet-Version","value":"4.0.30319"},{"key":"Request-Context","value":"appId=cid-v1:6fc40a28-ded9-474d-9431-194206b95549"},{"key":"Access-Control-Expose-Headers","value":"Request-Context"},{"key":"X-Powered-By","value":"ASP.NET"},{"key":"Date","value":"Mon, 13 Jul 2020 14:31:48 GMT"}],"cookie":[],"responseTime":null,"body":"{\n  \"bucket\": {\n    \"delivery_date\": \"2026-06-08T00:00:00Z\",\n    \"shift_start\": \"09:00:00\",\n    \"shift_end\": \"17:00:00\"\n  },\n  \"order_aggregate_id\": \"order-5e05d7e2-9cbb-43e2-bdb9-b2ab89f38918\",\n  \"invoice_number\": \"PCW000208251\",\n  \"customer_name\": \"Test\",\n  \"customer_phone\": \"+27 21 111 1234\",\n  \"waybill_number\": \"PCW000208251\",\n  \"parcels\": {\n    \"parcel-a4-envelope\": 0,\n    \"parcel-small\": 1,\n    \"parcel-medium\": 0,\n    \"parcel-large\": 0,\n    \"parcel-xlarge\": 0\n  }\n}"}],"_postman_id":"9b8c551a-16f3-4c4a-b73e-c6eee8ec1cbb"},{"name":"Create Warehouse","id":"a765d221-92f1-4d01-ac85-0ce4002c0154","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"warehouse_details\": {\n    \"warehouse_id\": \"warehouse-0d6e2bc7-3cec-4a44-90b1-eeaab62f3195\",\n    \"warehouse_code\": \"WH1792040031\",\n    \"name\": \"Woodstock Warehouse\",\n    \"email\": \"warehouse@picup.co.za\",\n    \"address\": \"62 Greatmore St, Woodstock, Cape Town, 7915\",\n    \"phone\": \"0821112223\",\n    \"suburb\": \"Woodstock\",\n    \"country\": \"South Africa\",\n    \"country_short_code\": \"ZA\",\n    \"postal_code\": \"7915\",\n    \"latitude\": -33.9292364,\n    \"longitude\": 18.45457669999996,\n    \"is_eligible_for_da_consolidation\": true,\n    \"allow_business_consolidation\": false,\n    \"default_special_instructions\": \"Special Instructions go here\",\n    \"operating_hours\": [\n      {\n        \"day_of_week\": \"Monday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Tuesday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Wednesday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Thursday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Friday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      }\n    ]\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/create-warehouse","description":"<p>The Create Warehouse call is used to create Warehouses on the system.</p>\n<p>Warehouse details are specified in the request body as a json object.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","business-abc15fdb-fd15-4b3a-a52c-aec367702d05","create-warehouse"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"3896f4ae-193a-41ae-934f-211706c1affc","name":"Create Warehouse","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"text/plain","type":"text"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"warehouse_id\": \"warehouse-9cc07864-0255-4f84-b3f2-5697e21529e9\",\r\n  \"warehouse_code\": \"WH001\",\r\n  \"name\": \"Woodstock Warehouse\",\r\n  \"email\": \"warehouse@picup.co.za\",\r\n  \"address\": \"62 Greatmore St, Woodstock, Cape Town, 7915\",\r\n  \"phone\": \"0821112223\",\r\n  \"suburb\": \"Woodstock\",\r\n  \"country\": \"South Africa\",\r\n  \"country_short_code\": \"ZA\",\r\n  \"postal_code\": \"7915\",\r\n  \"latitude\": -33.9292364,\r\n  \"longitude\": 18.45457669999996,\r\n  \"is_eligible_for_da_consolidation\": true,\r\n  \"allow_business_consolidation\": false,\r\n  \"default_special_instructions\": \"Special Instructions go here\",\r\n  \"operating_hours\": [\r\n    {\r\n      \"day_of_week\": \"Monday\",\r\n      \"opening_time\": \"09:00:00\",\r\n      \"closing_time\": \"17:00:00\"\r\n    },\r\n    {\r\n      \"day_of_week\": \"Tuesday\",\r\n      \"opening_time\": \"09:00:00\",\r\n      \"closing_time\": \"17:00:00\"\r\n    },\r\n    {\r\n      \"day_of_week\": \"Wednesday\",\r\n      \"opening_time\": \"09:00:00\",\r\n      \"closing_time\": \"17:00:00\"\r\n    },\r\n    {\r\n      \"day_of_week\": \"Thursday\",\r\n      \"opening_time\": \"09:00:00\",\r\n      \"closing_time\": \"17:00:00\"\r\n    },\r\n    {\r\n      \"day_of_week\": \"Friday\",\r\n      \"opening_time\": \"09:00:00\",\r\n      \"closing_time\": \"17:00:00\"\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"text"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/create-warehouse"},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"\"warehouse-1e255f5a-3e86-4b2a-a130-35d9b8eb1054\""}],"_postman_id":"a765d221-92f1-4d01-ac85-0ce4002c0154"},{"name":"Update Warehouse","id":"70d8d681-c38e-4446-babd-6b4c8f7adc52","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"warehouse_details\": {\n    \"warehouse_id\": \"\",\n    \"warehouse_code\": \"\",\n    \"name\": \"Updated Warehouse Name\",\n    \"email\": \"warehouse@picup.co.za\",\n    \"address\": \"62 Greatmore St, Woodstock, Cape Town, 7915\",\n    \"phone\": \"0821112223\",\n    \"suburb\": \"Woodstock\",\n    \"postal_code\": \"7915\",\n    \"latitude\": -33.9292364,\n    \"longitude\": 18.45457669999996,\n    \"country\": \"South Africa\",\n    \"country_short_code\": \"ZA\",\n    \"is_eligible_for_da_consolidation\": false,\n    \"allow_business_consolidation\": false,\n    \"default_special_instructions\": \"Updated special instructions\",\n    \"client_name\": \"Picup Technologies\",\n    \"client_type\": \"Business\",\n    \"operating_hours\": [\n      {\n        \"day_of_week\": \"Monday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Tuesday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Wednesday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Thursday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      },\n      {\n        \"day_of_week\": \"Friday\",\n        \"opening_time\": \"09:00:00\",\n        \"closing_time\": \"17:00:00\"\n      }\n    ]\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/update-warehouse","description":"<p>The Update Warehouse call is used to update Warehouses on the system.</p>\n<p>Warehouse details are specified in the request body as a json object.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","business-abc15fdb-fd15-4b3a-a52c-aec367702d05","update-warehouse"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"6b72d0d3-5760-4b0b-ba20-07ada0be9018","name":"Update Warehouse","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"warehouse_details\": {\r\n        \"name\": \"Example Warehouse\",\r\n        \"email\": \"warehousemanager@exampe.com\",\r\n        \"address\": \"2 Fir Street, Observatory, Cape Town, South Africa\",\r\n        \"warehouse_code\": \"PIC01\", //optional\r\n        \"phone\": \"0216850212\",\r\n        \"suburb\": \"Observatory\",\r\n        \"postal_code\": \"7920\",\r\n        \"latitude\": -33.935389,\r\n        \"longitude\": 18.469159,\r\n        \"country\": \"South Africa\",\r\n        \"country_short_code\": \"ZA\",\r\n        \"is_eligible_for_da_consolidation\": false,\r\n        \"allow_business_consolidation\": false,\r\n        \"default_special_instructions\": \"Example Special Instructions\"\r\n    }\r\n}","options":{"raw":{"language":"text"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/business-abc15fdb-fd15-4b3a-a52c-aec367702d05/update-warehouse"},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"70d8d681-c38e-4446-babd-6b4c8f7adc52"},{"name":"Download Waybill PDF","id":"1ec77796-0af5-417f-943a-5cb534e2d959","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"[\n  \"PCW0000001\"\n]","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/download-waybills","description":"<p>Passing through the Picup order waybill number will generate a PDF waybill set for all parcels attached to this order. This is returned as a PDF blob.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","download-waybills"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"99b51e02-d7b8-4392-b2d9-690c67cf0dd3","name":"Download Waybill PDF","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"[\"PCW0000001\"]","options":{"raw":{"language":"text"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/download-waybills"},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"1ec77796-0af5-417f-943a-5cb534e2d959"},{"name":"Reconcile Parcels","id":"ce33d1c6-256e-4e9c-8c87-252f09a50a2b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"reconcile_parcels\": [\n    {\n      \"parcel_waybill\": \"\",\n      \"result\": \"Deliver\"\n    }\n  ],\n  \"reconcile_reason\": \"Reconcile parcels reason.\"\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/integration/reconcile-parcels","description":"<p>This endpoint allows parcels to be reconciled to a specified final state based on the parcel waybill.</p>\n<p>Valid values for \"result\" - which is the final state being reconciled to:</p>\n<ul>\n<li><p><code>StartFragmentCollect</code></p>\n</li>\n<li><p><code>FailCollection</code></p>\n</li>\n<li><p><code>Deliver</code></p>\n</li>\n<li><p><code>FailDelivery</code></p>\n</li>\n<li><p><code>Return</code></p>\n</li>\n<li><p><code>FailFinalCollectionEndFragment</code></p>\n</li>\n</ul>\n<blockquote>\n<p>NB: THE PARCELS PROVIDED CAN BE FROM SEPARATE/INDIVIDUAL ORDERS, AS THE RECON IS ON THE PARCEL LEVEL - THEY WILL HOWEVER SHARE THE SAME REASON PROVIDED.</p>\n</blockquote>\n<p>NOTE: requires a real in-flight value - set  (a dispatched last-mile parcel_waybill) / 0 (an integer order id currently on 219). No other request in this collection produces that state.</p>\n","urlObject":{"protocol":"https","path":["v1","integration","reconcile-parcels"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"d40215d8-4de2-4f78-9a40-abf6e0cf5981","name":"Reconcile Parcels","originalRequest":{"method":"POST","header":[{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"reconcile_parcels\": [\r\n        {\r\n            \"parcel_waybill\": \"PCW000100000_1\",\r\n            \"result\": \"Deliver\"\r\n        },\r\n        {\r\n            \"parcel_waybill\": \"PCW000100000_3\",\r\n            \"result\": \"FailDelivery\"\r\n        }\r\n    ],\r\n    \"reconcile_reason\": \"Reconcile parcels reason.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"picupdev-webapi.azurewebsites.net/v1/integration/reconcile-parcels"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":""}],"_postman_id":"ce33d1c6-256e-4e9c-8c87-252f09a50a2b"},{"name":"Change Bucket","event":[{"listen":"test","script":{"id":"976da3c5-1911-492f-9dd9-cf29dd981841","exec":["const oid = pm.collectionVariables.get('change-bucket-order-id');","if (!oid || String(oid) === '0') {","  console.warn('change-bucket-order-id not set from Get Staged Orders. Set it to an integer order_id that is on 219, then re-run.');","} else {","  pm.test('Status code is 200', () => pm.response.to.have.status(200));","  pm.test('Returns a bucket id', () => pm.expect(Number(pm.response.text())).to.be.a('number').and.not.NaN);","}"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"14d01d88-4940-4625-8c7a-39ecfbe2f870","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"new_bucket_id\": null,\n  \"bucket_details\": {\n    \"delivery_date\": \"\",\n    \"shift_start\": \"06:00\",\n    \"shift_end\": \"08:00\",\n    \"warehouse_id\": \"\",\n    \"warehouse_name\": \"{{warehouse-name}}\"\n  },\n  \"order_ids\": [\n    0\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/bucket/219/change-bucket","description":"<p>Moves one or more orders off their current bucket into another bucket.</p>\n<p>Path segment is the SOURCE bucket the orders are on now. <code>order_ids</code> are integer <code>order_id</code> values (as returned by Get Staged Orders), not GUIDs or waybills. With <code>new_bucket_id</code> null, <code>bucket_details</code> is used to find or create the target bucket - this request uses a distinct 06:00-08:00 shift so a separate target bucket is used.</p>\n<p>Chaining: Get Staged Orders finds a staged order that is currently in a bucket and sets 219 and 0. If no bucketed order exists in the environment, set 0 manually to an integer order_id on 219.</p>\n","urlObject":{"protocol":"https","path":["v1","bucket","219","change-bucket"],"host":["picupdev-webapi.azurewebsites.net"],"query":[],"variable":[]}},"response":[{"id":"53ae9336-7273-43aa-8364-ef854e685dda","name":"Change Bucket","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"api-key","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05"}],"body":{"mode":"raw","raw":"{\n  \"new_bucket_id\": null,\n  \"bucket_details\": {\n    \"delivery_date\": \"\",\n    \"shift_start\": \"09:00\",\n    \"shift_end\": \"17:00\",\n    \"warehouse_id\": \"\"\n  },\n  \"order_ids\": [\n    44731\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://picupdev-webapi.azurewebsites.net/v1/bucket/219/change-bucket","description":"The `Change Bucket` call allows orders to be moved from one bucket to another. The source `bucket_id` is passed as a URL parameter, with the destination specified in the request body as either a `new_bucket_id` for an existing bucket, or a `bucket_details` object to create a new one.\n\nThe `order_ids` array specifies which integer order IDs (as returned by `Get Staged Orders`) should be moved from the source bucket.\n\n**Important:** If `new_bucket_id` is provided, it must not be in `Dispatched` state. Set `new_bucket_id` to `null` to have the system find or create a matching bucket from `bucket_details`.\n\nBuckets can be viewed at: [http://staging.picup.co.za/dashboard/buckets](http://staging.picup.co.za/dashboard/buckets)\n\nA successful request will return a `200 OK` with the resulting `bucket_id`."},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"}],"cookie":[],"responseTime":null,"body":"1764"}],"_postman_id":"14d01d88-4940-4625-8c7a-39ecfbe2f870"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["const now = new Date();","const pad = n => String(n).padStart(2, \"0\");","const todayDate = now.getFullYear() + \"-\" + pad(now.getMonth()+1) + \"-\" + pad(now.getDate());","const todayDatetime = now.toISOString();","pm.collectionVariables.set(\"today-date\", todayDate);","pm.collectionVariables.set(\"today-datetime\", todayDatetime);"],"id":"53628bee-adb7-4201-a46c-8e1ef58891fc"}}],"variable":[{"key":"picup-url","value":"picupdev-webapi.azurewebsites.net","description":"Hostname only — no scheme. Dev: picupdev-webapi.azurewebsites.net, Staging: picupstaging-webapi.azurewebsites.net"},{"key":"picup-version","value":"v1"},{"key":"business-id","value":"business-abc15fdb-fd15-4b3a-a52c-aec367702d05","description":"Sandbox API key / business ID"},{"key":"orderId","value":"order-00000000-0000-0000-0000-000000000000","description":"CQRS aggregate ID in order-[GUID] format — auto-saved by Get Order by Business Reference test script"},{"key":"business-reference","value":"20200710-180831-ABC831-c","description":"Your internal order reference string"},{"key":"bucketId","value":"219","description":"Bucket ID integer"},{"key":"order-ingestion-url","value":"karooooodev-orderingestion.azurewebsites.net","description":"Hostname only — no scheme. Order ingestion microservice — update per environment"},{"key":"warehouse-id","value":"","description":"Auto-populated by Business Details test script — do not set manually"},{"key":"warehouse-code","value":"","description":"Auto-populated by Business Details test script — do not set manually"},{"key":"waybill-number","value":"PCW000208235","description":"Auto-populated by Get Staged Orders test script, or set manually to any PCW number"},{"key":"today-date","value":"","description":"Auto-set by collection pre-request script — YYYY-MM-DD format"},{"key":"today-datetime","value":"","description":"Auto-set by collection pre-request script — ISO 8601 UTC format"},{"key":"start-date","value":"2020-06-10","description":"Fixed start date for range queries — YYYY-MM-DD"},{"key":"start-datetime","value":"2020-06-10T00:00:00.000Z","description":"Fixed start date for range queries — ISO 8601 UTC"},{"key":"addbucket-ref","value":""},{"key":"staged-waybill-number","value":""},{"key":"parcel-waybill","value":""},{"key":"change-bucket-order-id","value":"0"},{"key":"change-bucket-source-id","value":"219"}]}