<commit_before>---
title: Get Started
layout: reference
---

# Receipts

## Get Started

- [Version](#version)
- [Regional Availability](#regional-availability)
- [Explore the API](#explore-the-api)
  - [Prerequisites](#prerequisites)
  - [Endpoints](#endpoints)
    - [Acquire an Access Token](#retrieve-a-user-access-token)
    - [GET Service Index](#endpoint-service-index)
    - [GET Schemas](#endpoint-schemas)
    - [POST Receipts](#endpoint-post-a-receipt)
    - [GET Receipts by User ID](#endpoint-get-receipts-by-userid)
    - [GET Receipts by Receipt ID](#endpoint-get-a-receipt-by-id)
    - [GET Receipt Image by Receipt ID](#endpoint-get-receipt-image)
  - [Explore the API in JavaScript](#explore-the-api-in-javascript)

### Version

- 4.0
- [3.0](https://developer.concur.com/api-reference-deprecated/version-three/receipts.html) [Deprecation Notice](https://developer.concur.com/changelog/2016/11/07/receipts-version-three-deprecation.html).

#### Overview of Version 4.0

Version 4.0 of the Receipts API offers features like more receipt types, automatic e-receipt generation in end user’s preferred language and ability for partners to provide detailed tax information. Unlike version 3.0, we are discontinuing the use of matching facts; instead the partner will have to create a receipt for a specific end user. Receipts 4.0 works only with the new [Authentication API](https://developer.concur.com/api-reference/authentication/apidoc.html).

### Regional Availability

```
https://us.api.concursolutions.com/receipts/
```

```
https://emea.api.concursolutions.com/receipts/
```

### Explore the API

#### Prerequisites

1. [Create a sandbox](https://developer.concur.com/manage-apps/register.html) if you don't already have one.
2. Read the [Getting Started](https://developer.concur.com/api-reference/authentication/getting-started.html) section of [Authentication API](https://developer.concur.com/api-reference/authentication/apidoc.html).

Once you have registered your application, read about the [API endpoints](#endpoints) below, or click the button to download a request collection for Postman.

<a href="https://app.getpostman.com/run-collection/56acd8062493df1bb6de"
   target="_blank"
   onclick="ga('send', 'event', 'Postman', 'Click', 'https://app.getpostman.com/run-collection/56acd8062493df1bb6de');"
>
  ![Run in Postman](https://run.pstmn.io/button.svg)
</a>


#### Endpoints

|Endpoint|Response Format|Request Summary|
|---|---|---|
|[GET /](#endpoint-service-index)|JSON|Get service index URLs|
|[GET /schemas](#endpoint-schemas)|JSON|Get currently supported receipt schemas|
|[POST /v4/users/:userId](#endpoint-post-a-receipt)|N/A|Post a receipt|
|[GET /v4/users/:userId](#endpoint-get-receipts-by-userid)|JSON|Get a user's receipts|
|[GET /v4/:receiptId](#endpoint-get-a-receipt-by-id)|JSON|Get a receipt by ID|
|[GET /v4/:receiptId/image](#endpoint-get-receipt-image)|image file|Get a receipt image.|

##### Retrieve a User Access Token:

Before making requests to the Receipts API, you must [obtain an access token from the Authentication API](https://developer.concur.com/api-reference/authentication/getting-started.html).

The response will include an `access_token` field, which contains your access token. For subsequent calls, you will need to include this access token in the `Authorization` header of your calls. An `id_token` will be also included in the response. In order to retrieve the unique ID for your user, you will have to decode this `id_token` at [jwt.io](https://jwt.io/). You will need this ID in order to post receipts.

Examples:

cURL:

```shell
curl -d "client_secret={YOUR SECRET}&client_id={YOUR CLIENT ID}&grant_type=password&username={YOUR USERNAME}&password={YOUR PASSWORD}" https://us.api.concursolutions.com/oauth2/v0/token
```
<commit_msg>Updated Postman link in receipts<commit_after>---
title: Get Started
layout: reference
---

# Receipts

## Get Started

- [Version](#version)
- [Regional Availability](#regional-availability)
- [Explore the API](#explore-the-api)
  - [Prerequisites](#prerequisites)
  - [Endpoints](#endpoints)
    - [Acquire an Access Token](#retrieve-a-user-access-token)
    - [GET Service Index](#endpoint-service-index)
    - [GET Schemas](#endpoint-schemas)
    - [POST Receipts](#endpoint-post-a-receipt)
    - [GET Receipts by User ID](#endpoint-get-receipts-by-userid)
    - [GET Receipts by Receipt ID](#endpoint-get-a-receipt-by-id)
    - [GET Receipt Image by Receipt ID](#endpoint-get-receipt-image)
  - [Explore the API in JavaScript](#explore-the-api-in-javascript)

### Version

- 4.0
- [3.0](https://developer.concur.com/api-reference-deprecated/version-three/receipts.html) [Deprecation Notice](https://developer.concur.com/changelog/2016/11/07/receipts-version-three-deprecation.html).

#### Overview of Version 4.0

Version 4.0 of the Receipts API offers features like more receipt types, automatic e-receipt generation in end user’s preferred language and ability for partners to provide detailed tax information. Unlike version 3.0, we are discontinuing the use of matching facts; instead the partner will have to create a receipt for a specific end user. Receipts 4.0 works only with the new [Authentication API](https://developer.concur.com/api-reference/authentication/apidoc.html).

### Regional Availability

```
https://us.api.concursolutions.com/receipts/
```

```
https://emea.api.concursolutions.com/receipts/
```

### Explore the API

#### Prerequisites

1. [Create a sandbox](https://developer.concur.com/manage-apps/register.html) if you don't already have one.
2. Read the [Getting Started](https://developer.concur.com/api-reference/authentication/getting-started.html) section of [Authentication API](https://developer.concur.com/api-reference/authentication/apidoc.html).

Once you have registered your application, read about the [API endpoints](#endpoints) below, or click the button to download a request collection for Postman.

<a href="https://app.getpostman.com/run-collection/56acd8062493df1bb6de" target="_blank" onclick="ga('send', 'event', 'Postman', 'Click', 'https://app.getpostman.com/run-collection/56acd8062493df1bb6de');">
  <img src="https://run.pstmn.io/button.svg" alt="Run in Postman">
</a>


#### Endpoints

|Endpoint|Response Format|Request Summary|
|---|---|---|
|[GET /](#endpoint-service-index)|JSON|Get service index URLs|
|[GET /schemas](#endpoint-schemas)|JSON|Get currently supported receipt schemas|
|[POST /v4/users/:userId](#endpoint-post-a-receipt)|N/A|Post a receipt|
|[GET /v4/users/:userId](#endpoint-get-receipts-by-userid)|JSON|Get a user's receipts|
|[GET /v4/:receiptId](#endpoint-get-a-receipt-by-id)|JSON|Get a receipt by ID|
|[GET /v4/:receiptId/image](#endpoint-get-receipt-image)|image file|Get a receipt image.|

##### Retrieve a User Access Token:

Before making requests to the Receipts API, you must [obtain an access token from the Authentication API](https://developer.concur.com/api-reference/authentication/getting-started.html).

The response will include an `access_token` field, which contains your access token. For subsequent calls, you will need to include this access token in the `Authorization` header of your calls. An `id_token` will be also included in the response. In order to retrieve the unique ID for your user, you will have to decode this `id_token` at [jwt.io](https://jwt.io/). You will need this ID in order to post receipts.

Examples:

cURL:

```shell
curl -d "client_secret={YOUR SECRET}&client_id={YOUR CLIENT ID}&grant_type=password&username={YOUR USERNAME}&password={<PASSWORD>}" https://us.api.concursolutions.com/oauth2/v0/token
```

{'fraction_non_alphanumeric': 0.14281980922514048, 'fraction_numerical': 0.013066771200836273, 'mean_word_length': 4.874136607828089, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 28, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4253075', 'n_tokens_mistral': 2620, 'n_tokens_neox': 2392, 'n_words': 647}