TratowAPI
API aberta · Checkout: caixa

Lançar sangria ou reforço no caixa

post/api/open/v1/cash-sessions/{id}/movements

Em resumo

  • POST /api/open/v1/cash-sessions/{id}/movements
  • Precisa de chave read_write.
  • Obrigatórios: id, type, amountCents.
  • Sucesso: 201.
  • Authorizationstringheaderobrigatório

    Chave de API no formato Bearer ttw_live_<prefixo>_<segredo>, criada em Integrações → Chaves de API. Este endpoint precisa de chave read_write.

  • idstringobrigatório

    Id do registro (UUID).

Corpo

application/json
  • typeenum<string>obrigatório

    Tipo. Os valores aceitos estão no tipo.

    Valores aceitos:withdrawalsupplyexpense

  • amountCentsintegerobrigatório

    Valor em centavos.

    0 a 9007199254740991

  • reasonstring

    Motivo.

    até 300 caracteres

  • expenseCategoryIdstring<uuid>

    Id de despesa categoria (UUID).

  • counterpartAccountIdstring<uuid>

    Id de counterpart conta (UUID).

Resposta 201

application/json
  • idstring<uuid>obrigatório

    Identificador único (UUID).

  • typeenum<string>obrigatório

    Tipo. Os valores aceitos estão no tipo.

    Valores aceitos:sale_inchange_outwithdrawalsupplyexpenserefund_out

  • amountCentsintegerobrigatório

    Valor em centavos.

    -9007199254740991 a 9007199254740991

  • saleIdstring<uuid>pode ser nuloobrigatório

    Id de venda (UUID).

  • saleNumberintegerpode ser nuloobrigatório

    -9007199254740991 a 9007199254740991

  • reasonstringpode ser nuloobrigatório

    Motivo.

  • expenseIdstring<uuid>pode ser nuloobrigatório

    Id de despesa (UUID).

  • createdByNamestringpode ser nuloobrigatório

    Nome de criado por (só leitura).

  • createdAtstring<date-time>obrigatório

    Data e hora em que foi criado (ISO 8601, UTC).

curl --request POST \  --url 'https://qa-tratow.ips.app.br/api/open/v1/cash-sessions/{id}/movements' \  --header 'Authorization: Bearer <chave>' \  --header 'Content-Type: application/json' \  --data '{    "type": "withdrawal",    "amountCents": 8000,    "reason": "texto",    "expenseCategoryId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",    "counterpartAccountId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d"  }'
Resposta
{  "id": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "type": "sale_in",  "amountCents": 8000,  "saleId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "saleNumber": 1,  "reason": "texto",  "expenseId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "createdByName": "texto",  "createdAt": "2026-11-03T17:30:00.000Z"}

Os valores são ilustrativos.