Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 121 additions & 98 deletions schemas/cache/.hashes.json

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions schemas/cache/account/get-account-financials-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"description": "Request financial status for an operator-billed account. Returns spend summary, credit/balance status, and invoice history. Only applicable when the seller declares account_financials capability.",
"examples": [
{
"data": {
"account": {
"account_id": "acc_acme_001"
}
},
"description": "Query by account ID for current billing cycle"
},
{
"data": {
"account": {
"brand": {
"domain": "acme-corp.com"
},
"operator": "acme-corp.com"
},
"period": {
"end": "2026-01-31",
"start": "2026-01-01"
}
},
"description": "Query by natural key for a specific period"
},
{
"data": {
"account": {
"brand": {
"brand_id": "spark",
"domain": "nova-brands.com"
},
"operator": "pinnacle-media.com"
}
},
"description": "Agency querying financials for a client account"
}
],
"properties": {
"account": {
"$ref": "../core/account-ref.json",
"description": "Account to query financials for. Must be an operator-billed account."
},
"context": {
"$ref": "../core/context.json"
},
"ext": {
"$ref": "../core/ext.json"
},
"period": {
"$ref": "../core/date-range.json",
"description": "Date range for the spend summary. Defaults to the current billing cycle if omitted."
}
},
"required": [
"account"
],
"title": "Get Account Financials Request",
"type": "object"
}
319 changes: 319 additions & 0 deletions schemas/cache/account/get-account-financials-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Financial status for an operator-billed account. Returns spend summary, credit/balance status, payment status, and invoice history. The level of detail varies by seller \u2014 only account, currency, and period are guaranteed on success.",
"examples": [
{
"data": {
"account": {
"account_id": "acc_acme_001"
},
"credit": {
"available_credit": 54770.0,
"credit_limit": 100000.0,
"utilization_percent": 45.23
},
"currency": "USD",
"invoices": [
{
"amount": 38500.0,
"due_date": "2026-02-28",
"invoice_id": "inv_2026_01",
"paid_date": "2026-02-15",
"period": {
"end": "2026-01-31",
"start": "2026-01-01"
},
"status": "paid"
}
],
"payment_status": "current",
"payment_terms": "net_30",
"period": {
"end": "2026-02-28",
"start": "2026-02-01"
},
"spend": {
"media_buy_count": 3,
"total_spend": 45230.0
},
"timezone": "America/New_York"
},
"description": "Credit account \u2014 current, with invoice history"
},
{
"data": {
"account": {
"brand": {
"domain": "acme-corp.com"
},
"operator": "acme-corp.com"
},
"balance": {
"available": 1800.0,
"last_top_up": {
"amount": 10000.0,
"date": "2026-02-01"
}
},
"currency": "USD",
"payment_status": "current",
"payment_terms": "prepay",
"period": {
"end": "2026-02-28",
"start": "2026-02-01"
},
"spend": {
"media_buy_count": 2,
"total_spend": 8200.0
},
"timezone": "America/Los_Angeles"
},
"description": "Prepay account with low balance"
},
{
"data": {
"errors": [
{
"code": "UNSUPPORTED_FEATURE",
"message": "Financial data is not available for agent-billed accounts. The agent's own billing system is the source of truth."
}
]
},
"description": "Agent-billed account \u2014 not supported"
}
],
"oneOf": [
{
"additionalProperties": true,
"description": "Financial data retrieved successfully",
"not": {
"required": [
"errors"
]
},
"properties": {
"account": {
"$ref": "../core/account-ref.json",
"description": "Account reference, echoed from the request"
},
"balance": {
"description": "Prepay balance. Present for prepay accounts.",
"properties": {
"available": {
"description": "Remaining prepaid balance",
"minimum": 0,
"type": "number"
},
"last_top_up": {
"description": "Most recent balance top-up",
"properties": {
"amount": {
"description": "Top-up amount",
"minimum": 0,
"type": "number"
},
"date": {
"description": "Date of top-up",
"format": "date",
"type": "string"
}
},
"required": [
"amount",
"date"
],
"type": "object"
}
},
"required": [
"available"
],
"type": "object"
},
"context": {
"$ref": "../core/context.json"
},
"credit": {
"description": "Credit status. Present for credit-based accounts (payment_terms like net_30).",
"properties": {
"available_credit": {
"description": "Remaining credit available (credit_limit minus outstanding balance)",
"type": "number"
},
"credit_limit": {
"description": "Maximum outstanding balance allowed",
"minimum": 0,
"type": "number"
},
"utilization_percent": {
"description": "Credit utilization as a percentage (0-100)",
"maximum": 100,
"minimum": 0,
"type": "number"
}
},
"required": [
"credit_limit",
"available_credit"
],
"type": "object"
},
"currency": {
"description": "ISO 4217 currency code for all monetary amounts in this response",
"pattern": "^[A-Z]{3}$",
"type": "string"
},
"ext": {
"$ref": "../core/ext.json"
},
"invoices": {
"description": "Recent invoices. Sellers may limit the number returned.",
"items": {
"properties": {
"amount": {
"description": "Invoice total in currency",
"minimum": 0,
"type": "number"
},
"due_date": {
"description": "Payment due date",
"format": "date",
"type": "string"
},
"invoice_id": {
"description": "Seller-assigned invoice identifier",
"type": "string"
},
"paid_date": {
"description": "Date payment was received. Present when status is 'paid'.",
"format": "date",
"type": "string"
},
"period": {
"$ref": "../core/date-range.json",
"description": "Billing period covered by this invoice"
},
"status": {
"description": "Invoice status",
"enum": [
"draft",
"issued",
"paid",
"past_due",
"void"
],
"type": "string"
}
},
"required": [
"invoice_id",
"amount",
"status"
],
"type": "object"
},
"type": "array"
},
"payment_status": {
"description": "Overall payment status. current: all obligations met. past_due: one or more invoices overdue. suspended: account suspended due to payment issues.",
"enum": [
"current",
"past_due",
"suspended"
],
"type": "string"
},
"payment_terms": {
"description": "Payment terms in effect (e.g., 'net_30', 'prepay')",
"type": "string"
},
"period": {
"$ref": "../core/date-range.json",
"description": "The actual period covered by spend data. May differ from the requested period if the seller adjusts to billing cycle boundaries."
},
"spend": {
"description": "Spend summary for the period",
"properties": {
"media_buy_count": {
"description": "Number of active media buys in the period",
"minimum": 0,
"type": "integer"
},
"total_spend": {
"description": "Total spend in the period, in currency",
"minimum": 0,
"type": "number"
}
},
"required": [
"total_spend"
],
"type": "object"
},
"timezone": {
"description": "IANA timezone of the seller's billing day boundaries (e.g., 'America/New_York'). All dates in this response \u2014 period, invoice periods, due dates \u2014 are calendar dates in this timezone. Buyers in a different timezone should expect spend boundaries to differ from their own calendar day.",
"type": "string"
}
},
"required": [
"account",
"currency",
"period",
"timezone"
],
"title": "GetAccountFinancialsSuccess",
"type": "object"
},
{
"additionalProperties": true,
"description": "Operation failed \u2014 financials not available",
"not": {
"anyOf": [
{
"required": [
"account"
]
},
{
"required": [
"currency"
]
},
{
"required": [
"period"
]
},
{
"required": [
"timezone"
]
}
]
},
"properties": {
"context": {
"$ref": "../core/context.json"
},
"errors": {
"description": "Operation-level errors",
"items": {
"$ref": "../core/error.json"
},
"minItems": 1,
"type": "array"
},
"ext": {
"$ref": "../core/ext.json"
}
},
"required": [
"errors"
],
"title": "GetAccountFinancialsError",
"type": "object"
}
],
"title": "Get Account Financials Response",
"type": "object"
}
1 change: 1 addition & 0 deletions schemas/cache/account/list-accounts-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"enum": [
"active",
"pending_approval",
"rejected",
"payment_required",
"suspended",
"closed"
Expand Down
Loading