Order-Products-Account-Modify
Mike.robski (Talk | contribs) m (1 revision: Release 92) |
Latest revision as of 11:20, 8 April 2014
Contents
|
[edit] Set and modify an account on a later step when ordering products and services
This example provides the steps to set order's account on a later step and modify it afterward.
[edit] Create a new order
Use POST /orders to create a new order
[edit] Request
POST /orders Content-Type: application/json; charset=UTF-8 {}
[edit] Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001 Set-Cookie : OwnerId=d0977ed2-86e7-4101-adfe-2675ba0e26ac; Path=/ { "orderId": "000001452259ee0103d4e652007f000000010001", "links": [ {"href": "https://api.hostway.com/orders/", "rel": "self"}, {"href": "https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001", "rel": "item"} ] }
[edit] Add a product
Use POST /orders/{order_id}/account/products to add a product
[edit] Request
POST /orders/000001452259ee0103d4e652007f000000010001/account/products Content-Type: application/json; charset=UTF-8 { "offering": "https://api.hostway.com/productSpecifications/core.plangroup.dedserver.plan4/offerings/USD-1" }
[edit] Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/ { "url": "https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/" }
[edit] Add a service to the product with no attributes
Use POST /orders/{order_id}/account/products/{productId}/services to add a product's service
[edit] Request
POST /orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/services Content-Type: application/json; charset=UTF-8 { "name": "test123.com", "serviceSpecification": "https://api.hostway.com/serviceSpecifications/core.dedserver", "billingCycle": 1 }
[edit] Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/000001452292557b24c2acc0007f000000010001/account/products/0000014522925d3222f0ce5b007f000000010001/services/0000014522926e5b266b61ad007f000000010001/ { "url": "https://api.hostway.com/orders/000001452292557b24c2acc0007f000000010001/account/products/0000014522925d3222f0ce5b007f000000010001/services/0000014522926e5b266b61ad007f000000010001/" }
[edit] Set an existing account for the order
Use PUT /orders/{order_id}/account to assign an existing account to the order
[edit] Request
PUT /orders/000001452292557b24c2acc0007f000000010001/account Content-Type: application/json; charset=UTF-8 { "accountNumber": "test793347" }
[edit] Response
204 No Content
[edit] Set some account attributes
Use PUT /orders/{orderId}/account/attributes to set the account attributes in an order.
[edit] Request
PUT /orders/0000014522fbfd383c2b1a33007f000000010001/account/attributes Content-Type: application/json; charset=UTF-8 [ { "name":"partner_account_id", "value":"paccid_030414051600" } ]
[edit] Response
204 No Content
[edit] Set modified regular contact
Use PUT /orders/{orderId}/account/contactInfo/{contactType} to set the account contact details for a given contact type in an order.
[edit] Request
PUT /orders/0000014522fbfd383c2b1a33007f000000010001/account/contactInfo/regular Content-Type: application/json; charset=UTF-8 { "name": { "firstName": "Test-Regular", "lastName": "Contact", "company": "MyCompany" }, "address": { "street1": "111 My Street", "street2": "street2", "city": "Chicago", "stateOrProvince": "IL", "postalCode": "60606", "countryCode": "US" }, "contactMedia": { "phone1": "312-555-1111", "phone2": "312-555-222", "fax": "312-555-1111", "email1": "myemail@something.com", "email1Format": "html" } }
[edit] Set account payment info
Use PUT /orders/{orderId}/account/paymentInfo to set the account's payment info.
[edit] Request
PUT /orders/0000014522fbfd383c2b1a33007f000000010001/account/paymentInfo Content-Type: application/json; charset=UTF-8 { "paymentInfoType": "credit_card", "creditCardType": "visa", "accountNumber": "1234567890123456", "cardHolderName": "John Jello", "expirationDate": "2015-06", "verificationNumber": "503", "billingAddress": { "street1": "My street", "street2": "", "city": "Chicago", "stateOrProvince": "IL", "postalCode": "60606", "countryCode": "US" } }
[edit] Response
204 No Content
[edit] Response
204 No Content
[edit] Submit the order
Use POST /orders/{order_id}/action to submit the order and to invoke the ordered product provisioning.
[edit] Request
POST /orders/000001452292557b24c2acc0007f000000010001/action Content-Type: application/json; charset=UTF-8 { "action": "submit" }
[edit] Response
202 Accepted
See also