Get order

The Get order method returns order 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}/orders/{order_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_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
order_idpathintegerRequiredOrder 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

dataobjectResponse 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. Applied to delayed orders only


total

float

Total amount of the order



promo_code

string

Promo code 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


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 the charges, see the data model in Get end-customer charge.
  • For the account, see the data model in Get account.
  • For the payment, see the data model in Get payment.
  • For the 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)

Request example

GET /api/v3/resellers/1/orders/13416?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": null,
            "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": 22990,
                    "target_id": "SubscriptionResource",
                    "target_type": "SubscriptionResource",
                    "type": "ProvisioningItem::Upgrade",
                    "status": "completed",
                    "description": "HDD",
                    "quantity": 2
                },
                {
                    "id": 22989,
                    "target_id": "Subscription",
                    "target_type": "Subscription",
                    "type": "ProvisioningItem::New",
                    "status": "completed",
                    "description": "CSPMonthly",
                    "quantity": 1
                }
            ]
        },
        "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"
                }
            }
        }
    },
    "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": {}
            }
        }
    ]
}