> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api/shopper-apis/shoppers/managing-shoppers/data-validation.md).

# Data validation

Understand the Data Validation service.

The Data Validation service is a request/response-based process. It provides a mechanism for attaching data points to a page in a Digital River store and validating each data point against an external endpoint provided by a third-party client.

![Data Validation Service flow](https://files.readme.io/b9b0bce-Data_Validation_Service.png)

## Data validation details

A successful Data Validation request results in a response that contains a non-null, non-empty element. An unsuccessful Data Validation request results in an invalid response code (`responseCode`).

#### Note

A third-party client must define the `responseCode.`

{% tabs %}
{% tab title="Payload" %}

```json
{
	"DataValidationRequest": {
		"dataPoints": {
			"item": [
				{
					"name": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "CustomerID"
					},
					"value": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "12345"
					},
					"valueDataType": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointInfo"
				},
				{
					"name": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "SRPID"
					},
					"value": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "67890"
					},
					"valueDataType": {
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointInfo"
				}
			],
			"_xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
			"_xsi:type": "ns1:DataPointInfos"
		},
		"extendedAttributes": {
			"_xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
			"_xmlns:ns2": "http://integration.digitalriver.com/Common/1.0",
			"_xsi:type": "ns2:ExtendedAttributesInfoArray",
			"_xsi:nil": "true"
		},
		"_xmlns:ns1": "http://integration.digitalriver.com/DataValidationService",
		"__prefix": "ns1"
	}
}
```

{% endtab %}

{% tab title="Successful response" %}

```json
{
	"DataValidationResponse": {
		"dataPointResponses": {
			"item": [
				{
					"name": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "CustomerID"
					},
					"value": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "12345"
					},
					"valueDataType": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointResponseInfo"
				},
				{
					"name": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "SRPID"
					},
					"value": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "67890"
					},
					"valueDataType": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointResponseInfo"
				}
			],
			"_xmlns": "http://integration.digitalriver.com/DataValidationService",
			"_xsi:type": "ns1:DataPointResponseInfos"
		},
		"valid": {
			"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
			"_xsi:type": "xsd:boolean",
			"__text": "true"
		},
		"_xmlns:ns1": "http://integration.digitalriver.com/DataValidationService",
		"_xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
		"_xsi:type": "ns1:DataValidationResponse",
		"__prefix": "ns1"
	}
}
```

{% endtab %}

{% tab title="Unsuccessful response" %}

```json
{
	"DataValidationResponse": {
		"dataPointResponses": {
			"item": [
				{
					"name": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "CustomerID"
					},
					"value": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "12345"
					},
					"valueDataType": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointResponseInfo"
				},
				{
					"name": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "SRPID"
					},
					"value": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "67890"
					},
					"valueDataType": {
						"_xmlns": "",
						"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
						"_xsi:type": "xsd:string",
						"__text": "string"
					},
					"_xsi:type": "ns1:DataPointResponseInfo"
				}
			],
			"_xmlns": "http://integration.digitalriver.com/DataValidationService",
			"_xsi:type": "ns1:DataPointResponseInfos"
		},
		"valid": {
			"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
			"_xsi:type": "xsd:boolean",
			"__text": "false"
		},
		"responseCode": {
			"_xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
			"_xsi:type": "xsd:string",
			"__text": "DATA_VALIDATION_INVALID"
		},
		"_xmlns:ns1": "http://integration.digitalriver.com/DataValidationService",
		"_xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
		"_xsi:type": "ns1:DataValidationResponse",
		"__prefix": "ns1"
	}
}
```

{% endtab %}
{% endtabs %}

## Data validation schema

The data validation schema serves as a blueprint for validating data requests. It ensures that the data points and their respective types comply with predefined standards, leading to successful data validation responses. Refer to the links in the table below for more details on the schema components, raw schema, and sample XML.

| Version             | Schema Components Table                                                                       | Raw Schema                                                                        | Sample XML                                                                                |
| ------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Version 1 (Current) | [View](https://drhadmin.digitalriver.com/integration/isg/schematable/DataValidationService/1) | [View](https://drhadmin.digitalriver.com/integration/xsd/DataValidationService/1) | [View](https://drhadmin.digitalriver.com/integration/isg/example/DataValidationService/1) |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digitalriver.com/commerce-api/shopper-apis/shoppers/managing-shoppers/data-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
