Skip to main content
POST
/
v1
/
resources
/
accountingInvoice
Create Invoice
const url = 'https://api.runmorph.dev/v1/resources/accountingInvoice';
const options = {
  method: 'POST',
  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

Query Parameters

returnResource
default:false

Body

invoiceCode
string
required

Unique invoice identifier (human-readable)

Required string length: 1 - 250
status
enum<string>
required

Invoice state

Available options:
draft,
paid,
void,
overdue,
pending
currency
string
required

ISO currency code (e.g., USD)

Required string length: 3
preTaxAmount
number
required

Amount before taxes

Required range: x >= 0
taxAmount
number
required

Total tax applied

Required range: x >= 0
totalAmount
number
required

Final total (with tax)

Required range: x >= 0
inclusiveOfTax
boolean
required

Whether prices are tax-inclusive

balance
number
required

Outstanding balance

Required range: x >= 0
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)

lineItems
object[]

The line items associated with the invoice

note
string

Internal or external memo / comments

Response

Created

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