Get customer or subscription related consumptions

Get customer consumptions - a list of consumptions for customer.

PATH:

/v1/clients/{clientId}/consumptions

PATH PARAMETERS:

clientId
required

integer

Your assigned ClientId.

RESPONSES:

200 OK

RESPONSE SCHEMA:

Array () [
id

string

Id of the retrieved consumption.

customerNumber

string

Id of the customer the consumption is assigned to.

subscriptionId

string

Id of the subscription the consumption is assigned to.

invoiceId

string

Id of the invoice if the consumption has been invoiced.

items

array of items

The items that make up this consumption.

Array () [
id

string

Unique Id of the item within this consumption.

productDetails

productDetails object

Details of your product.

productId

string <= 100 characters

Id of the product.

description

string <= 200 characters

A description of the product.

unit

unit object

no description in swagger file

netPrice

number decimal

The net amount.

quantity

number decimal

Number of units.

code

string

Enum: OTH BAG BAL BDL BKL BOU BOX BTL BUN CAN CBM CCM CMS CTN DOZ DRM GGR GMS GRS GYD KGS KLR KME MLT MTR MTS NOS PAC PCS PRS QTL ROL SET SQF SQM SQY TBS TGM THD TON TUB UGS UNT YDS

no description in swagger file

currencyCode

string

The currency code.

total

total object

no description in swagger file

grossAmount

number decimal

Total gross amount.

netAmount

number decimal

Total net amount.

currencyCode

string

Currency code as defined by ISO-4217.

occurredAt

occurredAt object

When this transaction occurred.

start

string date-time

When this transaction occurred (start).

end

string date-time

Optional. When this transaction occurred (end).

metadata

array of metadata

Optional. A list of key-value pairs.

Array () [
key

string <= 30 characters

The key of the metadata item.

value

string <= 255 characters

The value of the metadata item.


]

]
createdAt

string date-time

When this consumption was created.

billingDate

string date

The billing date of this consumption.

refunds

array of refunds

The refunds created on this consumption.

Array () [
id

string

Id of the refund.

invoiceId

string

Id of the invoice.

items

array of items

The items that make up this refund.

Array () [
currencyCode

string

The currency code.

id

string

Id of the item in the consumption that was refunded.


]

]
consumptionTotal

consumptionTotal object

The totals of the consumption.

grossAmount

number decimal

The gross amount.

vatAmount

number decimal

The VAT amount.

currencyCode

string

The currency code.

refundTotal

refundTotal object

The totals of the refund(s).

grossAmount

number decimal

The gross amount.

vatAmount

number decimal

The VAT amount.

currencyCode

string

The currency code.

metadata

array of metadata

Optional. A list of key-value pairs.

Array () [
key

string <= 30 characters

The key of the metadata item.

value

string <= 255 characters

The value of the metadata item.


]
_links

array of _links

List of hypermedia links related to this resource.

]
400 Bad request.

RESPONSE SCHEMA:

undefined
401 Missing or invalid "Authorization" header.

RESPONSE SCHEMA:

type

string

The type of error that is carried within this response. The value of this type is an URI that can be dereferenced for a human-readable explanation of the error type.

category

string

Enum: BUSINESS_ERROR TECHNICAL_ERROR

Category of the error, used primarily to determine whether the same request should be retried or not. Possible values:

  • BUSINESS_ERROR - A business error occured. This request should not be retried without modification
  • TECHNICAL_ERROR - A temporary, technical error occurred. the request should be retried after a back-off period.

title

string

A short, human-readable summary of the problem.

message

string

A short, human-readable summary of the problem. Identical to title.

403 Lacking permissions.

RESPONSE SCHEMA:

type

string

The type of error that is carried within this response. The value of this type is an URI that can be dereferenced for a human-readable explanation of the error type.

category

string

Enum: BUSINESS_ERROR TECHNICAL_ERROR

Category of the error, used primarily to determine whether the same request should be retried or not. Possible values:

  • BUSINESS_ERROR - A business error occured. This request should not be retried without modification
  • TECHNICAL_ERROR - A temporary, technical error occurred. the request should be retried after a back-off period.

title

string

A short, human-readable summary of the problem.

message

string

A short, human-readable summary of the problem. Identical to title.

500 Unexpected internal server error.

RESPONSE SCHEMA:

type

string

The type of error that is carried within this response. The value of this type is an URI that can be dereferenced for a human-readable explanation of the error type.

category

string

Enum: BUSINESS_ERROR TECHNICAL_ERROR

Category of the error, used primarily to determine whether the same request should be retried or not. Possible values:

  • BUSINESS_ERROR - A business error occured. This request should not be retried without modification
  • TECHNICAL_ERROR - A temporary, technical error occurred. the request should be retried after a back-off period.

title

string

A short, human-readable summary of the problem.

message

string

A short, human-readable summary of the problem. Identical to title.

Path

get

/v1/clients/{clientId}/consumptions

Response samples

200400401403500
  • [
      ...
      • {
        • "id": "string",
        • "customerNumber": "string",
        • "subscriptionId": "string",
        • "invoiceId": "string",
        • "items": [ ...
          • {
            • "id": "string",
            • "productDetails": { ...
              • "productId": "string",
              • "description": "string"
              },
            • "unit": { ...
              • "currencyCode": "string"
              },
            • "total": { ...
              • "currencyCode": "string"
              },
            • "occurredAt": { ...
              • "start": "string",
              • "end": "string"
              },
            • "metadata": [ ...
              • {
                • "key": "string",
                • "value": "string"
                }
              ]
            }
          ],
        • "createdAt": "string",
        • "billingDate": "string",
        • "refunds": [ ...
          • {
            • "id": "string",
            • "invoiceId": "string",
            • "items": [ ...
              • {
                • "id": "string"
                }
              ]
            }
          ],
        • "consumptionTotal": { ...
          • "currencyCode": "string"
          },
        • "refundTotal": { ...
          • "currencyCode": "string"
          },
        • "metadata": [ ...
          • {
            • "key": "string",
            • "value": "string"
            }
          ],
        • "_links": [ ...
          • {
            • "method": "string",
            • "href": "string",
            • "rel": "string",
            • "target": X
            }
          ]
        }
    ]
undefined
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string"
    }