Customer IP address

You can capture the IP address of the customer who placed the order. Digital River uses this IP address to identify and prevent fraudulent activities.

Customer IP format and inclusion

The Commerce API validates the format of the IP address and supports both IPv4 and IPv6 address schemes.

The following example uses IPv4:

URI
Request body
URI
POST /v1/shoppers/me/carts/active
Request body
{
“cart”:{
“ipAddress”:192.16.1.1
}
}

The following example used IPv6:

URI
Request body
URI
POST /v1/shoppers/me/carts/active
Request body
{
“cart”:{
“ipAddress”:2001:0000:3238:DFE1:63::FEFB
}
}

If the call does not include an IP address, the call will work as originally designed. Digital River will not fail the order submission.

When a request captures an ipAddress, Digital River will use it to screen the order for fraud during submission.

When a connector (such as WordPress Plugin, Magento Extension, Salesforce B2B Commerce Connector, and so on) creates a cart, the connector collects all cart required data (including the customer's IP address, if available) before calling the Cart resource. For these scenarios, the IP address should be sent in the Cart call.

The following example uses IPv4:

URI
Request body
URI
POST /v1/shoppers/me/carts/active/submit-cart
Request body
{
"cart": {
"ipAddress":"192.179.12.1"
}
}

The following example uses IPv6:

URI
Request body
URI
POST /v1/shoppers/me/carts/active/submit-cart
Request body
{
"cart": {
"ipAddress":"2001:0000:3238:DFE1:63::FEFB"
}
}

Validation using the GET /shoppers/me request

You can validate the customer's IP address was successfully captured by using the GET /shoppers/me request. In the Response body, search for ipAddress. If the value of the ipAddress field is null, the client did not send an IP address for the customer. If the ipAddress is not null, run an IP search to verify the IP address, city, and state matches the customer address in the Global Commerce order. The IP address needs to be the customer's IP address and not the client server's IP address.

URI
Request body
URI
GET /v1/shoppers/me?expand=all
Request body
{
"shopper": {
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me",
"id": 495796950789,
"username": "myu_external",
"externalReferenceId": "myu_external@digitalriver.com",
"firstName": "Marc",
"lastName": "Yu",
"emailAddress": "myu_external@digitalriver.com",
"locale": "en_US",
"currency": "USD",
"sendMail": "false",
"sendEmail": "false",
"ipAddress": "192.179.12.1",
"paymentOptions": {
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me/payment-options",
"paymentOption": [
{
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me/payment-options/13821416689",
"id": 13821416689,
"nickName": "default",
"isDefault": "false",
"type": "CreditCardMethod",
"creditCard": {
"expirationMonth": 12,
"expirationYear": 2022,
"issueCode": null,
"startMonth": null,
"startYear": null,
"displayableNumber": "************1111",
"type": "visa",
"displayName": "Visa"
}
}
]
},
"addresses": {
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me/addresses"
},
"orders": {
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me/orders"
},
"subscriptions": {
"uri": "http://dispatch-test.digitalriver.com/v1/shoppers/me/subscriptions"
}

Validation errors

If the IP address format is incorrect (that is, not in a valid IPv4 and IPv6 format), the response will send a 409 Conflict error:

409 Conflict error