riverty logo

Docs

Get Customer or Subscription Related Consumptions

Get customer consumptions - a list of consumptions for customer.

Path

GET /v1/clients/{clientId}/consumptions

Request Parameters

clientId
required
integer
Your assigned `ClientId`.
customerNumber
required
string
Customer number.
subscriptionId
string
Id of the subscription.

Responses

Successful RequestUnsuccessful Request, Incorrect/Missing Information

Request Example

    
        null
    

Response Example

    
        [
 {
  "consumptionTotal": {
   "grossAmount": 125,
   "vatAmount": 25,
   "currencyCode": "NOK"
  },
  "refundTotal": {
   "grossAmount": 25,
   "vatAmount": 25,
   "currencyCode": "NOK"
  },
  "id": "consumption-id-1",
  "customerNumber": "customer-number-1",
  "subscriptionId": "subscription-id",
  "invoiceId": "100484",
  "items": [
   {
    "id": "1",
    "productDetails": {
     "productId": "pack-2gb",
     "description": "2gb data pack."
    },
    "unit": {
     "netPrice": 100,
     "quantity": 1,
     "code": "PCS",
     "currencyCode": "NOK"
    },
    "total": {
     "grossAmount": 125,
     "netAmount": 100,
     "currencyCode": "NOK",
     "vatPercentage": 25
    },
    "occurredAt": {
     "start": "2022-09-28T10:40:44.421Z",
     "end": null
    },
    "metadata": [
     {
      "key": "product-number",
      "value": "3937501"
     }
    ]
   }
  ],
  "createdAt": "2022-09-28T10:40:44.421Z",
  "billingDate": null,
  "metadata": [
   {
    "key": "order-id",
    "value": "a9ee9996-e941-4aa8-90b9-4b047c4afe87"
   }
  ],
  "_links": [
   {
    "method": "GET",
    "href": "https://api.riverty.io/subscription/v1/clients/1234/consumptions/consumption-id-1",
    "rel": "self",
    "target": "API"
   },
   {
    "method": "GET",
    "href": "https://api.riverty.io/subscription/v1/clients/1234/consumptions/consumption-id-1/timeline",
    "rel": "timeline",
    "target": "API"
   },
   {
    "method": "GET",
    "href": "https://api.riverty.io/subscription/v1/clients/1234/subscriptions/subscription-id-1",
    "rel": "subscription",
    "target": "API"
   }
  ]
 }
]