Skip to content

/get_product_sharing

/products/get_product_sharing

Target audience: Developers

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

Required scope

1
/external/product/r

Parameters

Name Description
id The id of the sharing
code Product code

Curl Example

Get by id

1
2
3
4
curl --request POST \
  --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

1
2
3
4
curl --request POST \
  --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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
HTTP 200
{
  "item": [
    {
      "shareable": false,
      "limit": 0,
      "sharing_text": nil,
      "sharing_title": nil,
      "received_product_text": nil,
      "received_product_title": nil
    }
  ]
}

Errors

Example error response

1
2
3
4
5
6
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