> ## Documentation Index
> Fetch the complete documentation index at: https://developer.jtl-software.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SalesOrderPaymentBalance

> What is due, paid and open for a sales order. It counts the payments of the order and of its invoices and their invoice corrections, so the order shows the whole picture.



**Kind**: `object`

## Fields

**`salesOrderId`**: `ID!`

The ID of the sales order.

---

**`currencyCode`**: `String!`

The currency of the amounts (ISO 4217).

---

**`grossAmount`**: `Decimal!`

The gross amount of the order.

---

**`creditedAmount`**: `Decimal!`

The gross amount of the invoice corrections of its invoices.

---

**`amountDue`**: `Decimal!`

What the customer has to pay: the gross amount minus the credited amount; for a cancelled order 0 minus the credited amount.

---

**`paidAmount`**: `Decimal!`

What counts as paid: the payments of the order and of its invoices and invoice corrections, including cash discount write-offs and payouts (negative). Payments towards dunning fees do not count.

---

**`openAmount`**: `Decimal!`

'amountDue' minus 'paidAmount'. Negative when the order is overpaid; a cancelled order is overpaid by everything paid.

---

**`overpaidAmount`**: `Decimal!`

How much the order is overpaid: the negative open amount as a positive number, otherwise 0. This is what 'CreateSalesOrderRefund' can refund.

---

**`paymentStatus`**: `DocumentPaymentStatus!`

How far the order is paid.

---

**`paidAt`**: `DateTime`

When the order became fully paid: the date of its last payment, or its creation date when nothing is due. Empty while it is not fully paid.

