Orders-orderId-account-products-productId-discounts:DELETE

From Hostway API Documentation
Jump to: navigation, search

DELETE /orders/{orderId}/account/products/{productId}/discounts

Remove all discounts that were previously added at the Product level. This will not remove discounts that were added at the order or service level.

Contents


Request

DELETE /orders/{orderId}/account/products/{productId}/discounts

Request Parameters

orderId - string
The unique order Id. The URI of the order is returned by the POST /orders call.
productId - string
UUID specifying the product for which actions are to be performed

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.
Product could not be found.
502 Bad Gateway - Unexpected backend response. Cannot delete custom product discounts.

Example

Success

Request

DELETE /orders/{orderId}/account/products/{productId}/discounts
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
Cookie: OwnerId={owner_id}; Path=/

Response

204 No Content

Missing authorization

Request

DELETE /orders/{orderId}/account/products/{productId}/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}/account/products/{productId}/discounts
Authorization: Basic ZWdjUlBtZWZiWnJVQHNpdGVjb250cm9sX2hvc3R3YXlfdXNfbWFpbjpTdnVROGlWOUFTVTc0
Cookie: OwnerId={owner_id}; Path=/

Response

403 Forbidden
Content-Type : application/json; charset=UTF-8

{
  "forbidden" : {
    "guid" : "a0c6a265-eaa9-4187-b4eb-0b0b7b112810",
    "message" : "Unauthorized: DiscountsView failed permission check",
    "code" : 403,
    "details" : ""
  }
}

Order does not exist

Request

DELETE /orders/{non-existent_orderId}/account/products/{productId}/discounts
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound" : {
    "guid" : "8a56063d-b099-4688-b020-d31035529d45",
    "message" : "Resource not found",
    "code" : 404,
    "details" : ""
  }
}

Product could not be found

Request

DELETE /orders/{orderId}/account/products/{non-existent_productId}/discounts
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound" : {
    "guid" : "42f454f4-a534-46ea-888e-c05af56c1130",
    "message" : "Resource not found",
    "code" : 404,
    "details" : ""
  }
}


See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox