List Invoices


                https://api.ocamba.com/v2/ocamba/invoices
            

Returns a list of Invoices


Name
Description
fieldsstring
The client can request more efficient filtered representation of the resource showing only specific field(s), using the “fields” query parameter. Note that the “fields” parameter has precedence over the “view” parameter.

Example GET /v2/ocamba/RESOURCE_NAME?fields=id,name

See "Tips" for the list of filterable parameters.


Example: fields=field1,field2,field3

viewstring
Ocamba API returns full representation of the resource using the “view=full” query parameter. If not specified, the default view will be used.

Note that the “fields” parameter has precedence over the “view” parameter.


Example: view=full/default

pagestring
The page number indicates which set of items will be returned in the response. The format of request is "page=N,M" where 'N' (required) represents page number and 'M' (optional) is number of items per page.

Examples:
N=1, M=20 → returns page 1 with 20 items
N=2, M=20 → returns page 2 with 20 items (items 21-40)
N=3 → returns page 3. The number of objects returned depends on the resource settings.


Example: page=1,10

sortstring
Sorts the response by specified field(s) with the option to specify sorting order (ascending by default, add prefix "-" for descending).

Examples:
GET /v2/ocamba/RESOURCE_NAME?sort=name → sorts per name, ascending
GET /v2/ocamba/RESOURCE_NAME?sort=-id → sorts per id descending
GET /v2/ocamba/RESOURCE_NAME?sort=id,-name → sorts per id ascending, then name descending

See tips for the list of sortable fields.


Example: sort=-field1,filed2

qstring
Set the q parameter value to search for a keyword or search term.

Example:
GET /v2/ocamba/members?q=sou → returns members that contain string 'sou'

See tips for the list of searchable parameters.

q_fieldsstring
Use the q_fields parameter to list all fields you want to include in the search using q parameter. Note that not all fields are searchable on a specific object. If parameter q_fields is not specified, search is performed on a default search field.

Examples:
GET /v2/ocamba/members?q=sou&q_fields=lname → API retuns members whose lname contains string 'sou'.
GET /v2/ocamba/members?q=sou&q_fields=fname,lname,email → API returns members that contain string 'sou' in any of the specified fields.

See tips for the list of searchable parameters.


company_idinteger
A unique company identifier generated by the Ocamba platform.


Example: company_id=12345

statusstring
Describe status of the object.


Example: status=status1

update_timestring
Timezone: GMT.


Example: update_time=2021-09-14

create_timestring
Timezone: GMT.


Example: create_time=2021-09-14

idstring (uuid)
A unique identifier generated by the Ocamba platform.


Example: id=c7db9321-dc48-43f1-b32d-a45a4991879a

invoice_numberstring
The invoice number, generated by Ocamba api. Unique.


Example: invoice_number=OCM-210001

app_idstring
A unique app identifier generated by the Ocamba platform.


Example: app_id=1000

amountfloat
Total amount.


Example: amount=11.99

pricefloat
Sum of prices applied on the invoice line items.


Example: price=1

discountfloat
Total of discounts applied on the invoice line items.


Example: discount=1.1

taxnumber (integer)
Total tax on invoice.


Example: tax=1.3

currency_codestring
Three-letter, uppercase currency code.


Example: currency_code=USD

sentnumber (integer)
Indicates if invoice is sent to company billing address or not.


Example: sent=1

start_timestring
When billing period starts.


Example: start_time=2021-11-24

end_timestring
When billing period ends.


Example: end_time=2021-04-01

payment_timestring
When invoice was paid. Only for 'paid' invoices.


Example: payment_time=2021-11-24

due_datestring
Due date.


Example: due_date=2021-04-01

200 - OK
Arrow
Name
Description
items[ invoice ]
An array of all created items.
Invoice
Name
Description
amountfloat
Total amount.


Example: 102.19

app_idstring
The ID of the application


Example: 1000

create_timedateTime
Timezone: GMT.


Example: 2021-11-10 10:23:55

currency_codestring
The three-letter currency code, supported by Ocamba, that indicates the currency.


Example: USD

discountfloat
Total of discounts applied on the invoice line items.

due_datedate
Due date


Example: 2021-11-24

end_datedate
When billing period ends.


Example: 2021-11-30

idstring (uuid)
The ID of the invoice, generated by the Ocamba API.


Example: 2c9ab0a8-d0d2-49aa-b790-9697cc3aed14

invoice_numberstring
The invoice number, generated by Ocamba api. Unique.


Example: OCM-210001

items[ invoice-item ]
Array of the invoice items. Minimum length 1.
Invoice Item
Name
Description
amountfloat
Line item amount (`amount = price - discount + tax`).

discountfloat
Line item discount (`discount = price * discount_rate / 100`).

discount_ratefloat
Represents a discount expressed as a percentage. Used to calculate discount.

namestring
Name of the invoice.


Example: Ocamba Push Startup Plan (Monthly)

pricefloat
Line item price (`price = quantity * unit_price`).

quantityfloat
Line item quantity.

taxfloat
Line item tax (`tax = (price - discount) * tax_rate / 100`).

tax_ratefloat
Represents a tax expressed as a percentage. Used to calculate tax.

unit_pricefloat
Price per one unit.

payment_timedateTime
When invoice was paid. Only for 'paid' invoices.


Example: 2021-11-24 10:23:55

pdfstring (uri)
Location of the pdf version of the invoice.


Example: https://storage.ocamba.com/9999999/ocamba/invoices/OCM-210001.pdf

pricefloat
Sum of prices applied on the invoice line items.


Example: 99.99

sentinteger
Indicates if invoice is sent to company billing address or not.


Example: 1

Possible values: 0 | 1

start_datedate
When billing period starts.


Example: 2021-11-01

statusstring
The current status of the invoice.


Example: paid

Possible values: pending | unpaid | paid

taxfloat
Total tax on invoice.


Example: 2.2

update_timedateTime
Timezone: GMT.


Example: 2021-11-10 10:23:55

totalinteger
A total number of items.


Example: 209
tip
1 Searchable field is invoice_number.

2 Sortable fields are: invoice_number, status, price, discount, amount, tax, currency_code, xero_status, start_date, end_date, payment_time, due_date, create_time and update_time.
200 Arrow
{
    "total": 209,
    "items": [
        {
            "id": "2c9ab0a8-d0d2-49aa-b790-9697cc3aed14",
            "company_id": "6197120",
            "app_id": "1003",
            "invoice_number": "OCM-213376",
            "status": "paid",
            "price": 9.99,
            "tax": 2,
            "amount": 11.99,
            "currency_code": "USD",
            "pdf": "https://dev-storage.ocamba.com/6197120/ocamba/invoices/OCM-213376.pdf",
            "sent": 1,
            "items": [
                {
                    "name": "Ocamba Push Startup Plan (Monthly)",
                    "quantity": 1,
                    "unit_price": 9.99,
                    "price": 9.99,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 2,
                    "amount": 11.99
                }
            ],
            "due_date": "2021-11-24",
            "payment_time": "2021-11-24 10:23:55",
            "create_time": "2021-11-24 10:23:55",
            "update_time": "2021-11-24 10:24:04"
        },
        {
            "id": "6c5206d1-e4d7-4331-8db6-0fa7b4905592",
            "company_id": "6197120",
            "app_id": "1003",
            "invoice_number": "OCM-213375",
            "status": "paid",
            "price": 99.99,
            "tax": 20,
            "amount": 119.99,
            "currency_code": "USD",
            "pdf": "https://dev-storage.ocamba.com/6197120/ocamba/invoices/OCM-213375.pdf",
            "sent": 1,
            "items": [
                {
                    "name": "Ocamba Push Business Plan (Monthly)",
                    "quantity": 1,
                    "unit_price": 99.99,
                    "price": 99.99,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 20,
                    "amount": 119.99
                }
            ],
            "due_date": "2021-11-24",
            "payment_time": "2021-11-24 08:30:18",
            "create_time": "2021-11-24 08:30:18",
            "update_time": "2021-11-24 08:31:04"
        },
        {
            "id": "c8a1ccbf-7b59-4d8a-aa3d-a246f31432e5",
            "company_id": "6197120",
            "app_id": "1001",
            "invoice_number": "OCM-213372",
            "status": "paid",
            "price": 249.99,
            "tax": 50,
            "amount": 299.99,
            "currency_code": "USD",
            "pdf": "https://dev-storage.ocamba.com/6254628/ocamba/invoices/OCM-213372.pdf",
            "sent": 1,
            "items": [
                {
                    "name": "Ocamba Adex Network Plan (Monthly)",
                    "quantity": 1,
                    "unit_price": 249.99,
                    "price": 249.99,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 50,
                    "amount": 299.99
                }
            ],
            "start_date": "2021-11-23",
            "end_date": "2021-11-23",
            "due_date": "2021-11-23",
            "payment_time": "2021-11-23 11:59:28",
            "create_time": "2021-11-23 11:59:28",
            "update_time": "2021-11-23 13:05:13"
        }
    ]
}
{
  "total": 209,
  "items": [
    {
      "id": "2c9ab0a8-d0d2-49aa-b790-9697cc3aed14",
      "app_id": "1000",
      "invoice_number": "OCM-210001",
      "status": "paid",
      "price": 99.99,
      "tax": 2.2,
      "amount": 102.19,
      "currency_code": "USD",
      "pdf": "https://storage.ocamba.com/9999999/ocamba/invoices/OCM-210001.pdf",
      "sent": 1,
      "items": [
        {
          "name": "Ocamba Push Startup Plan (Monthly)"
        }
      ],
      "due_date": "2021-11-24",
      "start_date": "2021-11-01",
      "end_date": "2021-11-30",
      "payment_time": "2021-11-24 10:23:55",
      "create_time": "2021-11-10 10:23:55",
      "update_time": "2021-11-10 10:23:55"
    }
  ]
}