• 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 invoice ID.

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.

number string readonly

The invoice number.

formatted_number string readonly

The formatted invoice number.

created_via string readonly

Shows where the invoice was created.

status string

Invoice status. Options: draft, closed, archived, cancelled Default is draft

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_created string readonly

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

date_created_gmt string readonly

The date the invoice was created, as GMT.

date_modified string readonly

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

date_modified_gmt string readonly

The date the invoice was last modified, as GMT.

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.

prices_include_tax boolean

True in case prices include tax.

customer_id integer

User ID linked to the invoice. 0 for guests.

vat_id string

VAT ID.

is_reverse_charge boolean

Is a reverse of charge?

is_taxable boolean

Is taxable?

round_tax_at_subtotal boolean

Round tax at subtotal?

relative_path string readonly

Relative path to PDF file.

path string readonly

Absolute path to PDF file.

formatted_address string readonly

Formatted address data.

address object

Address data.

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.

meta_data array

Meta data.

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.

tax_rate_percentages properties
tax_rate_percentages item number

tax_rate_percentages item.

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.

shipping_address properties
first_name string

Shipping first name.

last_name string

Shipping last name.

company string

Shipping company name.

address_1 string

Shipping address line 1.

address_2 string

Shipping address line 2.

city string

Shipping city name.

state string

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

postcode string

Shipping postal code.

country string

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

vat_id string

Shipping VAT ID.

meta_data properties
id integer readonly

Meta ID.

key string

Meta key.

value string null

Meta value.

product_items properties
id integer readonly

Item ID.

name string null

Product name.

quantity integer

Quantity billed.

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.

meta_data array

Meta data.

attributes array

Item attributes.

price number

Product price.

price_net number readonly

Product net price.

price_tax number readonly

Product price tax.

price_subtotal number

Product price (before discounts).

price_subtotal_tax number readonly

Product price tax (before discounts).

price_subtotal_net number 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.

taxes properties
id integer

Tax item ID.

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.

meta_data array

Meta data.

attributes array

Attributes.

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.

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.

tax_items properties
id integer

Tax item ID.

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.

meta_data array

Meta data.

attributes array

Attributes.

shipping_items properties
id integer readonly

Item ID.

name string null

Product name.

quantity integer

Quantity billed.

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.

meta_data array

Meta data.

attributes array

Item attributes.

price number

Product price.

price_net number readonly

Product net price.

price_tax number readonly

Product price tax.

price_subtotal number

Product price (before discounts).

price_subtotal_tax number readonly

Product price tax (before discounts).

price_subtotal_net number 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.

name string null

Product name.

quantity integer

Quantity billed.

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.

meta_data array

Meta data.

attributes array

Item attributes.

price number

Product price.

price_net number readonly

Product net price.

price_tax number readonly

Product price tax.

price_subtotal number

Product price (before discounts).

price_subtotal_tax number readonly

Product price tax (before discounts).

price_subtotal_net number 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.

code string null

Coupon code.

quantity integer

Quantity billed.

line_total string

Line total (after discounts).

meta_data array

Meta data.

attributes array

Item attributes.

price number

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.

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.