Orders-orderId-account-products-productId:PUT

From Hostway API Documentation
Revision as of 10:52, 20 August 2015 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PUT /orders/{orderId}/account/products/{productId}

Updates an existing product in order builder. Currently supports only updating the billing cycle.

Contents


Request

PUT /orders/{orderId}/account/products/{productId}

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


URI 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.

Request Body

A dictionary containing the key "billingCycle" and a value that is integer.

{
  "billingCycle": 12
}
 

Validation Rules

  1. The product URL ( https://api.hostway.com/orders/{orderId}/account/products/{productId} ) should point to a valid product already added to the order.
  2. The billing cycle should be a valid integer between 1 and 120 and also a valid billing cycle as defined in ServicePlex.

Response

Status Code

Status Code Error Message Description
204 No Content - The operation was successfully completed.
400 Bad Request POST data error Missing billing cycle value.
POST data error Trying to add a billing cycle less than 1.
POST data error Trying to update the billing cycle to value > 120.
Unable to update the product 0000014ee39eee9c95fa4b5b007f000000010001 Trying to update the billing cycle to value that is not available for the product.
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. The OwnerId cookie was not specified or is incorrect.
403 Forbidden Unauthorized: Products failed permission check The client does not have permissions to update the product.
404 Not Found Resource not found The client is trying to update the billing cycle for a non existing product or order.
502 Bad Gateway - Unexpected backend response.

Response Body

Successful response

None.

Error responses

400 Bad Request - empty body is passed
{
    "badRequest": {
        "guid": "bd80dfdc-5752-4472-96f2-90f590ddb3f9",
        "message": "POST data error",
        "code": 400,
        "details":  {"billingCycle": "Required"}
    }
}

400 Bad Request - invalid body is passed (required field is missing)
{
    "badRequest": {
        "guid": "aae865ae-5102-49d9-b1ef-8a5419cc0ce7",
        "message": "POST data error",
        "code": 400,
        "details":  {"billingCycle": "Required"}
    }
}

400 Bad Request - invalid billing cycle is passed
{
    "badRequest": {
        "guid": "fdd0b796-c690-47af-9666-0478e2bcae27",
        "message": "POST data error",
        "code": 400,
        "details":  {"billingCycle": "0 is less than minimum value 1"}
    }
}

400 Bad Request - invalid billing cycle is passed
{
    "computeFault": {
        "guid": "1e98f8ea-d298-4867-a9aa-0a6486dbefb0",
        "message": "POST data error",
        "code": 400,
        "details": {"billingCycle": "122 is greater than maximum value 120"}
    }
}

400 Bad Request - billing cycle is not available for the product
{
    "computeFault": {
        "guid": "1e98f8ea-d298-4867-a9aa-0a6486dbefb0",
        "message": "Unable to update the product 0000014edfe57d8b9b2c78bf007f000000010001",
        "code": 400,
        "details": ""
    }
}
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.
403 Forbidden

{
    "forbidden": {
                  "guid": "6af8e3e6-c3dc-4083-8389-1c1a038c62c0",
                  "message": "Unauthorized: Products failed permission check",
                  "code": 403,
                  "details": ""
                 }
}
404 Not Found - the order or product was not found.
{
    "itemNotFound": {
        "guid": "e1792d8a-5b0a-43ef-adf5-34a0710c8fc5",
        "message": "Resource not found",
        "code": 404,
        "details": ""
    }
}
502 Bad Gateway - unexpected error from the backend.
{
    "computeFault": {
        "guid": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce",
        "timestamp": "2014-09-10 20:59:50",
        "code": 502,
        "errorRefId": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce"
    }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox