Invoices

Endpoints relating to Invoice objects

List all invoices.

Returns a list of invoices.

Request
query Parameters
page
integer >= 1
Default: 1

Page number of the page to retrieve

Example: page=1
per
integer [ 1 .. 100 ]

Count of items in each page. Should be between 1 and 100 (inclusive).

Example: per=20
sort
string

Sort results by the specified field.

Value: "due_date"
direction
string
Default: "desc"

Set sort order. Allows "asc"(ascending) or "desc" (descending).

Enum: "asc" "desc"
f.status
string

Filters the list based on the status of the invoice

Enum: "outstanding" "past_due" "void" "paid"
f.shipment.id
integer

Filters the list for invoices associated with a shipment

Example: f.shipment.id=12345
f.billed_directly_to_client
boolean

Filters for invoices that are billed directly to the client, rather than invoices that are billed to a shipment. This parameter is mutually exclusive with the f.shipment.id filter.

f.entity.id
integer

Filters the list based on the ID of the company entity that receives the invoice

Example: f.entity.id=12345
f.entity.ref
string

Filters the list based on the ref of the company entity that receives the invoice

Example: f.entity.ref=my-entity-ref
f.name
string

Filters the list based on the name of the invoice

Example: f.name=FLEX-123456-1
f.issued_at.gt
string

Filters the list for invoices issued after the specified date

Example: f.issued_at.gt=2019-06-01
f.issued_at.lt
string

Filters the list for invoices issued before the specified date

Example: f.issued_at.lt=2019-06-01T17:29:23.172Z
f.last_updated_at.gt
string

Filters the list for invoices last updated after the specified date

Example: f.last_updated_at.gt=2019-06-01
f.last_updated_at.lt
string

Filters the list for invoices last updated before the specified date

Example: f.last_updated_at.lt=2019-06-01T17:29:23.172Z
f.client_id
integer
Deprecated

[DEPRECATED] Filters the list for invoices billed directly to a client

Example: f.client_id=54321
f.shipment_id
integer
Deprecated

[DEPRECATED] Filters the list for invoices associated with a shipment

Example: f.shipment_id=12345
Responses
200

collection of invoices

Response Schema: application/json
_object
string
self
string
version
integer
object
_object
string
prev
string or null
next
string or null
Array of objects (Invoice)
400

error

get/invoices
Response samples
application/json
{
  • "_object": "/api/response",
  • "version": 2,
  • "data": {
    • "_object": "/api/collections/paginated",
    • "prev": null,
    • "data": [
      • {
        }
      ]
    }
}

Retrieve an invoice

Retrieves the details of a single invoice

Request
path Parameters
id
required
string

The unique id for the invoice to be retrieved

Responses
200

Success

Response Schema: application/json
_object
string
self
string
version
integer
object (Invoice)
_object
string

Type of the object. Always '/invoice' for this object.

id
string

Unique ID for the invoice

name
string

Unique name for the invoice

issued_at
string <date-time>

When the invoice was issued

due_date
string <date>

Due date of the invoice

quote_currency_code
string

Currency code of the accepted quote

exchange_rate
number

Exchange rate used to convert the quote currency to the invoice currency

invoice_type
string

The type of charges included on this invoice

object (Money-2)

Sum of charges on the invoice

object (Money-2)

Outstanding balance on the invoice

status
string

Status of the invoice

Enum: "outstanding" "past_due" "void" "paid" "payment_pending"
type
string

What the invoice is being issued for. Shipment related charges are type Shipment and non-shipment related charges are type Client

Enum: "Shipment" "Client"
voided_at
string <date-time>

When the invoice was voided (if applicable)

last_updated_at
string <date-time>

Time of the last adjustment to in invoice

object (CompanyEntity)

Entity receiving the invoice (i.e. the customer)

object (CompanyEntity)

Entity issuing the invoice (i.e. Flexport)

Array of objects (InvoiceItem)
notes
Array of strings
Array of objects (CreditMemo)

List of any credits applied to this invoice.

object (ShipmentRef)
service_level
string or null

Service level of the shipment associated with the invoice

400

error

get/invoices/{id}
Response samples
application/json

Success

{
  • "_object": "/api/response",
  • "version": 2,
  • "data": {
    • "_object": "/invoice",
    • "id": "abcdef123",
    • "name": "FLEX-123456-1",
    • "issued_at": "2019-05-22T18:39:53.679Z",
    • "due_date": "2019-05-22",
    • "quote_currency_code": "USD",
    • "exchange_rate": 1.2543,
    • "invoice_type": "general",
    • "total": {
      • "_object": "/money",
      • "amount": "6843.29",
      • "currency_code": "EUR"
      },
    • "balance": {
      • "_object": "/money",
      • "amount": "6743.29",
      • "currency_code": "EUR"
      },
    • "status": "void",
    • "type": "Shipment",
    • "voided_at": "2019-05-22T20:49:15.639Z",
    • "last_updated_at": "2019-05-24T20:49:15.653Z",
    • "service_level": "Standard",
    • "notes": [
      • "**Container numbers**\n\n1234567",
      • "**Notes**\n\nOther details about this invoice"
      ],
    • "recipient": {
      • "_object": "/company_entity",
      • "id": 123456,
      • "name": "Your Company Name",
      • "mailing_address": {
        },
      • "ref": "id-123456",
      • "vat_numbers": [
        ]
      },
    • "issuer": {
      • "_object": "/company_entity",
      • "id": 28714,
      • "name": "Flexport LLC",
      • "mailing_address": {
        },
      • "ref": "id-54321",
      • "vat_numbers": [
        ]
      },
    • "items": [
      • {
        },
      • {
        },
      • {
        },
      • {
        },
      • {
        },
      • {
        }
      ],
    • "credit_memos": [
      • {
        }
      ],
    • "shipments": {}
    }
}