Orders-orderId-discounts:DELETE
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 85) |
Mike.robski (Talk | contribs) m (1 revision: Release 98) |
||
(One intermediate revision by one user not shown) | |||
Line 16: | Line 16: | ||
== Response == | == Response == | ||
− | |||
=== Status Code === | === Status Code === | ||
− | + | {| class='wikitable' | |
− | : Success | + | |- |
+ | ! Status Code | ||
+ | ! Error Message | ||
+ | ! Description | ||
+ | |- | ||
+ | | 204 No Content | ||
+ | | align="center" | - | ||
+ | | The request was executed successfully. | ||
+ | |- | ||
+ | | 401 Unauthorized | ||
+ | | align="center" | - | ||
+ | | 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 | ||
+ | | align="center" | - | ||
+ | | Unexpected backend response. Cannot delete custom discounts. | ||
+ | |} | ||
+ | |||
+ | == Example == | ||
+ | === Success === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/{orderId}/discounts | ||
+ | Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 204 No Content</nowiki> | ||
+ | |||
+ | === Missing authorization === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/{orderId}/discounts | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 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.</nowiki> | ||
+ | |||
+ | === Insuffucient privileges === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/{orderId}/discounts | ||
+ | Authorization: Basic ZWdjUlBtZWZiWnJVQHNpdGVjb250cm9sX2hvc3R3YXlfdXNfbWFpbjpTdnVROGlWOUFTVTc0 | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 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": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order does not exist === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/{non-existent_orderId}/discounts | ||
+ | Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
− | + | '''Response''' | |
− | : | + | <nowiki> |
+ | 404 Not Found | ||
+ | Content-Type : application/json; charset=UTF-8 | ||
− | + | { | |
− | : | + | "itemNotFound": { |
+ | "guid": "7f3091bd-5930-4f14-9f02-86780cd8405f", | ||
+ | "message": "Resource not found", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
− | |||
− | |||
== See also == | == See also == |
Latest revision as of 07:51, 15 September 2014
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 |
Request
DELETE /orders/{orderId}/discounts
Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
URI Parameters
None.
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.
Response
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. |
Example
Success
Request
DELETE /orders/{orderId}/discounts Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch Cookie: OwnerId={owner_id}; Path=/
Response
204 No Content
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.
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": "" } }
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": "" } }
See also