Orders-orderId:DELETE

From Hostway API Documentation
Jump to: navigation, search

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.
403 Forbidden Unauthorized: Order failed permission check Access an associated order as an authenticated user, not associated with the 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.

Unassociated user without cookie

Request

DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2
Authorization: {unassociated_user_authorization}

Response

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

{
  "forbidden" : {
    "guid" : "bb99d8e5-cb4a-4c87-9c03-57743ef06ac7",
    "message" : "Unauthorized: Order failed permission check",
    "code" : 403,
    "details" : ""
  }
}

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