Get a List of the Reseller's Orders
The Get a List of the Reseller's Orders method returns the list of Orders of the current Reseller or any of its downstream Resellers.
Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.
GET {base_url}/api/v3/resellers/{reseller_id}/orders
Arguments
Name | Parameter Type | Data type | Required/ Optional | Description | ||||
---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) | ||||
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) | ||||
Accept | header | string | Required | Information about data types that the client (browser) supports | ||||
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) | ||||
page[size] | query | integer | Optional | Page navigation: number of elements per page. The default value is 50 | ||||
page[number] | query | integer | Optional | Page navigation: page number | ||||
sort | query | string | Optional | Sorting the list by the specified parameter:
As a {parameter}, the following fields can be used (see Response model):
| ||||
filter[created_at] | query | string | Optional | Filtering the list by the creation date of Orders in the RFC 3339 format (for example, 2017-10-04T15:12:01.558009%2B03:00). To specify the period, the following filters are used:
| ||||
filter[updated_at] | query | string | Optional | Filtering the list by the update date of Orders in the RFC 3339 format (for example, 2017-10-04T15:12:01.558009%2B03:00). To specify the period, the following filters are used:
| ||||
filter[account_id] | query | string | Optional | Filtering the list by the Account ID | ||||
filter[type] | query | string | Optional | Filtering the list by the Order type | ||||
filter[status] | query | string | Optional | Filtering the list by the Order status | ||||
filter[subscription_id] | query | string | Optional | Filtering the list by the Subscription ID | ||||
include | query | string | Optional | Returns additional information about objects related to Orders. The following object and possible value are supported:
|
Response model
Name | Data type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | array | Response data | |||||||||||||||||||||
id | integer | Order ID | |||||||||||||||||||||
type | string | Data type | |||||||||||||||||||||
attributes | object | Information 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, which was used to pay for the Order | |||||||||||||||||||||
type | string | Order type. For the list of Order types, see Managing an order | |||||||||||||||||||||
closed_at | date | Date and time when the Order was closed | |||||||||||||||||||||
expiration_date | date | Date by which the order must be paid (the order status must be confirmed). The date is calculated using the grace period, which is set in the Service Term (see Creating a service term) | |||||||||||||||||||||
provisioning_date | date | Date of the Order provisioning | |||||||||||||||||||||
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, which is linked to the Order | |||||||||||||||||||||
manager_id | integer | ID and name of the Manager who created the Order | |||||||||||||||||||||
string | IP address of the user who created the Order | ||||||||||||||||||||||
custom_price | bool | Whether the individual prices are used for the ordered Subscription:
| |||||||||||||||||||||
created_by | string | Information about the creator of the Order:
| |||||||||||||||||||||
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 (service or additional resource), which is related to the item of the Order | |||||||||||||||||||||
target_type | string | Entity type, which is related to the item of the Order:
| |||||||||||||||||||||
type | string | Internal type of the Order item:
| |||||||||||||||||||||
status | string | Current status of the Order item:
| |||||||||||||||||||||
description | string | Brief description of the Order item | |||||||||||||||||||||
quantity | integer | Resource amount changed with the Order | |||||||||||||||||||||
relationships | array | Related objects | |||||||||||||||||||||
charges | array | Charges data | |||||||||||||||||||||
data | array | Related object information:
| |||||||||||||||||||||
included | array | Additional information about objects listed in the request:
Attributes of the object:
| |||||||||||||||||||||
links | array | Page navigation links that use the defined page navigation parameters | |||||||||||||||||||||
self | string | Current page link | |||||||||||||||||||||
first | string | First page link | |||||||||||||||||||||
prev | string | Previous page link | |||||||||||||||||||||
next | string | Next page link | |||||||||||||||||||||
last | string | Last page link |
Request example
GET /api/v3/resellers/1/orders?include=charges&page[size]=2&page[number]=190&filter[created_at][gt]=2020-08-01T10:00:00.000+03:00&filter[created_at][lt]=2020-11-01T10:00:00.000+03:00&filter[status]=completed
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
Response example
{
"data": [
{
"id": "10567",
"type": "sales_orders",
"attributes": {
"created_at": "2020-08-02T10:56:54.594+03:00",
"updated_at": "2020-08-02T11:03:44.049+03:00",
"document_id": "SO006035",
"status": "completed",
"account_id": 600,
"type": "SalesOrder",
"closed_at": "2020-08-02T11:03:44.049+03:00",
"expiration_date": "2020-09-01",
"provisioning_date": null,
"total": "14.51",
"promo_code": null,
"payment_id": 7779,
"manager_id": null,
"requester_ip": "10.0.0.203",
"custom_price": false,
"created_by": "#17 Abramovich Roman",
"subscription_id": 3007122,
"items": [
{
"id": 18286,
"target_id": "SubscriptionResource",
"target_type": "SubscriptionResource",
"type": "ProvisioningItem::Upgrade",
"status": "completed",
"description": "HDD",
"quantity": 1
},
{
"id": 18285,
"target_id": "Subscription",
"target_type": "Subscription",
"type": "ProvisioningItem::New",
"status": "completed",
"description": "CSP monthly",
"quantity": 1
}
]
},
"relationships": {
"charges": {
"data": [
{
"id": "308427",
"type": "charges"
},
{
"id": "308426",
"type": "charges"
}
]
}
}
},
{
"id": "10570",
"type": "renewal_orders",
"attributes": {
"created_at": "2020-09-02T10:08:04.180+03:00",
"updated_at": "2020-09-02T10:08:04.826+03:00",
"document_id": "RN002160",
"status": "completed",
"account_id": 600,
"type": "RenewalOrder",
"closed_at": "2020-09-02T10:08:04.826+03:00",
"expiration_date": "2020-10-02",
"provisioning_date": null,
"total": "14.52",
"promo_code": "",
"payment_id": 7782,
"manager_id": null,
"requester_ip": null,
"custom_price": false,
"created_by": "system",
"subscription_id": 3007116,
"items": [
{
"id": 18290,
"target_id": "Subscription",
"target_type": "Subscription",
"type": "ProvisioningItem::Renew",
"status": "completed",
"description": "CSP monthly",
"quantity": "2020-10-02"
}
]
},
"relationships": {
"charges": {
"data": [
{
"id": "308456",
"type": "charges"
},
{
"id": "308457",
"type": "charges"
}
]
}
}
}
],
"included": [
{
"id": "308427",
"type": "charges",
"attributes": {
"created_at": "2020-08-02T10:56:54.739078+0300",
"updated_at": "2020-09-02T10:08:09.327220+0300",
"subscription_id": 3007122,
"subscription_resource_id": 34928,
"quantity": 1,
"operate_from": "2020-09-01",
"duration": 0.033,
"description": "Upgrade resource (recurring fee) \"HDD\" for Subscription #3007122 \"CSP monthly\"",
"unit_price": "15.0",
"amount": "0.5",
"status": "deleted",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": "HDD",
"plan_resource_id": 4340,
"resource_id": 1454,
"order_id": 10567,
"operate_to": "2020-09-01",
"close_date": "2020-09-01",
"billing_date": "2020-09-01",
"additional_params": [],
"discount": "0.00",
"original_amount": "0.5",
"original_amount_currency": "EUR",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "600",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3007122",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "1598",
"type": "plans"
}
},
"discount": {
"data": null
}
}
},
{
"id": "308426",
"type": "charges",
"attributes": {
"created_at": "2020-08-02T10:56:54.732962+0300",
"updated_at": "2020-09-02T10:08:07.740634+0300",
"subscription_id": 3007122,
"subscription_resource_id": 34928,
"quantity": 1,
"operate_from": "2020-08-02",
"duration": 0.967,
"description": "Upgrade resource (recurring fee) \"HDD\" for Subscription #3007122 \"CSP monthly\"",
"unit_price": "15.0",
"amount": "14.51",
"status": "closed",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": "HDD",
"plan_resource_id": 4340,
"resource_id": 1454,
"order_id": 10567,
"operate_to": "2020-08-31",
"close_date": "2020-08-31",
"billing_date": "2020-08-01",
"additional_params": [],
"discount": "0.00",
"original_amount": "14.51",
"original_amount_currency": "EUR",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "600",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3007122",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "1598",
"type": "plans"
}
},
"discount": {
"data": null
}
}
},
{
"id": "308456",
"type": "charges",
"attributes": {
"created_at": "2020-09-02T10:08:04.297139+0300",
"updated_at": "2020-09-02T10:08:04.857631+0300",
"subscription_id": 3007116,
"subscription_resource_id": 34903,
"quantity": 1,
"operate_from": "2020-09-02",
"duration": 0.968,
"description": "Renewal resource (recurring fee) \"HDD\" for subscription #3007116 \"CSP monthly\"",
"unit_price": "15.0",
"amount": "14.52",
"status": "blocked",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": "HDD",
"plan_resource_id": 4340,
"resource_id": 1454,
"order_id": 10570,
"operate_to": "2020-09-30",
"close_date": "2020-09-30",
"billing_date": "2020-09-01",
"additional_params": [],
"discount": "0.00",
"original_amount": "14.52",
"original_amount_currency": "EUR",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "600",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3007116",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "1598",
"type": "plans"
}
},
"discount": {
"data": null
}
}
},
{
"id": "308457",
"type": "charges",
"attributes": {
"created_at": "2020-09-02T10:08:04.304794+0300",
"updated_at": "2020-09-02T10:08:04.838551+0300",
"subscription_id": 3007116,
"subscription_resource_id": 34903,
"quantity": 1,
"operate_from": "2020-10-01",
"duration": 0.032,
"description": "Renewal resource (recurring fee) \"HDD\" for subscription #3007116 \"CSP monthly\"",
"unit_price": "15.0",
"amount": "0.48",
"status": "opened",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": "HDD",
"plan_resource_id": 4340,
"resource_id": 1454,
"order_id": 10570,
"operate_to": "2020-10-01",
"close_date": "2020-10-01",
"billing_date": "2020-10-01",
"additional_params": [],
"discount": "0.00",
"original_amount": "0.48",
"original_amount_currency": "EUR",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "600",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3007116",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "1598",
"type": "plans"
}
},
"discount": {
"data": null
}
}
}
],
"links": {
"self": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2020-08-01T10%3A00%3A00.000+03%3A00&filter%5Bcreated_at%5D%5Blt%5D=2020-11-01T10%3A00%3A00.000+03%3A00&filter%5Bstatus%5D=completed&include=charges&page%5Bnumber%5D=190&page%5Bsize%5D=2",
"first": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2020-08-01T10%3A00%3A00.000+03%3A00&filter%5Bcreated_at%5D%5Blt%5D=2020-11-01T10%3A00%3A00.000+03%3A00&filter%5Bstatus%5D=completed&include=charges&page%5Bnumber%5D=1&page%5Bsize%5D=2",
"prev": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2020-08-01T10%3A00%3A00.000+03%3A00&filter%5Bcreated_at%5D%5Blt%5D=2020-11-01T10%3A00%3A00.000+03%3A00&filter%5Bstatus%5D=completed&include=charges&page%5Bnumber%5D=189&page%5Bsize%5D=2",
"next": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2020-08-01T10%3A00%3A00.000+03%3A00&filter%5Bcreated_at%5D%5Blt%5D=2020-11-01T10%3A00%3A00.000+03%3A00&filter%5Bstatus%5D=completed&include=charges&page%5Bnumber%5D=191&page%5Bsize%5D=2",
"last": "https://test.activeplatform.com/api/v3/resellers/1/orders?filter%5Bcreated_at%5D%5Bgt%5D=2020-08-01T10%3A00%3A00.000+03%3A00&filter%5Bcreated_at%5D%5Blt%5D=2020-11-01T10%3A00%3A00.000+03%3A00&filter%5Bstatus%5D=completed&include=charges&page%5Bnumber%5D=191&page%5Bsize%5D=2"
}
}