---
title: "Record a payment"
method: POST
path: "/payments"
tags: ["Payments"]
---

# Record a payment

`POST /payments`

## Request

- Base URL: `https://www.billingengine.com/api/v1`
- URL: `https://www.billingengine.com/api/v1/payments`
- Auth: HTTP bearer

A payment needs the gross amount and the ids of sent, open invoices of the same customer and tax rate.

## Request body

- PaymentInput
  - `amount` number, required: Gross amount.
  - `invoice_ids` integer[], required
  - `date` string, date: Defaults to today.
  - `payment_method` 'transfer' | 'cash'

## Response `201`

The recorded payment.

- Payment
  - `id` integer
  - `number` union
    - string
    - integer
  - `date` string, date
  - `amount` number
  - `currency` string
  - `payment_method` 'transfer' | 'cash'
  - `cancelled` boolean
  - `customer` CustomerReference
    - `id` integer
    - `name` string
  - `invoice_ids` integer[]

## Other responses

- `400`: Malformed request: missing parameter, invalid JSON, invalid date or invalid filter.
- `401`: Missing or invalid API key.
- `403`: The API is not available in the Free plan, or the monthly invoice maximum of the plan has been reached.
- `422`: The record is invalid. The messages explain why.

---

[API](https://skmtc.dev/billingengine/apis/billingengine-api.md) · [All operations](https://skmtc.dev/billingengine/apis/billingengine-api/llms.txt) · [OpenAPI document](https://skmtc.dev/billingengine/apis/billingengine-api/revisions/71d8ea5fb554?raw)
