Create or update a consumption.
PUT /v1/clients/{clientId}/consumptions/{consumptionId}
application/json
{
"customerNumber": "customer-number-1",
"subscriptionId": "subscription-id-1",
"items": [
{
"id": "1",
"productDetails": {
"productId": "pack-2gb",
"description": "2gb data pack."
},
"unit": {
"netPrice": 100,
"quantity": 1,
"code": "PCS"
},
"tax": {
"vatPercentage": 25
},
"total": {
"grossAmount": 125,
"netAmount": 100
},
"occurredAt": {
"start": "2022-09-28T10:40:44.421Z",
"end": null
},
"metadata": [
{
"key": "product-number",
"value": "3937501"
}
]
}
],
"metadata": [
{
"key": "order-id",
"value": "a9ee9996-e941-4aa8-90b9-4b047c4afe87"
}
]
}
{
"consumptionTotal": {
"grossAmount": 125,
"vatAmount": 25,
"currencyCode": "NOK"
},
"refundTotal": {
"grossAmount": 20,
"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"
}
]
}