• Germanized
  • REST API

Invoices

Use this endpoint to query invoices.

List invoices

GET: /wp-json/sab/v1/invoices/

Properties

context string

Scope under which the request is made; determines fields present in response. Options: view, edit Default is view

page integer

Current page of the collection. Default is 1

per_page integer

Maximum number of items to be returned in result set. Default is 10

search string

Limit results to those matching a string.

after string

Limit response to resources published after a given ISO8601 compliant date.

before string

Limit response to resources published before a given ISO8601 compliant date.

exclude array

Ensure result set excludes specific IDs.

include array

Limit result set to specific ids.

offset integer

Offset the result set by a specific number of items.

order string

Order sort attribute ascending or descending. Options: asc, desc Default is desc

orderby string

Sort collection by object attribute. Options: date, id Default is date

status array

Limit result set to documents which have specific statuses. Default is any

reference_id number

Limit result set to documents which have a specific reference id.

reference_type string

Limit result set to documents which have a specific reference type.

Limit result set to invoices which have a specific payment statuses. Default is any

exclude properties
exclude item integer

exclude item.

include properties
include item integer

include item.

status properties
status item string

status item. Options: any, draft, closed, archived, cancelled

payment_status properties
payment_status item string

payment_status item. Options: any, pending, partial, complete

Example

This is an example request which retrieves invoices associated with a certain order.

curl https://example.com/wp-json/sab/v1/invoices/?reference_id=<order_id>

Manage invoices

Retrieve, update or delete an invoice.

GET|POST|PUT|PATCH|DELETE: /wp-json/sab/v1/invoices/<id>

Properties

id integer readonly

Unique identifier for the resource.

parent_id integer

Parent document ID.

reference_id integer

The reference id linked to the document.

reference_type string

The reference type linked to the document.

reference_number string

The reference formatted number linked to the document.

number string readonly

The document number.

formatted_number string readonly

The formatted document number.

created_via string readonly

Shows where the document was created.

status string

The current document status. Options: draft, closed, archived, cancelled Default is draft

date_created string readonly

The date the document was created, in the site’s timezone.

date_created_gmt string readonly

The date the document was created, as GMT.

date_modified string readonly

The date the document was last modified, in the site’s timezone.

date_modified_gmt string readonly

The date the document was last modified, as GMT.

date_sent string

The date the document was sent, in the site’s timezone.

date_sent_gmt string

The date the document was sent, as GMT.

customer_id integer

User ID linked to the document. 0 for guests.

author_id integer

Author ID linked to the document.

relative_path string readonly

Relative path to PDF file.

path string readonly

Absolute path to PDF file.

journal_type string

The journal type for numbering purposes.

version string

The document version.

country string

The document country.

formatted_address string readonly

Formatted address data.

address object

Address data.

Attachments.

meta_data array

Meta data.

order_id integer

The order ID linked to the invoice.

order_number string

The formatted order number linked to the invoice.

order_type string

The order resource type, e.g. woocommerce. Default is woocommerce

sync boolean

Whether to automatically sync the invoice with it’s order if possible.

payment_status string

Invoice payment status. Options: pending, partial, complete Default is pending

payment_method_name string

The payment method slug.

payment_method_title string

The payment method title.

payment_transaction_id string

The payment transaction id.

currency string

Currency the invoice was created with, in ISO format. Options: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYR, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, IRT, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PRB, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW Default is USD

date_paid string readonly

The date the invoice was marked as paid, in the site’s timezone.

date_paid_gmt string readonly

The date the invoice was marked as paid, as GMT.

date_due string

The date until which the invoice is due for payment, in the site’s timezone.

date_due_gmt string

The date until which the invoice is due for payment, as GMT.

date_of_service string

The date of service, in the site’s timezone.

date_of_service_gmt string

The date of service, as GMT.

date_of_service_end string

The end date of service, in the site’s timezone.

date_of_service_end_gmt string

The end date of service, as GMT.

product_total string readonly

Product total amount for the invoice.

product_subtotal string readonly

Product subtotal (before discounts) amount for the invoice.

shipping_total string readonly

Shipping total amount for the invoice.

shipping_subtotal string readonly

Shipping subtotal (before discounts) amount for the invoice.

fee_total string readonly

Fee total amount for the invoice.

fee_subtotal string readonly

Fee subtotal (before discounts) amount for the invoice.

discount_total string readonly

Discount total amount for the invoice.

discount_percentage string readonly

Discount percentage for the invoice.

discount_notice string

A notice on discounts e.g. coupon codes used.

additional_costs_discount_total string readonly

Discount on additional costs e.g. shipping and fees.

voucher_total string

Voucher total amount for the invoice.

voucher_net string readonly

Voucher net amount for the invoice.

voucher_tax string

Voucher tax amount for the invoice.

total_tax string readonly

Tax total amount for the invoice.

subtotal_tax string readonly

Subtotal tax (before discounts) amount for the invoice.

product_tax string readonly

Product tax total amount for the invoice.

product_subtotal_tax string readonly

Product subtotal tax (before discounts) amount for the invoice.

shipping_tax string readonly

Shipping tax total amount for the invoice.

shipping_subtotal_tax string readonly

Shipping subtotal tax (before discounts) amount for the invoice.

fee_tax string readonly

Fee tax total amount for the invoice.

fee_subtotal_tax string readonly

Fee subtotal tax (before discounts) amount for the invoice.

discount_tax string readonly

Discount tax total amount for the invoice.

additional_costs_discount_tax string readonly

Additional costs discount tax total amount for the invoice.

total string readonly

Total amount for the invoice.

subtotal string readonly

Subtotal (before discounts) amount for the invoice.

total_net string readonly

Total net amount for the invoice.

subtotal_net string readonly

Subtotal net amount for the invoice.

product_net string readonly

Product net amount for the invoice.

product_subtotal_net string readonly

Product subtotal net amount for the invoice.

shipping_net string readonly

Shipping net amount for the invoice.

shipping_subtotal_net string readonly

Shipping subtotal net amount for the invoice.

fee_net string readonly

Fee net amount for the invoice.

fee_subtotal_net string readonly

Fee subtotal net amount for the invoice.

total_paid string

Total paid amount of the invoice.

tax_rate_percentages array readonly

Tax rate percentages.

prices_include_tax boolean

True in case prices include tax.

vat_id string

VAT ID.

is_reverse_charge boolean readonly

Is a reverse of charge?

is_vat_exempt boolean

Is a vat exempt?

is_oss boolean

Is a OSS invoice?

is_eu boolean readonly

Is taxable in EU?

is_b2b boolean readonly

Is a b2b transaction?

is_eu_intra_community_supply boolean readonly

Is a EU intra-community supply?

is_eu_vat boolean readonly

Is taxable in a EU VAT country?

is_third_country boolean readonly

Is taxable in a third country?

is_taxable boolean

Is taxable?

round_tax_at_subtotal boolean

Round tax at subtotal?

formatted_shipping_address string readonly

Formatted shipping address data.

Shipping Address data.

taxable_country string readonly

Taxable country code in ISO 3166-1 alpha-2 format.

taxable_postcode string readonly

Taxable postcode.

taxable_company string readonly

Taxable company.

Product items data.

tax_items array readonly

Tax items.

Shipping items.

fee_items array

Fee lines data.

Voucher items.

totals object

Total data.

tax_totals array

Tax total data.

address properties
first_name string

First name.

last_name string

Last name.

company string

Company name.

address_1 string

Address line 1.

address_2 string

Address line 2.

city string

City name.

state string

ISO code or name of the state, province or district.

postcode string

Postal code.

country string

Country code in ISO 3166-1 alpha-2 format.

email string

Email address.

phone string

Phone number.

vat_id string

Address VAT ID.

attachments properties
id string readonly

Unique identifier for the resource.

type string

The attachment type, e.g. einvoice.

name string

The attachment name.

title string readonly

The attachment title.

extension string

The attachment file extension.

date_created string readonly

The date the attachment was created, in the site’s timezone.

date_created_gmt string readonly

The date the attachment was created, as GMT.

document_id string

The attachment document id.

relative_path string readonly

Relative path to attachment file.

path string readonly

Absolute path to attachment file.

filename string readonly

The filename.

meta_data array

Meta data.

meta_data properties
id integer readonly

Meta ID.

key string

Meta key.

value string null

Meta value.

tax_rate_percentages properties
tax_rate_percentages item number

tax_rate_percentages item.

shipping_address properties
first_name string

First name.

last_name string

Last name.

company string

Company name.

address_1 string

Address line 1.

address_2 string

Address line 2.

city string

City name.

state string

ISO code or name of the state, province or district.

postcode string

Postal code.

country string

Country code in ISO 3166-1 alpha-2 format.

email string

Email address.

phone string

Phone number.

vat_id string

Address VAT ID.

product_items properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

is_taxable boolean

Whether the item is taxable or not.

line_subtotal string

Line subtotal (before discounts).

discount_total string readonly

Discount total.

discount_net string readonly

Discount net total.

discount_tax string readonly

Discount tax total.

discount_percentage string readonly

Discount percentage.

subtotal_tax string readonly

Line subtotal tax (before discounts).

line_total string

Line total (after discounts).

total_tax string readonly

Line total tax (after discounts).

taxes array

Product taxes.

price string

Product price.

price_net string readonly

Product net price.

price_tax string readonly

Product price tax.

price_subtotal string

Product price (before discounts).

price_subtotal_tax string readonly

Product price tax (before discounts).

price_subtotal_net string readonly

Product net price (before discounts).

total string readonly

Product total.

total_net string readonly

Product net total.

subtotal string readonly

Product subtotal.

subtotal_net string readonly

Product net subtotal.

product_id string null

Product ID.

sku string

SKU.

is_virtual boolean

Whether this is a virtual item.

is_service boolean

Whether this item is a service or not.

has_differential_taxation boolean

Whether this item differential taxed or not.

attributes properties
value string readonly

Attribute value.

key string

Attribute key.

label string

Attribute label.

formatted_label string readonly

Attribute formatted label.

formatted_value string readonly

Attribute formatted value.

taxes properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

tax_type string readonly

Tax type e.g. product.

round_tax_at_subtotal boolean readonly

True in case tax is rounded at subtotal.

is_oss boolean readonly

Is OSS tax?

total_tax string

Tax total.

total_net string

Tax net total.

subtotal_tax string

Tax subtotal.

subtotal_net string

Tax net subtotal.

tax_rate object

tax_rate.

tax_rate properties
percent string

Tax percentage.

formatted_percentage string

Formatted tax percentage.

country string

Tax country.

priority integer

Tax priority.

is_compound boolean

Is compound?

is_oss boolean

Is OSS?

label string

Tax rate label.

tax_items properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

tax_type string readonly

Tax type e.g. product.

round_tax_at_subtotal boolean readonly

True in case tax is rounded at subtotal.

is_oss boolean readonly

Is OSS tax?

total_tax string

Tax total.

total_net string

Tax net total.

subtotal_tax string

Tax subtotal.

subtotal_net string

Tax net subtotal.

tax_rate object

tax_rate.

shipping_items properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

is_taxable boolean

Whether the item is taxable or not.

line_subtotal string

Line subtotal (before discounts).

discount_total string readonly

Discount total.

discount_net string readonly

Discount net total.

discount_tax string readonly

Discount tax total.

discount_percentage string readonly

Discount percentage.

subtotal_tax string readonly

Line subtotal tax (before discounts).

line_total string

Line total (after discounts).

total_tax string readonly

Line total tax (after discounts).

taxes array

Product taxes.

price string

Product price.

price_net string readonly

Product net price.

price_tax string readonly

Product price tax.

price_subtotal string

Product price (before discounts).

price_subtotal_tax string readonly

Product price tax (before discounts).

price_subtotal_net string readonly

Product net price (before discounts).

total string readonly

Product total.

total_net string readonly

Product net total.

subtotal string readonly

Product subtotal.

subtotal_net string readonly

Product net subtotal.

enable_split_tax boolean

Whether to enable split-tax calculation.

fee_items properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

is_taxable boolean

Whether the item is taxable or not.

line_subtotal string

Line subtotal (before discounts).

discount_total string readonly

Discount total.

discount_net string readonly

Discount net total.

discount_tax string readonly

Discount tax total.

discount_percentage string readonly

Discount percentage.

subtotal_tax string readonly

Line subtotal tax (before discounts).

line_total string

Line total (after discounts).

total_tax string readonly

Line total tax (after discounts).

taxes array

Product taxes.

price string

Product price.

price_net string readonly

Product net price.

price_tax string readonly

Product price tax.

price_subtotal string

Product price (before discounts).

price_subtotal_tax string readonly

Product price tax (before discounts).

price_subtotal_net string readonly

Product net price (before discounts).

total string readonly

Product total.

total_net string readonly

Product net total.

subtotal string readonly

Product subtotal.

subtotal_net string readonly

Product net subtotal.

enable_split_tax boolean

Whether to enable split-tax calculation.

voucher_items properties
id integer readonly

Item ID.

reference_id integer

Item reference ID.

parent_id integer

Item parent ID.

name string null

Item name.

document_id integer

Item document ID.

quantity integer

Item Quantity.

meta_data array

Meta data.

attributes array

Item attributes.

code string null

Coupon code.

line_total string

Line total (after discounts).

price string

Product price.

total string readonly

Product total.

totals properties
type string readonly

Total type.

total string readonly

Total amount.

total_formatted string readonly

Total formatted amount.

label string readonly

Total label.

label_formatted string readonly

Formatted label.

unit string readonly

The total’s unit.

unit_type string readonly

The total’s unit type, e.g. currency.

placeholders array readonly

Total placeholders.

placeholders properties
tax_totals properties
product string readonly

Product tax total.

shipping string readonly

Shipping tax total.

fee string readonly

Fee tax total.

net_totals properties
product string readonly

Product net total.

shipping string readonly

Shipping net total.

fee string readonly

Fee net total.

Download PDF

Download the invoice PDF.

GET: /wp-json/sab/v1/invoices/<id>/pdf

Properties

file binary readonly

The file data (base64 encoded).

path string readonly

Local path to file in case it exists.

filename string readonly

The filename.

is_preview boolean readonly

Whether it is a preview or the file is persisted.