---
title: "Create credits usage"
method: POST
path: "/v1/customers/{id}/credits/{productId}/usage"
tags: ["Customers > Credits"]
---

# Create credits usage

`POST /v1/customers/{id}/credits/{productId}/usage`

Create a usage entry for a credit product. This will impact the balance of the customer by `usage_retained`.

## Path parameters

- `id` string, required
- `productId` string, required

## Request body

- CreateCreditUsage
  - `usage_retained` number, required — Value indicating the number of credits consumed.
  - `event_id` string — Event ID corresponding to the credit consumption.

## Response `201`

The created credit transaction

- CreditTransaction
  - `id` string, required — Credit transaction ID.
  - `product_id` string, nullable, required — ID of the product related to the transaction.
  - `price` object, nullable, required — Price details related to the transaction.
    - `id` string, required
    - `amount` number, required — Monetary amount. Expressed in currency's smallest unit.
    - `pack_size` number, required
  - `customer_id` string, required — ID of the customer related to the transaction.
  - `payment_method_id` string, nullable, required — ID of the payment method related to the transaction.
  - `invoice_id` string, nullable, required — ID of the invoice related to the transaction.
  - `event_id` string, nullable, required — ID of the event related to the credit consumption.
  - `aggregator_id` string, nullable, required — ID of the aggregator that triggered this usage (for multi-aggregator credits).
  - `expires_at` string, date, nullable, required — Expiration date for credits linked to this transaction
  - `type` 'topup' | 'usage' | 'expiration', required — Type of credit transaction.
  - `source` 'app' | 'portal' | 'api' | 'system', required — Deprecated field, we recommend no longer using it.
  - `amount_excluding_tax` number, nullable, required — Monetary amount. Expressed in currency's smallest unit.
  - `credit_count` number, required — Value of credits related to the transaction.
  - `balance_after` number, required — Credit balance after the transaction.
  - `created_at` string, date-time, required — Credit transaction creation date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
  - `updated_at` string, date-time, required — Credit transaction last edition date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

---

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