# Supported OAuth and Commerce API formats

The Commerce API and OAuth support requests and responses in XML and JSON formats. XML is the default for the Commerce API; JSON is the default for the OAuth API. You can override the default in the Accept header for both the OAuth and Commerce API. You can also override the default format using the format query parameter in the Commerce API.

## Accept header format for OAuth

The following example shows the supported accept header format for the [OAuth ](/commerce-api-references/shopper-apis/oauth/tokens.md)resource.

{% tabs %}
{% tab title="Request Header" %}

```http
Accept: application/json (default)
Accept: application/xml
```

{% endtab %}
{% endtabs %}

### Accept header format for Commerce API

The following example shows the supported accept header format for [Shoppers ](/commerce-api-references/shopper-apis/shoppers/shoppers.md)resource.

{% tabs %}
{% tab title="Request Header" %}

```http
Accept: application/xml (default)
Accept: application/json
```

{% endtab %}
{% endtabs %}

### Query parameter format

The following GET request sets the parameter format to JSON:

{% tabs %}
{% tab title="Request Header" %}

```http
GET /shoppers/me/categories?format=json
Accept: */*
Authorization: bearer your_access_token
```

{% endtab %}
{% endtabs %}

### Supported webhook formats

Digital River supports the XML format for webhooks.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/supported-oauth-and-commerce-api-formats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
