> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.andel.org/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.andel.org/_mcp/server.

# Get a single purchase

GET https://api.andel.org/exchange/v1/purchases/{purchase_id}

Reference: https://docs.andel.org/dataexchange/data-exchange-api/purchases/get-purchase

## Authentication

- `Authorization` header (bearer token, required) — Production machine-to-machine flow. Tokens issued by Descope.
- `Authorization` header (bearer token, required) — Developer-exploration flow with PKCE. Used by Postman Guided Auth.

## Servers

- `https://api.andel.org/exchange/v1` (Production, default)
- `https://7403d846-765d-4d63-9e5c-b7f0ab21a354.mock.pstmn.io/exchange/v1` (Postman mock server (sandbox; auth is not enforced))

## Request

### Path parameters

- `purchase_id` (string, required)

## Response

### 200

A single purchase.

- `purchase_id` (string, required) — Andel-issued unique identifier.
- `member_id` (string, required) — Plan or PBM member identifier.
- `plan_id` (string, required) — Plan that the member belongs to. Each member belongs to exactly one plan. Tokens are scoped to a set of allowed plan IDs; purchases for plans outside that set are not returned.
- `purchased_at` (datetime, required) — ISO 8601 UTC timestamp from the pharmacy point-of-sale.
- `currency` (string, required, default: USD) — ISO 4217 currency code.
- `date_of_service` (date, required) — The actual fill date used for eligibility validation. Distinct from `purchased_at`, which is the point-of-sale timestamp.
- `event_type` (enum, required, default: claim) — The kind of accumulator event. `claim` is a normal fill; `reversal` restores accumulators for a returned or voided fill; `adjustment` is a flat or paired correction.
  - Allowed values: `claim`, `reversal`, `adjustment`, `hra_initial_load`, `hra_rollover`, `hra_incentive`
- `ndc` (string, optional) — 11-digit National Drug Code.
- `prescriber_spi` (string, optional) — Surescripts Prescriber ID.
- `member_purchase_amount` (double, optional) — (Proposed - provenance pending) Total amount the member paid at point-of-sale, USD.
- `oop_amount` (double, optional) — (Proposed - provenance pending) Member out-of-pocket portion, USD.
- `plan_contribution` (double, optional) — (Proposed - provenance pending) Plan's portion of the purchase (the plan contribution), USD.
- `quantity` (integer, optional) — Units dispensed.
- `days_supply` (integer, optional) — Days of therapy the dispensed quantity covers.
- `provider_type` (enum, optional) — Qualifier describing which provider identifier is carried in the provider slot.
  - Allowed values: `ncpdp`, `npi`, `dea`, `copay_assist`
- `pharmacy_npi` (string, optional) — Dispensing pharmacy identifier, when provided.
- `network_ind` (enum, optional) — Whether the fill adjudicated in- or out-of-network.
  - Allowed values: `in_network`, `out_of_network`, `both`, `inn_house`
- `original_purchase_id` (string, optional, nullable) — For reversals or adjustments, the `purchase_id` of the purchase being corrected. Null for new purchases.
- `status` (enum, optional) — Processing status of the purchase.
  - Allowed values: `accepted`, `rejected`, `pended`, `reversed`
- `deductible_applied` (double, optional) — (Proposed - provenance pending) Amount of this purchase applied to the member's deductible, USD.
- `subscriber_id` (string, optional) — The member's subscriber identifier at the PBM's eligibility system. Distinct from `member_id`.
- `first_name` (string, optional) — Member first name.
- `last_name` (string, optional) — Member last name.
- `date_of_birth` (date, optional) — Member date of birth.
- `gender` (enum, optional) — Member gender as carried to the PBM.
  - Allowed values: `unknown`, `male`, `female`, `non_binary`
- `relationship` (enum, optional) — Member's relationship to the subscriber.
  - Allowed values: `subscriber`, `spouse`, `dependent`, `student`, `disabled_dependent`, `adult_dependent`, `domestic_partner`
- `accumulators` (list of object, optional) — (Proposed - provenance pending) Per-accumulator deltas this purchase applies (deductible, out-of-pocket, HRA, caps). A single fill can apply against up to six accumulators at once.
  - `type_of_benefit_account` (enum, required) — Which benefit accumulator this delta applies to.
    - Allowed values: `hra`, `deductible`, `oop`, `cap`, `lifetime_cap`, `drug_cap`, `benefit_deductible`, `benefit_oop`, `base_deductible`, `base_oop`, `tmoop`
  - `amount` (double, required) — (Proposed - provenance pending) Dollars applied to this accumulator on this purchase, USD.
  - `cr_db_indicator` (enum, required) — `debit` consumes the accumulator, `credit` restores it (a reversal), `replace` overwrites the running total, `bypass` ignores this accumulator for this transaction.
    - Allowed values: `debit`, `credit`, `replace`, `bypass`
  - `participation_type` (enum, optional) — Network level this accumulator tracks (may differ per accumulator).
    - Allowed values: `in_network`, `out_of_network`, `combined`, `inn_house`
  - `accumulated_amount` (double, optional) — (Proposed - provenance pending) Running total applied to date, USD. Required by ESI for `replace`.
  - `remaining_amount` (double, optional) — (Proposed - provenance pending) Amount left before the accumulator cap is met, USD.
  - `met_this_transaction` (boolean, optional) — True when this purchase drove `remaining_amount` to zero (e.g., deductible met on this fill).
- `origin_code` (enum, optional) — ESI origin code for HRA balance events (`hra_initial_load`, `hra_rollover`, `hra_incentive`); `E` is a non-shared pharmacy dollars load. Omitted for pharmacy fills.
  - Allowed values: `E`, `R`
- `plan_year` (integer, optional) — Plan year the balance applies to. Used for HRA balance events.
- `esi` (object, optional) — ESI wire-protocol identifiers, populated when a purchase is exchanged via the ESI CDH format. All fields optional.
  - `sender_id` (string, optional) — ESI-assigned trading-partner sender identifier.
  - `receiver_id` (string, optional) — Receiver identifier; `MHS` when sending to ESI.
  - `signature` (string, optional) — 26-character composite transaction key (date + milliseconds + sequence + source-app code).
  - `claim_id` (string, optional) — ESI claim identifier.
  - `claim_xref_id` (string, optional) — Original-transaction reference on a reversal or adjustment. Mirrors `original_purchase_id`.
  - `transmission_type` (enum, optional) — Data Request (sent) vs Data Response (acknowledged).
    - Allowed values: `DQ`, `DR`
  - `request_code` (enum, optional) — Claim / Reversal / Adjustment request code.
    - Allowed values: `01`, `02`, `04`
  - `response_code` (string, optional) — ESI Data Response code; `00` is accepted, otherwise an error code.
  - `reason_code` (string, optional) — Granular reason detail beyond the response code.

## Examples

### An enriched in-network purchase

**Response**

```json
{
  "purchase_id": "7e3a3c5e-3b7f-4f0a-9e65-1c9c3a8b1234",
  "member_id": "M-987654321",
  "plan_id": "PLN-0001",
  "purchased_at": "2026-05-13T18:24:01Z",
  "currency": "USD",
  "date_of_service": "2026-05-13",
  "event_type": "claim",
  "ndc": "00093005301",
  "prescriber_spi": "1234567890",
  "member_purchase_amount": 42.5,
  "oop_amount": 10,
  "plan_contribution": 32.5,
  "quantity": 30,
  "days_supply": 30,
  "provider_type": "npi",
  "network_ind": "in_network",
  "status": "accepted",
  "deductible_applied": 32.5,
  "subscriber_id": "SUB-4471902",
  "first_name": "Maria",
  "last_name": "Lopez",
  "date_of_birth": "1984-07-02",
  "gender": "female",
  "relationship": "subscriber",
  "accumulators": [
    {
      "type_of_benefit_account": "deductible",
      "amount": 32.5,
      "cr_db_indicator": "debit",
      "participation_type": "in_network",
      "accumulated_amount": 532.5,
      "remaining_amount": 967.5,
      "met_this_transaction": false
    },
    {
      "type_of_benefit_account": "oop",
      "amount": 10,
      "cr_db_indicator": "debit",
      "participation_type": "in_network",
      "accumulated_amount": 410,
      "remaining_amount": 2590,
      "met_this_transaction": false
    },
    {
      "type_of_benefit_account": "hra",
      "amount": 32.5,
      "cr_db_indicator": "debit",
      "participation_type": "in_network",
      "accumulated_amount": 132.5,
      "remaining_amount": 367.5,
      "met_this_transaction": false
    }
  ],
  "esi": {
    "sender_id": "ANDEL-TPO-0001",
    "receiver_id": "MHS",
    "signature": "20260513182401512A1B2C3D",
    "claim_id": "CLM-0009912837",
    "transmission_type": "DQ",
    "request_code": "01",
    "response_code": "00"
  }
}
```

**SDK Code**

```python An enriched in-network purchase
import requests

url = "https://api.andel.org/exchange/v1/purchases/purchase_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript An enriched in-network purchase
const url = 'https://api.andel.org/exchange/v1/purchases/purchase_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go An enriched in-network purchase
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.andel.org/exchange/v1/purchases/purchase_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby An enriched in-network purchase
require 'uri'
require 'net/http'

url = URI("https://api.andel.org/exchange/v1/purchases/purchase_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java An enriched in-network purchase
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.andel.org/exchange/v1/purchases/purchase_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php An enriched in-network purchase
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.andel.org/exchange/v1/purchases/purchase_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp An enriched in-network purchase
using RestSharp;

var client = new RestClient("https://api.andel.org/exchange/v1/purchases/purchase_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift An enriched in-network purchase
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.andel.org/exchange/v1/purchases/purchase_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### A reversal restoring a prior purchase

**Response**

```json
{
  "purchase_id": "c8d2f6a0-9b1e-4d7c-8a3f-2e6b4c9d0011",
  "member_id": "M-987654321",
  "plan_id": "PLN-0001",
  "purchased_at": "2026-05-20T09:02:14Z",
  "currency": "USD",
  "date_of_service": "2026-05-13",
  "event_type": "reversal",
  "ndc": "00093005301",
  "prescriber_spi": "1234567890",
  "member_purchase_amount": 42.5,
  "oop_amount": 10,
  "plan_contribution": 32.5,
  "quantity": 30,
  "provider_type": "npi",
  "network_ind": "in_network",
  "original_purchase_id": "7e3a3c5e-3b7f-4f0a-9e65-1c9c3a8b1234",
  "status": "accepted",
  "deductible_applied": 32.5,
  "subscriber_id": "SUB-4471902",
  "first_name": "Maria",
  "last_name": "Lopez",
  "date_of_birth": "1984-07-02",
  "gender": "female",
  "relationship": "subscriber",
  "accumulators": [
    {
      "type_of_benefit_account": "deductible",
      "amount": 32.5,
      "cr_db_indicator": "credit",
      "participation_type": "in_network",
      "accumulated_amount": 500,
      "remaining_amount": 1000,
      "met_this_transaction": false
    },
    {
      "type_of_benefit_account": "oop",
      "amount": 10,
      "cr_db_indicator": "credit",
      "participation_type": "in_network",
      "accumulated_amount": 400,
      "remaining_amount": 2600,
      "met_this_transaction": false
    },
    {
      "type_of_benefit_account": "hra",
      "amount": 32.5,
      "cr_db_indicator": "credit",
      "participation_type": "in_network",
      "accumulated_amount": 100,
      "remaining_amount": 400,
      "met_this_transaction": false
    }
  ],
  "esi": {
    "sender_id": "ANDEL-TPO-0001",
    "receiver_id": "MHS",
    "signature": "20260520090214733B2C3D4E",
    "claim_id": "CLM-0009913004",
    "claim_xref_id": "CLM-0009912837",
    "transmission_type": "DQ",
    "request_code": "02",
    "response_code": "00"
  }
}
```

**SDK Code**

```python A reversal restoring a prior purchase
import requests

url = "https://api.andel.org/exchange/v1/purchases/purchase_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript A reversal restoring a prior purchase
const url = 'https://api.andel.org/exchange/v1/purchases/purchase_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A reversal restoring a prior purchase
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.andel.org/exchange/v1/purchases/purchase_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A reversal restoring a prior purchase
require 'uri'
require 'net/http'

url = URI("https://api.andel.org/exchange/v1/purchases/purchase_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A reversal restoring a prior purchase
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.andel.org/exchange/v1/purchases/purchase_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A reversal restoring a prior purchase
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.andel.org/exchange/v1/purchases/purchase_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A reversal restoring a prior purchase
using RestSharp;

var client = new RestClient("https://api.andel.org/exchange/v1/purchases/purchase_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A reversal restoring a prior purchase
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.andel.org/exchange/v1/purchases/purchase_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### An initial annual HRA load

**Response**

```json
{
  "purchase_id": "a1b2c3d4-e5f6-4071-8293-a4b5c6d7e8f9",
  "member_id": "M-987654321",
  "plan_id": "PLN-0001",
  "purchased_at": "2026-01-01T00:00:00Z",
  "currency": "USD",
  "date_of_service": "2026-01-01",
  "event_type": "hra_initial_load",
  "status": "accepted",
  "accumulators": [
    {
      "type_of_benefit_account": "hra",
      "amount": 500,
      "cr_db_indicator": "credit",
      "participation_type": "in_network",
      "accumulated_amount": 500,
      "remaining_amount": 0,
      "met_this_transaction": false
    }
  ],
  "origin_code": "E",
  "plan_year": 2026
}
```

**SDK Code**

```python An initial annual HRA load
import requests

url = "https://api.andel.org/exchange/v1/purchases/purchase_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript An initial annual HRA load
const url = 'https://api.andel.org/exchange/v1/purchases/purchase_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go An initial annual HRA load
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.andel.org/exchange/v1/purchases/purchase_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby An initial annual HRA load
require 'uri'
require 'net/http'

url = URI("https://api.andel.org/exchange/v1/purchases/purchase_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java An initial annual HRA load
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.andel.org/exchange/v1/purchases/purchase_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php An initial annual HRA load
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.andel.org/exchange/v1/purchases/purchase_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp An initial annual HRA load
using RestSharp;

var client = new RestClient("https://api.andel.org/exchange/v1/purchases/purchase_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift An initial annual HRA load
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.andel.org/exchange/v1/purchases/purchase_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```