---
title: "Record Token Purchase"
method: POST
path: "/admin/payers/{user_id}/token-purchases"
tags: ["subscriptions"]
---

# Record Token Purchase

`POST /admin/payers/{user_id}/token-purchases`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/admin/payers/{user_id}/token-purchases`
- Auth: none declared

Record units somebody bought. **Admin-only until a payment provider exists.**

Units land immediately and raise the ceiling in **every** state, trial included — we
are never in the position of refusing money from a customer trying to give it to us.

**`external_ref` is UNIQUE since the Payrexx work**, so recording the same provider
transaction twice by hand is refused rather than granted twice. That is a 409 and not
a 500: an operator re-keying a reference they already entered is an ordinary mistake,
and the message has to say which one.

## Path parameters

- `user_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- TokenPurchaseIn
  - `units` integer, required
  - `unit_price` union
    - number
    - string
  - `source` string
  - `expires_at` string, date-time, nullable
  - `external_ref` string, nullable

## Response `201`

Successful Response

- TokenPurchaseOut
  - `id` string, required
  - `payer_user_id` string, required
  - `units` integer, required
  - `consumed_units` integer, required
  - `unit_price` string, required
  - `currency` string, required
  - `source` string, required
  - `purchased_at` string, date-time, required
  - `expires_at` string, date-time, nullable
  - `external_ref` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zeno-works/apis/zeno-api.md) · [All operations](https://skmtc.dev/zeno-works/apis/zeno-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zeno-works/apis/zeno-api/revisions/1eb93dde146c?raw)
