> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create purchase

> Records a purchase against a subscriber.

`kit.createPurchase` records a purchase against a subscriber.

```ts automations/create-purchase.automation.ts theme={null}
import { automation, markSignificant } from "automate.ax"
import { kit } from "automate.ax/kit"

export default automation("Create purchase", () => {
  markSignificant(
    kit.createPurchase({
      purchase: {
        emailAddress: "customer@example.com",
        transactionId: "order_1042",
        status: "paid",
        subtotal: 59,
        tax: 4.72,
        shipping: 0,
        discount: 10,
        total: 53.72,
        currency: "USD",
        transactionTime: "2026-09-05T12:00:00Z",
        products: [
          {
            name: "Creator workbook",
            pid: "workbook",
            lid: "order_1042_workbook",
            quantity: 1,
            unitPrice: 59,
            sku: "WORKBOOK-PRINT",
          },
        ],
      },
    }),
  )
})
```

## Input

Pass these fields:

| Field      | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `purchase` | `object` | Yes      | —           |

## Output

Returns an object with these fields:

| Field      | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `purchase` | `object` | Yes      | —           |

> This action requires a Kit OAuth connection. Kit does not allow V4 API keys for this endpoint.

<Warning>
  Do not reuse a `transactionId` for retries outside Automate.ax. Kit appends
  the submitted products to the existing purchase, so repeating the same
  transaction can create duplicate line items.
</Warning>

Kit rate limits OAuth connections to 600 requests per 60 seconds and V4 API keys to 120 requests per 60 seconds. Automate.ax honors provider retry timing for rate-limit and temporary bulk-capacity responses.
