Skip to main content
Skip table of contents

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:

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

Headers

  • authorization – bearer token that the client received at signon
  • nv-tenant-id – the tenant ID

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:

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

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

Example

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

See also

JavaScript errors detected

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

If this problem persists, please contact our support.