OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

Making a purchase

OpenTV Video Platform's Purchase Service enables the user to purchase products from the client app.

Request

To initiate a purchase, send a POST request to:

https://<host>:<port>/purchase_service/v1/user/product/actions/purchase

If PIN checking has been set up for purchases in your deployment, use version 2 of this request instead, which also takes the PIN that the user entered. See Making a purchase with a PIN.

Headers

  • Authorization – the client's access token, as a bearer token (Bearer <access token>). This is the access_token that the client gets when it signs in – see Authentication token. This header is mandatory.

  • Content-Type: application/json

Mandatory arguments

  • productId – the ID of the product to be purchased

Other arguments

None

Example

A POST request with this payload initiates the purchase of the product with the specified ID:

JSON
{
  "productId": "1234DFG5sd"
}

Response

A successful request returns an HTTP 201 status.

A bad request returns an HTTP 400 status.

An unauthorised request returns an HTTP 401 status.

A forbidden request returns an HTTP 403 status.

If the specified product does not exist, the request returns an HTTP 401 status ("errorCode": "3080").

See the Purchase Service API documentation for the specific error codes that are returned for the HTTP 4xx statuses.

Example

JSON
{
  "productId": "1234DFG5sd",
  "purchaseAuthRequestReference": "CRM_PARTNER_AUTH_REQUEST_REFERENCE/X-CORRELATION-ID"
}

See also