GET /api/vendor/v1/orders.json?api_token={api_token}
Arguments
| | | | |
---|
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 | Set the reversed sorting mode by the specified field: true — descending sorting.false — ascending sorting (by default).
|
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
| | |
---|
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:- id — item ID of the Order.
target_id — entity ID (service or additional resource), which is related to the item of the Order. target_type — an entity type, which is related to the item of the Order: type — internal item type of the Order: "ProvisioningItem::Upgrade" — increasing an amount of the subscription's resources. "ProvisioningItem::New" — new subscription. "ProvisioningItem::RegisterDomain" — domain registration. "ProvisioningItem::Renew" — renewal of the subscription. "ProvisioningItem::SwitchPlan" — changing a plan within the subscription. "ProvisioningItem::Downgrade" — decreasing an amount of the subscription's resources. "ProvisioningItem::TransferDomain" — transferring a domain. "ProvisioningItem::RegisterCertificate" — registration of the SSL-certificate.
status — current status of the Order item: - waiting for payment — Order has been placed by a customer, the payment is expected.
- provisioning — Order has been accepted, the service is provided.
- provisioning failed — Order has been accepted, but the service is not provided.
- completed — Order has been successfully processed.
- cancelled — Order has been cancelled by a customer.
description — brief description of the Order item.
|
charges | array | List of charges, which were created by the Order: - id — charge ID.
- subscription_id — subscription ID.
- subscription_resource_id — subscription's resource ID.
- subscription_resource_name — name of the subscription's resource.
- plan_resource_id — ID of the plan resource.
- resource_id — resource ID.
- quantity — total quantity of the ordered resources.
- operate_from — begin date of the paid period.
- operate_to — end date of the paid period.
- duration — fraction of the paid period of the month.
- description — detailed information about the charge.
- unit_price — price of the unit of the service.
- amount — amount of the charge.
- status — current status of the charge:
- new — charge was created.
- opened — charge was created, but the funds weren't blocked and weren't writing off from the account balance (for CSP subscriptions).
- blocked — charge was created, but wasn't paid, funds were blocked on the account balance.
- waiting for a refund — user performed the operation that must be approved by the manager in order to make a refund.
- closed — funds were written off from the account balance.
- deleted — change was deleted.
- refunded — funds have been successfully returned to the account balance.
- waiting for approve — user performed the operation that must be approved by a manager.
- type — internal class of charge:
- "Charge::Setup" — charge for the subscription setup.
- "Charge::Recurring" — charge for the recurring fee of the subscription.
- "Charge::Renewal" — charge for the renewing of the subscription.
- "Charge::RecurringResource" — charge for the recurring fee of the subscription's resource.
- "Charge::SetupResource" — charge for the setup of the subscription's resource.
- "Charge::Transfer" — charge for the domain transferring.
- order_id — Order ID, for which the charge is related.
- close_date — date when the charge will be closed.
- created_at — date and time of the charge creation.
- updated_at — date and time when the charge was updated last time.
|
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": []
}
]