---
title: "Reverse an allocation"
method: POST
path: "/credits/end-users/{externalUserId}/deallocate"
tags: ["End users"]
---

# Reverse an allocation

`POST /credits/end-users/{externalUserId}/deallocate`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/end-users/{externalUserId}/deallocate`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Moves credits from the end user's balance back to the workspace platform pool, reversing an earlier allocation. Send amounts as decimal strings and reuse the same Idempotency-Key when retrying one logical transfer.

## Path parameters

- `externalUserId` string, required: Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `credits` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.

## Response `200`

Credits returned to the platform pool

- TransferResult
  - `success` unknown, required
  - `externalUserId` string, required: Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
  - `usd` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
  - `credits` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
  - `poolBalanceUsd` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
  - `endUserBalanceUsd` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
