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/ 
Optional

Description

api_tokenquerystringRequiredAPI token of the manager who performs the operation (see API Token Authentication)

account_id

form

integer

Required

Account ID

payment_modelformstringRequired

Payment model for the ordered Subscription:

  • prepay
  • postpay
subscription_credit_limit_use_systemformboolOptional

Sets whether the default Subscription credit limit is used for the ordered Subscription:

  • true — the Order uses the Subscription credit limit value that is set in the Account class or redefined on the Account level.
  • false — the Order uses the Subscription credit limit value that is redefined on the Subscription level.

For postpaid Subscriptions only (payment_model = postpay)

subscription_credit_limitformfloatOptionalThe 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)
promocodeformstringOptionalA promo code to get the discount (see Managing promo codes in the ActivePlatform. Operator Control Panel)

items

form

array

Required

Order items


plan_idformintegerRequiredPlan ID


plan_period_id

form

integer

Required

Plan period ID


resources

form

array

Optional

Ordered Resources



idformintegerOptionalResource ID



quantity

form

integer

Optional

Resource amount


certificate_infoformstringOptionalCertificate information. Used for ordering Certificate Subscriptions only (see Ordering an SSL certificate subscription)


approver_emailformstringOptionalEmail of the employee responsible for approving all requests for certificates


server_typeformstringOptionalType of the server that will use the SSL certificate


positionformstringOptionalPosition of the employee responsible for approving all requests for certificates


domainformstringOptionalFully qualified domain name (FQDN) of the server. It should exactly match the domain or subdomain name


csrformstringOptionalPreliminary generated Certificate request (CSR)

nameformstringOptionalDomain name. Used for ordering Domain Subscriptions only (see Ordering domain subscription)


additional_params

form

array

Optional

Additional parameters of the Order



idformintegerOptionalParameter 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

arrayOrder items

idintegerItem ID

target_idintegerID of the entity (Subscription or Resources) that is linked to the Order item

target_typestring

Type of the entity that is linked to the Order item:

  • Subscription.

  • SubscriptionResource


typestring

Item type:

  • ProvisioningItem::Upgrade — increasing amount of the Subscription Resource.

  • ProvisioningItem::New — new Subscription.

  • ProvisioningItem::RegisterDomain — domain registration.

  • ProvisioningItem::Renew — renewal of the Subscription.

  • ProvisioningItem::SwitchPlan — changing Plan Period of the Subscription.

  • ProvisioningItem::Downgradedecreasing amount of the Subscription Resource.

  • ProvisioningItem::TransferDomain — domain transferring.

  • ProvisioningItem::RegisterCertificate — SSL certificate registration.


statusstring

Item status:

  • 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.

descriptionstringA brief description of the Order item

charges

array

List of the Charges that are linked to the Order (see Charges)


idintegerCharge ID

subscription_idintegerSubscription ID

subscription_resource_idintegerSubscription Resource ID

subscription_resource_namestringSubscription Resource name

plan_resource_idintegerPlan Resource ID

resource_idintegerResource ID

quantityintegerOrdered quantity of the Resource

operate_fromdateStart date of the paid period in the YYYY-MM-DD format

operate_todateEnd date of the paid period in the YYYY-MM-DD format

durationfloatFraction of the paid period of the month

descriptionstringDetailed information about the Charge

unit_pricefloatUnit price

amountfloatAmount of Charge

statusstringCharge status:
  • new — the Charge was created.
  • openedthe Charge was created, but the funds were not blocked on the Account balance (for CSP Subscriptions).
  • blockedthe Charge was created, and the funds were blocked on the Account balance.
  • waiting for a refunda customer performed an operation that must be approved manually by the manager to make a refund.
  • closed — the funds were charged off from the Account balance.
  • deletedthe Charge was deleted.
  • refundeda customer performed an operation that successfully returned the funds to the Account balance
  • waiting for approve — a customer performed the operation that must be approved manually by a manager.

typestringCharge type:
  • Charge::SetupSubscription setup Charge.
  • Charge::RecurringSubscription Recurring fee Charge.
  • Charge::RenewalSubscription renewal Charge.
  • Charge::RecurringResourceResource Recurring fee Charge.
  • Charge::SetupResourceResource setup Charge.
  • Charge::Transfer — domain transferring Charge.

order_idintegerID of the Order that is linked to the Charge

close_datedateDate when the Charge will be closed in the YYYY-MM-DD format

created_atdateDate and time of the Charge creation

updated_atdateDate 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": []
      }
  ]
}
POST /api/vendor/v1/orders.json?api_token=vY5fwetestK3gJXZH5uHCw
{
"account_id": 1,
"payment_model": "prepay",
"items": [ { "plan_id": 6, "plan_period_id": 2, "name": "example.com" }]
}
POST /api/vendor/v1/orders.json?api_token=vY5fwetestK3gJXZH5uHCw
{
 "account_id":513,
   "payment_model":"postpay",
   "items":[
      {
         "plan_id":21,
         "plan_period_id":112,
         "resources":[          ],
         "certificate_info":{
            "approver_email":"admin@example.com",
            "server_type":"apachessl",
            "position":"CEO",
            "domain":"*.example.com",
            "csr":"-----BEGIN CERTIFICATE REQUEST-----\cTBk1vc2NvdzERMA8GA1UECgwITmV3T3JkZXIxETAPBgNVBAsMCEdGREZnc2ZnMSUwIwYDVQQDDBwqLnRlc3Q0NTY3OC5hcC10ZXN0LXRlYW0uY29tMRowGAYJKoZIhvcNAQkBDAtkZXBAZml4LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ2pW5mo+m69bm/giMcBJE3IyUwtMFj8nJQhp6PmkXZfO2I7R4MNS0pHvfTe8A+Pj40W8AlbWdEDdN+8E9LrFjUhrB6TCx9V1oxHF7m96auAieiPpZ0Az9hmm4fpBzGoVqAqjf5MJBW7z2aeUecjLtoUz3xZ8foTG5cy9J0GvgUko5fuQLIzmYpyZmKDzFaPSDgf9kchI0+emh0ebcMGvAolAIHr9B+jMlsh7YfBjd1kBmAa/1K4TjD8XLs1cJpQu84wwwSa4d9cUCv/ETi7COGorQpBFUJ2LZ1/JD//6Rh9h5ZZ3rq+ZIeVeKhJIPO7N+dc/W7PLNXdasD/di8ifnsCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQB5W0X687TC8gnNjOAOStMbNt0kKpBIzHNiOtlUBMB2tVaJjfAcsiXmOoqXyHKbPUZ8Ac+leNlQkqtGnkHUU5jX1RQAp9DqVQhyi3c0xbIMn2HEd5s0cD269cJGAdh/u2UPKNPM46N642scB/sqObI18fozOLF7DPoPSJPYgJ56C5RAbNdbxTFT4O9BlT5Goeypck3J986dFUQi32Gs9kEdWQyFo2Q3dMio5gSATHofxi5pBcmsiPoKOH1aZL+wtAABd8HWaEEOypRR4ejuopijnLPrqhke0z+7DfLriIFvXU8aBpGoG7253ftjUA5xYADkg1Ft35nARt7qeZomJD+q\n-----END CERTIFICATE REQUEST-----"
         }
      }
   ]
}

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"
        }
    ]
}