Get a List of Invoices
The Get List of Invoices method returns the list of Invoices. The 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-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) |
Accept | header | string | Required | Information about data types that the client (browser) supports |
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 |
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] | query | string | Optional | Filter the list by beginning date of the period covered by the Invoice |
filter[to_date] | query | string | Optional | Filter the list by end date of the period covered by the Invoice |
filter[payment_model] | query | string | Optional | Filter the list by the payment_model:
|
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"
}
}