---
title: "Purchase"
method: POST
path: "/events/ecommerce/purchase"
tags: ["eCommerce"]
---

# Purchase

`POST /events/ecommerce/purchase`

Make a call to this endpoint when a user generates an order or purchase.

## Request body

- PurchaseRequest
  - `items` ProductRequest[], required — List of items purchased.
    - `productId` string, required — A unique identifier for the product (i.e. "T-Shirt"). If you are providing a [Google Shopping Feed](https://support.google.com/merchants/answer/7052112?hl=en), this should be [item_group_id](https://support.google.com/merchants/answer/6324507). If you don't have an [item_group_id](https://support.google.com/merchants/answer/6324507) in your feed, use [id](https://support.google.com/merchants/answer/6324405). If you are using [Shopify](https://help.shopify.com/en/manual/products), this should be Shopify product ID.
    - `productVariantId` string, required — A unique identifier for the product variant (i.e. "Medium Blue T-Shirt"). If you are providing a [Google Shopping Feed](https://support.google.com/merchants/answer/7052112?hl=en), this should be [id](https://support.google.com/merchants/answer/6324405). If you are using Shopify, this should be Shopify product Variant ID.
    - `productImage` string — A link to the image of the product. The image should not be larger than 500kb. This image will be used when sending MMS text messages.
    - `productUrl` string — The URL for the product.
    - `name` string — The name of the product. This should be in a format that could be used directly in a message.
    - `price` Price[], required — The price and currency of the product.
      - `value` number, required — The price of the product.
      - `currency` string — The currency used for the price in [ISO 4217 format](https://www.iso.org/iso-4217-currency-codes.html).
    - `quantity` integer — The number of products.
  - `orderId` string
  - `salesChannel` SalesChannel
    - `channelType` 'WEB' | 'IOS_APP' | 'ANDROID_APP' | 'IN_STORE' | 'PHONE' | 'OTHER' | '' — The type of sales channel.
  - `occurredAt` string, date-time — Timestamp of when the action occurred in [ISO 8601 format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#date.and.time.format.examples). If the timestamp is older than 12 hours, it will not trigger any relevant journeys. If no timestamp is provided, it is assumed the event occurred when the endpoint is called.
  - `user` EventUser, required — User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive. Phone, email, or an external identifier (clientUserId or another custom identifier) are required
    - `phone` string — Phone number of the user associated with the action. [E.164 format](https://en.wikipedia.org/wiki/E.164) is required. This field is required if either email or an externalIdentifier is not provided.
    - `email` string — Email of the user associated with the action. This field is required if either phone or an externalIdentifier is not provided.
    - `externalIdentifiers` ExternalIdentifiers — clientUserId or another custom identifier. This field is required if either phone or email is not provided. If using an external identifier instead of phone or email, the external identifier must first be associated with a phone or email using the Identity API.
      - `clientUserId` string — (optional) Your primary ID for a user
      - `customIdentifiers` object[] — (optional) Namespaced custom identifiers and their values.
        - `name` string
        - `value` string

## Response `200`

Ok

## Other responses

- `400` — Invalid parameter in request query or body
- `401` — Unauthorized
- `403` — Access Denied
- `404` — The specified resource was not found
- `429` — The user has sent too many requests in a given amount of time
- `500` — Internal Server Error

---

[API](https://skmtc.net/attentive/apis/attentive-api.md) · [All operations](https://skmtc.net/attentive/apis/attentive-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attentive/attentive-api/versions/6041ef3081b4/schema)
