Create an Order
The Create an Order method is used to create a new Order.
Restrictions of the method
The Create an Order method cannot be used for ordering Subscriptions to services that require specifying additional parameters (for example, Microsoft services and G Suite).
The Create an Order method does not generate the Certificate request (CSR) and Private key that are required for ordering an SSL Certificate Subscription (see Ordering an SSL certificate subscription). For successful provisioning of the ordered Subscription, additional tools for integration are required.
POST /api/vendor/v1/orders.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/ | Description | ||
---|---|---|---|---|---|---|
api_token | query | string | Required | API token of the manager who performs the operation (see API Token Authentication) | ||
account_id | form | integer | Required | Account ID | ||
payment_model | form | string | Required | Payment model for the ordered Subscription:
| ||
subscription_credit_limit_use_system | form | bool | Optional | Sets whether the default Subscription credit limit is used for the ordered Subscription:
For postpaid Subscriptions only (payment_model = postpay) | ||
subscription_credit_limit | form | float | Optional | The value of the Subscription credit limit that is redefined on the Subscription level (subscription_credit_limit_use_system = false). For postpaid Subscriptions only (payment_model = postpay) | ||
promocode | form | string | Optional | A promo code to get the discount (see Managing promo codes in the ActivePlatform. Operator Control Panel) | ||
items | form | array | Required | Order items | ||
plan_id | form | integer | Required | Plan ID | ||
plan_period_id | form | integer | Required | Plan period ID | ||
resources | form | array | Optional | Ordered Resources | ||
id | form | integer | Optional | Resource ID | ||
quantity | form | integer | Optional | Resource amount | ||
certificate_info | form | string | Optional | Certificate information. Used for ordering Certificate Subscriptions only (see Ordering an SSL certificate subscription) | ||
approver_email | form | string | Optional | Email of the employee responsible for approving all requests for certificates | ||
server_type | form | string | Optional | Type of the server that will use the SSL certificate | ||
position | form | string | Optional | Position of the employee responsible for approving all requests for certificates | ||
domain | form | string | Optional | Fully qualified domain name (FQDN) of the server. It should exactly match the domain or subdomain name | ||
csr | form | string | Optional | Preliminary generated Certificate request (CSR) | ||
name | form | string | Optional | Domain name. Used for ordering Domain Subscriptions only (see Ordering domain subscription) | ||
additional_params | form | array | Optional | Additional parameters of the Order | ||
id | form | integer | Optional | Parameter ID | ||
value | form | Depends on the parameter | Optional | Parameter value |
Response model
Name | Data type | Description | |
---|---|---|---|
id | integer | Order ID | |
document_id | string | Order number | |
status | string | Order status. For the list of statuses, see Viewing order details | |
account_id | integer | Account ID | |
type | string | Order type. For the list of Order types, see Managing an order | |
created_at | date | Date and time of the Order creation | |
closed_at | date | Date and time when the Order was closed | |
expiration_date | date | The date when the unpaid Payment gets the Expired status. The date is calculated using the Payment expiration period from the Account class (see Creating an account class) | |
total | float | Total amount of the order | |
promo_code | string | A promo code to get the discount | |
payment_id | integer | ID of the Payment that is linked to the Order | |
items | array | Order items | |
id | integer | Item ID | |
target_id | integer | ID of the entity (Subscription or Resources) that is linked to the Order item | |
target_type | string | Type of the entity that is linked to the Order item:
| |
type | string | Item type:
| |
status | string | Item status:
| |
description | string | A brief description of the Order item | |
charges | array | List of the Charges that are linked to the Order (see Charges) | |
id | integer | Charge ID | |
subscription_id | integer | Subscription ID | |
subscription_resource_id | integer | Subscription Resource ID | |
subscription_resource_name | string | Subscription Resource name | |
plan_resource_id | integer | Plan Resource ID | |
resource_id | integer | Resource ID | |
quantity | integer | Ordered quantity of the Resource | |
operate_from | date | Start date of the paid period in the YYYY-MM-DD format | |
operate_to | date | End date of the paid period in the YYYY-MM-DD format | |
duration | float | Fraction of the paid period of the month | |
description | string | Detailed information about the Charge | |
unit_price | float | Unit price | |
amount | float | Amount of Charge | |
status | string | Charge status:
| |
type | string | Charge type:
| |
order_id | integer | ID of the Order that is linked to the Charge | |
close_date | date | Date when the Charge will be closed in the YYYY-MM-DD format | |
created_at | date | Date and time of the Charge creation | |
updated_at | date | Date and time when the Charge was updated |
Request example
POST /api/vendor/v1/orders.json?api_token=vY5fwetestK3gJXZH5uHCw
{
"account_id": 505,
"payment_model": "postpay",
"subscription_credit_limit_use_system": false,
"subscription_credit_limit": 1500.0,
"items": [
{
"plan_id": 1376,
"plan_period_id": 2529,
"resources": [
{
"id": 4057,
"quantity": 1
}
],
"additional_params": []
}
]
}
Response example
{
"id": 8082,
"document_id": "SO004723",
"status": "provisioning",
"account_id": 505,
"type": "SalesOrder",
"created_at": "2019-10-19T10:27:59.142+03:00",
"closed_at": null,
"expiration_date": "2019-11-01",
"total": "0.42",
"promo_code": null,
"payment_id": null,
"items": [
{
"id": 12138,
"target_id": 3005691,
"target_type": "Subscription",
"type": "ProvisioningItem::New",
"status": "waiting_for_payment",
"description": "Csp endless"
},
{
"id": 12139,
"target_id": 30292,
"target_type": "SubscriptionResource",
"type": "ProvisioningItem::Upgrade",
"status": "waiting_for_payment",
"description": "Chill"
}
],
"charges": [
{
"id": 73511,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-10-01",
"operate_to": "2020-10-18",
"duration": 0.581,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "0.58",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-10-31",
"created_at": "2019-10-19T10:27:59.918855+0300",
"updated_at": "2019-10-19T10:27:59.918855+0300"
},
{
"id": 73510,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-09-01",
"operate_to": "2020-09-30",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-09-30",
"created_at": "2019-10-19T10:27:59.912897+0300",
"updated_at": "2019-10-19T10:27:59.912897+0300"
},
{
"id": 73509,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-08-01",
"operate_to": "2020-08-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-08-31",
"created_at": "2019-10-19T10:27:59.906015+0300",
"updated_at": "2019-10-19T10:27:59.906015+0300"
},
{
"id": 73508,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-07-01",
"operate_to": "2020-07-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-07-31",
"created_at": "2019-10-19T10:27:59.897296+0300",
"updated_at": "2019-10-19T10:27:59.897296+0300"
},
{
"id": 73507,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-06-01",
"operate_to": "2020-06-30",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-06-30",
"created_at": "2019-10-19T10:27:59.890144+0300",
"updated_at": "2019-10-19T10:27:59.890144+0300"
},
{
"id": 73506,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-05-01",
"operate_to": "2020-05-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-05-31",
"created_at": "2019-10-19T10:27:59.882115+0300",
"updated_at": "2019-10-19T10:27:59.882115+0300"
},
{
"id": 73505,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-04-01",
"operate_to": "2020-04-30",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-04-30",
"created_at": "2019-10-19T10:27:59.872124+0300",
"updated_at": "2019-10-19T10:27:59.872124+0300"
},
{
"id": 73504,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-03-01",
"operate_to": "2020-03-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-03-31",
"created_at": "2019-10-19T10:27:59.862073+0300",
"updated_at": "2019-10-19T10:27:59.862073+0300"
},
{
"id": 73503,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-02-01",
"operate_to": "2020-02-29",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-02-29",
"created_at": "2019-10-19T10:27:59.852040+0300",
"updated_at": "2019-10-19T10:27:59.852040+0300"
},
{
"id": 73502,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2020-01-01",
"operate_to": "2020-01-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2020-01-31",
"created_at": "2019-10-19T10:27:59.840842+0300",
"updated_at": "2019-10-19T10:27:59.840842+0300"
},
{
"id": 73501,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2019-12-01",
"operate_to": "2019-12-31",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2019-12-31",
"created_at": "2019-10-19T10:27:59.828518+0300",
"updated_at": "2019-10-19T10:27:59.828518+0300"
},
{
"id": 73500,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2019-11-01",
"operate_to": "2019-11-30",
"duration": 1.0,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2019-11-30",
"created_at": "2019-10-19T10:27:59.815670+0300",
"updated_at": "2019-10-19T10:27:59.815670+0300"
},
{
"id": 73499,
"subscription_id": 3005691,
"subscription_resource_id": 30292,
"subscription_resource_name": "Chill",
"plan_resource_id": 4057,
"resource_id": 1504,
"quantity": 1.0,
"operate_from": "2019-10-19",
"operate_to": "2019-10-31",
"duration": 0.419,
"description": "Upgrade resource (recurring fee) \"Chill\" for Subscription #3005691 \"Csp endless\"",
"unit_price": "1.0",
"amount": "0.42",
"status": "new",
"type": "Charge::Recurring",
"order_id": 8082,
"close_date": "2019-10-31",
"created_at": "2019-10-19T10:27:59.799305+0300",
"updated_at": "2019-10-19T10:27:59.799305+0300"
}
]
}