api:customer:customer-subscriptions
Table of Contents
API : CustomerSubscriptions List
Introduction
This request will return all the subscriptions for either a given a customer, or a reseller. The reseller subscriptions is a summary of all of their customers' subscriptions.
For customers, all subscriptions are grouped per product, so the overview will show Product X, its cost and price, and how many “subscribers”/accounts that use this product.
For resellers, the grouping works similarly, but it goes a level beyond that, and groups all products on their reseller product, then showing
Request
| URL | https://api.telecomx.dk/customer/subscriptions | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Query | customer | Id of the customer (24 hex-char string) |
| reseller | Id of the reseller. If given, it will show a reseller view instead of customer view (thus overruling the customer query parameter) | |
| format | Can be either CSV or JSON. If none is given, it will default to JSON. | |
Query example
https://api.telecomx.dk/customer/subscriptions?customer=1234567890ABCDEF12345678 https://api.telecomx.dk/customer/subscriptions?customer=1234567890ABCDEF12345678&format=csv https://api.telecomx.dk/customer/subscriptions?reseller=8211399890BBBDEF12345178 https://api.telecomx.dk/customer/subscriptions?reseller=8211399890BBBDEF12345178&format=csv
Response
| Array of the following JSON objects | ||
|---|---|---|
| matchingProduct | Object | Product object, containing normal product properties (see API : Product Get) |
| subscriptions | Array | Contains array of each subscription/account |
| subscriptions[].customer | ObjectId | Customer ID |
| subscriptions[].name | String | Product name if customer overview, customer name if reseller overview |
| subscriptions[].sumPrice | Number (decimal) | The price of these subscriptions |
| subscriptions[].sumWholesale | Number (decimal) | The wholesale price of these subscriptions |
| subscriptions[].units | Number (integer) | The amount of these subscriptions |
| accountType | String | The type of account |
| sumPrice | Number (decimal) | Sum price of all subscriptions |
| sumWholesale | Number (decimal) | Sum wholesale of all subscriptions |
| units | Number (integer) | Amount of subscriptions/units |
Note that properties holding no value may be omitted from the object.
Example
{ [ "matchingProduct": { ... }, "subscriptions": [ { "customer": "1ee67cd5785b63196225851b", "name": "Numberrent Supreme", "sumPrice": 200, "sumWholesale": 100, "units": 20 }, { "customer": "ff567cd5785b63196225851b", "name": "Numberrent Super Supreme", "sumPrice": 256.45, "sumWholesale": 170.20, "units": 1 } ], "sumPrice": 456.45, "sumWholesale": 370.20, "units": 21, "accountType": "NUMBER" ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | customer | Customer not found |
| 404 | reseller | Reseller not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/customer/customer-subscriptions.txt · Last modified: 2025/02/21 13:34 by Joakim Andersen