Get list of invoices

The Get list of invoices method returns the list of invoices for the current reseller or for any of its downstream resellers.

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information

The manager's API token specified in an API request determines the current reseller and downstream resellers accessible within a method.

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

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
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 in the RFC 3339 format (for example, 2019-05-29T15:12:01.558009+03:00 or 2019-05-29)

filter[updated_at]

query

date

Optional

Filter the list by the invoice update date in the RFC 3339 format (for example, 2019-05-29T15:12:01.558009+03:00 or 2019-05-29)

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 (YYYY-MM-DD)
filter[to_date]querystringOptionalFilter the list by end date of the period covered by the invoice (YYYY-MM-DD)
filter[payment_model]querystringOptional

Filter the list by the payment_model:

  • prepay
  • postpay

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:

  • prepay
  • postpay

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"
    }
}