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

# Pay bills

> Pay a bill with a transfer, or record a payment you already made.

Every payment is tracked on the bill, so its status and outstanding balance
always show where the money is.

## Pay with a new transfer

Add `billId` when you create an [ACH](/api-reference/transfers/ach/create),
[wire](/api-reference/transfers/wire/create),
[international wire](/api-reference/transfers/international-wire/create) or
[realtime](/api-reference/transfers/realtime/create) transfer. The transfer
is sent as usual and recorded as a payment on the bill.

```bash theme={null}
curl https://api.slash.com/v2/transfers/ach \
  -X POST \
  -H "X-API-Key: $SLASH_API_KEY" \
  -H "x-legal-entity: $SLASH_LEGAL_ENTITY_ID" \
  -H "X-Idempotency-Key: pay-INV-4471" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": { "amount": 120000, "currency": "USD" },
    "fromAccount": "subaccount_operations123",
    "destinationId": "le_contact_destination_2rj4l7hmrrrcv",
    "billId": "bill_2rj4l7hmrrrcv",
    "ach": { "speed": "standard", "companyEntryDescription": "VENDOR PAY" }
  }'
```

The payment shows up in the bill's `payments` list. The bill's `status`
follows once Slash recomputes it, usually within moments: `payment_pending`
while the transfer is on its way, or `pending_approval` if a payment policy
requires approval first.

```json theme={null}
{
  "id": "bill_2rj4l7hmrrrcv",
  "status": "payment_pending",
  "payments": [
    {
      "id": "bill_payment_2rj4l7hmrrrcv",
      "transferId": "transfer_intent_2rj4l7hmrrrcv",
      "transactionId": "agg_tx_2rj4l7hmrrrcv",
      "status": "pending",
      "amount": { "amount": 120000, "currency": "USD" }
    }
  ]
}
```

When the transfer settles, the bill becomes `paid`, or `partially_paid` if
the transfer covered only part of the total. If the transfer fails or is
returned, the amount is owed again and the bill becomes `payment_failed`.

You can pay part of a bill, or pay to a different bank account than the one
on the bill. Paying a bill that already has a payment waiting for approval,
scheduled or on its way, or that is already `paid`, returns `bill_not_payable`.
A bill with a purchase card requested for it returns `bill_card_request_open`
until the request is cancelled, since spending the card settles the bill.

## Record a payment you already made

If you paid the vendor without a `billId`, link the payment afterwards with
[Link a payment to a bill](/api-reference/bills/payments/add). Send exactly
one of a `transferId` or the `transactionId` of any transaction your key can
read with `transactions.view`, such as a card purchase.

```bash theme={null}
curl https://api.slash.com/v2/bills/bill_2rj4l7hmrrrcv/payments \
  -X POST \
  -H "X-API-Key: $SLASH_API_KEY" \
  -H "x-legal-entity: $SLASH_LEGAL_ENTITY_ID" \
  -H "Content-Type: application/json" \
  -d '{ "transactionId": "agg_tx_2rj4l7hmrrrcv" }'
```

A payment can only count toward one bill. If the payment already has an
[accounting entry](/docs/v2/accounting/overview), it becomes the bill's
payment entry, so the expense isn't booked twice.

## Fix a payment on the wrong bill

[Unlink a payment from a bill](/api-reference/bills/payments/remove) removes
the payment from the bill without touching the money, then link it to the
right bill. To stop a payment that is awaiting approval or scheduled,
[void the bill](/api-reference/bills/void) instead. A payment already on its
way can't be voided; cancel a pending ACH payment with
[Cancel an ACH transfer](/api-reference/transfers/ach/cancel).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.