{"openapi":"3.1.0","info":{"title":"PayloadPier — Supplier Price Compare","version":"0.2.0","description":"Supplier price comparison for software integrations and purchasing workflows. Authenticate with a scoped X-API-Key and supply an Idempotency-Key. Subscription quota is used first; any remainder uses prepaid credits subject to the key spending cap. Requests are bounded. Source files and result bodies are not retained; repeated idempotency keys return a usage reference without a second charge. Current hosting uses test billing only; real payments are disabled."},"servers":[{"url":"https://payloadpier.com"}],"security":[{"CustomerApiKey":[]}],"tags":[{"name":"Commerce"},{"name":"Developer tools"}],"paths":{"/api/health":{"get":{"operationId":"getHealth","summary":"Service health","responses":{"200":{"description":"Current private-beta service state; billing remains disabled.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"const":"ok"},"service":{"type":"string"},"version":{"type":"string"},"stage":{"const":"private-beta"},"billing_enabled":{"const":false},"apis":{"type":"array","items":{"type":"string"}}},"required":["status","service","version","stage","billing_enabled","apis"]}}}}}}},"/api/catalog":{"get":{"operationId":"getCatalog","summary":"API catalog and proposed pricing","description":"Includes beta and planned products. Planned paths are roadmap identifiers, not callable endpoints or purchasable entitlements. Prices are proposals; checkout is disabled. paygMicros uses millionths of USD; plan priceCents uses cents of USD. Subscription included-unit semantics depend on each product bounds description.","responses":{"200":{"description":"Catalog, readiness and proposed prices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResult"}}}}}}},"/api/v1/compare":{"post":{"operationId":"supplierPrice","summary":"Supplier Price Compare","tags":["Commerce"],"description":"Compare customer-supplied complete snapshots by exact SKU. Accepts JSON or two CSV/XLSX uploads. Up to 5,000 data rows per snapshot, 100 columns, 2 MiB per uploaded file, and 5 MiB for the entire request. XLSX formulas, numeric SKU cells and ambiguous multi-sheet files are rejected; select a sheet explicitly where needed. ZIP safety limits include 16 MiB expanded data and 1,000 entries. Inputs are processed in memory. Currency/unit mismatches reject the request. Removed means absent from the new snapshot, not confirmed discontinued. Selling prices are held constant; margins exclude freight, taxes and overhead. One usage unit per successful comparison. All input data comes from the caller; this endpoint does not supply a proprietary or live external dataset.","parameters":[{"name":"X-API-Key","in":"header","required":true,"description":"A funded, scoped customer API key. The website is public; private Site tokens are not required.","schema":{"type":"string","pattern":"^api_[a-f0-9]{64}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Required in test/live paid mode: 1–128 printable non-space ASCII characters. Reuse only for the exact same raw request body and API. Multipart retries must preserve the original encoded body and boundary. A repeated usage record returns 409 without a second charge; response bodies are not stored.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[!-~]+$"}}],"x-paid-mode-security":[{"CustomerApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRequest"},"example":{"old_rows":[{"sku":"SKU-1","price":"10.00","currency":"USD","price_basis":"unit","unit":"each"}],"new_rows":[{"sku":"SKU-1","price":"10.50","currency":"USD","price_basis":"unit","unit":"each"}]}},"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"properties":{"old_file":{"type":"string","format":"binary","description":"Old UTF-8 CSV or XLSX snapshot, at most 2 MiB."},"new_file":{"type":"string","format":"binary","description":"New UTF-8 CSV or XLSX snapshot, at most 2 MiB."},"config":{"type":"string","contentMediaType":"application/json","contentSchema":{"$ref":"#/components/schemas/SupplierFileConfig"},"description":"JSON text conforming to SupplierFileConfig. Omitted mappings default to canonical headers. Worksheet selection is optional only when unambiguous. Optional selling_prices map current per-unit prices by exact SKU.","example":"{\"old_mapping\":{\"sku\":\"SKU\",\"price\":\"Cost\",\"currency\":\"Currency\",\"price_basis\":\"Basis\",\"unit\":\"Unit\"},\"new_mapping\":{\"sku\":\"SKU\",\"price\":\"Cost\",\"currency\":\"Currency\",\"price_basis\":\"Basis\",\"unit\":\"Unit\"}}"}},"required":["old_file","new_file"]}}}},"responses":{"200":{"description":"Completed result. Findings, exceptions, or invalid CSV data can be successful processing results. Disabled billing reports charged:false.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResult"}}}},"400":{"description":"Malformed UTF-8 JSON, empty body, malformed multipart, or missing/invalid paid-mode idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Paid-mode customer API key is missing, invalid, expired or revoked. The private hosting gate may separately deny access before this handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Paid-mode usage is not authorized: insufficient prepaid credits, daily spending cap reached, or inactive key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Cross-origin browser request denied, paid key scope denied, or suspended billing account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API unavailable. Planned catalog products have no working API route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Paid-mode idempotency conflict or previous usage record. Repeated identical requests do not charge again; prior result bodies are not retained, so the response is 409 rather than a result replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Entire request exceeds 5 MiB. Supplier per-file limits are reported as validation failures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported content type. New beta endpoints accept application/json only; supplier comparison also accepts multipart/form-data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid input or unsupported file. error.issues is present for structured validation errors. No partial result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected processing failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Billing storage or service configuration is unavailable, or the billing environment does not match its database.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"DecimalInput":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"SignedDecimalInput":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."},"OutputDecimal":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"Issue":{"type":"object","additionalProperties":false,"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"sku":{"type":"string"},"source_row":{"type":"integer","minimum":1}},"required":["path","code","message"]},"ErrorResponse":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"},"maxItems":100}},"required":["code","message"]},"request_id":{"type":"string","format":"uuid"},"usage_id":{"type":"string"}},"required":["error"]},"UsageBilling":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"mode":{"const":"disabled"},"charged":{"const":false},"quoted_units":{"type":"integer","minimum":1}},"required":["mode","charged","quoted_units"]},{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["test","live"]},"usage_id":{"type":"string"},"units":{"type":"integer","minimum":1},"included_units":{"type":"integer","minimum":0},"wallet_charge_micro_usd":{"type":"integer","minimum":0}},"required":["mode","usage_id","units","included_units","wallet_charge_micro_usd"]}],"description":"Current beta returns disabled and never charges. In enabled environments a valid successful request consumes available subscription units first, then prepaid USD credits. 1 USD = 1,000,000 micro-USD. Test credits and live funds use separate databases."},"SupplierRow":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"price":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"price_basis":{"type":"string","enum":["pack","unit"]},"pack_quantity":{"type":"string","pattern":"^(?!0+(?:\\.0+)?$)\\d{1,18}(?:\\.\\d{1,18})?$","description":"Positive plain decimal string, up to 18 integer and 18 fractional digits."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"moq":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"moq_basis":{"type":"string","enum":["pack","unit"]},"source_row":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["sku","price","currency","price_basis","unit"],"description":"Unique SKU within each snapshot. Matched SKUs must retain currency and unit. Explicit pack quantities are required for pack prices or pack MOQ.","dependentRequired":{"moq":["moq_basis"],"moq_basis":["moq"]},"allOf":[{"if":{"properties":{"price_basis":{"const":"pack"}},"required":["price_basis"]},"then":{"required":["pack_quantity"]}},{"if":{"properties":{"moq_basis":{"const":"pack"}},"required":["moq_basis"]},"then":{"required":["pack_quantity"],"properties":{"moq":{"type":"string","pattern":"^\\d{1,18}(?:\\.0{1,18})?$"}}}}]},"SupplierRequest":{"type":"object","additionalProperties":false,"properties":{"old_rows":{"type":"array","items":{"$ref":"#/components/schemas/SupplierRow"},"maxItems":5000},"new_rows":{"type":"array","items":{"$ref":"#/components/schemas/SupplierRow"},"maxItems":5000},"selling_prices":{"type":"object","additionalProperties":{"type":"string","pattern":"^(?!0+(?:\\.0+)?$)\\d{1,18}(?:\\.\\d{1,18})?$","description":"Positive plain decimal string, up to 18 integer and 18 fractional digits."},"description":"Exact SKU to positive current per-base-unit selling price. SKU must occur in a submitted snapshot. Same unit and currency as its product; held constant across both snapshots."}},"required":["old_rows","new_rows"]},"SupplierFileConfig":{"type":"object","additionalProperties":false,"properties":{"old_mapping":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string"},"price_basis":{"type":"string"},"pack_quantity":{"type":"string"},"unit":{"type":"string"},"moq":{"type":"string"},"moq_basis":{"type":"string"}},"required":["sku","price"],"description":"Canonical field to exact source column name. SKU and price require nonempty existing source columns. Currency, price_basis and unit require a mapping or an explicit per-file default. Each selected source column can be mapped only once. Omit optional mappings or use an empty string."},"new_mapping":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string"},"price_basis":{"type":"string"},"pack_quantity":{"type":"string"},"unit":{"type":"string"},"moq":{"type":"string"},"moq_basis":{"type":"string"}},"required":["sku","price"],"description":"Canonical field to exact source column name. SKU and price require nonempty existing source columns. Currency, price_basis and unit require a mapping or an explicit per-file default. Each selected source column can be mapped only once. Omit optional mappings or use an empty string."},"old_defaults":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string"},"price_basis":{"type":"string"},"pack_quantity":{"type":"string"},"unit":{"type":"string"},"moq":{"type":"string"},"moq_basis":{"type":"string"}},"required":[]},"new_defaults":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string"},"price_basis":{"type":"string"},"pack_quantity":{"type":"string"},"unit":{"type":"string"},"moq":{"type":"string"},"moq_basis":{"type":"string"}},"required":[]},"old_sheet":{"type":"string"},"new_sheet":{"type":"string"},"selling_prices":{"type":"object","additionalProperties":{"type":"string","pattern":"^(?!0+(?:\\.0+)?$)\\d{1,18}(?:\\.\\d{1,18})?$","description":"Positive plain decimal string, up to 18 integer and 18 fractional digits."},"description":"Exact SKU to positive current per-base-unit selling price. SKU must occur in a submitted snapshot. Same unit and currency as its product; held constant across both snapshots."}},"required":[]},"SupplierNormalizedRow":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"price":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"price_basis":{"type":"string","enum":["pack","unit"]},"pack_quantity":{"type":"string","pattern":"^(?!0+(?:\\.0+)?$)\\d{1,18}(?:\\.\\d{1,18})?$","description":"Positive plain decimal string, up to 18 integer and 18 fractional digits."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"moq":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"moq_basis":{"type":"string","enum":["pack","unit"]},"source_row":{"type":"integer","minimum":1,"maximum":9007199254740991},"unit_cost":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"minimum_units":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]}},"required":["sku","price","currency","price_basis","unit","unit_cost","minimum_units"]},"SupplierResult":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":"object","additionalProperties":false,"properties":{"old_count":{"type":"integer","minimum":0},"new_count":{"type":"integer","minimum":0},"added":{"type":"integer","minimum":0},"removed":{"type":"integer","minimum":0},"changed":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0},"cost_increases":{"type":"integer","minimum":0},"cost_decreases":{"type":"integer","minimum":0},"margin_declines":{"type":"integer","minimum":0}},"required":["old_count","new_count","added","removed","changed","unchanged","cost_increases","cost_decreases","margin_declines"]},"changes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string"},"status":{"type":"string","enum":["added","removed","changed","unchanged"]},"changed_fields":{"type":"array","items":{"type":"string"}},"old":{"anyOf":[{"$ref":"#/components/schemas/SupplierNormalizedRow"},{"type":"null"}]},"new":{"anyOf":[{"$ref":"#/components/schemas/SupplierNormalizedRow"},{"type":"null"}]},"unit_cost_delta":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"unit_cost_change_pct":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"margin_old_pct":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"margin_new_pct":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"margin_delta_pp":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["sku","status","changed_fields","old","new","unit_cost_delta","unit_cost_change_pct","margin_old_pct","margin_new_pct","margin_delta_pp","warnings"]},"maxItems":10000},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["summary","changes","warnings","request_id","billing"]},"MerchantRow":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string","minLength":1,"maxLength":200,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"price":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"availability":{"type":"string","enum":["in_stock","out_of_stock","preorder","backorder"]},"url":{"type":"string","minLength":1,"maxLength":2048,"format":"uri","description":"Absolute HTTP(S) URL with no whitespace, controls or credentials. Compared after standard URL serialization; never fetched."}},"required":["sku","price","currency","availability","url"]},"MerchantNormalizedRow":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string","minLength":1,"maxLength":200,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"price":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"availability":{"type":"string","enum":["in_stock","out_of_stock","preorder","backorder"]},"url":{"type":"string","format":"uri","description":"Standard serialized HTTP(S) URL. Percent encoding can make this longer than the submitted URL."}},"required":["sku","price","currency","availability","url"]},"MerchantRequest":{"type":"object","additionalProperties":false,"properties":{"feed_rows":{"type":"array","items":{"$ref":"#/components/schemas/MerchantRow"},"maxItems":5000},"store_rows":{"type":"array","items":{"$ref":"#/components/schemas/MerchantRow"},"maxItems":5000}},"required":["feed_rows","store_rows"]},"MerchantResult":{"type":"object","additionalProperties":false,"properties":{"comparison_type":{"const":"supplied_merchant_snapshots"},"summary":{"type":"object","additionalProperties":false,"properties":{"feed_count":{"type":"integer","minimum":0},"store_count":{"type":"integer","minimum":0},"matched":{"type":"integer","minimum":0},"mismatched":{"type":"integer","minimum":0},"missing_in_feed":{"type":"integer","minimum":0},"missing_in_store":{"type":"integer","minimum":0},"currency_mismatches":{"type":"integer","minimum":0}},"required":["feed_count","store_count","matched","mismatched","missing_in_feed","missing_in_store","currency_mismatches"]},"changes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"sku":{"type":"string"},"status":{"type":"string","enum":["matched","mismatched","missing_in_feed","missing_in_store"]},"mismatched_fields":{"type":"array","items":{"type":"string"}},"feed":{"anyOf":[{"$ref":"#/components/schemas/MerchantNormalizedRow"},{"type":"null"}]},"store":{"anyOf":[{"$ref":"#/components/schemas/MerchantNormalizedRow"},{"type":"null"}]},"store_minus_feed_price":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["sku","status","mismatched_fields","feed","store","store_minus_feed_price","warnings"]},"maxItems":10000},"limitations":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["comparison_type","summary","changes","limitations","request_id","billing"]},"InvoiceLine":{"type":"object","additionalProperties":false,"properties":{"line_id":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"quantity":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"unit_price":{"type":"string","pattern":"^\\d{1,18}(?:\\.\\d{1,18})?$","description":"Nonnegative plain decimal string; up to 18 integer and 18 fractional digits. No exponents, symbols or separators."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."}},"required":["line_id","quantity","unit_price","currency","unit"]},"InvoiceRequest":{"type":"object","additionalProperties":false,"properties":{"po_lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLine"},"maxItems":5000},"invoice_lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLine"},"maxItems":5000}},"required":["po_lines","invoice_lines"],"description":"At most 5,000 rows combined. line_id must be unique within each document. Quantities and unit prices use the same explicit unit and price basis; no aggregation or fuzzy mapping."},"InvoiceResult":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":"object","additionalProperties":false,"properties":{"po_lines":{"type":"integer","minimum":0},"invoice_lines":{"type":"integer","minimum":0},"matched":{"type":"integer","minimum":0},"exception_lines":{"type":"integer","minimum":0}},"required":["po_lines","invoice_lines","matched","exception_lines"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"line_id":{"type":"string"},"status":{"type":"string","enum":["matched","exception"]},"exceptions":{"type":"array","items":{"type":"string"}},"purchase_order":{"anyOf":[{"$ref":"#/components/schemas/InvoiceLine"},{"type":"null"}]},"invoice":{"anyOf":[{"$ref":"#/components/schemas/InvoiceLine"},{"type":"null"}]},"po_amount":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"invoice_amount":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"quantity_delta":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"unit_price_delta":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"amount_delta":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]}},"required":["line_id","status","exceptions","purchase_order","invoice","po_amount","invoice_amount","quantity_delta","unit_price_delta","amount_delta"]},"maxItems":5000},"totals":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"po_amount":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"invoice_amount":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"invoice_minus_po":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."}},"required":["currency","po_amount","invoice_amount","invoice_minus_po"]}},"limitations":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["summary","lines","totals","limitations","request_id","billing"]},"CsvColumn":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"type":{"type":"string","enum":["string","decimal","integer","boolean","date"]},"required":{"type":"boolean"},"unique":{"type":"boolean"},"min":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."},"max":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."},"enum":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","maxLength":4096}}},"required":["name","type"],"description":"Column names must be unique. min/max are allowed only for decimal/integer types; integer bounds must be whole-number strings and min must not exceed max. enum compares exact strings, while numeric uniqueness uses numeric equality.","allOf":[{"if":{"properties":{"type":{"enum":["string","boolean","date"]}}},"then":{"not":{"anyOf":[{"required":["min"]},{"required":["max"]}]}}},{"if":{"properties":{"type":{"const":"integer"}}},"then":{"properties":{"min":{"type":"string","pattern":"^-?\\d{1,18}$"},"max":{"type":"string","pattern":"^-?\\d{1,18}$"}}}}]},"CsvDataRow":{"type":"object","maxProperties":100,"propertyNames":{"maxLength":128},"additionalProperties":{"type":["string","null"],"maxLength":4096}},"CsvRequest":{"type":"object","additionalProperties":false,"properties":{"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/CsvColumn"}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/CsvDataRow"},"maxItems":5000},"repairs":{"type":"object","additionalProperties":false,"properties":{"trim":{"type":"boolean"},"empty_to_null":{"type":"boolean"}},"required":[]}},"required":["schema","rows"],"description":"Already-parsed cells only; no file upload. At most 4,000,000 total characters across row keys and string values. Numbers must be supplied as source strings. Enabled repairs apply only to schema-listed columns; unknown columns are preserved and reported."},"CsvResult":{"type":"object","additionalProperties":false,"properties":{"valid":{"type":"boolean"},"summary":{"type":"object","additionalProperties":false,"properties":{"rows":{"type":"integer","minimum":0},"columns":{"type":"integer","minimum":0},"valid_rows":{"type":"integer","minimum":0},"invalid_rows":{"type":"integer","minimum":0},"issue_count":{"type":"integer","minimum":0},"changed_cells":{"type":"integer","minimum":0}},"required":["rows","columns","valid_rows","invalid_rows","issue_count","changed_cells"]},"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"},"maxItems":100},"issues_truncated":{"type":"boolean"},"normalized_rows":{"type":"array","items":{"$ref":"#/components/schemas/CsvDataRow"},"maxItems":5000},"limitations":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["valid","summary","issues","issues_truncated","normalized_rows","limitations","request_id","billing"]},"ExpectedSettlement":{"type":"object","additionalProperties":false,"properties":{"reference":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"amount":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."}},"required":["reference","currency","amount"]},"SettlementRow":{"type":"object","additionalProperties":false,"properties":{"transaction_id":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"reference":{"type":"string","minLength":1,"maxLength":256,"description":"Exact case-sensitive identifier. No surrounding whitespace or control characters."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"gross":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."},"fee":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."},"net":{"type":"string","pattern":"^-?\\d{1,18}(?:\\.\\d{1,18})?$","description":"Signed plain decimal string; up to 18 integer and 18 fractional digits. No leading plus, exponents, symbols or separators."}},"required":["transaction_id","reference","currency","gross","fee","net"]},"SettlementRequest":{"type":"object","additionalProperties":false,"properties":{"expected":{"type":"array","items":{"$ref":"#/components/schemas/ExpectedSettlement"},"maxItems":5000},"settlements":{"type":"array","items":{"$ref":"#/components/schemas/SettlementRow"},"maxItems":5000}},"required":["expected","settlements"],"description":"At most 5,000 rows combined. Expected references and settlement transaction IDs must each be unique. Multiple settlements per reference remain ambiguous; they are not silently aggregated into a match."},"SettlementResult":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":"object","additionalProperties":false,"properties":{"expected_rows":{"type":"integer","minimum":0},"settlement_rows":{"type":"integer","minimum":0},"matched":{"type":"integer","minimum":0},"exception_references":{"type":"integer","minimum":0},"ambiguous_references":{"type":"integer","minimum":0}},"required":["expected_rows","settlement_rows","matched","exception_references","ambiguous_references"]},"results":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"reference":{"type":"string"},"status":{"type":"string","enum":["matched","exception"]},"expected":{"anyOf":[{"$ref":"#/components/schemas/ExpectedSettlement"},{"type":"null"}]},"settlements":{"type":"array","items":{"$ref":"#/components/schemas/SettlementRow"},"maxItems":5000},"exceptions":{"type":"array","items":{"type":"string"}},"gross_delta":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},{"type":"null"}]},"inconsistent_transaction_ids":{"type":"array","items":{"type":"string"}}},"required":["reference","status","expected","settlements","exceptions","gross_delta","inconsistent_transaction_ids"]},"maxItems":5000},"totals":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Explicit three-uppercase-letter code; assignment as an official currency is not independently verified."},"expected":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"gross":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"fee":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"net":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"gross_minus_expected":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."},"net_identity_difference":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$","description":"Plain decimal string. Computed results can have more digits than inputs."}},"required":["currency","expected","gross","fee","net","gross_minus_expected","net_identity_difference"]}},"limitations":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["summary","results","totals","limitations","request_id","billing"]},"EmailRequest":{"type":"object","additionalProperties":false,"properties":{"html":{"type":"string","minLength":1,"maxLength":1048576,"description":"Non-whitespace HTML; at most 1 MiB encoded as UTF-8 and at most 50,000 parsed nodes. Byte and node limits are enforced at runtime."}},"required":["html"]},"EmailResult":{"type":"object","additionalProperties":false,"properties":{"audit_type":{"const":"static_html_email_heuristics"},"summary":{"type":"object","additionalProperties":false,"properties":{"input_bytes":{"type":"integer","minimum":0},"parsed_nodes":{"type":"integer","minimum":0},"images":{"type":"integer","minimum":0},"anchors":{"type":"integer","minimum":0},"errors":{"type":"integer","minimum":0},"warnings":{"type":"integer","minimum":0},"total_findings":{"type":"integer","minimum":0},"returned_findings":{"type":"integer","minimum":0},"findings_truncated":{"type":"boolean"}},"required":["input_bytes","parsed_nodes","images","anchors","errors","warnings","total_findings","returned_findings","findings_truncated"]},"findings":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"},"element":{"anyOf":[{"type":"string"},{"type":"null"}]},"attribute":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"column":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["code","severity","message","element","attribute","line","column"]},"maxItems":200},"limitations":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","format":"uuid"},"billing":{"$ref":"#/components/schemas/UsageBilling"}},"required":["audit_type","summary","findings","limitations","request_id","billing"]},"CatalogProduct":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["beta","planned"]},"path":{"type":"string"},"paygMicros":{"type":"integer","minimum":0},"unit":{"type":"string"},"plans":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"priceCents":{"type":"integer","minimum":0},"included":{"type":"integer","minimum":0}},"required":["id","name","priceCents","included"]}},"category":{"type":"string","enum":["Commerce","Documents","Developer tools","Public data","Web3"]},"bounds":{"type":"string"},"sequence":{"type":"integer","minimum":1}},"required":["id","name","description","status","path","paygMicros","unit","plans","category","bounds","sequence"]},"CatalogResult":{"type":"object","additionalProperties":false,"properties":{"currency":{"const":"USD"},"pricing_status":{"const":"proposed"},"checkout_enabled":{"const":false},"products":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProduct"}}},"required":["currency","pricing_status","checkout_enabled","products"]}},"securitySchemes":{"SiteServiceAccess":{"type":"apiKey","in":"header","name":"OAI-Sites-Authorization","description":"Bearer <platform-issued private Site token>. Interactive owner sign-in is an alternative handled by hosting. This is not a customer API key; do not expose the token in client code."},"CustomerApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"A scoped customer API key. Idempotency-Key is also required for paid API calls."}}}}