Submit an invoice

Prev Next
Post
/v1/invoices

Submit a new invoice to MakersHub. Supports two modes based on the request body structure:

  • File submission: Include a data field as a base64-encoded string. The file is uploaded and queued for OCR extraction.
  • Data submission: Send invoice fields directly in the request body (no data wrapper). The invoice is created directly without OCR processing.

The endpoint detects the mode automatically: if the body contains a data field with a string value, it is treated as a file submission. Otherwise, the body is treated as structured invoice data.


File Submission

Field Type Description
data string Base64 encoded file content (PDF/Image). Required.
filename string Original filename including extension. Required.
type string MIME type. Defaults to application/pdf.

Data Submission

Send invoice fields directly in the request body.

Field Type Description
supplier_info object Supplier details (name, web, email, phone_number, address, supplierId).
ship_to object Ship-to address (name, address).
bill_to object Bill-to address (name, address, memo, departmentId, entityId).
invoice_number string Invoice number.
po_number string Purchase order number.
invoice_terms string Payment terms (e.g., "Net 30", "2%10 Net45").
invoice_date string Invoice date (YYYY-MM-DD).
invoice_due string Payment due date (YYYY-MM-DD).
invoice_items array Line items (same structure as PATCH endpoint).
invoice_total number Total invoice amount.
tags string Comma-separated tags.
Security
HTTP
Type bearer

Enter your API token.

Body parameters
submitPdf

Submit PDF Invoice (File)

{
  "data": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL1BhZ2UvUGFyZW50IDIgMCBSL1Jlc291cmNlczw8L0ZvbnQ8PC9GMSAxIDAgUj4+Pj4vTWVkaWFCb3hbMCAwIDYxMiA3OTJdL0NvbnRlbnRzIDQgMCBSPj4KZW5kb2JqCg==",
  "filename": "invoice-2024-001.pdf",
  "type": "application/pdf"
}
submitImage

Submit Image Invoice (File)

{
  "data": "/9j/4AAQSkZJRgABAQEASABIAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKO...",
  "filename": "invoice-scan.jpg",
  "type": "image/jpeg"
}
submitData

Submit Invoice Data Directly

{
  "supplier_info": {
    "name": "Belimo AirControls",
    "web": "www.belimo.com",
    "email": null,
    "phone_number": "800-543-9038",
    "address": "33 Turner Road\nDanbury, CT 06810",
    "supplierId": "61"
  },
  "ship_to": {
    "name": "ABC Supply",
    "address": "785 1st Street\nBEAVER PA 15009"
  },
  "bill_to": {
    "name": "ABC Supply",
    "address": "100 2nd Street\nBRIDGEVILLE PA 15017",
    "memo": null,
    "departmentId": "4",
    "entityId": null
  },
  "invoice_number": "920308481-add01",
  "po_number": "22-015242-7T",
  "invoice_terms": "2%10 Net45",
  "invoice_date": "2025-11-25",
  "invoice_due": "2026-01-09",
  "invoice_items": [
    {
      "id": "0-690f4cdf21388",
      "qty": 1.0,
      "price": 212.6,
      "total": 212.6,
      "description": "B313B+TFRB24-SR - 3-way Characterized Control Valve",
      "sku": "",
      "itemId": "",
      "customerId": "78",
      "accountId": "60",
      "classId": "5000000000000276764"
    },
    {
      "id": "1-690f4cdf21398",
      "qty": 1.0,
      "price": 3.99,
      "total": 3.99,
      "description": "Tagging Charge",
      "sku": "",
      "itemId": "",
      "customerId": "78",
      "accountId": "60",
      "classId": "5000000000000276764"
    }
  ],
  "invoice_total": 216.59,
  "tags": "ABC"
}
Expand All

Submit an invoice via file upload or structured data:

  • File submission: Body includes data (base64 string), filename, and optional type.
  • Data submission: Body contains invoice fields directly (no data wrapper).
OneOf
InvoiceFileSubmission
object (InvoiceFileSubmission)
data
string Required

Base64 encoded file content (PDF/Image).

filename
string Required

Original filename including extension.

type
string

MIME type. Defaults to application/pdf.

InvoiceDataSubmission
object (InvoiceDataSubmission)
supplier_info
object (InvoiceSupplierInfo)

Supplier/vendor information.

name
string

Supplier name.

web
string

Supplier website URL.

email
string

Supplier email address.

phone_number
string

Supplier phone number.

address
string

Supplier address.

supplierId
string

External supplier/vendor ID reference.

ship_to
object (InvoiceShipTo)

Ship-to address information.

name
string

Ship-to name.

address
string

Ship-to address.

bill_to
object (InvoiceBillTo)

Bill-to address information.

name
string

Bill-to name.

address
string

Bill-to address.

memo
string

Memo or notes for the bill-to.

departmentId
string

Department reference ID.

entityId
string

Entity reference ID.

invoice_number
string

Invoice number.

po_number
string

Purchase order number.

invoice_terms
string

Payment terms (e.g., "Net 30", "2%10 Net45").

invoice_date
string (date)

Invoice date (YYYY-MM-DD).

invoice_due
string (date)

Payment due date (YYYY-MM-DD).

invoice_items
Array of object (InvoiceLineItem)

Line items array.

object

Individual line item on an invoice.

id
string Required

Line item identifier.

qty
number Required

Quantity.

price
number Required

Unit price.

total
number Required

Line total.

description
string Required

Item description.

sku
string

Item SKU.

itemId
string

Reference to item master record.

customerId
string

Customer reference for billable items.

accountId
string

GL account reference ID.

classId
string

Accounting class reference ID.

poId
string

Purchase order reference ID.

poLineId
string

Purchase order line reference ID.

billable
boolean

Mark line item as billable.

Defaultfalse
departmentId
string

Department reference ID.

entityId
string

Entity reference ID.

taxId
string

Tax code reference ID.

taxInclusive
boolean

Price includes tax.

Defaultfalse
invoice_total
number

Total invoice amount.

tags
string

Comma-separated tags.

Responses
201

Invoice submitted successfully

fileSuccess

File Submission Success

{
  "status": "OK",
  "msg": "Invoice record is added for extraction",
  "result": 12345
}
dataSuccess

Data Submission Success

{
  "status": "OK",
  "msg": "Record added.",
  "result": 12345
}
object
status
string
Valid values[ "OK" ]
msg
string
result
400

Bad Request

missingFilename

Missing Filename (File Submission)

{
  "status": "Error",
  "msg": "The filename property is required.",
  "result": null
}
invalidBase64

Invalid Base64 (File Submission)

{
  "status": "Error",
  "msg": "Invalid base64 encoded string.",
  "result": null
}
invalidDataMapping

Invalid Data Fields (Data Submission)

{
  "status": "Error",
  "msg": "Value 'invalid' does not match type 'float' at path 'invoice_total'.",
  "result": null
}
object
status
string
Valid values[ "Error" ]
msg
string
result
401

Unauthorized

415

Unsupported Media Type