Orders-orderId:DELETE

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(DELETE /orders/{orderId})
Line 15: Line 15:
  
 
== Response ==
 
== Response ==
 
 
=== Status Code ===
 
=== Status Code ===
;204 No Content
+
{| class="wikitable"
: Order was successfully deleted.
+
! Status Code
 +
! Error Message
 +
! Description
 +
|-
 +
| 204 No Content
 +
| align="center" | -
 +
| Order was successfully deleted.
 +
|-
 +
| 401 Unauthorized
 +
| align="center" | -
 +
| The '''OwnerId''' cookie or the '''Authorization''' header are not specified or do not permit deletion of the specified order.
 +
|-
 +
| 404 Not Found
 +
| Resource not found
 +
| The specified order does not exist or it was previously deleted.
 +
|-
 +
| 405 Method Not Allowed
 +
| Method not allowed
 +
| The order was submitted and cannot be deleted.
 +
|}
  
;404 Not Found
+
== Example ==
: The specified order does not exist or it was previously deleted.
+
  
;409 Conflict
+
=== Success ===
: The order was submitted and cannot be deleted.
+
'''Request'''
 +
<nowiki>
 +
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c
 +
Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/</nowiki>
  
== Example ==
+
'''Response'''
 +
<nowiki>
 +
204 No Content</nowiki>
  
=== Request ===
+
=== No permission ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2
 +
Cookie: OwnerId=wrong_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>
 +
 
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2
 +
Cookie: OwnerId=0b3fc7bd-6905-4de7-bddb-43d2c7365e7a; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type: application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound": {
 +
    "guid": "3d9b09b4-9737-473b-91a5-6a8d2d212581",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Order has already been submitted ===
 +
'''Request'''
 
  <nowiki>
 
  <nowiki>
 
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c
 
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c
Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/
+
Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/</nowiki>
</nowiki>
+
  
=== Response ===
+
'''Response'''
 
  <nowiki>
 
  <nowiki>
204 No Content
+
405 Method Not Allowed
</nowiki>
+
Content-Type: application/json; charset=UTF-8
 +
 
 +
{
 +
  "badMethod": {
 +
    "guid": "93343aac-1451-4ed1-bca8-ac143f263cbe",
 +
    "message": "Method not allowed",
 +
    "code": 405,
 +
    "details": ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Revision as of 03:44, 5 September 2014

DELETE /orders/{orderId}

Deletes an order. Only new orders that were not submitted can be deleted.

Contents

Request

DELETE /orders/{orderId}

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 - Order was successfully deleted.
401 Unauthorized - The OwnerId cookie or the Authorization header are not specified or do not permit deletion of the specified order.
404 Not Found Resource not found The specified order does not exist or it was previously deleted.
405 Method Not Allowed Method not allowed The order was submitted and cannot be deleted.

Example

Success

Request

DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c
Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/

Response

204 No Content

No permission

Request

DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2
Cookie: OwnerId=wrong_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.

Order does not exist

Request

DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2
Cookie: OwnerId=0b3fc7bd-6905-4de7-bddb-43d2c7365e7a; Path=/

Response

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

{
  "itemNotFound": {
    "guid": "3d9b09b4-9737-473b-91a5-6a8d2d212581",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Order has already been submitted

Request

DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c
Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/

Response

405 Method Not Allowed
Content-Type: application/json; charset=UTF-8

{
  "badMethod": {
    "guid": "93343aac-1451-4ed1-bca8-ac143f263cbe",
    "message": "Method not allowed",
    "code": 405,
    "details": ""
  }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox