Skip to main content
PATCH
/
v1
/
resources
/
accountingInvoice
/
{resourceId}
Update Invoice
const url = 'https://api.runmorph.dev/v1/resources/accountingInvoice/{resourceId}';
const options = {
  method: 'PATCH',
  headers: {
    'x-api-key': '<api-key>',
    'x-api-secret': '<api-key>',
    'x-connector-id': '<api-key>',
    'x-owner-id': '<api-key>',
    'x-session-token': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: '{"invoiceCode":"<string>","customerContact":{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"},"customerCompany":{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"},"issuedAt":"<string>","dueAt":"<string>","paidAt":"<string>","status":"draft","lineItems":[{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"}],"currency":"<string>","preTaxAmount":1,"taxAmount":1,"totalAmount":1,"inclusiveOfTax":true,"balance":1,"note":"<string>"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "object": "resourceRef",
  "model": "<string>",
  "id": "<string>",
  "remote": {
    "id": "<string>"
  }
}

Authorizations

x-api-key
string
header
required
x-api-secret
string
header
required
x-connector-id
string
header
required
x-owner-id
string
header
required
x-session-token
string
header
required

Path Parameters

resourceId
string
required

Query Parameters

returnResource
default:false

Body

invoiceCode
string

Unique invoice identifier (human-readable)

Required string length: 1 - 250
customerContact
object

The customer's contact associated with the invoice

customerCompany
object

The customer's company associated with the invoice

issuedAt
string

Date when the invoice was issued

dueAt
string

Payment due date

paidAt
string

Date the invoice was paid (if applicable)

status
enum<string>

Invoice state

Available options:
draft,
paid,
void,
overdue,
pending
lineItems
object[]

The line items associated with the invoice

currency
string

ISO currency code (e.g., USD)

Required string length: 3
preTaxAmount
number

Amount before taxes

Required range: x >= 0
taxAmount
number

Total tax applied

Required range: x >= 0
totalAmount
number

Final total (with tax)

Required range: x >= 0
inclusiveOfTax
boolean

Whether prices are tax-inclusive

balance
number

Outstanding balance

Required range: x >= 0
note
string

Internal or external memo / comments

{key}
any

Response

OK

  • Option 1
  • Option 2
object
enum<string>
default:resource
required
Available options:
resourceRef
model
string
required
id
string
required
remote
object