Orders-orderId-discounts:DELETE
From Hostway API Documentation
(Difference between revisions)
(→Status Code) |
Mike.robski (Talk | contribs) m (1 revision: Release 98) |
Latest revision as of 07:51, 15 September 2014
[edit] DELETE /orders/{orderId}/discounts
Remove all discounts that were previously added at the Order level. This will not remove discounts that were added to specific products or services.
Contents |
[edit] Request
DELETE /orders/{orderId}/discounts
[edit] Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
[edit] URI Parameters
None.
[edit] Request Headers
- Cookie
- A cookie named OwnerId to identify the client (for most browser clients, the browser will do this automatically, depending on the browser configuration). The value of the cookie would come from the response to the create order request in the Set-Cookie response header.
[edit] Response
[edit] Status Code
Status Code | Error Message | Description |
---|---|---|
204 No Content | - | The request was executed successfully. |
401 Unauthorized | - | The request was not properly authorized. |
403 Forbidden | Unauthorized: DiscountsView failed permission check | The client does not have sufficient privileges. |
404 Not Found | Resource not found | Order does not exist. |
502 Bad Gateway | - | Unexpected backend response. Cannot delete custom discounts. |
[edit] Example
[edit] Success
Request
DELETE /orders/{orderId}/discounts Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch Cookie: OwnerId={owner_id}; Path=/
Response
204 No Content
[edit] Missing authorization
Request
DELETE /orders/{orderId}/discounts Cookie: OwnerId={owner_id}; Path=/
Response
401 Unauthorized Content-Type : text/plain; charset=UTF-8 401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
[edit] Insuffucient privileges
Request
DELETE /orders/{orderId}/discounts Authorization: Basic ZWdjUlBtZWZiWnJVQHNpdGVjb250cm9sX2hvc3R3YXlfdXNfbWFpbjpTdnVROGlWOUFTVTc0 Cookie: OwnerId={owner_id}; Path=/
Response
403 Forbidden Content-Type : application/json; charset=UTF-8 { "forbidden": { "guid": "8e235035-f8fe-465f-9b5d-85ef49829fd3", "message": "Unauthorized: DiscountsView failed permission check", "code": 403, "details": "" } }
[edit] Order does not exist
Request
DELETE /orders/{non-existent_orderId}/discounts Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch Cookie: OwnerId={owner_id}; Path=/
Response
404 Not Found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "7f3091bd-5930-4f14-9f02-86780cd8405f", "message": "Resource not found", "code": 404, "details": "" } }
[edit] See also