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

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 86)
(Status Code)
Line 22: Line 22:
  
 
== Response ==
 
== Response ==
 
 
=== Status Code ===
 
=== Status Code ===
;204 No Content
+
{| class='wikitable'
: The promotion code was successfully set.
+
|-
 +
! Status Code
 +
! Error Message
 +
! Description
 +
|-
 +
| 204 No Content
 +
| align="center" | -
 +
| The operation was successfully completed.
 +
|-
 +
| rowspan="2" | 404 Not Found
 +
| rowspan="2" | Resource not found
 +
| Order does not exist.
 +
|-
 +
| Product does not exist.
 +
|-
 +
| 502 Bad Gateway
 +
| align="center" | -
 +
| Unexpected backend response. Cannot delete promotion code.
 +
|}
 +
 
 +
== Example ==
 +
=== Successfully delete a promotion code for product ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/products/{product_id}/promotion
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
204 No Content</nowiki>
 +
 
 +
=== Product does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{order_id}/account/products/{non-existent_product_id}/promotion
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
  
;401 Unauthorized
+
'''Response'''
: The request was not properly authorized.
+
<nowiki>
 +
404 Not found
 +
Content-Type : application/json; charset=UTF-8
  
;404 Not Found
+
{
: Returned if the order or the product could not be found.
+
  "itemNotFound": {
 +
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Revision as of 09:30, 11 September 2014

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

Set promotion code for a product in an order.

Contents


Request

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

URI 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

Query String Parameters

None.

Request Headers

Content-Type
Required. Set this header to application/json; charset=UTF-8
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 operation was successfully completed.
404 Not Found Resource not found Order does not exist.
Product does not exist.
502 Bad Gateway - Unexpected backend response. Cannot delete promotion code.

Example

Successfully delete a promotion code for product

Request

DELETE /orders/{orderId}/account/products/{product_id}/promotion
Cookie: OwnerId={owner_id}; Path=/

Response

204 No Content

Product does not exist

Request

DELETE /orders/{order_id}/account/products/{non-existent_product_id}/promotion
Cookie: OwnerId={owner_id}; Path=/

Response

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

{
  "itemNotFound": {
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox