Docs/API/Invoices

Invoices

Create invoices, send them to customers, and accept payments against them. Invoices can be paid by card, ACH, or mail.

Invoice ↔ transaction linkage

When an invoice is paid, the resulting transaction's order_id and po_number fields are populated with the invoice ID, so you can look a transaction up from the invoice and vice versa. If you set invoice_number explicitly, that value is used as the order_id instead of the internal invoice ID.

Create invoice

POST /api/invoice

Top-level fields

FieldTypeRequiredDescription
currencystringrequiredCurrency code, e.g. USD.
company_namestringoptionalIssuing company.
company_logo_urlstringoptionalHosted URL of logo image to embed.
customer_numberstringoptionalYour own customer identifier.
customer_idstringoptionalVaulted customer ID, if this invoice is for a saved customer.
invoice_numberstringoptionalYour own invoice identifier.
date_duedatetimerequiredDue date, e.g. 2025-02-13T06:00:00.000Z.
payable_toobjectrequiredAddress of the company being paid. See below.
bill_toobjectrequiredAddress of the customer being billed. See below.
itemsarrayrequiredLine items. See below.
settings.allow_tippingbooleanoptionalShow a tip input on the hosted invoice page.
advanced_fieldsbooleanoptionalEnables extra line-item fields (shipped quantity, freight, taxable, tax rates).
enable_taxbooleanoptionalWhen true, invoice-level tax overrides item-level tax.
enable_shippingbooleanoptionalShow a shipping amount on the invoice.
require_shipping_detailsbooleanoptionalForce collection of a shipping address.
require_billing_details_on_payment_onlybooleanoptionalDelay billing-address collection until payment.
tax_percentstringrequiredInvoice-level tax rate. Use "0.000" to treat tax as a flat amount.
tax / shippingintegeroptionalAmounts in cents. tax is overridden by tax_percent unless that is "0".
amount_paid, service_fees_paid, surcharge_paid, discount_creditedintegeroptionalPre-existing paid amounts.
adjustmentintegeroptionalPayment adjustment applied to the invoice total.
allow_partial_paymentbooleanoptionalLet customers pay less than the full amount due.
transaction_typestringoptionalsale (default) or authorize.
payment_methodsstring arrayrequiredAllowed methods: some combination of card, ach, mail.
card_processor_id / ach_processor_idstringrequiredWhich processor to use for each type. Empty strings are accepted if you do not offer that type.
messagestringoptionalMessage shown to the customer on the invoice.
save_customer_vaultstringoptionalnone, optional, required — controls whether the customer gets vaulted at payment.
send_viastringrequiredemail, text, both, or none.
email_tostringoptionalDestination email address.

Address objects (payable_to, bill_to)

Either supply an id referring to a stored address, or inline all of: first_name, last_name, company, address_line_1 (required), address_line_2, city (required), state (two-letter, required), postal_code (required, must be valid for the country), country (two-letter, required), phone, fax, email.

Line items

FieldTypeRequiredDescription
statusstringrequiredpending or paid.
typestringoptionalItem type.
namestringoptionalItem name.
descriptionstringoptionalLine description.
unit_priceintegerrequiredCents.
quantityintegerrequiredUnits.
quantity_shippedintegeroptionalUnits shipped so far.
product_codestringoptionalSKU or product identifier.
commodity_codestringoptionalCommodity code — used for Level 3 data.
unit_of_measurestringoptionalE.g. lb, kg.
alternate_tax_identifierstringoptionalLine-specific tax ID.
taxablebooleanoptionalApply line-level tax instead of invoice-level.
local_tax_rate / local_taxstring / integeroptionalLocal tax rate and amount in cents.
national_tax_rate / national_taxstring / integeroptionalNational tax rate and amount in cents.
tax_rate / tax_amountstring / integeroptionalCombined rate (local + national) and total tax amount.
discount_amountintegeroptionalLine discount in cents.
freight_amountintegeroptionalFreight in cents.

Get invoice by ID

GET /api/invoice/{invoice_id}
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "bhi9vado3hogrne0u4tg",
    "currency": "USD",
    "company_name": "ACME Inc.",
    "customer_number": "123Customer",
    "payable_to": { ... },
    "bill_to": { ... },
    "items": [ ... ],
    "subtotal": 100,
    "tax_percent": "0.00",
    "tax": 0,
    "total": 100,
    "amount_paid": 0,
    "amount_due": 100,
    "payment_methods": ["card"],
    "status": "pending",
    "public_url": "d038ea94-3f4f-4703-9e94-74792605944e",
    "hosted_url": "https://sandbox.fluidpay.com/invoice/d038ea94-3f4f-4703-9e94-74792605944e"
  }
}

Search invoices

POST /api/invoices/search
FieldTypeDescription
idobject{operator: "=" | "!=", value: <id>}
amount_dueobject{operator: "=" | "!=" | "<" | ">", value: <integer cents>}
date_dueobject{start_date, end_date}, UTC YYYY-MM-DDTHH:MM:SSZ.
limit / offsetinteger0–100 / any.

Update invoice

POST /api/invoice/{invoice_id}

Same shape as create, with one additional field:

FieldTypeDescription
amount_dueintegerOverride the calculated amount due, in cents.

Delete invoice

DELETE /api/invoice/{invoice_id}

Resend invoice

POST /api/invoice/{invoice_id}/resend

Pay invoice

POST /api/invoice/{invoice_id}/pay

Charge an invoice directly from the API. Required unless paying_via_mail is set. The body looks like a transaction request:

FieldDescription
payment_method.cardnumber, expiration_date (MM/YY), cvc.
payment_method.achrouting_number, account_number, sec_code (web/ccd/ppd/tel), account_type.
payment_method.customerid (required), optional payment_method_id.
payment_method.tokenTokenizer token.