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 |
---|---|---|---|---|
id | path | string | Optional | Order ID |
api_token | query | string | Required | API 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 | array | A list of items in the order:
|
charges | array | List of charges, which were created by the order:
|
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"
}
]
}