Changes

stoney core: Customers Resource - REST API

139 bytes removed, 11:02, 27 July 2014
= Customers resource methods =
== Customer creation (POST) ==
To create a new customer the client needs to send a HTTP <code>POST</code> request on the customer collection resource URI <code>https://api.example.com/v1/customers</code> (also see [[Application_Programming_Interface_(API)#Base_URI|Base URI]]), including the associated customer informationsinformation.The service will generate a new customer and responds with a HTTP status code <code>201</code> (Created) on success. The newly created customer URI is returned within the HTTP location header, which can be used by the client to gather informations information about the new customer.
=== Customer creation request message ===
|string
|yes
|The customer's display name. Mostly the same as the <code>organizationName</code> or the <code>givenName</code> and <code>surname</code> out of the [[#billingAddress_object|billingAddress object]], but can also be the name of a brand.
|UTF-8 {64}
|
|
|<source lang="javascript">"customerName": "Super-duper HostingCustomer Ltd."</source>
|-
|object
|yes
|An object holding the billing address informations information for the given customer. Refer to the [[#billingAddress_object|billingAddress object table]] for more informationsinformation.
|
|
|object
|no
|An object holding the shipping address informations information for the given customer. Refer to the [[#shippingAddress_object|shippingAddress object table]] for more informationsinformation.
|
|
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
"isCompany": true,
"isActive": true,
"customerName": "Customer Ltd."
"countryCode": "CH",
"postalCode": "3012",
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
|string
|yes
|The customer's display name. Mostly the same as the <code>organizationName</code> or the <code>givenName</code> and <code>surname</code> out of the [[#billingAddress_object|billingAddress object]], but can also be the name of a brand.
|
|
|
|<source lang="javascript">"customerName": "Customer Ltd."</source>
|-
=== Customer element retrieval (GET) ===
To retrieve an existing customer and fetch the informations information associated with it, the client needs to send a HTTP <code>GET</code> request on the customer's element resource URI (such as <code>https://api.example.com/v1/customers/5000001</code>.The service responds with a HTTP status code 200 (OK) on success and returns the associated customer informationsinformation.
==== Customer element retrieval request message ====
|string
|yes
|The customer's display name. Mostly the same as the <code>organizationName</code> or the <code>givenName</code> and <code>surname</code> out of the [[#billingAddress_object|billingAddress object]], but can also be the name of a brand.
|
|
|
|<source lang="javascript">"customerName": "Super-duper HostingCustomer Ltd."</source>
|-
|object
|yes
|An object holding the billing address informations information for the given customer. Refer to the [[#billingAddress_object|billingAddress object table]] for more informationsinformation.
|
|
|object
|no
|An object holding the shipping address informations information for the given customer. Refer to the [[#shippingAddress_object|shippingAddress object table]] for more informationsinformation.
|
|
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
==== Customer update response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== Customer partly update (PATCH) ==
==== Customer partly update response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== Customer deletion (DELETE) ==
==== Customer deletion response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== Customer search ==
SLB, editor, reviewer
3,368
edits