API Reference - Customers

GET Customer

 

URL   https://{bluehub_host}:{rest_api_port}/rest/customer/
 Headers Supported Accept: application/xml
Authentication: OAuth...
Description    Allows you to retrieve Customers

 

 HTTP response codes:

 Success HTTP Status Code  200 OK
 Not Found HTTP Status Code  204 No Content
 Parameter 'where' has incorrect query  400 Bad Request
 OAuth Authentication HTTP error codes see OAuth section 

 

Optional parameters (can be passed in header or in URL):

WHERE Filter by an any element from the list:
  • code
Example: where=code=1

Operators Allowed in the WHERE Clause

With the WHERE clause, the following operators can be used:

OperatorDescription
= Equal
<> Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
LIKE Search for a pattern

Example - Get all Customers.
Request:

GET https://bluestorelive.com:9001/rest/customer/  
Accept: application/xml
Authorization: OAuth...

 

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CustomerData>
    <customer>
        <code>1</code>
        <loyaltyId>610058</loyaltyId>
        <gender>MALE</gender>
        <ageRange>AGE_20_TO_30</ageRange>
        <externalRef>Ext Test</externalRef>
        <taxOrVatRef>tax Test</taxOrVatRef>
        <createdOn>2012-03-23</createdOn>
        <version>3</version>
        <deleted>false</deleted>
            <address>
                <code>10</code>
                <isCorrespondence>true</isCorrespondence>
                <isBilling>false</isBilling>
                <isDelivery>true</isDelivery>
                <title>Mr</title>
                <firstName>First Test</firstName>
                <lastName>Last Test</lastName>
                <companyName>Company Test</companyName>
                <street1>Street Test</street1>
                <street2>Street Test 2</street2>
                <street3>Street Test 3</street3>
                <city>London</city>
                <stateOrRegion></stateOrRegion>
                <postalCode>E1 4XX</postalCode>
                <country>GB</country>
                <phone1>55555555</phone1>
                <phone2>55555555</phone2>
                <email>test@test.com</email>
            </address>
    </customer>
</CustomerData>

 

 

POST Customers

 URL  https://{bluehub_host}:{rest_api_port}/rest/inbound/
 Headers Supported  Accept: application/xml
 Authentication: OAuth...
 Description  Allows you to save customer from external systems

 

 Multiple customers can be sent in the same request using the API Inbound request structure.  Customer  tags are contained within <Transaction> elements in the Inbound structure. The inbound response structure is returned.

  

HTTP response codes:

A successful response will return the full bluestore POST response 

 Success HTTP Status Code  200 OK
 Not Found HTTP Status Code  204 No Content
 Parameter 'where' has incorrect query  400 Bad Request
 OAuth Authentication HTTP error codes  see OAuth Structure

 

Request format:

Red = next tag down

TODO include information about a tag in the same line

 

 

Level

Tag

Mandatory

Optional

Type

Maps To Internal Bluestore Element...

Comments

1

customers

 

 

 

 

2

customer  docNo=""

M

Integer

 

Repeatable with an Inbound document. Represents a single customer transaction.

Integer incrementing from 1 in each <Batch> tag.

3

code

O

Integer

CODE

If present, updates the customer with this code. If not present a new customer with autogenerated code is created and the new code is returned in response in <bluestoreRef>.

 

Must be greater than 0

3

externalRef

O

VarChar(255)

EXTERNALREF

 

3

taxOrVatRef

O

VarChar(255)

TAXORVATREF

 

3

loyaltyId

O

VarChar(25)

LOYALTYID

 

3

gender

O

VarChar(10)

GENDER

If set must be 'MALE' or 'FEMALE'.

3

ageRange

O

VarChar(20)

AGERANGE

If set must be one of 'AGE_UNDER_16', 'AGE_16_TO_20', 'AGE_20_TO_30', 'AGE_30_TO_40', 'AGE_40_TO_50', 'AGE_50_TO_60', 'AGE_60_TO_70' or 'AGE_OVER_70'.

3

addresses

O

     

4

address

M

    Customer Address details.

4

code

O

VarChar(50)

CODE

Ignored. Is autogenerated.

4

isCorrespondence

O

Boolean

ISCORRESPONDENCE

Default is ‘false’ if omitted

4

isDelivery

O

Boolean

ISDELIVERY

Default is ‘false’ if omitted

4

isBilling

O

Boolean

ISBILLING

Default is ‘false’ if omitted

4

title

O

VarChar(255)

TITLE

 

4

firstName

M

VarChar(255)

FIRSTNAME

 

4

lastName

M

VarChar(255)

LASTNAME

 

4

companyName

O

VarChar(255)

COMPANYNAME

 

4

street1

O

VarChar(255)

STREET1

 

4

street2

O

VarChar(255)

STREET2

 

4

street3

O

VarChar(255)

STREET3

 

4

city

O

VarChar(255)

CITY

 

4

stateOrRegion

O

VarChar(255)

STATEORREGION

 

4

postalCode

O

VarChar(255)

ZIPCODE

 

4

country

O

VarChar(50)

COUNTRY

Country Code.

4

phone1 O VarChar(255) PHONE1  

4

phone2

O

VarChar(255)

PHONE2

 

4

email O VarChar(255) EMAIL  

Example POST XML:

<?xml version="1.0"?>
<inbound lang="en" enterprise="482" requestNo="1">
    <batch batchNo="1">
        <customers>
            <customer docNo="1">
                <code>1311</code>
                <externalRef></externalRef>
                <taxOrVatRef></taxOrVatRef>
<loyaltyId>610058</loyaltyId>
               <gender>MALE</gender>
               <ageRange>AGE_20_TO_30</ageRange>
                <addresses>          <address>           <isCorrespondence>true</isCorrespondence>          <isDelivery>true</isDelivery>          <isBilling>false</isBilling>          <title>Mr</title>          <firstName>John</firstName>          <lastName>Smith</lastName>          <companyName>Test Company</companyName>          <street1>High St</street1>         <street2>x</street2>          <street3>x</street3>          <city>London</city>         <stateOrRegion></stateOrRegion>          <postalCode>E1 3XX</postalCode>          <country>GB</country>         <phone1>0209999999</phone1>          <phone2>0788888888</phone2>          <email>test@test.com</email>          </address>                 </addresses>      </customer>         </customers> </batch> </inbound>
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk