Get shared subscriptions
/accounts/shared_subscriptions
Target audience: Developers
Get shared subscriptions¶
Introduction¶
This endpoint will return all shared subscriptions for an account with receivers id, contact email and the shared user product id.
Optional, if user_product_id is given it will return receivers id, contact email and the specific user product id that was given.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v1/accounts/shared_subscriptions |
Production | https://backend.worldoftulo.com/external/api/v1/accounts/shared_subscriptions |
Requirements¶
Identity | Scope |
---|---|
No | /external/account/w |
Parameters¶
Name | Required | Type | Description |
---|---|---|---|
id | Required | String | The id of the account to get information about. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
user_product_id | Optional | String | The id of the user product, optional. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
Curl Example¶
curl --request GET \
--url https://payway-api.stage.adeprimo.se/external/api/v1/accounts/shared_subscriptions?id \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'authorization: Bearer <token>' \
--data '{
"id": "585a4768edce2c5e6f000001"
}'
Response¶
Example response: Without user_product_id¶
HTTP 200
{
"items": [
{
"account_id": "5c6291d537c2ed78a11518b7",
"product_sharing_id": "5c6291d537c2ed78a11518bf",
"state": "active",
"contact_email": "receiver1@accepted.com",
"user_product_id": "5c6291d537c2ed78a11518a3",
"sharing_limit": 2
},
{
"account_id": "5c6291d537c2ed78a11518bb",
"product_sharing_id": "5c6291d537c2ed78a1151349",
"state": "pending",
"contact_email": "receiver2@accepted.com",
"user_product_id": "5c6291d537c2ed78a11518a3",
"sharing_limit": 2
},
{
"account_id": "5c6291d537c2ed78a11518bb",
"product_sharing_id": "5c6291d537c2ed78a11518c0",
"state": "active",
"contact_email": "receiver2@accepted.com",
"user_product_id": "5c4870b037c2ed8581431300",
"sharing_limit": 1
}
]
}
Example response: With user_product_id¶
HTTP 200
{
"items": [
{
"account_id": "5c6291d537c2ed78a11518b7",
"product_sharing_id": "5c6291d537c2ed78a11456ec",
"state": "active",
"contact_email": "receiver1@accepted.com",
"user_product_id": "5c6291d537c2ed78a11534e9",
"sharing_limit": 2
},
{
"account_id": "5c6291d537c2ed78a11518bb",
"product_sharing_id": "5c6291d537c2ed78a11534c0",
"state": "active",
"contact_email": "receiver2@accepted.com",
"user_product_id": "5c6291d537c2ed78a11534e9",
"sharing_limit": 2
}
]
}
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 |
---|---|---|
unknown_parameter | Object | One or more parameters was not recognized |
HTTP 404 Not Found¶
Name | Type | Description |
---|---|---|
not_found | Object | The account could not be found |
HTTP 500 Internal Server Error¶
Name | Type | Description |
---|---|---|
internal_server_error | Object | Something unexpected happened server side |