Skip to navigation

Perform invoice action

View as Markdown

Performs an action on an invoice. See the request body for the available actions.

SEND emails the customer only the first time. On an invoice already emailed, the customer email is skipped and the response carries “customerEmailSkipped”: “ALREADY_EMAILED”; any requested ERP push still runs. Use SEND_REMINDER_EMAIL to send a payment reminder.

SEND and MARK_INVOICE_AS_VOID always return 201 with a job message. Poll GET /v3/jobs/:jobId for job status.

REVERT_INVOICE_TO_DRAFT moves an invoice back to DRAFT. A SENT_OFF_TABS invoice is reverted immediately and the updated invoice is returned. A SENT, FAILED or $0 PAID invoice is reset in the background (tax is voided and the invoice is removed from the ERP) and the response is 201 with a job message. The request is rejected with 400 and a reason when the invoice cannot be reverted, for example when it has payments, a credit memo application synced to the ERP, or an issue date in a closed accounting period, and with 409 while the invoice is still being sent.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

idstringRequired
Customer Id
invoiceIdstringRequired
Invoice Id

Request

Invoice actions for sending an invoice. Validation rules:

  1. At least one of sendToErp or sendToCustomer must be true
  2. sendToErp can be true while sendToCustomer is false (push to ERP only)
  3. sendToCustomer can be true while sendToErp is false (email customer only; useful when no ERP is connected)
  4. If sendToErp is true but the merchant has no ERP integration connected, the request is rejected
  5. the field overrideInvoiceDate is optional
SendInvoiceDtoobjectRequired
OR
MarkInvoiceAsPendingDtoobjectRequired
OR
MarkInvoiceToSentOffTabsDtoobjectRequired
OR
MarkInvoiceAsScheduledDtoobjectRequired
OR
MarkInvoiceAsVoidDtoobjectRequired
OR
SendReminderEmailDtoobjectRequired
OR
RevertInvoiceToDraftDtoobjectRequired

Response

Synchronous invoice action completed. Returned for MARK_INVOICE_AS_PENDING, MARK_INVOICE_TO_SENT_OFF_TABS, MARK_INVOICE_AS_SCHEDULED, and SEND_REMINDER_EMAIL.

payloadobject
Response payload, will be empty when success is false
successboolean

Boolean with true=success, false=failure

messagestring

Plain-text description of the result

errorobjectOptional
json element with any error messages or warnings

Errors

400
Bad Request Error
500
Internal Server Error