Shoppers 

The Shoppers API provides access to the current shopper and shopper data. Use the Shoppers API to retrieve shopper information and to set the shopper preferred locale and currency. After you get an access token, you can use the POST shoppers/me method to update the shopper to immediately use the specified locale and currency for that shopper. All subsequent API calls are done in the context of that locale and currency for that shopper.

An authenticated shopper session provides links to addresses, payment options, orders, subscriptions, and wish lists. The resource links are not available for anonymous shopper sessions. An anonymous shopper must log in to facilitate the transition to an authenticated shopper session. An authenticated shopper session also provides links (non-expandable) to orders and subscriptions. Addresses and payment options can be expanded; however, for orders and subscriptions, you must send follow-up calls to get that information specifically.

Best Practices: For an application that sends server-to-server requests to Global Commerce, we strongly recommend providing the shopper’s IP address when creating or updating a shopper. You can send the IP address as either a resource field in the request body or as a query parameter. The current shopper session stores and remembers the IP address for the current shopper session. Any restricted IP address causes the request to error.

The Shoppers API is available for both anonymous and authenticated sessions. In summary, get a limited token to support anonymous shopper activities; get a full access token to support authenticated shopper activities. For more information, see Create a Shopper.

Methods


					Host: api.digitalriver.com
Accept: application/json
Authorization: bearer your_access_token
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					{
  "shopper": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me",
    "id": "Anonymous",
    "username": null,
    "externalReferenceId": null,
    "firstName": null,
    "lastName": null,
    "emailAddress": null,
    "locale": "en_US",
    "currency": "USD",
    "ipAddress": null,
    "sendMail": null,
    "sendEmail": null
  }
}
			
					Host: api.digitalriver.com
User-Agent: API Client/1.0
Accept: application/xml
Authorization: bearer your_access_token
			
					<shopper>
 <username>jjohnson</username>
 <firstName>John</firstName>
 <lastName>Johnson</lastName>
 <externalReferenceId>abc123</externalReferenceId>
 <emailAddress>jjohnson@myCompany.com</emailAddress>
 <locale>en_US</locale>
 <currency>USD</currency>
</shopper>
			
					HTTP/1.1 201 Created
			
					The response body should be empty.
			
					Host: api.digitalriver.com
User-Agent: API Client/1.0
Accept: application/xml
Authorization: bearer your_access_token
			
					<shopper>
   <username>stan1.2</username>
   <password>QUJDMTIzMTIz</password>
   <firstName>Stan</firstName>
   <lastName>Stanley</lastName>
   <emailAddress>stan1.2@test.com</emailAddress>
   <locale>en_US</locale>
   <currency>USD</currency>
   <ipAddress>208.79.321.123</ipAddress>
   <sendMail>true</sendMail>
   <sendEmail>true</sendEmail>
</shopper>
			
					The response body should be empty.
			
					The response body should be empty.
			
					Host: api.digitalriver.com
User-Agent: API Client/1.0
Accept: application/xml
Authorization: bearer your_access_token
			
					The request body should be empty.
			
					HTTP/1.1 204 No Content
Content-Length: 0
			
					The response body should be empty.
			

Response Body Parameters

Field
Data Type
Visibility
Description
currency string expand The shopper's preferred currency.
emailAddress
string
default
The shopper's email address.
externalReferenceId string expand The unique reference ID for a shopper on the remote system. The externalReferenceId is required when the client (that is, the customer) maintains the master record for the shopper login credentials. See externalReferenceID and Client-maintained Shopper Login for more information. 
firstName
string
default
The shopper's first name.
id string default The shopper ID. TheID is assigned automatically when the shopper is created. The shopper ID is only applicable to a GET shoppers/me request. An anonymous shopper has an ID of "anonymous". An authenticated shopper has a numeric ID.
ipAddress string default The shopper's IP address.
lastName
string
default
The shopper's last name.
locale
string
expand
The shopper's preferred locale.
password string default The shopper's password. The password must be base64 encoded. The password is required when Digital River maintains the master record for the shopper login credentials and is required for public API keys. See Digital River-maintained Shopper Login for more information.
Note: The password only appears in the request body.
sendEmail Boolean expand Indicates whether the shopper would like to receive promotional emails.
sendMail Boolean expand Indicates whether the shopper would like to receive promotional newsletters.
username string default The shopper's username/login.