{"_id":"575676128749830e00681e99","project":"55a4d5531a5f991700a9409e","user":"560266564f15002100ee444b","parentDoc":null,"version":{"_id":"575676128749830e00681e82","__v":2,"project":"55a4d5531a5f991700a9409e","createdAt":"2016-06-07T07:21:54.005Z","releaseDate":"2016-06-07T07:21:54.005Z","categories":["575676128749830e00681e83","575676128749830e00681e84","575676128749830e00681e85","575676128749830e00681e86","575676128749830e00681e87","575676128749830e00681e88","575676128749830e00681e89","575676128749830e00681e8a","575676128749830e00681e8b","580c5ff36c35230f003d3b49"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"575676128749830e00681e83","__v":0,"version":"575676128749830e00681e82","project":"55a4d5531a5f991700a9409e","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-07-14T09:24:36.519Z","from_sync":false,"order":0,"slug":"setup","title":"urb-it as delivery method"},"__v":0,"updates":["56e7fd57b662631700974e68"],"next":{"pages":[],"description":""},"createdAt":"2015-09-24T07:45:59.685Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"57bc0cc860d92e0e0079e564","examples":{"codes":[]},"method":"post","auth":"required","params":[],"url":"/v2/orders/validate"},"isReference":true,"order":2,"body":"Validate delivery is called automaticly when [Create Order](doc:create-order) is used.\n\nIt is needed to validate delivery when changes are made to the cart. This is because the changes to the cart might affect urb-its ability to deliver the order.\n\n**Request parameters** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"0-0\": \"delivery_type\",\n    \"0-1\": \"[Delivery Type](doc:delivery-type)\",\n    \"0-2\": \"OneHour, Specific *Required\",\n    \"1-0\": \"delivery_expected_at\",\n    \"1-1\": \"datetime\",\n    \"1-2\": \"2012-04-23T18:25:43+02:00, *Required for Specific and optional for OneHour\",\n    \"2-0\": \"postal_code\",\n    \"2-1\": \"string\",\n    \"2-2\": \"string(50), *Required\",\n    \"4-0\": \"pickup_location\",\n    \"4-1\": \"[Pickup Location](doc:pickup-location)\",\n    \"4-2\": \"Guid(nullable)\",\n    \"5-0\": \"articles\",\n    \"5-1\": \"Article[]\",\n    \"5-2\": \"[Article](doc:article), *Required\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"The available delivery types are described under section [Delivery Type](doc:delivery-type)\",\n    \"1-3\": \"The expected date and time of the delivery.\\n\\nBy default the API datetime input uses Universal Time Coordinated (UTC). To offset the UTC, use plus or minus 00:00 in your API call. \\nThis allows you to input times in a different time zone; however, this does not modify the output times, which are always UTC. \\n\\n***Example:**  If the specified Delivery type is **OneHour = 1** we expect the value to be one hour (59-60 minutes) from from when the order was received.* \\n\\n***Example**: If the specified Delivery type is **Specific = 2** we expect the date and time specified by the end user. This should be at least one hour in the future.* \\n\\n***Important**: Opening hours can be configured in the Retailer Portal. If set, delivery date and time will be validated against those hours.* \\n\\n***Important**: If no opening hours configured in Retailer Portal, no opening hours validation will be made. We assume that the expected delivery date is validated against the retailers opening hours at the client. \\nThe pickup location is open at least one hour before the specified date and time.*\",\n    \"2-3\": \"The postal code of the end user. This is used in conjunction with the position of the selected pickup location to verify if a delivery is possible.\\n\\nMaximum of 20 characters.\\n\\nAllowed characters: Numerals \\\"0\\\" to \\\"9\\\", Upper & lower case letters of the ISO basic Latin alphabet, Spaces, hyphens\",\n    \"4-3\": \"The preferred Pickup location where the Associate should go to pickup the order, if no pickup location provided the closest to the customer will be used as pickup location.\\n\\n*The Pickup location will be validated agaist the delivery location of the end user and the working radius of the Associates.\\nIf no pickup location provided, the closest to consumer will be used.*\",\n    \"5-3\": \"The list of articles that should be delivered.\",\n    \"3-0\": \"store_location\",\n    \"3-1\": \"[Store Location](doc:store-location)\",\n    \"3-3\": \"The store locations are described under section [Store Location](doc:store-location)\",\n    \"3-2\": \"[Store Location](doc:store-location)\\n*Optional\\nGuid(nullable)\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\n}\n[/block]\n** Response Parameters **\nThe returned JSON object works as a verification of the validated order.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"delivery_type\",\n    \"0-1\": \"string\",\n    \"0-2\": \"[Delivery Type](doc:delivery-type)\",\n    \"0-3\": \"Verifies the delivery type for the order.\",\n    \"1-0\": \"postal_code\",\n    \"1-1\": \"string\",\n    \"1-2\": \"string\",\n    \"1-3\": \"Returns the postal code for the given order.\",\n    \"2-0\": \"delivery_expected_at\",\n    \"2-1\": \"DateTime\",\n    \"2-2\": \"2015-09-23T15:26:11.4595342+00:00\",\n    \"2-3\": \"Returns the expected delivery date and time. Wrapped as string.\",\n    \"3-0\": \"pickup_location\",\n    \"3-1\": \"object\",\n    \"3-2\": \"pickup_location object\",\n    \"3-3\": \"Returns the pickup_location object, containing id for the pickup_location.\",\n    \"4-0\": \"articles\",\n    \"4-1\": \"[Article](doc:article)[]\",\n    \"4-2\": \"[Article](doc:article)[]\",\n    \"4-3\": \"The articles included in the actual order. Returned as an array containing the object [Articles](doc:article)\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\n}\n[/block]\n## Sample JSON Request Header\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST https://stage-retailer-api.urb-it.com/api/delivery/validate HTTP/1.1\\nAccept-Encoding: gzip,deflate\\nContent-Type: application/json;charset=UTF-8\\nAuthorization: UWA b0477a45-1198-419f-b159-e484be341512:DNX22veCTbges6DH9n67TAAzSa0jFE0qOtJBstvIdyU=:48e0e16-cbc9-4953-ad33-f3d17c5330dc:1444981142\\nHost: stage-retailer-api.urb-it.com\\nContent-Type: application/json\\nCache-Control: no-cache\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n## Sample JSON Request Body\n\nOneHour - \"delivery_expected_at\" - field is not needed anymore\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"delivery_type\\\": \\\"OneHour\\\",\\n  \\\"postal_code\\\": \\\"11442\\\",\\n  \\\"store_location\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\",\\n  \\\"pickup_location\\\": {\\n    \\\"id\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\"\\n      },\\n  \\\"articles\\\": [\\n    {\\n      \\\"identifier\\\": \\\"1000093569\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Apple iPhone 6 (small) 16 GB\\\"\\n    },\\n    {\\n      \\\"identifier\\\": \\\"1000021548\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Samsung Galaxy S5\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Sample JSON Response - \"OneHour\"\nIf Urb-it is available as a delivery option a **200 Ok** will be returned.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n{\\n  \\\"delivery_type\\\": \\\"OneHour\\\",\\n  \\\"postal_code\\\": \\\"11442\\\",\\n  \\\"delivery_expected_at\\\": \\\"2015-09-23T15:26:11.4595342+00:00\\\",\\n  \\\"pickup_location\\\": {\\n    \\\"id\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\"\\n  },\\n  \\\"articles\\\": [\\n    {\\n      \\\"identifier\\\": \\\"1000093569\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Apple iPhone 6 (small) 16 GB\\\"\\n    },\\n    {\\n      \\\"identifier\\\": \\\"1000021548\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Samsung Galaxy S5\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Sample JSON Request Body - \"Specific\"\n**Important** - When Delivery Type = Specific the \"delivery_expected_at\" is needed - with an offset\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"delivery_type\\\": \\\"Specific\\\",\\n  \\\"postal_code\\\": \\\"11144\\\",\\n  \\\"delivery_expected_at\\\": \\\"2016-06-03T15:00:00+02:00\\\",\\n  \\\"store_location\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\",\\n  \\\"pickup_location\\\": {\\n    \\\"id\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\"\\n      },\\n  \\\"articles\\\": [\\n    {\\n      \\\"identifier\\\": \\\"1000093569\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Apple iPhone 6 (small) 16 GB\\\"\\n    },\\n    {\\n      \\\"identifier\\\": \\\"1000021548\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Samsung Galaxy S5\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n## Sample JSON Response - \"Specific\"\nIf Urb-it is available as a delivery option a **200 Ok** will be returned.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n{\\n  \\\"delivery_type\\\": \\\"Specific\\\",\\n  \\\"postal_code\\\": \\\"11442\\\",\\n  \\\"delivery_expected_at\\\": \\\"2016-06-03T15:00:00+02:00\\\",\\n  \\\"pickup_location\\\": {\\n    \\\"id\\\": \\\"9ad97326-6e08-4a4c-bbfd-8244550872fa\\\"\\n  },\\n  \\\"articles\\\": [\\n    {\\n      \\\"identifier\\\": \\\"1000093569\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Apple iPhone 6 (small) 16 GB\\\"\\n    },\\n    {\\n      \\\"identifier\\\": \\\"1000021548\\\",\\n      \\\"quantity\\\": 1,\\n      \\\"description\\\": \\\"Samsung Galaxy S5\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\nIf the delivery is not available urb-it will return [Error Responses](doc:error-responses) as specified in the [Error Responses](doc:error-responses) documentation.","excerpt":"**Version 2.0**\nValidates if Urb-it can be offered as a delivery option for the end users cart.","slug":"validate-delivery","type":"endpoint","title":"Validate delivery"}

postValidate delivery

**Version 2.0** Validates if Urb-it can be offered as a delivery option for the end users cart.

Definition

{{ api_url }}{{ page_api_url }}

Documentation

Validate delivery is called automaticly when [Create Order](doc:create-order) is used. It is needed to validate delivery when changes are made to the cart. This is because the changes to the cart might affect urb-its ability to deliver the order. **Request parameters** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Constraints", "0-0": "delivery_type", "0-1": "[Delivery Type](doc:delivery-type)", "0-2": "OneHour, Specific *Required", "1-0": "delivery_expected_at", "1-1": "datetime", "1-2": "2012-04-23T18:25:43+02:00, *Required for Specific and optional for OneHour", "2-0": "postal_code", "2-1": "string", "2-2": "string(50), *Required", "4-0": "pickup_location", "4-1": "[Pickup Location](doc:pickup-location)", "4-2": "Guid(nullable)", "5-0": "articles", "5-1": "Article[]", "5-2": "[Article](doc:article), *Required", "h-3": "Description", "0-3": "The available delivery types are described under section [Delivery Type](doc:delivery-type)", "1-3": "The expected date and time of the delivery.\n\nBy default the API datetime input uses Universal Time Coordinated (UTC). To offset the UTC, use plus or minus 00:00 in your API call. \nThis allows you to input times in a different time zone; however, this does not modify the output times, which are always UTC. \n\n***Example:** If the specified Delivery type is **OneHour = 1** we expect the value to be one hour (59-60 minutes) from from when the order was received.* \n\n***Example**: If the specified Delivery type is **Specific = 2** we expect the date and time specified by the end user. This should be at least one hour in the future.* \n\n***Important**: Opening hours can be configured in the Retailer Portal. If set, delivery date and time will be validated against those hours.* \n\n***Important**: If no opening hours configured in Retailer Portal, no opening hours validation will be made. We assume that the expected delivery date is validated against the retailers opening hours at the client. \nThe pickup location is open at least one hour before the specified date and time.*", "2-3": "The postal code of the end user. This is used in conjunction with the position of the selected pickup location to verify if a delivery is possible.\n\nMaximum of 20 characters.\n\nAllowed characters: Numerals \"0\" to \"9\", Upper & lower case letters of the ISO basic Latin alphabet, Spaces, hyphens", "4-3": "The preferred Pickup location where the Associate should go to pickup the order, if no pickup location provided the closest to the customer will be used as pickup location.\n\n*The Pickup location will be validated agaist the delivery location of the end user and the working radius of the Associates.\nIf no pickup location provided, the closest to consumer will be used.*", "5-3": "The list of articles that should be delivered.", "3-0": "store_location", "3-1": "[Store Location](doc:store-location)", "3-3": "The store locations are described under section [Store Location](doc:store-location)", "3-2": "[Store Location](doc:store-location)\n*Optional\nGuid(nullable)" }, "cols": 4, "rows": 6 } [/block] ** Response Parameters ** The returned JSON object works as a verification of the validated order. [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "delivery_type", "0-1": "string", "0-2": "[Delivery Type](doc:delivery-type)", "0-3": "Verifies the delivery type for the order.", "1-0": "postal_code", "1-1": "string", "1-2": "string", "1-3": "Returns the postal code for the given order.", "2-0": "delivery_expected_at", "2-1": "DateTime", "2-2": "2015-09-23T15:26:11.4595342+00:00", "2-3": "Returns the expected delivery date and time. Wrapped as string.", "3-0": "pickup_location", "3-1": "object", "3-2": "pickup_location object", "3-3": "Returns the pickup_location object, containing id for the pickup_location.", "4-0": "articles", "4-1": "[Article](doc:article)[]", "4-2": "[Article](doc:article)[]", "4-3": "The articles included in the actual order. Returned as an array containing the object [Articles](doc:article)" }, "cols": 4, "rows": 5 } [/block] ## Sample JSON Request Header [block:code] { "codes": [ { "code": "POST https://stage-retailer-api.urb-it.com/api/delivery/validate HTTP/1.1\nAccept-Encoding: gzip,deflate\nContent-Type: application/json;charset=UTF-8\nAuthorization: UWA b0477a45-1198-419f-b159-e484be341512:DNX22veCTbges6DH9n67TAAzSa0jFE0qOtJBstvIdyU=:48e0e16-cbc9-4953-ad33-f3d17c5330dc:1444981142\nHost: stage-retailer-api.urb-it.com\nContent-Type: application/json\nCache-Control: no-cache", "language": "http" } ] } [/block] ## Sample JSON Request Body OneHour – "delivery_expected_at" – field is not needed anymore [block:code] { "codes": [ { "code": "{\n \"delivery_type\": \"OneHour\",\n \"postal_code\": \"11442\",\n \"store_location\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\",\n \"pickup_location\": {\n \"id\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\"\n },\n \"articles\": [\n {\n \"identifier\": \"1000093569\",\n \"quantity\": 1,\n \"description\": \"Apple iPhone 6 (small) 16 GB\"\n },\n {\n \"identifier\": \"1000021548\",\n \"quantity\": 1,\n \"description\": \"Samsung Galaxy S5\"\n }\n ]\n}", "language": "json" } ] } [/block] ## Sample JSON Response – "OneHour" If Urb-it is available as a delivery option a **200 Ok** will be returned. [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n{\n \"delivery_type\": \"OneHour\",\n \"postal_code\": \"11442\",\n \"delivery_expected_at\": \"2015-09-23T15:26:11.4595342+00:00\",\n \"pickup_location\": {\n \"id\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\"\n },\n \"articles\": [\n {\n \"identifier\": \"1000093569\",\n \"quantity\": 1,\n \"description\": \"Apple iPhone 6 (small) 16 GB\"\n },\n {\n \"identifier\": \"1000021548\",\n \"quantity\": 1,\n \"description\": \"Samsung Galaxy S5\"\n }\n ]\n}", "language": "json" } ] } [/block] ## Sample JSON Request Body – "Specific" **Important** – When Delivery Type = Specific the "delivery_expected_at" is needed – with an offset [block:code] { "codes": [ { "code": "{\n \"delivery_type\": \"Specific\",\n \"postal_code\": \"11144\",\n \"delivery_expected_at\": \"2016-06-03T15:00:00+02:00\",\n \"store_location\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\",\n \"pickup_location\": {\n \"id\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\"\n },\n \"articles\": [\n {\n \"identifier\": \"1000093569\",\n \"quantity\": 1,\n \"description\": \"Apple iPhone 6 (small) 16 GB\"\n },\n {\n \"identifier\": \"1000021548\",\n \"quantity\": 1,\n \"description\": \"Samsung Galaxy S5\"\n }\n ]\n}", "language": "json", "name": "JSON" } ] } [/block] ## Sample JSON Response – "Specific" If Urb-it is available as a delivery option a **200 Ok** will be returned. [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n{\n \"delivery_type\": \"Specific\",\n \"postal_code\": \"11442\",\n \"delivery_expected_at\": \"2016-06-03T15:00:00+02:00\",\n \"pickup_location\": {\n \"id\": \"9ad97326-6e08-4a4c-bbfd-8244550872fa\"\n },\n \"articles\": [\n {\n \"identifier\": \"1000093569\",\n \"quantity\": 1,\n \"description\": \"Apple iPhone 6 (small) 16 GB\"\n },\n {\n \"identifier\": \"1000021548\",\n \"quantity\": 1,\n \"description\": \"Samsung Galaxy S5\"\n }\n ]\n}", "language": "json", "name": "JSON" } ] } [/block] If the delivery is not available urb-it will return [Error Responses](doc:error-responses) as specified in the [Error Responses](doc:error-responses) documentation.

User Information

Try It Out

post
 
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status 
Response Headers
{{ tryResults.responseHeaders }}