Get a List of Invoices

The Get List of Invoices method returns the list of InvoicesThe method can be called for the current Reseller or for any of its downstream Resellers.

Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.

GET {base_url}/api/v3/resellers/{reseller_id}/invoices

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

X-Api-TokenheaderstringRequiredAPI token of the Manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredIndicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser)
AcceptheaderstringRequired

Information about data types that the client (browser) supports

reseller_idpathintegerRequiredID of current Reseller or of any its downline Resellers (see Viewing and updating reseller general information)

filter[created_at]

query

date

Optional

Filter the list by the Invoice creation date

filter[updated_at]

query

date

Optional

Filter the list by the Invoice update date

filter[status]

query

string

Optional

Filter the list by the Invoice status (see Viewing the list of invoices)

filter[account_id]

query

string

Optional

Filter the list by the Account ID

filter[from_date]querystringOptionalFilter the list by beginning date of the period covered by the Invoice
filter[to_date]querystringOptionalFilter the list by end date of the period covered by the Invoice
filter[payment_model]querystringOptional

Filter the list by the payment_model:

  • postpay
  • prepay

page[size]

query

integer

OptionalPage navigation: number of elements per page. The default value is 50

page[number]

query

integer

OptionalPage navigation: page number

Response model

Name

Data type

Description

dataarrayResponse data


id

integer

Invoice ID

typestringData type

attributesobjectInvoice information



created_at

dateDate and time of Invoice creation



updated_at

dateData and time of Invoice last update



document_id

stringInvoice number (see Viewing the list of invoices)



status

stringInvoice status



total

stringInvoice total amount



account_id

integerID of the Account for which the Invoice was issued



from_date

dateStart date of the period covered by the Invoice



to_date

dateEnd date of the period covered by the Invoice



payment_model

string

Invoice payment model:

  • postpay
  • prepay

Request example

GET /api/v3/resellers/1/invoices?filter[from_date]=2019-01-01&filter[to_date]=2019-02-01&filter[status]=closed&filter[payment_model]=prepay&page[size]=2&page[number]=1
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "788",
            "type": "invoices",
            "attributes": {
                "created_at": "2019-02-02T01:02:04.357014+0300",
                "updated_at": "2019-02-02T01:02:04.773570+0300",
                "document_id": "000758",
                "status": "closed",
                "total": null,
                "account_id": 264,
                "from_date": "2019-01-01",
                "to_date": "2019-02-01",
                "payment_model": "prepay"
            }
        },
        {
            "id": "790",
            "type": "invoices",
            "attributes": {
                "created_at": "2019-02-02T01:02:05.062252+0300",
                "updated_at": "2019-02-02T01:02:05.799874+0300",
                "document_id": "000760",
                "status": "closed",
                "total": null,
                "account_id": 109,
                "from_date": "2019-01-01",
                "to_date": "2019-02-01",
                "payment_model": "prepay"
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2019-01-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2019-02-01&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2019-01-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2019-02-01&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": null,
        "next": null,
        "last": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2019-01-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2019-02-01&page%5Bnumber%5D=1&page%5Bsize%5D=2"
    }
}