Update an invoice

Changed on

Edit a scheduled or unpaid invoice. Only the fields you send change, and null clears a field. See Edit an invoice.

patch/v2/invoices/{invoiceId}

Request

  • Base URL
    https://api.slash.com
  • URL
    https://api.slash.com/v2/invoices/{invoiceId}
  • Auth
    API key in header X-API-Key

Request body

accountIdstring

The account payments settle into, with the sa_group_ prefix.

virtualAccountIdstring nullable

A virtual account to settle into, with the subaccount_ prefix. null settles into the account's primary virtual account.

numberstring
issueDatestring date
dueDatestring date
timezonestring
scheduledSendDatestring date

Only for scheduled invoices.

taxRatenumber nullable

null removes the tax.

memostring nullable

null clears the memo.

ccEmailsstring[]

Example request

{
  "lineItems": [
    {
      "name": "Robot arm maintenance",
      "quantity": 2,
      "unitAmount": {
        "amount": 45000
      }
    }
  ],
  "discount": {
    "percent": 10
  }
}

Response

The updated invoice.

idstring required

Invoice id with the inv_ prefix.

numberstring required

Unique per legal entity.

status'scheduled' | 'unpaid' | 'partially_paid' | 'paid' | 'void' required

See Invoice lifecycle.

overdueboolean required

Whether the invoice is unpaid or partially_paid and its due date has passed in its timezone.

customerIdstring

Customer id with the le_cus_ prefix.

accountIdstring required

The account payments settle into, with the sa_group_ prefix.

virtualAccountIdstring

The virtual account payments settle into, with the subaccount_ prefix. Absent when they settle into the account's primary virtual account.

seriesIdstring

The recurring series that issued the invoice, with the inv_series_ prefix.

issueDatestring date required
dueDatestring date required
timezonestring required

The IANA timezone the invoice's dates are in.

scheduledSendDatestring date

When a scheduled invoice will be emailed, at 9:00 in its timezone.

taxRatenumber

Tax as a percent of the subtotal after the discount. 8.5 means 8.5%.

memostring

A note printed on the invoice.

ccEmailsstring[] required

Also copied on the invoice and its reminders.

payUrlstring required

The hosted page where the customer views and pays the invoice.

documentIdstring required

The invoice's PDF, with the st_ prefix. Download it with GET /v2/documents/{documentId}. Each edit issues a new PDF.

nextReminderAtstring date-time

When the next automatic reminder is due to go out.

paidAtstring date-time

When the invoice became paid.

voidedAtstring date-time

When the invoice was voided.

createdAtstring date-time required

Example response

{
  "id": "inv_2rj4l7hmrrrcv",
  "number": "INV-1042",
  "customerId": "le_cus_2rj4l7hmrrrcv",
  "accountId": "sa_group_2rj4l7hmrrrcv",
  "timezone": "America/New_York",
  "lineItems": [
    {
      "name": "Robot arm maintenance",
      "quantity": 2
    }
  ],
  "discount": {
    "percent": 10
  },
  "taxRate": 8.5,
  "payments": [
    {
      "id": "inv_tr_link_2rj4l7hmrrrcv",
      "transactionId": "agg_tx_2rj4l7hmrrrcv"
    }
  ],
  "documentId": "st_2rj4l7hmrrrcv"
}

Changes