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-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 the current reseller or of any its downstream resellers (see Viewing and updating reseller general information) | ||||||||||||
invoice_id | path | integer | Required | Invoice ID | ||||||||||||
include | query | string | Optional | 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:
|
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 the invoice creation | |||||
updated_at | date | Date and time of the invoice update | |||||
document_id | string | Invoice number | |||||
status | string | Invoice status | |||||
total | float | Invoice total | |||||
account_id | integer | ID of the account for which the invoice was issued | |||||
from_date | date | Beginning 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:
| |||||
relationships | array | List of subscriptions, payments, charges, and corrections included in the invoice | |||||
subscriptions | array | List of subscriptions included in the invoice | |||||
data | array | ||||||
id | integer | Subscription ID | |||||
type | string | Data type | |||||
payments | array | List of payments included in the invoice | |||||
data | array | ||||||
id | integer | Payment ID | |||||
type | string | Data type | |||||
charges | array | List of charges included in the invoice | |||||
data | array | ||||||
id | integer | Charge ID | |||||
type | string | Data type | |||||
corrections | array | List of corrections included in the invoice (see Creating a correction) | |||||
data | array | ||||||
id | integer | Correction ID | |||||
type | string | Data type | |||||
included | array | Detailed information about subscriptions, payments, charges, and taxes | |||||
id | integer | Subscription ID | |||||
type | string | Data type | |||||
attributes | array | Subscription information | |||||
created_at | date | Date and time of the subscription creation | |||||
updated_at | date | Date and time of the subscription update | |||||
auto_renewal | boolean |
| |||||
billing_from | date | Beginning date of the subscription paid period | |||||
expiration_date | date | Subscription expiration date | |||||
name | string | Subscription name | |||||
renew_point_days | integer | The 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_model | string | Subscription payment model:
| |||||
payment_model_parameters | object | Payment model parameters | |||||
credit_limit | float | The value of the subscription debt, above which the postpaid subscription will be stopped. For postpaid subscription only (payment_model = postpay ) | |||||
current_debt | float | The 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 ) | |||||
id | integer | Payment ID | |||||
type | string | Data type | |||||
attributes | array | Detailed 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_id | integer | Account ID | |||||
discount_amount | float | Discount amount | |||||
total | float | Payment total | |||||
comment | string | Additional information about the payment | |||||
status | string | Payment status (see Payment types) | |||||
document_id | string | Payment number (see Viewing the list of payments) | |||||
expiration_date | date | Payment expiration date | |||||
payment_method_id | integer | Payment method ID (see Viewing the list of payment methods) | |||||
payment_method_name | string | Payment method name | |||||
closed_at | date | The close date of the charge. Returns null for unpaid payments | |||||
relationships | object | Information about objects that are linked to the payment | |||||
orders | object | The list of orders to pay | |||||
data | array | ||||||
id | integer | Order ID | |||||
type | string | Data type | |||||
invoices | object | The list of invoices | |||||
data | array | ||||||
id | integer | Invoice ID | |||||
type | string | Data type | |||||
reseller | object | Information about the reseller | |||||
data | object | ||||||
id | integer | Reseller ID | |||||
type | string | Data type | |||||
account | object | Information about the account | |||||
data | object | ||||||
id | integer | Account ID | |||||
type | string | Data type | |||||
payment_method | object | Information about the payment method | |||||
data | object | ||||||
id | integer | Payment method ID | |||||
type | string | Data type | |||||
id | integer | Charge ID | |||||
type | string | Data type | |||||
attributes | array | Charge information | |||||
created_at | date | Charge creation date | |||||
updated_at | date | Charge update date | |||||
subscription_id | integer | Subscription ID | |||||
subscription_resource_id | integer | Resource ID in the subscription | |||||
quantity | integer | Amount of ordered resources or services | |||||
operate_from | date | Start date of the charge period | |||||
duration | float | Charge period duration in months. For example, 1 day equals to 0.033, 2 years equal to 24 | |||||
description | string | Charge description | |||||
unit_price | float | Service or resource unit price for the selected reseller | |||||
amount | float | Charge total amount | |||||
status | string | Charge status (see Charges attributes for the list of statuses) | |||||
type | string | Charge internal type (see the list of type in Get Charge Info by ID, see also Charges attributes) | |||||
net_cost | float | Charge net cost for the selected reseller | |||||
taxes_amount | float | Taxes amount (see Add taxes) | |||||
subscription_resource_name | string | Resource name in the subscription | |||||
plan_resource_id | integer | Resource ID in the plan | |||||
resource_id | integer | Resource ID in the application template | |||||
order_id | integer | ID of the corresponding order | |||||
operate_to | date | End date of the charge period | |||||
close_date | date | Date when the charge will be closed. For the charges in the Closed status — the date when the charge was closed | |||||
relationships | array | General information about taxes for a charge (see Add taxes) | |||||
taxes | array | ||||||
data | array | ||||||
id | integer | Tax ID | |||||
type | string | Data type | |||||
id | integer | Tax ID | |||||
type | string | Data type | |||||
attributes | array | Detailed information about a tax | |||||
created_at | date | Date and time of tax creation | |||||
updated_at | date | Date and time of tax update | |||||
charge_id | integer | ID of the charge for which the tax was added | |||||
name | string | Tax name | |||||
description | string | Tax description and additional information | |||||
value | float | Tax value formatted to two decimals | |||||
id | integer | Correction ID (see Managing corrections) | |||||
type | string | Data type | |||||
attributes | array | Correction information | |||||
created_at | date | Date and time of the correction creation | |||||
updated_at | date | Date and time of the correction update | |||||
account_id | integer | Account ID | |||||
status | string | Correction status | |||||
total | float | Correction total amount | |||||
comment | string | Additional information about the correction | |||||
period_from | date | Beginning and end of the period for which the correction was created | |||||
period_to | date | ||||||
approved_at | date | Date and time of the correction approval | |||||
subscription_id | integer | ID 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
}
}
}
]
}