---
title: "Reconcile Invoices, Credit Notes, Payments, Refunds"
method: POST
path: "/reconcile"
tags: ["Operations"]
---

# Reconcile Invoices, Credit Notes, Payments, Refunds

`POST /reconcile`

## Request

- Base URL: `https://api.upflow.io/v1`
- URL: `https://api.upflow.io/v1/reconcile`
- Auth: API key in header `X-Api-Key` and API key in header `X-Api-Secret`

Manage a reconciliation, which assigns credit notes, payments and/or
refunds previously created to existing invoices.

A successful call will bind amounts and change invoices statuses
accordingly.

In order to avoid duplicating reconciliation, you have to provide a
unique `externalId` to identify it.

## Request body

- ReconcileRequest: Request body for reconciliation.
  - `externalId` string, required: A unique external identifier for this reconciliation operation.
  - `invoices` InvoiceRefWithAmount[]: Invoices involved in the reconciliation and the amounts linked.
    - `id` string, uuid: Invoice ID.
    - `externalId` string: Invoice external ID.
    - `customId` string: Invoice custom ID.
    - `amountLinked` integer, required: Amount allocated to the invoice (in cents).
  - `payments` PaymentRefWithAmount[]: Payments involved in the reconciliation and the amounts linked.
    - union
      - object: Reference to a payment with an associated amount.
        - `id` string, uuid, required: The payment transaction ID.
        - `externalId` string: The payment external ID.
        - `amountLinked` integer, required: Payment share allocated (in cents).
      - object: Reference to a payment with an associated amount.
        - `id` string, uuid: The payment transaction ID.
        - `externalId` string, required: The payment external ID.
        - `amountLinked` integer, required: Payment share allocated (in cents).
  - `creditNotes` CreditNoteRefWithAmount[]: Credit notes involved in the reconciliation and the amounts linked.
    - union
      - object: Reference to a credit note with an associated amount.
        - `id` string, uuid, required: The credit note ID.
        - `externalId` string: The credit note external ID.
        - `customId` string: The credit note custom ID.
        - `amountLinked` integer, required: Amount allocated from the credit note (in cents).
      - object: Reference to a credit note with an associated amount.
        - `id` string, uuid: The credit note ID.
        - `externalId` string, required: The credit note external ID.
        - `customId` string: The credit note custom ID.
        - `amountLinked` integer, required: Amount allocated from the credit note (in cents).
      - object: Reference to a credit note with an associated amount.
        - `id` string, uuid: The credit note ID.
        - `externalId` string: The credit note external ID.
        - `customId` string, required: The credit note custom ID.
        - `amountLinked` integer, required: Amount allocated from the credit note (in cents).
  - `refunds` RefundRefWithAmount[]: Refunds involved in the reconciliation and the amounts linked.
    - union
      - object: Reference to a refund with an associated amount.
        - `id` string, uuid, required: The refund ID.
        - `externalId` string: The refund external ID.
        - `amountLinked` integer, required: Amount linked to the refund (in cents).
      - object: Reference to a refund with an associated amount.
        - `id` string, uuid: The refund ID.
        - `externalId` string, required: The refund external ID.
        - `amountLinked` integer, required: Amount linked to the refund (in cents).

## Response `201`

Reconciliation result.

- 'CREATED' | 'UPDATED' | 'IGNORED' | 'UNCHANGED' | 'DELETED': Status of the reconciliation operation.

---

[API](https://skmtc.dev/upflow/apis/upflow-api.md) - [All operations](https://skmtc.dev/upflow/apis/upflow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upflow/apis/upflow-api/revisions/898a98ca0587?raw)
