Order-Domain
Mike.robski (Talk | contribs) m (1 revision: Release 100) |
Corinne.chui (Talk | contribs) m (1 revision) |
||
(One intermediate revision by one user not shown) | |||
Line 352: | Line 352: | ||
"ProratedUnitAmount":"7.95", | "ProratedUnitAmount":"7.95", | ||
"Type":"domain_registration_fee", | "Type":"domain_registration_fee", | ||
− | "Quantity":"1" | + | "Quantity":"1", |
+ | "Deferred":"0" | ||
} | } | ||
], | ], | ||
Line 472: | Line 473: | ||
"ProratedUnitAmount":"0.00", | "ProratedUnitAmount":"0.00", | ||
"Type":"recurring", | "Type":"recurring", | ||
− | "Quantity":"1" | + | "Quantity":"1", |
+ | "Deferred":"0" | ||
} | } | ||
], | ], | ||
Line 485: | Line 487: | ||
"SubTotal":"7.95", | "SubTotal":"7.95", | ||
"OneTimeFeeAmount":"7.95", | "OneTimeFeeAmount":"7.95", | ||
− | "TaxTotal":"0" | + | "TaxTotal":"0", |
+ | "DeferredSubTotals": [], | ||
+ | "DeferredTaxes": [], | ||
+ | "DeferredTotals": [] | ||
}, | }, | ||
"links":{ | "links":{ |
Latest revision as of 14:36, 30 May 2016
[edit] Order a new domain
This is a step by step example of ordering a domain through the Hostway Ordering API.
[edit] Create a new order
Use POST /orders to create a new order
[edit] Request
POST /orders Content-Type: application/json {}
[edit] Response
201 Created { "orderId":"00000149334635c2a163f194007f000000010001", "ownerId":"e497c8e7-8cf3-44ff-88d8-0c86521060da", "links":[ { "href":"http://coreapi01.ote.chicago.hostway:8100/orders/", "rel":"self" }, { "href":"http://coreapi01.ote.chicago.hostway:8100/orders/00000149334635c2a163f194007f000000010001", "rel":"item" } ] }
[edit] Add product to the order
The domain registration product specification offerings can be determined using the Hostway Product Catalog API. Add a new domain product to the order by using POST /orders/{order_id}/account/products.
[edit] Request
POST /orders/00000149334635c2a163f194007f000000010001/account/products Content-Type: application/json { "offering": "http://coreapi01.ote.chicago.hostway:8100/productSpecifications/core.plan.dnr.only/offerings/USD-12" }
[edit] Response
201 Created Content-Type : application/json; charset=UTF-8 Connection : close Location : http://coreapi01.ote.chicago.hostway:8100/orders/00000149334635c2a163f194007f000000010001/account/products/0000014933463b7219be46f0007f000000010001/ { "url":"http://coreapi01.ote.chicago.hostway:8100/orders/00000149334635c2a163f194007f000000010001/account/products/0000014933463b7219be46f0007f000000010001/", "productId":"0000014933463b7219be46f0007f000000010001" }
[edit] Add a service to the product
The domain registration service specification offerings can be determined using the Hostway Product Catalog API for the corresponding core.dnr.{tld} product. Then add a new email service to the order by using POST /orders/{order_id}/account/products/{product_id}/services.
[edit] Request
POST /orders/00000149334635c2a163f194007f000000010001/account/products/0000014933463b7219be46f0007f000000010001/services Content-Type: application/json { "name":"ng-test-fitnesse-20141021-1014.us", "serviceSpecification":"http://coreapi01.ote.chicago.hostway:8100/serviceSpecifications/core.dnr.us", "billingCycle":12 }
[edit] Response
201 Created Content-Type : application/json; charset=UTF-8 Location : http://coreapi01.ote.chicago.hostway:8100/orders/00000149334635c2a163f194007f000000010001/account/products/0000014933463b7219be46f0007f000000010001/services/0000014933463eead40ac7ba007f000000010001/ { "url":"http://coreapi01.ote.chicago.hostway:8100/orders/00000149334635c2a163f194007f000000010001/account/products/0000014933463b7219be46f0007f000000010001/services/0000014933463eead40ac7ba007f000000010001/", "serviceId":"0000014933463eead40ac7ba007f000000010001" }
[edit] Add attributes to the service
Use the PUT /orders/{order_id}/account/products/{product_id}/services/{service_id}/attributes call to add the attributes for the domain service. Note that the example below is using "extraParams" attribute which is only required for some TLDs (.us in this case).
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account/products/0000014933613211db39d7c4007f000000010001/services/0000014933613528f83d7290007f000000010001/attributes Content-Type: application/json { "domainName":"ng-test-fitnesse-20141021-1044.us", "operation":"register", "term":1, "authInfo":"mysecret", "nameservers":[ "ns1.test.com", "ns2.test.com" ], "extraParams":[ { "name":"us_nexus", "value":"C11" }, { "name":"us_purpose", "value":"P1" } ], "contactInfo":{ "registrant":{ "type":"registrant", "firstName":"John", "lastName":"Doe", "company":"ACME Inc.", "street1":"123 First Str.", "city":"Chicago", "zipOrPostal":"34567", "stateOrProvince":"IL", "countryCode":"US", "email1":"john.doe@test.com", "phone1":"+1.312.456789098" }, "administrative":{ "type":"administrative", "firstName":"Jane", "lastName":"Smith", "street1":"123 First Str.", "city":"Chicago", "zipOrPostal":"34567", "stateOrProvince":"IL", "countryCode":"US", "email1":"jane.smith@test.com", "phone1":"+1.312.456789111", "fax1":"+1.312.456789112" }, "billing":{ "type":"billing", "firstName":"James", "lastName":"Johnson", "street1":"123 First Str.", "city":"Chicago", "zipOrPostal":"34567", "stateOrProvince":"IL", "countryCode":"US", "email1":"james.johnson@test.com", "phone1":"+1.312.456789111" }, "technical":{ "type":"technical", "firstName":"Paul", "lastName":"Stevenson", "street1":"123 First Str.", "city":"Chicago", "zipOrPostal":"34567", "stateOrProvince":"IL", "countryCode":"US", "email1":"paul.stevenson@test.com", "phone1":"+1.312.456789111" } } }
[edit] Response
204 No content
[edit] Create a new account for the order
Use PUT /orders/{order_id}/account to create an account or add an existing one to the order.
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account Content-Type: application/json { "currency": "USD", "language": "en-US" }
[edit] Response
204 No content
[edit] Add user info
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account/user Content-Type: application/json { "userName": "quah@141021-104405.com", "password": "t0pSekr1t" }
[edit] Response
204 No content
[edit] Add billing contact
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account/contactInfo/billing Content-Type: application/json { "name":{ "firstName":"Billing", "middleName":"X", "lastName":"Customer", "company":"Hostway" }, "address":{ "street1":"100 n riverside", "street2":"ste 800", "city":"Chicago", "stateOrProvince":"IL", "postalCode":"60606", "countryCode":"US" }, "contactMedia":{ "phone1":"312-555-2222", "phone2":"312-555-3333", "fax":"312-555-1111", "email1":"james.johnson@test.com", "email1Format":"html", "email2":"gah@wev.com", "email2Format":"text" } }
[edit] Response
204 No Content
[edit] Add regular contact
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account/contactInfo/regular Content-Type: application/json { "name":{ "firstName":"Billing", "middleName":"X", "lastName":"Customer", "company":"Hostway" }, "address":{ "street1":"100 n riverside", "street2":"ste 800", "city":"Chicago", "stateOrProvince":"IL", "postalCode":"60606", "countryCode":"US" }, "contactMedia":{ "phone1":"312-555-2222", "phone2":"312-555-3333", "fax":"312-555-1111", "email1":"james.johnson@test.com", "email1Format":"html", "email2":"gah@wev.com", "email2Format":"text" } }
[edit] Response
204 No Content
[edit] Add payment info to the order
[edit] Request
PUT /orders/0000014933612cf9fb1c626a007f000000010001/account/paymentInfo Content-Type: application/json { "paymentInfoType":"credit_card", "creditCardType":"visa", "accountNumber":"4111111111111111", "cardHolderName":"John Jello", "expirationDate":"2015-06", "verificationNumber":"521", "billingAddress":{ "street1":"100 n riverside", "street2":"ste 800", "city":"Chicago", "stateOrProvince":"IL", "postalCode":"60606", "countryCode":"US" } }
[edit] Response
204 No Content
[edit] Validate the order
[edit] Request
POST /orders/0000014933612cf9fb1c626a007f000000010001/action Content-Type: application/json { "action": "validate" }
[edit] Response
204 No Content
[edit] Get a quote
[edit] Request
GET /orders/0000014933612cf9fb1c626a007f000000010001/quote
[edit] Response
200 OK Content-Type : application/json; charset=UTF-8 { "quote":{ "PurchasedPlan":[ { "Product":[ { "ChildProduct":[ ], "Name":"ng-test-fitnesse-20141021-1044.us", "MonthlyCycle":12, "ConfigType":"core.dnr.us", "Fees":[ { "ProrationAllowed":"0", "StartDate":"2014-10-21", "NumCharged":"0", "EndDate":"2015-10-20", "Description":"Domain registration fee ng-test-fitnesse-20141021-1044.us", "Discounts":[ ], "BaseAmount":"7.95", "UnitAmount":"7.95", "Prorated":"0", "MonthlyCycle":"12", "Currency":"USD", "Amount":"7.95", "NumCharges":"1", "ProratedUnitAmount":"7.95", "Type":"domain_registration_fee", "Quantity":"1", "Deferred":"0" } ], "Data":{ "Register":{ "ContactList":{ "Contact":[ { "@city":"Chicago", "@province":"IL", "@first_name":"Paul", "@fax":"", "@address1":"123 First Str.", "@address2":"", "@phone":"+1.312.456789111", "@country_code":"US", "@last_name":"Stevenson", "@postal":"34567", "@type":"technical", "@email":"paul.stevenson@test.com", "@company":"" }, { "@city":"Chicago", "@province":"IL", "@first_name":"Jane", "@fax":"", "@address1":"123 First Str.", "@address2":"", "@phone":"+1.312.456789111", "@country_code":"US", "@last_name":"Smith", "@postal":"34567", "@type":"admin", "@email":"jane.smith@test.com", "@company":"" }, { "@city":"Chicago", "@province":"IL", "@first_name":"John", "@fax":"", "@address1":"123 First Str.", "@address2":"", "@phone":"+1.312.456789098", "@country_code":"US", "@last_name":"Doe", "@postal":"34567", "@type":"company", "@email":"john.doe@test.com", "@company":"ACME Inc." }, { "@city":"Chicago", "@province":"IL", "@first_name":"James", "@fax":"", "@address1":"123 First Str.", "@address2":"", "@phone":"+1.312.456789111", "@country_code":"US", "@last_name":"Johnson", "@postal":"34567", "@type":"billing", "@email":"james.johnson@test.com", "@company":"" } ] }, "@term":"1", "@lock":"", "@domain_name":"ng-test-fitnesse-20141021-1044.us", "@agreed":"", "@nameservers":"ns1.test.com,ns2.test.com", "AuthInfo":"mysecret", "@reason":"", "@legal_type":"", "@agreement_version":"", "@operation":"register", "ExtraParams":[ { "Name":"us_nexus", "Value":"C11" }, { "Name":"us_purpose", "Value":"P1" } ] } }, "PromotionCode":null, "ProductGUID":"0000014933613528f83d7290007f000000010001" } ], "DisplayName":"", "Name":"DNR Only Plan", "ReferralKey":null, "MonthlyCycle":12, "PartnerId":"", "Plan":"core.plan.dnr.only", "Fees":[ { "ProrationAllowed":"0", "StartDate":"2014-10-21", "NumCharged":"0", "EndDate":"2015-10-20", "Description":"Recurring fee DNR Only Plan, ng-test-fitnesse-20141021-1044.us 10/21/2014 through 10/20/2015", "Discounts":[ ], "BaseAmount":"0.00", "UnitAmount":"0.00", "Prorated":"0", "MonthlyCycle":"12", "Currency":"USD", "Amount":"0.00", "NumCharges":"-1", "ProratedUnitAmount":"0.00", "Type":"recurring", "Quantity":"1", "Deferred":"0" } ], "PlanNumber":"0000014933613211db39d7c4007f000000010001", "PromotionCode":null, "PurchasedPlanNumber":"acct258192-0000014933615c88d6149e83007f00000001000" } ], "Hash":"b2f4dba3062c44084d3339561781d3bbc7bb9f70", "Currency":"USD", "Total":"7.95", "SubTotal":"7.95", "OneTimeFeeAmount":"7.95", "TaxTotal":"0", "DeferredSubTotals": [], "DeferredTaxes": [], "DeferredTotals": [] }, "links":{ "self":{ "href":"http://coreapi01.ote.chicago.hostway:8100/orders/0000014933612cf9fb1c626a007f000000010001/quote/", "rel":"self" } } }
[edit] Submit the order
Use POST /orders/{order_id}/action to submit the order.
[edit] Request
POST /orders/0000014933612cf9fb1c626a007f000000010001/action Content-Type: application/json { "action": "submit", "quoteHash": "b2f4dba3062c44084d3339561781d3bbc7bb9f70" }
[edit] Response
202 Accepted
See also