Get the List of Orders
The Get List of Orders method returns the list of Orders.
The list of Orders can be shown page by page. To split by page, the following Arguments should be passed:
- The page number (page).
- The amount of items per page (per_page).
The list of Orders can be sorted by any field. To sort the list of Orders the following Arguments should be passed:
- The field name that is used for sorting (sorting[field]).
- The sort direction (sorting[reversed]):
true
— the list will be sorted in descending direction.false
— the list will be sorted in ascending direction (by default).
The list of Orders can be filtered by:
- Creation date (filters[created_at]).
- Update date (filters[updated_at]).
- Account id (filters[account_id]).
- Type (filters[type]).
- Status (filters[status]).
GET /api/vendor/v1/orders.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/ | Description |
---|---|---|---|---|
page | query | integer | Optional | Returning a list of orders by current page number |
per_page | query | integer | Optional | Setting a number of items in the page |
sorting[field] | query | string | Optional | Sorting the list by a specified field |
sorting[reversed] | query | string | Optional | Setting the sorting mode:
|
filters[created_at] | query | date | Optional | Filtering the list by a creation date |
filters[updated_at] | query | date | Optional | Filtering the list by an update date |
filters[account_id] | query | integer | Optional | Filtering the list by an account ID |
filters[type] | query | string | Optional | Filtering the list by an account ID |
filters[status] | query | string | Optional | Filtering the list by a status |
Response model
Name | Data type | Description |
---|---|---|
id | integer | Order ID |
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 |
created_at | date | Date and time of the Order creation |
updated_at | date | Date and time when the Order was changed last time |
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 in the ActivePlatform. Operator Control Panel) |
total | float | Total amount of the Order |
promo_code | string | Promo code, which was used to get the discount (see Managing promo codes in the ActivePlatform. Operator Control Panel) |
payment_id | integer | Payment ID, which is linked to the Order |
items | array | List of items in the Order:
|
charges | array | List of charges, which were created by the Order:
|
Request example
GET http://billing.activeplatform.com:80/api/vendor/v1/orders.json?api_token=654321
Response example
[
{
"id": 2000219,
"document_id": "SO000002",
"status": "cancelled",
"account_id": 2000036,
"type": "SalesOrder",
"created_at": "2014-12-01T17:28:15.942+03:00",
"updated_at": "2014-12-15T01:00:29.505+03:00",
"expiration_date": "2014-12-15",
"total": "0.0",
"promo_code": null,
"payment_id": null,
"items": [
{
"id": 4203,
"target_id": 2000173,
"target_type": "Subscription",
"type": "ProvisioningItem::New",
"status": "cancelled",
"description": "iMind"
}
],
"charges": []
}
]