Get order

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

XML
GET {base_url}/api/v3/resellers/{reseller_id}/orders/{order_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 any of its downstream resellers (see 


)

order_id

path

integer

Required

Order ID

include

query

string

Optional

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

Object

Parameter value

Charges

charges

Account

account

Payment

payment

Subscription

subscription

Response model

Name

Data type

Description

data

object

Response data


id

string

Order ID


type

string

Data type


attributes

object

Information about the order 



created_at

string

Date and time of the order creation



updated_at

string

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 



account_id

integer

Account ID used to pay for the order



type

string

Order type. For the list of order types, see 



closed_at

string

Date and time when the order was closed



expiration_date

string

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 ) and the order creation date



provisioning_date

string

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



total

string

Total amount of the order



promo_code

string

Promo code used to get the discount (see )



payment_id

integer

Payment ID linked to the order



manager_id

integer

ID of the manager who created the order



requester_ip

string

IP address of the user who created the order



custom_price

bool

Whether 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_by

string

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_id

integer

ID of the linked subscription



items

array of objects

List of items in the order




id

integer

Item ID




target_id

integer

Entity ID




target_type

string

Entity type related to the item of the order:

  • Subscription — subscription.

  • SubscriptionResource — additional resource of the subscription.




type

string

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.




status

string

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.




description

string

Brief description of the order item




quantity

Depends on the order item

Quantitative representation of the the order item




resource_id

integer

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



payment_document_id

string

Payment number linked to the order


relationships

object

Related objects



charges

object

Charges data




data

array

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



account

object

Account data




data

object

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



payment

object

Payment data




data

object

Related object information:

Name

Data type

Description

id

string

ID of the object

type

string

Data type



subscription

object

Subscription data




data

object

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

string

ID of the object

type

string

Data type

attributes

object

Attributes of the object (see details below)

  • For the charges, see the data model in Get charge.

  • For the account, see the data model in Get account.

  • For the payment, see the data model in Get payment.

  • For the subscription:

    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 


    expiration_date

    string

    The expiration date of the subscription 


    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 


    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)

Request example

XML
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

JSON
{
    "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": "000002"
        },
        "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": {}
            }
        }
    ]
}