---
title: "Contact purchases"
method: GET
path: "/contacts/{id}/commerce"
tags: ["Contacts"]
---

# Contact purchases

`GET /contacts/{id}/commerce`

## Request

- Base URL: `https://sending.dev/api/v1`
- URL: `https://sending.dev/api/v1/contacts/{id}/commerce`
- Auth: HTTP bearer

Orders count, spent (per currency, never summed across currencies), average order value, first and last order, and the last 10 orders of the contact, from connected stores and the commerce API. Required scope: `commerce:read`.

## Path parameters

- `id` string, required: Contact ID.

## Response `200`

Contact purchases.

- ContactCommerce
  - `contactId` string, uuid, required
  - `ordersCount` integer, required: Orders, cancelled excluded, all currencies.
  - `totalSpent` number, nullable, required: Gross spent; `null` with more than one currency (never summed).
  - `currency` string, nullable, required
  - `averageOrderValue` number, nullable, required
  - `byCurrency` object[], required: One row per currency, highest revenue first: the numbers to read when there is more than one.
    - `currency` string, required
    - `revenue` number, required
    - `refunded` number, required
    - `orders` integer, required
    - `averageOrderValue` number, nullable, required
  - `firstOrderAt` string, date-time, nullable, required
  - `lastOrderAt` string, date-time, nullable, required
  - `recentOrders` CommerceOrder[], required: Last 10 orders, cancelled included.
    - `id` string, uuid, required
    - `source` 'store' | 'api', required: `store`: a connected store; `api`: `POST /commerce/orders`.
    - `connectionId` string, uuid, nullable, required
    - `externalId` string, required
    - `contactId` string, uuid, nullable, required
    - `status` 'placed' | 'fulfilled' | 'cancelled', required: API orders are always `placed`: the API knows no fulfillment or cancellation.
    - `total` number, required
    - `refunded` number, required
    - `currency` string, required
    - `placedAt` string, date-time, required
    - `attributedMessageId` string, nullable, required: Marketing message with the last content click in the attribution window before the order; `null` if none.
    - `attributedTo` object, nullable, required
      - `campaignId` string, uuid, nullable, required
      - `automationId` string, uuid, nullable, required
    - `items` object[], required
      - `title` string, required
      - `quantity` number, required
      - `price` number, nullable, required
      - `productId` string, nullable, required

## Other responses

- `401`: Missing or invalid token.
- `403`: Insufficient scope.
- `404`: Resource not found.

---

[API](https://skmtc.dev/sending/apis/sending-dev-api.md) · [All operations](https://skmtc.dev/sending/apis/sending-dev-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sending/apis/sending-dev-api/revisions/9fe78d2918a1?raw)
