POST /api/operator/credit

Credits a pot by hand, in the payer's currency, with a reference to the invoice or the reason. Not a sale: it is outside the tax export.

Surface: operator. Who may call: operator. Key: operator.credit.

Example request

curl -X POST https://caremcp.com/api/operator/credit \
  -H "Authorization: Bearer <operator token>" \
  -H "Content-Type: application/json" \
  -d '{"payer":"client","id":"7d1f0a0e-2c4b-4c7e-9a6e-000000000001","amountCents":2000,"ref":"INV-2026-001"}'

Example input

{
  "payer": "client",
  "id": "7d1f0a0e-2c4b-4c7e-9a6e-000000000001",
  "amountCents": 2000,
  "ref": "INV-2026-001"
}

Input schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "payer": {
   "type": "string",
   "enum": [
    "client",
    "organisation"
   ]
  },
  "id": {
   "type": "string",
   "format": "uuid",
   "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  },
  "amountCents": {
   "type": "integer",
   "minimum": 1,
   "maximum": 9007199254740991
  },
  "ref": {
   "type": "string",
   "minLength": 1,
   "maxLength": 80
  }
 },
 "required": [
  "payer",
  "id",
  "amountCents",
  "ref"
 ]
}

Output schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "amountCents": {
   "type": "integer",
   "minimum": -9007199254740991,
   "maximum": 9007199254740991
  },
  "ref": {
   "type": "string"
  },
  "at": {
   "type": "string"
  }
 },
 "required": [
  "id",
  "amountCents",
  "ref",
  "at"
 ],
 "additionalProperties": false
}