---
title: "Record a payment (create transaction)"
method: POST
path: "/transactions"
tags: ["Admin Sales: Transactions"]
---

# Record a payment (create transaction)

`POST /transactions`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/transactions`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/transactions/post.ts> (a function with typed inputs; its response is checked against the schema)

Records a manual payment against an invoice — the admin Sales → Transactions "Record Payment" action. Inserts a paid `order_transactions` row; when the cumulative payments reach the invoice grand total it marks the invoice paid and advances the order to completed (if a shipment exists) or processing. Returns the created transaction. Requires `sales.transactions.view` permission. Errors: 422 (missing/non-numeric fields), 400 (unknown invoice, invoice already paid, amount ≤ 0, or amount would exceed the invoice grand total).

## Request body

- object
  - `invoiceId` integer, required
  - `paymentMethod` string, required
  - `amount` number, required

## Response `201`

The created transaction.

## Other responses

- `400`: Unknown invoice, invoice already paid, amount ≤ 0, or amount exceeds the invoice grand total.
- `401`: Missing or invalid admin token.
- `403`: Admin role lacks sales.transactions.view.
- `422`: Missing or non-numeric invoiceId / paymentMethod / amount.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
