Get invoice

The Get invoice method returns invoice details for the current reseller or any of its downstream resellers.

XML
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


)

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 )

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:

Object

Parameter value

Subscriptions

subscriptions

Payments

payments

Charges

charges

Corrections

corrections

Taxes

taxes

Response model

Name

Data type

Description

data

object

Response data


id

string

Invoice ID


type

string

Data type


attributes

object

Invoice information



created_at

string

Date and time of the invoice creation



updated_at

string

Date and time of the invoice update



document_id

string

Invoice number



status

string

Invoice status



total

string

Invoice total



account_id

integer

ID of the account for which the invoice was issued



from_date

string

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



to_date

string

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



payment_model

string

Invoice payment model:

  • prepay

  • postpay



approved

bool

Indicates 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.


relationships

object

Related objects



subscriptions

object

List of subscriptions included in the invoice




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



payments

object

List of payments included in the invoice




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



charges

object

List of charges included in the invoice




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



corrections

object

List of corrections included in the invoice




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



taxes

object

List of taxes for charges included in the invoice




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type

included

array

Additional information about objects listed in the request:

Name

Data type

Description

id

integer

ID of the object

type

string

Data type

attributes

array

Attributes of the object (see details below)

Name

Data type

Description

id

string

ID of the subscription

type

string

Data type

attributes

object

Subscription details


created_at

string

Date and time of the subscription creation


updated_at

string

Date and time when the subscription was updated


auto_renewal

bool

The automatic subscription renewal option:

  • true — The automatic subscription renewal is enabled.

  • false — The automatic subscription renewal is off.


billing_from

string

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


expiration_date

string

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


name

string

Name of the subscription 


auto_renew_point_days

integer

Auto-renew point (in days)


start_date

string

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


status

string

Status of the subscription (for the list of subscription statuses, see )


payment_model

string

Subscription payment model:

  • prepay

  • postpay


payment_model_parameters

object

Payment model parameters



credit_limit

number

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



current_debt

number

The 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:

Name

Data type

Description

id

string

ID of the correction

type

string

Data type

attributes

object

Сorrection details


created_at

string

Date and time of the correction creation


updated_at

string

Date and time when the correction was updated


account_id

integer

Account ID


status

string

Correction status


total

string

Correction total amount


comment

string

Additional information about the correction


period_from

string

Beginning of the period for which the correction was created


period_to

string

End of the period for which the correction was created


approved_at

string

Date and time of the correction approval


subscription_id

integer

ID of the subscription for which the correction was applied

  • For every tax used to calculate a charge:

    Название

    Тип данных

    Описание

    id

    string

    The tax ID

    type

    string

    Data type

    attributes

    object

    Tax details


    created_at

    string

    Date and time of the tax creation


    updated_at

    string

    Date and time when the tax was updated


    charge_id

    integer

    The ID of the related charge


    origin_id

    integer

    The tax ID in the taxation module


    name

    string

    The tax name


    code

    string

    The tax code


    rate

    number

    The tax rate percentage


    amount

    string

    The tax amount calculated for net_amount of the charge

Request example

XML
GET /api/v3/resellers/1/invoices/3973?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

JSON
{
    "data": {
        "id": "3973",
        "type": "invoices",
        "attributes": {
            "created_at": "2021-03-02T01:12:58.186820+0300",
            "updated_at": "2021-03-02T01:12:58.380559+0300",
            "document_id": "003661",
            "status": "closed",
            "total": "220.0",
            "account_id": 906,
            "from_date": "2021-02-01",
            "to_date": "2021-03-01",
            "payment_model": "prepay",
            "approved": "false"
        },
        "relationships": {
            "subscriptions": {
                "data": [
                    {
                        "id": "3007572",
                        "type": "subscriptions"
                    },
                    {
                        "id": "3007576",
                        "type": "subscriptions"
                    }
                ]
            },
            "payments": {
                "data": []
            },
            "charges": {
                "data": [
                    {
                        "id": "85176",
                        "type": "charges"
                    },
                    {
                        "id": "85229",
                        "type": "charges"
                    }
                ]
            },
            "corrections": {
                "data": []
            },
            "taxes": {
                "data": []
            }
        }
    },
    "included": [
        {
            "id": "3007572",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "3007576",
            "type": "subscriptions",
            "attributes": {
                ...
            }
        },
        {
            "id": "85176",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "85229",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        }
    ]
}