Create order
Use the POST /v3/customers/<customer-id>/orders endpoint to place an order for a customer. Read more about scenarios where an order is created.
Assumptions
Ensure that you are aware of the following before creating an offer details:
-
orderTypeis required in the Create Order request.- Possible values are: NEW, RETURN, PREVIEW, PREVIEW_RENEWAL, or RENEWAL
-
subscriptionIdis mandatory in lineitems for:orderTypeRENEWALorderTypePREVIEW_RENEWAL if lineitems are present
-
referenceOrderIdis required for RETURN orders and should not be included for other order types. -
currencyCodeshould now be sent at the lineItem-level instead of order level.- For backwards compatability,
currencyCodecan still be sent at the order level.
- For backwards compatability,
-
The
discountCodeis applicable only to High Volume Discount customers who have migrated from VIP to VIP MP. You can use the discount code only if their discount level in VIP is between 17 and 22. -
flexDiscountCodescan be used in the request to apply Flexible Discounts for customers who meet the eligibility criteria. For additional details, see Managing Flexible Discounts.
Request header
Bearer <token>Request Body
Order resource without read-only fields:
{
"externalReferenceId": "759", // (optional)
"currencyCode": "USD", // (to be deprecated, use lineItem currencyCode)
"orderType": "NEW | RETURN | PREVIEW | PREVIEW_RENEWAL | RENEWAL",
"referenceOrderId": "", // (for returns only)
"lineItems": [
{
"extLineItemNumber": 4,
"offerId": "80004567EA01A12",
"quantity": 1,
"currencyCode": "USD",
"deploymentId": "12345",
"discountCode": "HVD_L18_PRE",
},
],
}
Response body
{
"externalReferenceId": "759",
"orderId": "0123456789",
"customerId": "9876543210",
"orderType": "NEW",
"referenceOrderId": "",
"currencyCode": "USD",
"creationDate": "2019-05-02T22:49:54Z",
"status": "1002",
"source": "API",
"lineItems": [
{
"extLineItemNumber": 4,
"offerId": "80004567EA01A12",
"quantity": 1,
"subscriptionId": "",
"status": "1002",
"currencyCode": "USD",
"deploymentId": "12345"
}
],
"links": {
"self": {
"uri": "/v3/customers/9876543210/orders/0123456789",
"method": "GET",
"headers": []
}
}
}