Get list of orders

The Get list of orders method returns the list of orders of 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 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}/orders

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 the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
page[size]queryintegerOptionalPage navigation: number of elements per page. The default value is 50
page[number]queryintegerOptionalPage navigation: page number
sortquerystringOptional

Sorting the list by the specified parameter:

  • sort={parameter} — ascending sorting.
  • sort={-parameter} — descending sorting.

As a {parameter}, the following order parameters can be used (see Response model):

  • id
  • created_at
  • closed_at
  • updated_at
  • expiration_date
  • provisioning_date
filter[created_at]querystringOptionalFiltering the list by the creation date of orders in the YYYY-MM-DD or 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). To specify the period, the following filters are used:
  • filter[created_at][gt] — date and time are greater than the specified.
  • filter[created_at][lt] — date and time are less than the specified.
filter[updated_at]querystringOptionalFiltering the list by the update date of orders in the YYYY-MM-DD or 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). To specify the period, the following filters are used:
  • filter[created_at][gt] — date and time are greater than the specified.
  • filter[created_at][lt] — date and time are less than the specified.
filter[account_id]querystringOptionalFiltering the list by the account ID
filter[type]querystringOptionalFiltering the list by the order type
filter[status]querystringOptionalFiltering the list by the order status
filter[subscription_id]querystringOptionalFiltering the list by the subscription ID
includequerystringOptional

Returns additional information about objects related to orders. The following objects and possible values are supported:

ObjectParameter value
Charges

charges

Accountaccount
Paymentpayment
Subscriptionsubscription

Response model

Name

Data type

Description

dataarrayResponse data

idintegerOrder ID

typestringData type

attributesobjectInformation about the order 


created_at

date

Date and time of the order creation



updated_at

date

Date and time when the order was changed last time



document_id

string

Order number



status

string

Status of the order. For the list of statuses, see Viewing order details



account_id

integer

Account ID used to pay for the order



type

string

Order type. For the list of order types, see Managing an order



closed_atdateDate and time when the order was closed


expiration_date

date

Date by which the order should be paid (completed). The date is calculated depending on the billing type and taking into account the value set in the Cancel unpaid order in field on the account class page (see Creating an account class) and the order creation date



provisioning_datedateDate of the order provisioning. For delayed orders, the provisioning date is greater than the creation date


total

float

Total amount of the order



promo_code

string

Promo code, which was used to get the discount (see Managing Promo Code discounts)



payment_id

integer

Payment ID linked to the order


manager_idintegerID of the manager who created the order


stringIP address of the user who created the order


custom_priceboolWhether the individual prices are used for the ordered subscription:
  • true — the subscription is ordered at the individual prices.
  • false — the subscription is ordered at the plan prices.


created_bystring

Information about the creator of the order:

  • ID and name of the reseller's manager or account's user who created the order.
  • system — the order is created automatically.


subscription_idintegerID of the linked subscription


items

array of objectsList of items in the order



idintegerItem ID



target_idintegerEntity ID



target_typestring

Entity type related to the item of the order:

  • Subscription — subscription.

  • SubscriptionResource — additional resource of the subscription.




typestring

Internal type of the order item:

  • ProvisioningItem::New — new subscription.

  • ProvisioningItem::Prolong — prolongation of the subscription.

  • ProvisioningItem::Renew — renewal of the subscription.

  • ProvisioningItem::Upgrade — increasing an amount of the subscription's resources.

  • ProvisioningItem::Downgrade — decreasing an amount of the subscription's resources.

  • ProvisioningItem::SwitchPlan — changing a plan within the subscription.

  • ProvisioningItem::RegisterDomain — domain registration.

  • ProvisioningItem::TransferDomain — transferring a domain.

  • ProvisioningItem::RegisterCertificate — registration of the SSL-certificate.




statusstring

Current status of the order item:

  • waiting_for_payment — the order has been placed by a customer, the payment is expected.
  • provisioning — the order has been accepted, the service is provided.
  • provisioning_failed — the order has been accepted, but the service is not provided.
  • completed — the order has been successfully processed.
  • cancelled — the order has been cancelled by a customer.



descriptionstringBrief description of the order item



quantityDepends on the order item

Quantitative representation of the the order item




resource_idinteger

The ID of an ordered plan resource. Only for target_type = SubscriptionResource



payment_document_idstring

Payment number linked to the order


relationshipsarrayRelated objects


chargesobjectCharges data



dataarray

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


accountobjectAccount data



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


paymentobjectPayment data



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


subscriptionobjectSubscription data



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idintegerID of the object
typestringData type
attributesobjectAttributes of the object (see details below)
  • For charges, see the data model in Get end-customer charge.
  • For an account, see the data model in Get account.
  • For a payment, see the data model in Get payment.
  • For a subscription:

    NameData typeDescription
    idintegerID of the subscription
    typestringData type
    attributesobjectSubscription details

    created_atdateDate and time of the subscription creation

    updated_atdateDate 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_fromdateThe start date of generating charges for the subscription 

    expiration_datedateThe expiration date of the subscription 

    namestringName of the subscription 

    auto_renew_point_daysinteger

    Auto-renew point (in days)


    start_datedateThe date of activation of the subscription 

    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_limitfloatThe value of the subscription debt, above which the postpaid subscription will be stopped. For postpaid subscriptions 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 subscriptions only (payment_model = postpay)
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/orders?page[size]=2&page[number]=2&sort=-updated_at&filter[created_at][gt]=2021-05-01T00:00:00.000000+0300&filter[created_at][lt]=2021-05-30T23:59:59.000000+0300&filter[status]=completed&include=charges,account,payment,subscription
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "13416",
            "type": "sales_orders",
            "attributes": {
                "created_at": "2021-05-28T16:01:32.308+03:00",
                "updated_at": "2021-05-28T16:01:40.227+03:00",
                "document_id": "SO007350",
                "status": "completed",
                "account_id": 944,
                "type": "SalesOrder",
                "closed_at": "2021-05-28T16:01:40.227+03:00",
                "expiration_date": "2021-06-01",
                "provisioning_date": "2021-05-28",
                "total": "54.18",
                "promo_code": null,
                "payment_id": 10146,
                "manager_id": 346,
                "requester_ip": "12.23.0.8",
                "custom_price": false,
                "created_by": "#1038 James Tony",
                "subscription_id": 3008520,
                "items": [
                    {
                        "id": 35924,
                        "target_id": 3012374,
                        "target_type": "Subscription",
                        "type": "ProvisioningItem::New",
                        "status": "completed",
                        "description": "Autoprovisioning Plan 1",
                        "quantity": 1
                    },
                    {
                        "id": 35925,
                        "target_id": 49964,
                        "target_type": "SubscriptionResource",
                        "type": "ProvisioningItem::Upgrade",
                        "status": "completed",
                        "description": "Resource 1",
                        "quantity": 1,
                        "resource_id": 152581
                    }
                ],
                "payment_document_id": "000001"
            },
            "relationships": {
                "charges": {
                    "data": [
                        {
                            "id": "317159",
                            "type": "charges"
                        },
                        {
                            "id": "317158",
                            "type": "charges"
                        }
                    ]
                },
                "account": {
                    "data": {
                        "id": "944",
                        "type": "accounts"
                    }
                },
                "payment": {
                    "data": {
                        "id": "10146",
                        "type": "payments"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3008520",
                        "type": "subscriptions"
                    }
                }
            }
        },
        {
            "id": "13415",
            "type": "sales_orders",
            "attributes": {
                "created_at": "2021-05-28T15:02:34.509+03:00",
                "updated_at": "2021-05-28T15:02:36.372+03:00",
                "document_id": "SO007349",
                "status": "completed",
                "account_id": 990,
                "type": "SalesOrder",
                "closed_at": "2021-05-28T15:02:36.372+03:00",
                "expiration_date": "2021-06-01",
                "provisioning_date": "2021-05-28",
                "total": "54.18",
                "promo_code": "",
                "payment_id": null,
                "manager_id": 346,
                "requester_ip": "12.23.0.8",
                "custom_price": false,
                "created_by": "#1077 Bill Wong",
                "subscription_id": 3008519,
                "items": [
                     {
                        "id": 35924,
                        "target_id": 3012374,
                        "target_type": "Subscription",
                        "type": "ProvisioningItem::New",
                        "status": "completed",
                        "description": "Autoprovisioning Plan 1",
                        "quantity": 1
                    },
                    {
                        "id": 35925,
                        "target_id": 49964,
                        "target_type": "SubscriptionResource",
                        "type": "ProvisioningItem::Upgrade",
                        "status": "completed",
                        "description": "Resource 1",
                        "quantity": 1,
                        "resource_id": 152581
                    } 
                ],
                "payment_document_id": "000002"
            },
            "relationships": {
                "charges": {
                    "data": [
                        {
                            "id": "317157",
                            "type": "charges"
                        },
                        {
                            "id": "317156",
                            "type": "charges"
                        }
                    ]
                },
                "account": {
                    "data": {
                        "id": "990",
                        "type": "accounts"
                    }
                },
                "payment": {
                    "data": null
                },
                "subscription": {
                    "data": {
                        "id": "3008519",
                        "type": "subscriptions"
                    }
                }
            }
        }
    ],
    "included": [
        {
            "id": "317159",
            "type": "charges",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "317158",
            "type": "charges",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "944",
            "type": "accounts",
            "attributes": {...
            },
            "relationships": {...
        },
        {
            "id": "10146",
            "type": "payments",
            "attributes": {...
            },
            "relationships": {...
                }
            }
        },
        {
            "id": "3008520",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2021-05-28T16:01:32.323030+0300",
                "updated_at": "2021-06-07T15:49:37.995072+0300",
                "auto_renewal": false,
                "billing_from": "2021-05-28",
                "expiration_date": "2021-06-28",
                "name": "CSPMonthly",
                "auto_renew_point_days": 0,
                "start_date": "2021-05-28",
                "status": "deleted",
                "payment_model": "prepay",
                "payment_model_parameters": {}
            }
        },
        {
            "id": "317157",
            "type": "charges",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "317156",
            "type": "charges",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "990",
            "type": "accounts",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "3008519",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2021-05-28T15:02:34.524836+0300",
                "updated_at": "2021-05-28T15:04:05.893641+0300",
                "auto_renewal": false,
                "billing_from": "2021-05-28",
                "expiration_date": "2021-06-28",
                "name": "CSPMonthly",
                "auto_renew_point_days": 0,
                "start_date": "2021-05-28",
                "status": "deleted",
                "payment_model": "postpay",
                "payment_model_parameters": {
                    "credit_limit": 5000,
                    "current_debt": 0
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2021-05-01T00%3A00%3A00.000000+0300&filter%5Bcreated_at%5D%5Blt%5D=2021-05-30T23%3A59%3A59.000000+0300&filter%5Bstatus%5D=completed&include=charges%2Csubscription%2Caccount%2Cpayment&page%5Bnumber%5D=2&page%5Bsize%5D=2&sort=-updated_at",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2021-05-01T00%3A00%3A00.000000+0300&filter%5Bcreated_at%5D%5Blt%5D=2021-05-30T23%3A59%3A59.000000+0300&filter%5Bstatus%5D=completed&include=charges%2Csubscription%2Caccount%2Cpayment&page%5Bnumber%5D=1&page%5Bsize%5D=2&sort=-updated_at",
        "prev": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2021-05-01T00%3A00%3A00.000000+0300&filter%5Bcreated_at%5D%5Blt%5D=2021-05-30T23%3A59%3A59.000000+0300&filter%5Bstatus%5D=completed&include=charges%2Csubscription%2Caccount%2Cpayment&page%5Bnumber%5D=1&page%5Bsize%5D=2&sort=-updated_at",
        "next": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2021-05-01T00%3A00%3A00.000000+0300&filter%5Bcreated_at%5D%5Blt%5D=2021-05-30T23%3A59%3A59.000000+0300&filter%5Bstatus%5D=completed&include=charges%2Csubscription%2Caccount%2Cpayment&page%5Bnumber%5D=3&page%5Bsize%5D=2&sort=-updated_at",
        "last": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2021-05-01T00%3A00%3A00.000000+0300&filter%5Bcreated_at%5D%5Blt%5D=2021-05-30T23%3A59%3A59.000000+0300&filter%5Bstatus%5D=completed&include=charges%2Csubscription%2Caccount%2Cpayment&page%5Bnumber%5D=98&page%5Bsize%5D=2&sort=-updated_at"
    }
}