---
title: "POST /v1/internal/credits/deposit"
method: POST
path: "/v1/internal/credits/deposit"
---

# POST /v1/internal/credits/deposit

`POST /v1/internal/credits/deposit`

Handle credits deposit after payment

## Headers

- `x-api-key` string, required

## Request body

- union
  - object
  - CreditsDepositParams
    - `amountPaidCents` integer — optional payment validation
    - `interval` string — from subscription metadata
    - `orgId` string, required
    - `referenceId` string, required
    - `resetBeforeDeposit` boolean — default false = additive
    - `source` string, required
    - `stripeCustomerId` string — from invoice.paid event
    - `stripeSubscriptionId` string — from invoice.paid event
    - `tier` string, required

## Response `200`

OK

- CreditsDepositResponse
  - `aiBalance` CreditsDepositBalanceChange
    - `new` number
    - `old` number
  - `creditsInserted` boolean
  - `cuBalance` CreditsDepositBalanceChange
    - `new` number
    - `old` number

## Other responses

- `400` — Bad Request
- `401` — Unauthorized

---

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