Get customer subscriptions
GET
/merchants/{merchantCode}/customers/{customerId}/subscriptions
const url = 'https://customer.shopgate.io/v1/merchants/example/customers/example/subscriptions?sort=null&limit=100&offset=0';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://customer.shopgate.io/v1/merchants/example/customers/example/subscriptions?sort=null&limit=100&offset=0'Get customer subscriptions
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
customerId
required
string
Query Parameters
Section titled “Query Parameters”filters
string
Filter for
- status
- subscriptionType
sort
string
Comma-separated list of fields to sort by and sort directions, separated by a colon each (e.g. field1:asc,field2:desc).
limit
integer
The limit of entries of one page
offset
integer
The offset where to start the page
Responses
Section titled “Responses”Media typeapplication/json
object
subscriptions
Array<object>
object
code
Subscription code. This needs to be unique within every user
string
subscriptionType
Type of subscription
string
entityType
The entity for which the subscription should be created
string
entityId
Id of the referenced entity, depending on entity type
string
status
string
params
Additional subscription properties
object
key
additional properties
any
createDate
string format: date-time
meta
object
limit
number
offset
number
totalItemCount
number
Example
{ "meta": { "limit": 100, "offset": 0, "totalItemCount": 1 }, "subscriptions": [ { "code": "default", "subscriptionType": "productInventoryRestocked", "entityType": "product", "entityId": "p1", "status": "active", "params": { "productName": "Example product", "imageUrl": "https://www.shopgate.com/hs-fs/hubfs/Schloss_IIII.jpeg?width=1200&height=900&name=Schloss_IIII.jpeg" }, "createDate": "2019-10-03T16:01:13.582Z" } ]}Access denied
Media typeapplication/json
object
code
Machine readable error code
string
message
required
Human readable error code
string
Examplegenerated
{ "code": "example", "message": "example"}Merchant or Customer not found
Media typeapplication/json
default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
Machine readable error code
string
message
required
Human readable error code
string
Examplegenerated
{ "code": "example", "message": "example"}
