Update an Order

This method updates an Order by the given Order ID.

PUT /api/vendor/v1/orders/{id}.json?api_token={api_token}

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

idpathstringOptionalOrder ID
api_tokenquerystringRequiredAPI token of the manager who perform the operation (see API Token Authentication)

payment_id

form

integer

Required

Payment ID

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 Plan Class (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

arrayA 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 — entity type, which is related to the item of the Order:

    • Subscription — subscription.

    • SubscriptionResource — additional resource of the subscription.

  • 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's 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

PUT http://billing.activeplatform.com:80/api/vendor/v1/orders/2010543.json?api_token=654321
{  
 "payment_id": 2007029
}

Response example

 {
  "id": 2010543,
  "document_id": "SO005309",
  "status": "waiting_for_payment",
  "account_id": 2000532,
  "type": "SalesOrder",
  "created_at": "2016-10-04T09:48:36.979+03:00",
  "updated_at": "2016-10-04T10:04:25.066+03:00",
  "expiration_date": "2016-10-04",
  "total": 0.14,
  "promo_code": null,
  "payment_id": 2007029,
  "items": [
    {
      "id": 16850,
      "target_id": 2006205,
      "target_type": "Subscription",
      "type": "ProvisioningItem::New",
      "status": "waiting_for_payment",
      "description": "MSExPlan"
    }
  ],
  "charges": [
    {
      "id": 754717,
      "subscription_id": 2006205,
      "subscription_resource_id": null,
      "subscription_resource_name": null,
      "plan_resource_id": null,
      "resource_id": null,
      "quantity": 1,
      "operate_from": "2016-12-01",
      "operate_to": "2017-01-01",
      "duration": 1,
      "description": "Purchasing Plan (recurring fee) #2006205 \"MSExPlan\"",
      "unit_price": 0.03,
      "amount": 0.03,
      "status": "new",
      "type": "Charge::Recurring",
      "order_id": 2010543,
      "close_date": "2017-01-01",
      "created_at": "2016-10-04T09:48:37.394427+0300",
      "updated_at": "2016-10-04T09:48:37.394427+0300"
    },
    {
      "id": 754716,
      "subscription_id": 2006205,
      "subscription_resource_id": null,
      "subscription_resource_name": null,
      "plan_resource_id": null,
      "resource_id": null,
      "quantity": 1,
      "operate_from": "2016-11-01",
      "operate_to": "2016-12-01",
      "duration": 1,
      "description": "Purchasing Plan (recurring fee) #2006205 \"MSExPlan\"",
      "unit_price": 0.03,
      "amount": 0.03,
      "status": "new",
      "type": "Charge::Recurring",
      "order_id": 2010543,
      "close_date": "2016-12-01",
      "created_at": "2016-10-04T09:48:37.362625+0300",
      "updated_at": "2016-10-04T09:48:37.362625+0300"
    },
    {
      "id": 754715,
      "subscription_id": 2006205,
      "subscription_resource_id": null,
      "subscription_resource_name": null,
      "plan_resource_id": null,
      "resource_id": null,
      "quantity": 1,
      "operate_from": "2016-10-04",
      "operate_to": "2016-11-01",
      "duration": 0.903,
      "description": "Purchasing Plan (recurring fee) #2006205 \"MSExPlan\"",
      "unit_price": 0.03,
      "amount": 0.03,
      "status": "new",
      "type": "Charge::Recurring",
      "order_id": 2010543,
      "close_date": "2016-11-01",
      "created_at": "2016-10-04T09:48:37.331884+0300",
      "updated_at": "2016-10-04T09:48:37.331884+0300"
    },
    {
      "id": 754714,
      "subscription_id": 2006205,
      "subscription_resource_id": null,
      "subscription_resource_name": null,
      "plan_resource_id": null,
      "resource_id": null,
      "quantity": 1,
      "operate_from": "2016-10-04",
      "operate_to": "2017-01-04",
      "duration": 1,
      "description": "Purchasing Plan (setup fee) #2006205 \"MSExPlan\"",
      "unit_price": 0.05,
      "amount": 0.05,
      "status": "new",
      "type": "Charge::Setup",
      "order_id": 2010543,
      "close_date": "2016-11-01",
      "created_at": "2016-10-04T09:48:37.227973+0300",
      "updated_at": "2016-10-04T09:48:37.227973+0300"
    }
  ]
}