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

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision: Release 98)
 
(2 intermediate revisions by 2 users not shown)
Line 21: Line 21:
  
 
== Response ==
 
== Response ==
 
 
=== Status Code ===
 
=== Status Code ===
;204 No Content
+
{| 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.
 +
|-
 +
| rowspan="3" | 404 Not Found
 +
| rowspan="3" | Resource not found
 +
| Order does not exist.
 +
|-
 +
| Product could not be found in this order.
 +
|-
 +
| Service could not be found for this product.
 +
|-
 +
| 502 Bad Gateway
 +
| align="center" | -
 +
| Custom discount could not be deleted.
 +
|}
 +
 
 +
 
 +
== Example ==
 +
=== Success ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/products/{productId}/services/{serviceId}/discounts
 +
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
204 No Content</nowiki>
 +
 
 +
=== Missing authorization ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/products/{productId}/services/{serviceId}/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}/account/products/{productId}/services/{serviceId}/discounts
 +
Authorization: Basic ZWdjUlBtZWZiWnJVQHNpdGVjb250cm9sX2hvc3R3YXlfdXNfbWFpbjpTdnVROGlWOUFTVTc0
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
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" : ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{non-existent_orderId}/account/products/{productId}/services/{serviceId}/discounts
 +
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound" : {
 +
    "guid" : "8a56063d-b099-4688-b020-d31035529d45",
 +
    "message" : "Resource not found",
 +
    "code" : 404,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Product could not be found ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/products/{non-existent_productId}/services/{serviceId}/discounts
 +
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound" : {
 +
    "guid" : "42f454f4-a534-46ea-888e-c05af56c1130",
 +
    "message" : "Resource not found",
 +
    "code" : 404,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
  
;401 Unauthorized
+
=== Service could not be found ===
: The request was not properly authorized.
+
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/products/{productId}/services/{non-existent_serviceId}/discounts
 +
Authorization: Basic dGVzdC52cGxleEBjb3JwX2xkYXBfc2VydmljZV9jaGk6VHJAcXNQODch
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
  
;403 Forbidden
+
'''Response'''
: The client does not have sufficient privileges.
+
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
  
;404 Not Found
+
{
: Returned if the order could not be found.
+
  "itemNotFound" : {
 +
    "guid" : "42f454f4-a534-46ea-888e-c05af56c1130",
 +
    "message" : "Resource not found",
 +
    "code" : 404,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Latest revision as of 08:51, 15 September 2014

[edit] DELETE /orders/{orderId}/account/products/{productId}/services/{serviceId}/discounts

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

Contents


[edit] Request

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

[edit] 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
serviceId - string
UUID specifying the service for which actions are to be performed

[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.
Product could not be found in this order.
Service could not be found for this product.
502 Bad Gateway - Custom discount could not be deleted.


[edit] Example

[edit] Success

Request

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

Response

204 No Content

[edit] Missing authorization

Request

DELETE /orders/{orderId}/account/products/{productId}/services/{serviceId}/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}/account/products/{productId}/services/{serviceId}/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" : ""
  }
}

[edit] Order does not exist

Request

DELETE /orders/{non-existent_orderId}/account/products/{productId}/services/{serviceId}/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" : ""
  }
}

[edit] Product could not be found

Request

DELETE /orders/{orderId}/account/products/{non-existent_productId}/services/{serviceId}/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" : ""
  }
}

[edit] Service could not be found

Request

DELETE /orders/{orderId}/account/products/{productId}/services/{non-existent_serviceId}/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" : ""
  }
}

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox