Skip to main content
Skip table of contents

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 account
  • deviceID (in body) – the ID of the device
  • originId – the ID of the system generating the request
  • items (there can be one or more items):
    • productId – the ID of the product being purchased
You can specify the total price for the products being ordered as part of the request (in the 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):

CODE
{
  "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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.