Skip to content

Get product sharing

/products/get_product_sharing

Target audience: Developers

Get product sharing option

Introduction

This endpoint returns the sharing option for a product.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/products/get_product_sharing
Production https://backend.worldoftulo.com/external/api/v1/products/get_product_sharing

Requirements

Identity Scope
No /external/product/r

Parameters

Name Description
id The id of the sharing
code Product code

Curl Example

Get by id

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products/get_product_sharing?id=52a781d6400e06897c00000f \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <token>' \

Get by product code

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products/get_product_sharing?code=adeprimo_digital \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <token>' \

Response

Successful response

HTTP 200
{
  "item": [
      {
          "shareable": true,
          "limit": 2,
          "sharing_text": "Description of the sharing",
          "sharing_title": "Title of the sharing",
          "received_product_text": "Description of the product",
          "received_product_title": "Title of the product"
      }
  ]
}

Not shareable response

HTTP 200
{
  "item": [
    {
      "shareable": false,
      "limit": 0,
      "sharing_text": null,
      "sharing_title": null,
      "received_product_text": null,
      "received_product_title": null
    }
  ]
}

Errors

Example error response

HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "account_id",
    "message": "Parameter must match format (/^[a-f\d]{24}$/)"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the posted json
json_parser_error Object The request body could not be parsed as valid json
invalid_content_type_error Object The requests Content-Type header isn't set to application/json
unknown_parameter Object One or more of the fields in the posted json was not recognized

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side