Get invoice

The Get invoice method returns invoice details for the current reseller or 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/{invoice_id}

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_idpathintegerRequired

ID of the current reseller or of any its downstream resellers (see Viewing and updating reseller general information)

invoice_idpathintegerRequiredInvoice ID
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

dataarrayResponse data


id

integer

Invoice ID

typestringData type

attributesobjectInvoice information



created_at

dateDate and time of the invoice creation



updated_at

dateDate and time of the invoice update



document_id

stringInvoice number



status

stringInvoice status



total

floatInvoice total



account_id

integerID of the account for which the invoice was issued



from_date

dateBeginning 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

relationshipsarray

List of subscriptions, payments, charges, and corrections included in the invoice



subscriptionsarrayList of subscriptions included in the invoice



dataarray





id
integerSubscription ID





type
stringData type


paymentsarray

List of payments included in the invoice




dataarray




idintegerPayment ID




typestringData type


chargesarray

List of charges included in the invoice




dataarray




idintegerCharge ID




typestringData type


correctionsarray

List of corrections included in the invoice (see Creating a correction)




dataarray




idintegerCorrection ID




typestringData type
includedarray

Detailed information about subscriptions, payments, charges, and taxes



idintegerSubscription ID


typestringData type


attributesarraySubscription information



created_at

date

Date and time of the subscription creation



updated_at

date

Date and time of the subscription update



auto_renewalboolean
  • true — the subscription auto-renewal option is on.
  • false — the subscription auto-renewal option is off (see Auto-renewing a subscription).



billing_fromdateBeginning date of the subscription paid period



expiration_datedateSubscription expiration date



name

string

Subscription name



renew_point_daysintegerThe subscription renew point (see Viewing and updating subscription's details



start_date

date

Subscription activation date



status

string

Subscription status (see Viewing the list of subscriptions for the list of statuses)




payment_modelstring

Subscription payment model:

  • prepay
  • postpay



payment_model_parametersobjectPayment model parameters




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




current_debtfloatThe subscription debt that is calculated as the total amount of all blocked charges for the subscription for the current billing period. For postpaid subscription only (payment_model = postpay)


idintegerPayment ID


typestringData type


attributesarrayDetailed information about the payment



created_at

date

Date and time of the payment creation



updated_at

date

Date and time of the payment update



account_idintegerAccount ID



discount_amountfloatDiscount amount



totalfloatPayment total



commentstringAdditional information about the payment



statusstringPayment status (see Payment types)



document_idstringPayment number (see Viewing the list of payments)



expiration_datedatePayment expiration date



payment_method_idintegerPayment method ID (see Viewing the list of payment methods)



payment_method_namestringPayment method name



closed_at

dateThe close date of the charge. Returns null for unpaid payments


relationshipsobjectInformation about objects that are linked to the payment



ordersobjectThe list of orders to pay




dataarray





idintegerOrder ID





typestringData type



invoicesobjectThe list of invoices




dataarray





idintegerInvoice ID





typestringData type



resellerobjectInformation about the reseller




dataobject





idintegerReseller ID





typestringData type



accountobjectInformation about the account




dataobject





idintegerAccount ID





typestringData type



payment_methodobjectInformation about the payment method




dataobject





idintegerPayment method ID





typestringData type


idintegerCharge ID


typestringData type


attributesarrayCharge information



created_at

date

Charge creation date




updated_at

date

Charge update date



subscription_idintegerSubscription ID



subscription_resource_idintegerResource ID in the subscription



quantityintegerAmount of ordered resources or services



operate_fromdateStart date of the charge period



durationfloatCharge period duration in months. For example, 1 day equals to 0.033, 2 years equal to 24



descriptionstringCharge description



unit_pricefloatService or resource unit price for the selected reseller



amountfloatCharge total amount



statusstringCharge status (see Charges attributes for the list of statuses)



typestringCharge internal type (see the list of type in Get Charge Info by ID, see also Charges attributes)



net_costfloatCharge net cost for the selected reseller



taxes_amountfloat

Taxes amount (see Add taxes)




subscription_resource_namestringResource name in the subscription



plan_resource_idintegerResource ID in the plan



resource_idintegerResource ID in the application template



order_idintegerID of the corresponding order



operate_todateEnd date of the charge period



close_datedate

Date when the charge will be closed.

For the charges in the Closed status — the date when the charge was closed



relationshipsarray

General information about taxes for a charge (see Add taxes)




taxesarray




dataarray





idintegerTax ID





typestringData type


idintegerTax ID


typestringData type


attributesarray

Detailed information about a tax




created_at

date

Date and time of tax creation



updated_at

date

Date and time of tax update



charge_idintegerID of the charge for which the tax was added



namestringTax name



descriptionstringTax description and additional information



valuefloatTax value formatted to two decimals


idintegerCorrection ID (see Managing corrections)


typestringData type


attributesarrayCorrection information



created_atdateDate and time of the correction creation



updated_atdateDate and time of the correction update



account_idintegerAccount ID



statusstringCorrection status



totalfloatCorrection total amount



commentstringAdditional information about the correction



period_fromdate

Beginning and end of the period for which the correction was created




period_todate



approved_atdateDate and time of the correction approval



subscription_idintegerID of the subscription for which the correction was applied

Request example

GET /api/v3/resellers/1/invoices/2046?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": "2046",
        "type": "invoices",
        "attributes": {
            "created_at": "2019-09-11T09:02:01.257560+0300",
            "updated_at": "2019-10-13T06:12:41.990713+0300",
            "document_id": "001800",
            "status": "closed",
            "total": "0.32",
            "account_id": 453,
            "from_date": "2019-09-10",
            "to_date": "2019-10-10",
            "payment_model": "postpay"
        },
        "relationships": {
            "subscriptions": {
                "data": [
                    {
                        "id": "3005665",
                        "type": "subscriptions"
                    },
                    {
                        "id": "3005201",
                        "type": "subscriptions"
                    }
                ]
            },
            "payments": {
                "data": [
                    {
                        "id": "6396",
                        "type": "payments"
                    }
                ]
            },
            "charges": {
                "data": [
                    {
                        "id": "73228",
                        "type": "charges"
                    }
                ]
            },
            "corrections": {
                "data": []
            }
        }
    },
    "included": [
        {
            "id": "3005665",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2019-08-30T00:15:43.769169+0300",
                "updated_at": "2019-10-11T21:31:07.417465+0300",
                "auto_renewal": false,
                "billing_from": "2019-09-01",
                "expiration_date": "2119-10-20",
                "name": "Azure stub",
                "renew_point_days": 0,
                "start_date": "2019-08-29",
                "status": "deleted",
                "payment_model": "postpay",
                "payment_model_parameters": {
                    "credit_limit": 100.0,
                    "current_debt": 0.06
                }
            }
        },
        {
            "id": "3005201",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2019-11-06T10:54:02.357325+0300",
                "updated_at": "2019-11-06T10:59:16.533047+0300",
                "auto_renewal": false,
                "billing_from": null,
                "expiration_date": "2119-10-20",
                "name": "Dr Web",
                "renew_point_days": 0,
                "start_date": null,
                "status": "installing",
                "payment_model": "postpay",
                "payment_model_parameters": {
                    "credit_limit": 100.0,
                    "current_debt": 0.0
                }
            }
        },
        {
            "id": "6396",
            "type": "payments",
            "attributes": {
                "created_at": "2019-10-11T09:00:02.876392+0300",
                "updated_at": "2019-10-11T09:00:02.876392+0300",
                "account_id": 453,
                "discount_amount": "0.0",
                "total": "0.32",
                "comment": "Postpay payment",
                "status": "waiting_for_payment",
                "document_id": "2005194",
                "expiration_date": "2019-11-10",
                "payment_method_id": null,
                "requester_ip": null,
                "manager_id": null,
                "payment_method_name": null,
                "closed_at": null
            },
            "relationships": {
                "orders": {
                    "data": []
                },
                "invoices": {
                    "data": [
                        {
                            "id": "2046",
                            "type": "invoices"
                        }
                    ]
                },
                "reseller": {
                    "data": {
                        "id": "1",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "453",
                        "type": "accounts"
                    }
                },
                "payment_method": {
                    "data": null
                }
            }
        },
        {
            "id": "73228",
            "type": "charges",
            "attributes": {
                "created_at": "2019-09-11T10:01:45.726138+0300",
                "updated_at": "2019-10-10T09:00:03.368862+0300",
                "subscription_id": 3005665,
                "subscription_resource_id": null,
                "quantity": 1.0,
                "operate_from": "2019-09-11",
                "duration": 0.07911273,
                "description": "\"Fee for consumed resources of subscription #3005665 \"Azure stub\"",
                "unit_price": "4.0",
                "amount": "0.32",
                "status": "closed",
                "type": "Charge::ExternalResource",
                "net_cost": null,
                "taxes_amount": 0,
                "subscription_resource_name": null,
                "plan_resource_id": null,
                "resource_id": null,
                "order_id": null,
                "operate_to": "2019-10-09",
                "close_date": "2019-10-09",
                "discount": "0.00"
            },
            "relationships": {
                "taxes": {
                    "data": []
                },
                "reseller": {
                    "data": {
                        "id": "1",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "453",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3005665",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "880",
                        "type": "plans"
                    }
                },
                "discount": {
                    "data": null
                }
            }
        }
    ]
}