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 role and access level of the manager, which determine the availability of a method.
  • 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

string

Optional

Filter the list by the invoice creation date in the YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339)

filter[updated_at]

query

string

Optional

Filter the list by the invoice update date in the YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339)

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
filter[charges]queryboolOptional

Filter the list of closed invoices by charges (see relationships.charges):

  • true — get only closed invoices with at least one charge.
  • false — get only closed invoices without charges.

page[size]

query

integer

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

page[number]

query

integer

OptionalPage navigation: page number
includequerystringOptional

Returns additional information about objects related to the invoice. The parameter can be a comma-separated list if information about several objects is required. The following objects and possible values are supported:

ObjectParameter value
Subscriptionssubscriptions
Paymentspayments
Chargescharges
Correctionscorrections
Taxestaxes

Response model

Name

Data type

Description

dataarray of objectsResponse data


id

string

Invoice ID

typestringData type

attributesobjectInvoice information



created_at

stringDate and time of invoice creation 



updated_at

stringData 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 an invoice was issued



from_date

stringStart date of the period covered by an invoice (YYYY-MM-DD)



to_date

stringEnd date of the period covered by an invoice (YYYY-MM-DD)



payment_model

string

Invoice payment model:

  • prepay
  • postpay


approvedboolIndicates whether it is an approved postpaid invoice with external management (see Invoices with external management):
  • true — a postpaid invoice with external management, and a third-party ERP system approved it.
  • false — in all other cases:
    • A postpaid invoice with external management, and a third-party ERP system did not approved it yet.
    • A postpaid invoice managed by the platform.
    • A prepaid invoice.
relationshipsobjectRelated objects

subscriptionsobjectList of subscriptions included in an invoice


dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type

paymentsobjectList of payments included in an invoice


dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type

chargesobjectList of charges included in an invoice


dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type

correctionsobjectList of corrections included in an invoice


dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type

taxesobjectList of taxes for charges included in an invoice


dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idintegerID of the object
typestringData type
attributesarrayAttributes of the object (see details below)
NameData typeDescription
idstringID of the subscription
typestringData type
attributesobjectSubscription details

created_atstringDate and time of the subscription creation

updated_atstringDate and time when the subscription was updated

auto_renewalbool

The automatic subscription renewal option:

  • true — The automatic subscription renewal is enabled.
  • false — The automatic subscription renewal is off.

billing_fromstringThe start date of generating charges for the subscription (YYYY-MM-DD)

expiration_datestringThe expiration date of the subscription (YYYY-MM-DD)

namestringName of the subscription 

auto_renew_point_daysinteger

Auto-renew point (in days)


start_datestringThe date of activation of the subscription (YYYY-MM-DD)

statusstring

Status of the subscription (for the list of subscription statuses, see Viewing the list of Resellers Subscriptions)


payment_modelstring

Subscription payment model:

  • prepay
  • postpay

payment_model_parametersobjectPayment model parameters


credit_limitnumberThe value of the subscription debt, above which the postpaid subscription will be stopped. For postpaid subscriptions only (payment_model = postpay)


current_debtnumberThe subscription debt that is calculated as the total amount of all blocked charges for the subscription for the current billing period. For postpaid subscriptions only (payment_model = postpay)
  • For a correction:
NameData typeDescription
idstringID of the correction
typestringData type
attributesobjectСorrection details

created_atstringDate and time of the correction creation

updated_atstringDate and time when the correction was updated

account_idintegerAccount ID

statusstringCorrection status

totalstringCorrection total amount

commentstringAdditional information about the correction

period_fromstringBeginning of the period for which the correction was created

period_tostringEnd of the period for which the correction was created

approved_atstringDate and time of the correction approval

subscription_idintegerID of the subscription for which the correction was applied
  • For every tax used to calculate a charge:

    НазваниеТип данныхОписание
    idstringThe tax ID
    typestringData type
    attributesobjectTax details

    created_atstringDate and time of the tax creation

    updated_atstringDate and time when the tax was updated

    charge_idintegerThe ID of the related charge

    origin_idintegerThe tax ID in the taxation module

    namestringThe tax name

    codestringThe tax code

    ratenumberThe tax rate percentage

    amountstringThe tax amount calculated for net_amount of the charge
linksobjectPage navigation links that use the defined page navigation parameters

selfstringCurrent page link

firststringFirst page link

prevstringPrevious page link

nextstringNext page link

laststringLast page link

Request example

GET /api/v3/resellers/1/invoices?filter[status]=closed&filter[from_date]=2021-02-01&filter[to_date]=2021-03-01&page[size]=2&page[number]=36&include=subscriptions,payments,charges,corrections,taxes
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "3974",
            "type": "invoices",
            "attributes": {
                "created_at": "2021-03-02T01:13:01.886407+0300",
                "updated_at": "2021-03-02T01:13:02.080438+0300",
                "document_id": "003662",
                "status": "closed",
                "total": "30.0",
                "account_id": 893,
                "from_date": "2021-02-01",
                "to_date": "2021-03-01",
                "payment_model": "prepay",
                "approved": "false"
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3007326",
                            "type": "subscriptions"
                        }
                    ]
                },
                "payments": {
                    "data": []
                },
                "charges": {
                    "data": [
                        {
                            "id": "83106",
                            "type": "charges"
                        }
                    ]
                },
                "corrections": {
                    "data": []
                },
                "taxes": {
                    "data": []
                }
            }
        },
        {
            "id": "3975",
            "type": "invoices",
            "attributes": {
                "created_at": "2021-03-02T01:19:12.771065+0300",
                "updated_at": "2021-03-02T01:19:12.992596+0300",
                "document_id": "003663",
                "status": "closed",
                "total": "54.0",
                "account_id": 108,
                "from_date": "2021-02-01",
                "to_date": "2021-03-01",
                "payment_model": "prepay",
                "approved": "false"
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3002769",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3002770",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3002771",
                            "type": "subscriptions"
                        }
                    ]
                },
                "payments": {
                    "data": []
                },
                "charges": {
                    "data": [
                        {
                            "id": "22719",
                            "type": "charges"
                        },
                        {
                            "id": "22840",
                            "type": "charges"
                        },
                        {
                            "id": "22962",
                            "type": "charges"
                        },
                        {
                            "id": "23083",
                            "type": "charges"
                        },
                        {
                            "id": "23204",
                            "type": "charges"
                        },
                        {
                            "id": "23326",
                            "type": "charges"
                        },
                        {
                            "id": "23447",
                            "type": "charges"
                        },
                        {
                            "id": "23568",
                            "type": "charges"
                        },
                        {
                            "id": "23690",
                            "type": "charges"
                        }
                    ]
                },
                "corrections": {
                    "data": []
                },
                "taxes": {
                    "data": []
                }
            }
        }
    ],
    "included": [
        {
            "id": "3007326",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "83106",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "3002769",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "3002770",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "3002771",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "22719",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "22840",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "22962",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23083",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23204",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23326",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23447",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23568",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "23690",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2021-02-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2021-03-01&include=subscriptions%2Cpayments%2Ccharges%2Ccorrections%2Ctaxes&page%5Bnumber%5D=36&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2021-02-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2021-03-01&include=subscriptions%2Cpayments%2Ccharges%2Ccorrections%2Ctaxes&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2021-02-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2021-03-01&include=subscriptions%2Cpayments%2Ccharges%2Ccorrections%2Ctaxes&page%5Bnumber%5D=35&page%5Bsize%5D=2",
        "next": null,
        "last": "https://test.activeplatform.com/api/v3/resellers/1/invoices?filter%5Bfrom_date%5D=2021-02-01&filter%5Bstatus%5D=closed&filter%5Bto_date%5D=2021-03-01&include=subscriptions%2Cpayments%2Ccharges%2Ccorrections%2Ctaxes&page%5Bnumber%5D=36&page%5Bsize%5D=2"
    }
}