Make an impulse purchase for a customer
Request
To make a purchase of a product ("impulse order") on behalf of a customer (for example, when a customer makes a purchase by phone), send a POST request to:
http://<host>:<port>/orders/operator/v1/account/{accountId}/orders
Mandatory fields
accountId
(in URL) – the ID of the customer accountdeviceID
(in body) – the ID of the deviceoriginId
– the ID of the system generating the requestitems
(there can be one or more items):productId
– the ID of the product being purchased
finalPrice
field), for example, to give the customer a discount. If you do not supply a total price, the regular, defined prices for the products are used.
For all available fields, see Orders API documentation.
Example
A request with this payload purchases the specified product on behalf of the user (whose account ID is specified in the URL):
{
"deviceId": "iPhone-123456789",
"originId": "MPP",
"finalPrice": 0,
"items": [
{
"productId": "2f5339bd-e915-4c32-b377-acc488974b35"
}
]
}
Response
A successful request returns an HTTP 201 status. The response includes the complete order object.
An unsuccessful request returns an HTTP 400 status if there was a problem with the request.
An unauthorised request returns an HTTP 401 status.
See also
For full details of this API, see Orders API documentation.