BizKitHub
DocsAPI ReferenceContact Credit/bff/contact-credit/expiration-breakdown
getContact CreditAdmin BFF

/bff/contact-credit/expiration-breakdown

Returns the customer's unspent credits sliced into buckets by their expiration date. FIFO-aware: each bucket reports only what is still unspent of the underlying source credit(s), not the original face value. Buckets are ordered: overdue first (past expiration but not yet processed by the cron), then by date ascending, never-expires last. A non-zero outstandingDebt reports a negative running balance that has not yet been paid off.

Contact CreditgetBffContact-creditExpiration-breakdown

Parameters

1 query

Query parameters

· 1
customerIdstringRequired

Contact external ID.

Exampleabc123def456ghij

Response schema

1 status code documented

200Success
totalAmountnumberRequired

Sum of all buckets — matches shop__contact.credit when outstandingDebt is 0.

Examples363677
totalAmountMoneynumberRequired

Sum of all bucket money values.

Examples363677
outstandingDebtnumberRequired

Unpaid debt not yet absorbed by a positive credit. > 0 means the customer is in the red.

Default: 0
Example0
currencystringRequired

ISO 4217 code of the organisation default currency used for all *Money fields.

ExampleCZK
bucketsobject[]Required

Buckets ordered: overdue first, then by date ascending, never-expires last.

Each array item:
expirationDatestring | nullRequired

Calendar date when the credits in this bucket expire. null = bucket holds credits with no scheduled expiration.

One of 2:
Variant 1
string

YYYY-MM-DD calendar date.

Example2026-06-13
Variant 2
null
overduebooleanRequired

True when the expiration date is in the past but the cron has not yet processed it. The next cron tick will sweep these.

Default: false
Examplefalse
amountnumberRequired

Total unspent credits in this bucket.

Example36
amountMoneynumberRequired

Total money value in this bucket (scaled proportionally).

Example36
sourcesobject[]Required
Each array item:
creditIdnumberRequired

Internal id of the source credit.

Example8422
creditExternalIdstringRequired

External (16-char) id of the source credit — link target for drill-down.

Example4L0jcnkzA8SPW1gE
originalAmountnumberRequired

Face value of the source credit before any FIFO consumption.

Example300
amountnumberRequired

Unspent portion of the source credit contributed to this bucket.

Example36
amountMoneynumberRequired

Money value scaled proportionally to amount.

Example36
expirationAtstring | nullRequired

Exact expiration timestamp of the source credit. null when the bucket is the never-expires bucket.

One of 2:
Variant 1
string

Exact ISO timestamp of the source credit expiration.

Variant 2
null

Response example

application/json
{
  "totalAmount": 36,
  "totalAmountMoney": 36,
  "outstandingDebt": 0,
  "currency": "CZK",
  "buckets": [
    {
      "overdue": false,
      "amount": 36,
      "amountMoney": 36,
      "sources": [
        {
          "creditId": 8422,
          "creditExternalId": "4L0jcnkzA8SPW1gE",
          "originalAmount": 300,
          "amount": 36,
          "amountMoney": 36
        }
      ]
    }
  ]
}

Request example

GET /bff/contact-credit/expiration-breakdown

get
curl -X GET "https://api.bizkithub.com/bff/contact-credit/expiration-breakdown?customerId=abc123def456ghij" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key