# Pay an invoice

Pay an invoice by bank transfer, quoting its number, and see what the payment methods of the API do.

Every invoice is paid by bank transfer, within 14 days of its date, quoting the invoice number as
the reference. There is nothing to set up. Card payment and SEPA direct debit are not offered.

## Prerequisites

- In the console, `billing:GetInvoices` to open **Invoices** (without it the page shows an
  access-denied notice) and an invoice (without it the invoice's page is not found), and
  `billing:GetPaymentMethods` to open **Payment methods** (without it the page shows an
  access-denied notice).

## Pay

**Console**
1. Open **Invoices** and choose the invoice.
2. Under **How to pay**, copy the **IBAN** and the **BIC**.
3. Transfer the total from your bank, with the invoice number as the reference.

**How to pay** is shown while an invoice is issued or overdue. **Payment methods** shows the same
bank details, the reference and the payment term.

**CLI:** not available. A payment is a bank transfer from your own bank; the PDF of the invoice carries the bank details.
**API:** not available. A payment is a bank transfer from your own bank; the PDF of the invoice carries the bank details.

## Result

The invoice's status becomes `paid` when Deutsche Cloud records your payment; the platform does not
change it by itself. When the billing account is marked overdue, **Billing** and **Payment
methods** show "Payment overdue."

## Payment methods in the API

The API keeps a list of payment methods, whose only type is `bank_transfer`. It does not change how
an invoice is paid, and the console does not show it.

```sh
dcloud billing payment-methods list
dcloud billing payment-methods create --type bank_transfer
```

- Listing needs `billing:GetPaymentMethods`; adding, removing or changing the default needs
  `billing:ManagePaymentMethods`.
- The first method added becomes the default. Adding a second `bank_transfer` is refused with `409`
  "Bank transfer is already how this organization pays; it cannot be added twice."
- Removing the default makes the oldest remaining method the default.
- Setting the default or removing a method checks the permission before the id: without
  `billing:ManagePaymentMethods` the answer is `403` even for an id that does not exist.

## Related

- [Read and download an invoice](read-an-invoice.md)
- `billing.payment-methods.list` · `dcloud billing payment-methods list`
