Skip to content

Invoices

TIP

The invoice ID will be set to the following fields on a transaction when paid:

  • Order ID
  • PO number

This will allow you to look up a transaction by an invoice ID and vice versa. If you set the invoice number field on an invoice, then the transaction order ID field will be this invoice number in place of the invoice ID.

Create Invoice

Create a new invoice.

Request Method: POST

URL Endpoint: /api/invoice

NameTypeDefaultDescriptionRequired
currencystring literalCurrency that invoice amounts should be in ("USD", etc.)*
company_namestringName of company issuing the invoice
company_logo_urlstringHosted location of logo image to include on invoice
customer_numberstringOptional identifier for the invoiced customer to match merchant records
customer_idstringID of the saved customer being invoiced (must be a valid customer id if included)
invoice_numberstringOptional identifier for the invoice to match merchant records
payable_toobjectobject containing details for the person the invoice is being paid to*
payable_to
    .id
stringID of the stored address you want to make the invoice payable to
payable_to
    .first_name
stringFirst name
payable_to
    .last_name
stringLast name
payable_to
    .company
stringCompany name
payable_to
    .address_line_1
stringAddress line 1*
payable_to
    .address_line_2
stringAddress line 2
payable_to
    .city
stringCity*
payable_to
    .state
string literalState, in 2-character format ("KS", "QC", etc.))*
payable_to
    .postal_code
stringPostal code (must be a valid postal code for the country provided)*
payable_to
    .country
string literalCountry, in 2-character format ("US", "CA", "MX", etc.)*
payable_to
    .phone
stringPhone number
payable_to
    .fax
stringFax number
payable_to
    .email
stringEmail address (must be valid email format, "example@mail.com")
bill_toobjectobject containing details for the person the invoice is being billed to*
bill_to
    .id
stringID of the stored address you want to make the invoice billable to
bill_to
    .first_name
stringFirst name
bill_to
    .last_name
stringLast name
bill_to
    .company
stringCompany name
bill_to
    .address_line_1
stringAddress line 1*
bill_to
    .address_line_2
stringAddress line 2
bill_to
    .city
stringCity*
bill_to
    .state
string literalState, in 2-character ("KS", "QC", etc.)format*
bill_to
    .postal_code
stringPostal (must be a valid postal code for the country provided) code*
bill_to
    .country
string literalCountry, in 2-character ("US", "CA", "MX", etc.) format*
bill_to
    .phone
stringPhone number
bill_to
    .fax
stringFax number
bill_to
    .email
stringEmail address (must be valid email format, "example@mail.com")
date_duedatetime stringDate the invoice is due ("2021-02-13T06:00:00.000Z")by*
items[#]object arrayarray containing line items included in the invoice*
items[#]
    .status
string literal"pending" or "paid"*
items[#]
    .type
string""Type of item
items[#]
    .name
string""Name of item
items[#]
    .description
string""Description of item
items[#]
    .unit_price
integerUnit price of item*
items[#]
    .quantity
integerQuantity of item*
items[#]
    .quantity_shipped
integer0Quantity of items shipped to customer
items[#]
    .product_code
string""Product Code of item
items[#]
    .commodity_code
string""Commodity Code of item
items[#]
    .unit_of_measure
string""Unit of measure of item ("lb", "kg", etc.)
items[#]
    .alternate_tax_identifier
string""Alternate tax ID for item
items[#]
    .taxable
booleanfalseWhether local and national tax should be applied at the item level rather than the invoice level
items[#]
    .local_tax_rate
string""Local tax rate for item ("1.000")
items[#]
    .local_tax
integer0Local tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .national_tax_rate
string""National tax rate for item ("1.000")
items[#]
    .national_tax
integer0National tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .tax_rate
string""Combined tax rate for item (local tax + national tax)
items[#]
    .tax_amount
integer0Tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .discount_amount
integer0Discount to take off the item's total amount, expressed in cents (100 = $1.00))
items[#]
    .freight_amount
integer0Freight amount to add to the item's total, expressed in cents (100 = $1.00)
advanced_fieldsbooleanfalseWhether or not to include additional fields for line items (advanced fields include quantity_shipped, freight_amount, unit_of_measure, taxable, local_tax_rate, local_tax, national_tax_rate, national_tax)
enable_taxbooleanfalseWhether or not to enable tax (if enabled, tax applied at the invoice level will override taxes applied at the item level)
enable_shippingbooleanfalseWhether or not to enable shipping
require_shipping_detailsbooleanfalseWhether or not to require shipping details
require_billing_details_on_payment_onlybooleanfalseWhether or not to require billing details only at time of payment
tax_percentstringTax rate to apply to invoice total if enable_tax is true. A rate of "0.000" will cause tax to be read as a flat amount.*
taxintegercalculated amountTotal tax amount of the invoice, expressed in cents (100 = $1.00). If tax_percent is included and is not "0", this field will be overridden with the calculated amount.
shippingintegercalculated amountShipping amount of the invoice, expressed in cents (100 = $1.00)
amount_paidintegercalculated amountAmount of the invoice that has already been paid, expressed in cents (100 = $1.00)
service_fees_paidintegercalculated amountService fee amount that has already been paid, expressed in cents (100 = $1.00)
surcharge_paidintegercalculated amountSurcharge amount that has already been paid, expressed in cents (100 = $1.00)
discount_creditedintegercalculated amountDiscount amount that has already been credited, expressed in cents (100 = $1.00)
adjustmentinteger0Apply a payment adjustment to the total amount of the invoice, expressed in cents (100 = $1.00)
allow_partial_paymentbooleanfalseWhether or not to allow partial payment of the amount due
transaction_typestring literal"sale""sale" or "authorize"
payment_methods[#]string arrayAllowable payment method types ("card", "ach", and/or "mail")*
card_processor_id (can be "")stringID of the payment processor to use for credit card payments*
ach_processor_id (can be "")stringID of the payment processor to use for ACH payments*
messagestringMessage for customers viewing the invoice
send_viastring literalHow to send invoice notifications ("email", "text", "both", or "none")*
email_tostringEmail address (must be valid email format, "xxxxx@xxxxx.xxx")

Get Invoice By ID

Retrieve details for the specified invoice.

Request Method: GET

URL Endpoint: /api/invoice/{ invoice id }

json
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "bhi9vado3hogrne0u4tg",
    "currency": "USD",
    "company_name": "ACME Inc.",
    "company_logo_url": "",
    "customer_number": "123Customer",
    "payable_to": {
      "id": "",
      "first_name": "First",
      "last_name": "Last",
      "company": "Merchant Business",
      "address_line_1": "123 Some St",
      "address_line_2": "",
      "city": "Some City",
      "state": "IL",
      "postal_code": "60000",
      "country": "US",
      "phone": "5555555555",
      "fax": "5555555555",
      "email": "info@somewebsite.com"
    },
    "bill_to": {
      "id": "",
      "first_name": "First",
      "last_name": "Last",
      "company": "Some Business",
      "address_line_1": "123 Drury Lane",
      "address_line_2": "",
      "city": "Some City",
      "state": "IL",
      "postal_code": "60000",
      "country": "US",
      "phone": "5555555555",
      "fax": "5555555555",
      "email": "info@somesite.com"
    },
    "created_at": "2019-02-13T22:52:26Z",
    "date_due": "2019-02-13T06:00:00Z",
    "items": [
      {
        "id": "bhi9vado3hogrne0u4t0",
        "name": "Widget",
        "description": "A widget for processors",
        "quantity": 1,
        "quantity_shipped": 0,
        "unit_of_measure": "",
        "unit_price": 100,
        "discount": 0,
        "discount_type": "$",
        "taxable": false,
        "local_tax": "0",
        "national_tax": "0",
        "tax_rate": "0",
        "tax_amount": 0,
        "amount": 100,
        "status": "pending"
      }
    ],
    "advanced_fields": false,
    "subtotal": 100,
    "tax_percent": "0.00",
    "tax": 0,
    "total": 100,
    "amount_paid": 0,
    "adjustment": 0,
    "amount_due": 100,
    "payment_methods": ["card"],
    "card_processor_id": "bhi5qa5o3hogms88jojg",
    "ach_processor_id": "",
    "status": "pending",
    "message": "Thank you for your business!",
    "reject_message": "",
    "send_via": "none",
    "last_sent_at": "0001-01-01T00:00:00Z",
    "updated_at": "2019-02-13T23:15:43Z",
    "public_url": "d038ea94-3f4f-4703-9e94-74792605944e",
    "hosted_url": "http://localhost:8080/invoice/d038ea94-3f4f-4703-9e94-74792605944e"
  }
}

Search Invoices

Retrieve details for all invoices that match provided search criteria.

Request Method: POST

URL Endpoint: /api/invoices/search

NameTypeDescription
idobjectObject containing details for searching by id
id
    .operator
string literal"=" or "!="
id
    .value
stringinvoice id to match or exclude
amount_dueobjectObject containing details for searching by amount_due
amount_due
    .operator
string literal"=", "!=", "<", or ">"
amount_due
    .value
integeramount to match or exclude
date_dueobjectObject containing details for searching by date_due
date_due
    .start_date
date stringSearches by date_due between the provided start_date and end_date. (Dates in UTC "YYYY-MM-DDTHH:II:SSZ")
date_due
    .end_date
date stringSearches by date_due between the provided start_date and end_date. (Dates in UTC "YYYY-MM-DDTHH:II:SSZ")
limitintegerMaximum records to return (0-100)
offsetintegerNumber of records to offset the return by

Update Invoice

Update an existing invoice.

Request Method: POST

URL Endpoint: /api/invoice/{ invoice id }

NameTypeDefaultDescriptionRequired
currencystring literalCurrency that invoice amounts should be in ("USD", etc.)*
company_namestringName of company issuing the invoice
company_logo_urlstringHosted location of logo image to include on invoice
customer_numberstringOptional identifier for the invoiced customer to match merchant records
customer_idstringID of the saved customer being invoiced (must be a valid customer id if included)
invoice_numberstringOptional identifier for the invoice to match merchant records
payable_toobjectobject containing details for the person the invoice is being paid to*
payable_to
    .id
stringID of the stored address you want to make the invoice payable to
payable_to
    .first_name
stringFirst name
payable_to
    .last_name
stringLast name
payable_to
    .company
stringCompany name
payable_to
    .address_line_1
stringAddress line 1*
payable_to
    .address_line_2
stringAddress line 2
payable_to
    .city
stringCity*
payable_to
    .state
string literalState, in 2-character format ("KS", "QC", etc.))*
payable_to
    .postal_code
stringPostal code (must be a valid postal code for the country provided)*
payable_to
    .country
string literalCountry, in 2-character format ("US", "CA", "MX", etc.)*
payable_to
    .phone
stringPhone number
payable_to
    .fax
stringFax number
payable_to
    .email
stringEmail address (must be valid email format, "example@mail.com")
bill_toobjectobject containing details for the person the invoice is being billed to*
bill_to
    .id
stringID of the stored address you want to make the invoice billable to
bill_to
    .first_name
stringFirst name
bill_to
    .last_name
stringLast name
bill_to
    .company
stringCompany name
bill_to
    .address_line_1
stringAddress line 1*
bill_to
    .address_line_2
stringAddress line 2
bill_to
    .city
stringCity*
bill_to
    .state
string literalState, in 2-character ("KS", "QC", etc.)format*
bill_to
    .postal_code
stringPostal (must be a valid postal code for the country provided) code*
bill_to
    .country
string literalCountry, in 2-character ("US", "CA", "MX", etc.) format*
bill_to
    .phone
stringPhone number
bill_to
    .fax
stringFax number
bill_to
    .email
stringEmail address (must be valid email format, "example@mail.com")
date_duedatetime stringDate the invoice is due ("2021-02-13T06:00:00.000Z")by*
items[#]object arrayarray containing line items included in the invoice*
items[#]
    .status
string literal"pending" or "paid"*
items[#]
    .type
string""Type of item
items[#]
    .name
string""Name of item
items[#]
    .description
string""Description of item
items[#]
    .unit_price
integerUnit price of item*
items[#]
    .quantity
integerQuantity of item*
items[#]
    .quantity_shipped
integer0Quantity of items shipped to customer
items[#]
    .product_code
string""Product Code of item
items[#]
    .commodity_code
string""Commodity Code of item
items[#]
    .unit_of_measure
string""Unit of measure of item ("lb", "kg", etc.)
items[#]
    .alternate_tax_identifier
string""Alternate tax ID for item
items[#]
    .taxable
booleanfalseWhether local and national tax should be applied at the item level rather than the invoice level
items[#]
    .local_tax_rate
string""Local tax rate for item ("1.000")
items[#]
    .local_tax
integer0Local tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .national_tax_rate
string""National tax rate for item ("1.000")
items[#]
    .national_tax
integer0National tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .tax_rate
string""Combined tax rate for item (local tax + national tax)
items[#]
    .tax_amount
integer0Tax amount to be added to the item's total, expressed in cents (100 = $1.00)
items[#]
    .discount_amount
integer0Discount to take off the item's total amount, expressed in cents (100 = $1.00))
items[#]
    .freight_amount
integer0Freight amount to add to the item's total, expressed in cents (100 = $1.00)
advanced_fieldsbooleanfalseWhether or not to include additional fields for line items (advanced fields include quantity_shipped, freight_amount, unit_of_measure, taxable, local_tax_rate, local_tax, national_tax_rate, national_tax)
enable_taxbooleanfalseWhether or not to enable tax (if enabled, tax applied at the invoice level will override taxes applied at the item level)
enable_shippingbooleanfalseWhether or not to enable shipping
require_shipping_detailsbooleanfalseWhether or not to require shipping details
require_billing_details_on_payment_onlybooleanfalseWhether or not to require billing details only at time of payment
tax_percentstringTax rate to apply to invoice total if enable_tax is true. A rate of "0.000" will cause tax to be read as a flat amount.*
taxintegercalculated amountTotal tax amount of the invoice, expressed in cents (100 = $1.00). If tax_percent is included and is not "0", this field will be overridden with the calculated amount.
shippingintegercalculated amountShipping amount of the invoice, expressed in cents (100 = $1.00)
amount_paidintegercalculated amountAmount of the invoice that has already been paid, expressed in cents (100 = $1.00)
service_fees_paidintegercalculated amountService fee amount that has already been paid, expressed in cents (100 = $1.00)
surcharge_paidintegercalculated amountSurcharge amount that has already been paid, expressed in cents (100 = $1.00)
discount_creditedintegercalculated amountDiscount amount that has already been credited, expressed in cents (100 = $1.00)
adjustmentinteger0Apply a payment adjustment to the total amount of the invoice, expressed in cents (100 = $1.00)
amount_dueintegercalculated amountAmount of the invoice that remains due, expressed in cents (100 = $1.00)
allow_partial_paymentbooleanfalseWhether or not to allow partial payment of the amount due
transaction_typestring literal"sale""sale" or "authorize"
payment_methods[#]string arrayAllowable payment method types ("card", "ach", and/or "mail")*
card_processor_id (can be "")stringID of the payment processor to use for credit card payments*
ach_processor_id (can be "")stringID of the payment processor to use for ACH payments*
messagestringMessage for customers viewing the invoice
send_viastring literalHow to send invoice notifications ("email", "text", "both", or "none")*
email_tostringEmail address (must be valid email format, "xxxxx@xxxxx.xxx")

Delete Invoice

Delete the specified invoice.

Request Method: DELETE

URL Endpoint: /api/invoice/{ invoice id }

json
{
  "status": "success",
  "msg": "success"
}