TratowAPI
API aberta · Estoque

Estornar movimentação de estoque

post/api/open/v1/stock/movements/{id}/reverse

Em resumo

  • POST /api/open/v1/stock/movements/{id}/reverse
  • Precisa de chave read_write.
  • Obrigatórios: id.
  • 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
  • notesstringpode ser nulo

    Observações livres.

    até 2000 caracteres

Resposta 201

application/json
  • idstring<uuid>obrigatório

    Identificador único (UUID).

  • productIdstring<uuid>obrigatório

    Id de produto (UUID).

  • productNamestringobrigatório

    Nome de produto (só leitura).

  • unitenum<string>obrigatório

    Unidade de medida.

    Valores aceitos:unmlgkglcmmcxpct

  • typeenum<string>obrigatório

    Tipo. Os valores aceitos estão no tipo.

    Valores aceitos:in.purchasein.returnin.adjustout.saleout.service_useout.lossout.expiredout.internalout.adjust

  • quantitystringobrigatório

    Quantidade (decimal em texto, até 3 casas, para produtos fracionados).

  • unitCostCentsintegerobrigatório

    Unitário custo em centavos (100 = R$ 1,00).

    -9007199254740991 a 9007199254740991

  • totalCostCentsintegerobrigatório

    Total custo em centavos (100 = R$ 1,00).

    -9007199254740991 a 9007199254740991

  • balanceAfterstringobrigatório
  • negativeWarningbooleanobrigatório
  • supplierIdstring<uuid>pode ser nuloobrigatório

    Id de fornecedor (UUID).

  • supplierNamestringpode ser nuloobrigatório

    Nome de fornecedor (só leitura).

  • invoiceNumberstringpode ser nuloobrigatório
  • professionalIdstring<uuid>pode ser nuloobrigatório

    Id de profissional (UUID).

  • refTypeenum<string>obrigatório

    Valores aceitos:manualappointmentsaleinventorypurchase_orderreversal

  • refIdstring<uuid>pode ser nuloobrigatório

    Id de ref (UUID).

  • reversesIdstring<uuid>pode ser nuloobrigatório

    Id de reverses (UUID).

  • reversedByIdstring<uuid>pode ser nuloobrigatório

    Id de estornado por (UUID).

  • notesstringpode ser nuloobrigatório

    Observações livres.

  • createdByIdstring<uuid>pode ser nuloobrigatório

    Id de criado por (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/stock/movements/{id}/reverse' \  --header 'Authorization: Bearer <chave>' \  --header 'Content-Type: application/json' \  --data '{    "notes": "Prefere atendimento pela manhã."  }'
Resposta
{  "id": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "productId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "productName": "texto",  "unit": "un",  "type": "in.purchase",  "quantity": "1",  "unitCostCents": 8000,  "totalCostCents": 8000,  "balanceAfter": "texto",  "negativeWarning": true,  "supplierId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "supplierName": "texto",  "invoiceNumber": "texto",  "professionalId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "refType": "manual",  "refId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "reversesId": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "reversedById": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "notes": "Prefere atendimento pela manhã.",  "createdById": "3f6c1b2a-4c7a-4d9e-8b1f-2e5d6a7b4c9d",  "createdByName": "texto",  "createdAt": "2026-11-03T17:30:00.000Z"}

Os valores são ilustrativos.