Skip to main content
POST
/
v1
/
analytics
/
explain-charge
explain charge
curl --request POST \
  --url https://api.unprice.dev/v1/analytics/explain-charge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "invoice_id": "<string>",
  "entry_id": "<string>",
  "project_id": "<string>",
  "limit": 100,
  "offset": 0
}
'
{
  "invoice": {
    "id": "<string>",
    "statement_key": "<string>",
    "customer_id": "<string>",
    "currency": "<string>"
  },
  "line": {
    "entry_id": "<string>",
    "billing_period_id": "<string>",
    "kind": "<string>",
    "amount": 123,
    "currency": "<string>"
  },
  "scope": {
    "project_id": "<string>",
    "customer_id": "<string>",
    "feature_slug": "<string>",
    "period_key": "<string>",
    "customer_entitlement_id": "<string>",
    "feature_plan_version_id": "<string>"
  },
  "summary": {
    "event_count": 123,
    "total_usage": 123,
    "total_amount": 123,
    "latest_amount_after": 123,
    "currency": "<string>",
    "amount_scale": 123,
    "first_event_at": 123,
    "last_event_at": 123,
    "multi_component_event_count": 123
  },
  "events": [
    {
      "event_id": "<string>",
      "idempotency_key": "<string>",
      "customer_entitlement_id": "<string>",
      "grant_id": "<string>",
      "feature_plan_version_id": "<string>",
      "feature_slug": "<string>",
      "period_key": "<string>",
      "event_slug": "<string>",
      "aggregation_method": "<string>",
      "timestamp": 123,
      "created_at": 123,
      "delta": 123,
      "value_after": 123,
      "amount": 123,
      "amount_after": 123,
      "amount_scale": 8,
      "currency": "<string>",
      "priced_at": 123,
      "tier_index": 123,
      "pricing_component_count": 1,
      "source_id": "<string>"
    }
  ],
  "answer": "<string>",
  "evidence": [
    {
      "id": "<string>"
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "has_more": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Explain charge request

invoice_id
string
required
entry_id
string
required
project_id
string
limit
integer
default:100
Required range: 1 <= x <= 500
offset
integer
default:0
Required range: x >= 0

Response

Explain charge response

invoice
object
required
line
object
required
scope
object
required
summary
object
required
events
object[]
required
answer
string
required
evidence
object[]
required
pagination
object
required