---
title: "POST /api/credits/"
method: POST
path: "/api/credits/"
tags: ["api"]
---

# POST /api/credits/

`POST /api/credits/`

## Request body

- CustomerBalanceAdjustmentCreateRequest
  - `customer_id` string, nullable, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
  - `amount` number, double, required
  - `currency_code` string, required
  - `description` string, nullable
  - `effective_at` string, date-time
  - `expires_at` string, date-time, nullable
  - `amount_paid` number, double
  - `amount_paid_currency_code` string

## Response `201`

- CustomerBalanceAdjustment
  - `credit_id` string, required
  - `customer` LightweightCustomer, required
    - `customer_name` string, nullable, required — The display name of the customer
    - `email` string, email, nullable, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
    - `customer_id` string, nullable, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
  - `amount` number, double, required
  - `amount_remaining` number, double, required
  - `currency` PricingUnit, required
    - `code` string, required
    - `name` string, required
    - `symbol` string, required
  - `description` string, nullable, required
  - `effective_at` string, date-time, required
  - `expires_at` string, date-time, nullable, required
  - `status` 'active' | 'inactive', required — * `active` - Active * `inactive` - Inactive
  - `amount_paid` number, double, required
  - `amount_paid_currency` PricingUnit, required
    - `code` string, required
    - `name` string, required
    - `symbol` string, required
  - `drawdowns` CreditDrawdown[], required
    - `credit_id` string, required
    - `amount` number, double, required
    - `description` string, nullable
    - `applied_at` string, date-time, required

## Changes

> 50 revisions in range; 1 could not be searched.

- **2023-02-20** `d246ebbb528d` — 1 breaking, 3 info
  - the response property `customer/customer_id` became nullable for the status `201`
  - the request property `customer_id` became nullable (media type: application/json)
  - the request property `customer_id` became nullable (media type: application/x-www-form-urlencoded)
  - the request property `customer_id` became nullable (media type: multipart/form-data)
- **2023-02-19** `33a8ac13f9bf` — 1 info
  - the `customer/customer_id` response's property pattern `^[-a-zA-Z0-9_]+$` was removed for the status `201`
- **2023-01-20** `3ce328fada43` — 5 breaking, 1 info
  - the response property `amount_paid_currency` became nullable for the status `201`
  - the `amount_paid_currency` response's property type/format changed from `object`/`` to ``/`` for status `201`
  - removed the required property `amount_paid_currency/code` from the response with the `201` status
  - removed the required property `amount_paid_currency/name` from the response with the `201` status
  - …2 more
- **2023-01-20** `97264bb2115e` — 1 info
  - endpoint added
- **2023-01-16** `36b48cae00a3` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/uselotus/apis/lotus-api/changes/api/credits/post.md)

---

[API](https://skmtc.dev/uselotus/apis/lotus-api.md) · [All operations](https://skmtc.dev/uselotus/apis/lotus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/uselotus/lotus-api/revisions/1f59f4fea13f/schema)
