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-Token | header | string | Required | API token of a manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Media type of the request. Specify the following: application/vnd.api+json |
Accept | header | string | Required | Supported media types of the answer. Specify the following: application/vnd.api+json |
base_url | path | string | Required | ActivePlatform URL |
reseller_id | path | integer | Required | ID 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] | query | string | Optional | Filter the list by beginning date of the period covered by the invoice (YYYY-MM-DD) |
filter[to_date] | query | string | Optional | Filter the list by end date of the period covered by the invoice (YYYY-MM-DD) |
filter[payment_model] | query | string | Optional | Filter the list by the
|
page[size] | query | integer | Optional | Page navigation: number of elements per page. The default value is 50 |
page[number] | query | integer | Optional | Page navigation: page number |
Response model
Name | Data type | Description | ||
---|---|---|---|---|
data | array | Response data | ||
id | integer | Invoice ID | ||
type | string | Data type | ||
attributes | object | Invoice information | ||
created_at | date | Date and time of invoice creation | ||
updated_at | date | Data and time of invoice last update | ||
document_id | string | Invoice number (see Viewing the list of invoices) | ||
status | string | Invoice status | ||
total | string | Invoice total amount | ||
account_id | integer | ID of the account for which the invoice was issued | ||
from_date | date | Start date of the period covered by the invoice | ||
to_date | date | End date of the period covered by the invoice | ||
payment_model | string | Invoice payment model:
|
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"
}
}