{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"0to1pay Payment & Fulfillment API","version":"1.0.0-design","description":"Seller API for USDC and USDT payments on supported networks and verified order fulfillment. Resource IDs are UUID strings. Merchant API keys are scoped to a merchant, project and environment. Payments settle in USDC or USDT on supported networks."},"servers":[{"url":"/v1","description":"Use the origin that serves the OpenAPI document."}],"security":[{"ServerKey":[]}],"tags":[{"name":"Payments"},{"name":"Quotes"},{"name":"Attempts"},{"name":"Verification"},{"name":"Operations"},{"name":"Connections"},{"name":"Webhooks"},{"name":"Events"},{"name":"Fulfillment"},{"name":"Billing"},{"name":"Console"}],"paths":{"/console/scope":{"get":{"operationId":"getConsoleScope","summary":"Read the authenticated console key scope","tags":["Console"],"x-required-scope":"console:read","responses":{"200":{"description":"Read the authenticated console key scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleScopeResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/console/overview":{"get":{"operationId":"getConsoleOverview","summary":"Read the scoped console overview","tags":["Console"],"x-required-scope":"console:read","parameters":[{"$ref":"#/components/parameters/ConsoleQuery"},{"$ref":"#/components/parameters/ConsoleOffset"}],"responses":{"200":{"description":"Read the scoped console overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleOverview"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/console/payments/{payment_id}":{"get":{"operationId":"getConsolePayment","summary":"Read scoped console payment detail","tags":["Console"],"x-required-scope":"console:read","parameters":[{"$ref":"#/components/parameters/payment_id"}],"responses":{"200":{"description":"Read scoped console payment detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsolePaymentDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/billing/plans":{"get":{"operationId":"listBillingPlans","summary":"List request plans and subscription prices","tags":["Billing"],"x-required-scope":"billing:read","description":"Plan prices, included API requests, and available subscription collection options for USDC on Ethereum or Base and USDT on TRON. Paid periods last 30 days.\n","responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPlans"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/subscription":{"get":{"operationId":"getBillingSubscription","summary":"Read the scoped subscription and request usage","tags":["Billing"],"x-required-scope":"billing:read","description":"Current prepaid period and admitted API requests. The test allowance follows UTC calendar months.","responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/invoices":{"get":{"operationId":"listBillingInvoices","summary":"List recent subscription invoices to resume checkout or reconciliation","tags":["Billing"],"x-required-scope":"billing:read","description":"Returns up to 20 invoices for the caller's project and current collection environment, newest first. Open, reconciling and scheduled invoices are retained ahead of older history.","responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoiceList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"operationId":"createBillingInvoice","summary":"Create a stablecoin subscription invoice and payer challenge","tags":["Billing"],"x-required-scope":"billing:write","description":"Select an offered collection network with network_id, or omit it for the configured default. The selected network determines the six-decimal settlement asset. The invoice records the asset, amount and plan terms.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingInvoice"}}}},"responses":{"201":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoice"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"409":{"$ref":"#/components/responses/BillingInvoiceConflict"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/invoices/{invoice_id}":{"parameters":[{"$ref":"#/components/parameters/invoice_id"}],"get":{"operationId":"getBillingInvoice","summary":"Read the scoped subscription invoice","tags":["Billing"],"x-required-scope":"billing:read","description":"Returns the invoice, frozen quote, wallet authorization message and entitlement state.","responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoice"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/invoices/{invoice_id}/authorize":{"parameters":[{"$ref":"#/components/parameters/invoice_id"}],"post":{"operationId":"authorizeBillingInvoice","summary":"Authorize the subscription invoice with the payer wallet","tags":["Billing"],"x-required-scope":"billing:write","description":"Sign the exact invoice intent signing_message with the wallet that will pay.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeChainIntent"}}}},"responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoice"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/invoices/{invoice_id}/submit":{"parameters":[{"$ref":"#/components/parameters/invoice_id"}],"post":{"operationId":"submitBillingInvoice","summary":"Submit the signed subscription transaction claim","tags":["Billing"],"x-required-scope":"billing:write","description":"Submit a second signature binding the claimed transaction ID to the authorization. The worker independently verifies the payment.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitChainIntent"}}}},"responses":{"200":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoice"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/keys":{"post":{"operationId":"issueBillingKey","summary":"Issue a scoped server key for the active subscription","tags":["Billing"],"x-required-scope":"billing:write","description":"Requires an active subscription. Keep the returned secret server-side and reuse the same idempotency key if the response is lost.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingKeyRequest"}}}},"responses":{"201":{"description":"Successful scoped billing response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingKey"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/billing/test-keys":{"post":{"operationId":"issueTestBillingKey","summary":"Issue a scoped Sandbox server key","tags":["Billing"],"x-required-scope":"billing:write","description":"Issue a test-only integration key without a paid subscription. A project may issue up to five Sandbox keys per rolling 24 hours and hold up to five active Sandbox keys. Keep the returned secret server-side. If the response is lost, retry with the same billing credential and Idempotency-Key. Regular reads never expose the secret.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingKeyRequest"}}}},"responses":{"201":{"description":"Test-only server key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestBillingKey"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/BillingForbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"description":"Sandbox key limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/chain/assets":{"get":{"operationId":"listChainAssets","summary":"List supported USDC and USDT deployments on configured networks","description":"Live checkout supports Ethereum native USDC and USDT, TRON USDT, and Base native USDC. Only configured networks in the caller's environment are returned. Sandbox keys can discover test USDC on Ethereum Sepolia and Base Sepolia and test USDT on TRON Nile when enabled.\n","tags":["Connections"],"x-required-scope":"payments:read","responses":{"200":{"description":"Allowlisted assets in rollout order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainAssets"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"}}}},"/chain/connections":{"post":{"operationId":"createChainConnection","summary":"Create a watch-only chain connection for the scoped merchant","description":"Select a network returned by listChainAssets for this environment.","tags":["Connections"],"x-required-scope":"connections:manage","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChainConnection"}}}},"responses":{"201":{"description":"Ready connection for a configured chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/connections/{connection_id}/chain-recipients":{"parameters":[{"$ref":"#/components/parameters/connection_id"}],"post":{"operationId":"registerChainRecipients","summary":"Register merchant-controlled one-use stablecoin recipient addresses","tags":["Connections"],"x-required-scope":"connections:manage","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterChainRecipients"}}}},"responses":{"201":{"description":"Registered recipients. Signing material is never returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainRecipients"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/payments":{"post":{"operationId":"createPayment","summary":"Create immutable order payment obligation","tags":["Payments"],"x-required-scope":"payments:write","description":"Same scoped order_ref/order_revision and identical specification returns the existing resource. Changed snapshot requires explicit revision but retains the same business grant identity. For new payments, every allowed connection must support the price denomination in listChainAssets.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Payment persisted. No money has been charged.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayment"}}}}},"get":{"operationId":"listPayments","summary":"List scoped payments","tags":["Payments"],"x-required-scope":"payments:read","description":"","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/payments/{payment_id}":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"get":{"operationId":"getPayment","summary":"Get payment, decision and fulfillment projections","tags":["Payments"],"x-required-scope":"payments:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/payments/{payment_id}/receipt":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"get":{"operationId":"getPaymentReceipt","summary":"Read the confirmed funds received for a payment","tags":["Payments"],"x-required-scope":"payments:read","description":"Returns current finalized on-chain funds linked to this payment's bound quote recipients, grouped by exact token and network. Confirmed reversals, refunds, and dispute adjustments are deducted. These are deposits to the order's recipients and do not establish payer identity or eligibility for fulfillment. Payments without canonical receipt data are reported as unavailable.","responses":{"200":{"description":"Successful scoped receipt response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentReceipt"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/payments/{payment_id}/quotes":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"post":{"operationId":"createQuote","summary":"Freeze stablecoin payable terms","tags":["Quotes"],"x-required-scope":"payments:write","description":"Reserve a unique recipient for the selected network and freeze the amount and token. Quote expiry cannot exceed the payment expiry. New quotes use the selected network's matching asset from listChainAssets.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Immutable quote created.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuote"}}}}}},"/quotes/{quote_id}":{"parameters":[{"$ref":"#/components/parameters/quote_id"}],"get":{"operationId":"getQuote","summary":"Read a frozen quote","tags":["Quotes"],"x-required-scope":"payments:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/quotes/{quote_id}/chain-intents":{"parameters":[{"$ref":"#/components/parameters/quote_id"}],"post":{"operationId":"createChainIntent","summary":"Create a wallet approval challenge for a buyer checkout","tags":["Quotes"],"x-required-scope":"payments:write","description":"The merchant server must first authenticate the buyer and authorize access to the quote. Supply a stable opaque reference for that authenticated checkout. Never send the session credential itself.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChainIntent"}}}},"responses":{"200":{"description":"The checkout's payer and wallet approval message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainIntent"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/quotes/{quote_id}/chain-intents/{intent_id}/authorize":{"parameters":[{"$ref":"#/components/parameters/quote_id"},{"$ref":"#/components/parameters/intent_id"}],"post":{"operationId":"authorizeChainIntent","summary":"Authorize the frozen quote with the chosen payer wallet","tags":["Quotes"],"x-required-scope":"payments:write","description":"Verify the signature over the exact signing_message returned by createChainIntent.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeChainIntent"}}}},"responses":{"200":{"description":"Wallet approval is recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainIntent"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/quotes/{quote_id}/chain-intents/{intent_id}/submit":{"parameters":[{"$ref":"#/components/parameters/quote_id"},{"$ref":"#/components/parameters/intent_id"}],"post":{"operationId":"submitChainIntent","summary":"Bind a broadcast transaction to its authorized checkout","tags":["Quotes"],"x-required-scope":"payments:write","description":"Submit a second wallet signature over signing_message followed by a newline and Transaction, a colon, a space and the canonical transaction ID. The Worker verifies the actual token source and finalized transfer.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitChainIntent"}}}},"responses":{"200":{"description":"The transaction claim is recorded for verification. Check the payment for the resulting decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainIntent"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/payments/{payment_id}/attempts":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"post":{"operationId":"createAttempt","summary":"Get or open the transfer attempt for an assigned chain quote","tags":["Attempts"],"x-required-scope":"attempts:initiate","description":"Chain quotes open a transfer attempt when assigned. Repeating this call returns that attempt.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Chain transfer attempt for the assigned quote.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptMutationResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttempt"}}}}},"get":{"operationId":"listAttempts","summary":"List every payment attempt","tags":["Attempts"],"x-required-scope":"payments:read","description":"","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/attempts/{attempt_id}":{"parameters":[{"$ref":"#/components/parameters/attempt_id"}],"get":{"operationId":"getAttempt","summary":"Get current execution state","tags":["Attempts"],"x-required-scope":"payments:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attempt"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/payments/{payment_id}/verify":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"post":{"operationId":"requestVerification","summary":"Schedule authoritative evidence verification","tags":["Verification"],"x-required-scope":"payments:verify","description":"Does not accept paid=true or set success. Requesting verification does not allocate unverified evidence.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Verification operation queued.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}}}}},"/payments/{payment_id}/cancel":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"post":{"operationId":"cancelPayment","summary":"Stop new collection attempts","tags":["Payments"],"x-required-scope":"payments:write","description":"Preserve every in-flight attempt and late payment. Never infer funds returned from local cancellation.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Collection closed locally. Late transfers remain visible.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPayment"}}}}}},"/payments/{payment_id}/reviews":{"parameters":[{"$ref":"#/components/parameters/payment_id"}],"post":{"operationId":"reviewPayment","summary":"Record a narrow audited fulfillment decision","tags":["Verification"],"x-required-scope":"payments:review","description":"Compare expected_resource_version under lock. accept_unattributed_chain_payment requires the ID of one verified exact chain movement and reviewed evidence. accept_late_payment requires independent valid evidence, bound order, correct full amount/asset/payee/account and timing-only hold; all other blockers fail with 409. It does not reopen collection, manufacture money, clear refunds/disputes, change provenance, or reissue an existing grant. keep_on_hold and reject_fulfillment record persistent business restrictions; reconciliation must not silently discard them. If an effect is already claimed/applied/unknown, preserve that fact and return conflict or review without pretending to undo it. Actor comes from auth; reason and prior/new decision are immutable audit data. New command/outbox, if justified, uses the existing order/action grant identity.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Identical previous review result; no repeated grant.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResult"}}}},"201":{"description":"Review audit and resulting decision committed atomically.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequest"}}}}}},"/operations/{operation_id}":{"parameters":[{"$ref":"#/components/parameters/operation_id"}],"get":{"operationId":"getOperation","summary":"Inspect an operation without repeating it","tags":["Operations"],"x-required-scope":"operations:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/connections":{"get":{"operationId":"listConnections","summary":"List chain connections","tags":["Connections"],"x-required-scope":"connections:read","description":"","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/connections/{connection_id}":{"parameters":[{"$ref":"#/components/parameters/connection_id"}],"get":{"operationId":"getConnection","summary":"Get metadata and capabilities, never secrets","tags":["Connections"],"x-required-scope":"connections:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/connections/{connection_id}/disable":{"parameters":[{"$ref":"#/components/parameters/connection_id"}],"post":{"operationId":"disableConnection","summary":"Stop new actions for this connection","tags":["Connections"],"x-required-scope":"connections:manage","description":"Do not erase pending/unknown operations or delivery work.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Connection disabled; historic operations/evidence retained.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionDisable"}}}}}},"/webhook-endpoints":{"post":{"operationId":"createWebhookEndpoint","summary":"Register merchant event destination","tags":["Webhooks"],"x-required-scope":"webhooks:manage","description":"Validate public HTTPS destination, DNS resolution, redirect policy, private networks and tenant ownership rules; localhost only explicit test allowlist. Store one-time creation response encrypted for narrowly scoped idempotent retry; ordinary reads never expose secret.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Endpoint and one-time signing secret created.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpoint"}}}}}},"/webhook-endpoints/{endpoint_id}":{"parameters":[{"$ref":"#/components/parameters/endpoint_id"}],"get":{"operationId":"getWebhookEndpoint","summary":"Get merchant event destination metadata","tags":["Webhooks"],"x-required-scope":"webhooks:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/webhook-endpoints/{endpoint_id}/rotate-secret":{"parameters":[{"$ref":"#/components/parameters/endpoint_id"}],"post":{"operationId":"rotateWebhookSecret","summary":"Rotate merchant event signing secret","tags":["Webhooks"],"x-required-scope":"webhooks:manage","description":"Different key_id, overlap bounded; sender chooses new key and consumer accepts allowed old key until cutoff.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"New one-time secret and overlap metadata.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateWebhookSecret"}}}}}},"/events":{"get":{"operationId":"listEvents","summary":"Replay project events by opaque cursor","tags":["Events"],"x-required-scope":"events:read","description":"Ordered by committed event sequence within this project/environment. Event bodies immutable. Re-reading events does not reissue grants.","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RequestBudgetExhausted"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/fulfillments/{command_id}":{"parameters":[{"$ref":"#/components/parameters/command_id"}],"get":{"operationId":"getFulfillment","summary":"Get command and current execution projections","tags":["Fulfillment"],"x-required-scope":"fulfillment:read","description":"","parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentCommand"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/fulfillments/{command_id}/claim":{"parameters":[{"$ref":"#/components/parameters/command_id"}],"post":{"operationId":"claimFulfillment","summary":"Request fresh execution permission","tags":["Fulfillment"],"x-required-scope":"fulfillment:execute","description":"Idempotency binds request/claim identity but bypasses generic cached-success replay. Always recheck claim expiry/revocation, current decision and same grant desired_version. claim validity is time-of-check; a chain reorganization can require compensation. Same key cannot create a new lease after expiry.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Current decision, possibly valid=false. Never use HTTP success alone as execution permission.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}}}},"/fulfillments/{command_id}/results":{"parameters":[{"$ref":"#/components/parameters/command_id"}],"post":{"operationId":"reportFulfillmentResult","summary":"Record the merchant-reported outcome","tags":["Fulfillment"],"x-required-scope":"fulfillment:results","description":"A receipt attests the merchant commit; it does not independently prove delivery. Accept late results belonging to a real prior claim, even expired/superseded, and mark review as needed. Conflicting reports append a review record and return conflict; never overwrite silently.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Identical previous outcome returned.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentResult"}}}},"201":{"description":"Outcome durably recorded.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentResultInput"}}}}}},"/fulfillments/{command_id}/retry-delivery":{"parameters":[{"$ref":"#/components/parameters/command_id"}],"post":{"operationId":"retryFulfillmentDelivery","summary":"Redeliver the same immutable command","tags":["Fulfillment"],"x-required-scope":"fulfillment:retry","description":"No new grant identity, no reset of applied/unknown side effects.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Same command/event queued for delivery retry.","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryDelivery"}}}}}}},"webhooks":{"stablepayEvent":{"post":{"operationId":"receiveStablePayEvent","summary":"Outbound event delivered to merchant registered endpoint","security":[],"description":"Authenticate StablePay-Signature against the endpoint key. Exact signing input is UTF8(\"stablepay.webhook.v1\\n\" + event_id + \"\\n\" + delivery_id + \"\\n\" + t + \"\\n\") || raw_body_bytes. HMAC-SHA256 lower hex, t Unix seconds; timing-safe compare; default 300 second clock tolerance. Sender refreshes t/delivery_id each network attempt, event body and command identity unchanged. Durable inbox before ACK. 2xx is receipt only.","parameters":[{"name":"StablePay-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix_seconds>,kid=<key_uuid>,v1=<lowercase_hmac_sha256_hex>"},{"name":"StablePay-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Must equal immutable body.event_id."},{"name":"StablePay-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"New UUID per network delivery attempt; not in immutable event body."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventEnvelope"}}}},"responses":{"200":{"description":"Event durably accepted; no implication of completed fulfillment."},"202":{"description":"Durably queued by merchant."},"400":{"description":"Invalid body or conflicting identity."},"401":{"description":"Invalid signature or timestamp."},"503":{"description":"Not durably accepted; retry same event/command."}}}}},"components":{"securitySchemes":{"ServerKey":{"type":"http","scheme":"bearer","description":"Opaque secret, hashed in key registry, bound to merchant/project/environment and explicit scopes. Never exposed to browser. No tenant selection headers."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Stable per logical caller mutation, scoped to bound merchant/project/environment + operation. Same key with different canonical request -> 409. Claim responses dynamically revalidate validity.","schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}},"Cursor":{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"ConsoleQuery":{"name":"q","in":"query","description":"Case-insensitive partial order reference or exact payment ID.","schema":{"type":"string","maxLength":256}},"ConsoleOffset":{"name":"offset","in":"query","description":"Number of orders to skip. The console page has 25 orders.","schema":{"type":"integer","minimum":0,"maximum":2147483647,"multipleOf":25,"default":0}},"payment_id":{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"attempt_id":{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"quote_id":{"name":"quote_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"invoice_id":{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"intent_id":{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"connection_id":{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"operation_id":{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"command_id":{"name":"command_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"endpoint_id":{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}},"responses":{"BadRequest":{"description":"Malformed input / unsupported asset or action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid server credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Scope, environment, account or resource ownership denied, or an active subscription is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found in caller scope; cross-tenant existence is not disclosed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Idempotency payload mismatch, stale revision, unsafe duplicate operation, binding/allocation conflict or contradictory result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limit. Retry read-only operations after Retry-After; retain logical mutation key.","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BillingForbidden":{"description":"BILLING_KEY_REQUIRED for a non-billing credential or SUBSCRIPTION_REQUIRED when key issuance requires an active paid period.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BillingInvoiceConflict":{"description":"Idempotency payload mismatch, another pending or reconciling invoice (BILLING_INVOICE_IN_PROGRESS), an already scheduled renewal (BILLING_RENEWAL_SCHEDULED), or unavailable recipient capacity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RequestBudgetExhausted":{"description":"API_REQUEST_LIMIT_REACHED. The current request budget is exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"Required service unavailable. An external mutation may still have executed; retain/poll operation ID instead of creating a new payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ConsoleScope":{"type":"object","additionalProperties":false,"required":["merchant_id","project_id","environment"],"properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"}}},"ConsoleScopeResponse":{"type":"object","additionalProperties":false,"required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/ConsoleScope"}}},"ConsoleMoney":{"type":"object","additionalProperties":false,"required":["asset","amount_atomic","scale"],"properties":{"asset":{"type":"string","minLength":1,"maxLength":160},"amount_atomic":{"type":"string","pattern":"^(0|[1-9][0-9]{0,77})$"},"scale":{"type":"integer","minimum":0,"maximum":36},"symbol":{"type":"string","minLength":1,"maxLength":32}}},"ConsoleConnection":{"type":"object","additionalProperties":false,"required":["connection_id","display_name","provider","mode","status","provider_account_id","identity_verified","validated_at"],"properties":{"connection_id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"provider":{"type":"string"},"mode":{"type":"string"},"status":{"type":"string"},"provider_account_id":{"type":["string","null"]},"identity_verified":{"type":"boolean"},"validated_at":{"type":["string","null"],"format":"date-time"},"chain_id":{"type":"integer","minimum":0},"network_name":{"type":"string"}}},"ConsoleOrderRow":{"type":"object","additionalProperties":false,"required":["id","order_ref","order_revision","price","created_at","funding_status","decision_status","delivery_status","execution_status","reason_codes"],"properties":{"id":{"type":"string","format":"uuid"},"order_ref":{"type":"string"},"order_revision":{"type":"integer","minimum":0},"price":{"$ref":"#/components/schemas/ConsoleMoney"},"created_at":{"type":"string","format":"date-time"},"funding_status":{"type":"string"},"decision_status":{"type":["string","null"]},"delivery_status":{"type":["string","null"]},"execution_status":{"type":["string","null"]},"reason_codes":{"type":["array","null"],"items":{"type":"string"}}}},"ConsoleTotals":{"type":"object","additionalProperties":false,"required":["orders","eligible","attention","applied","deliveries_exhausted","deliveries_retrying","verification_exhausted","unknown_operations","usage","queue_lag_seconds","monthly_limit"],"properties":{"orders":{"type":"integer","minimum":0},"eligible":{"type":"integer","minimum":0},"attention":{"type":"integer","minimum":0},"applied":{"type":"integer","minimum":0},"deliveries_exhausted":{"type":"integer","minimum":0},"deliveries_retrying":{"type":"integer","minimum":0},"verification_exhausted":{"type":"integer","minimum":0},"unknown_operations":{"type":"integer","minimum":0},"usage":{"type":"integer","minimum":0},"queue_lag_seconds":{"type":["integer","null"],"minimum":0},"monthly_limit":{"type":["integer","null"],"minimum":0}}},"ConsoleReconciliation":{"type":"object","additionalProperties":false,"required":["connection_id","stream","covered_through","next_scan_at","lag_seconds","consecutive_failures","last_error_code"],"properties":{"connection_id":{"type":"string","format":"uuid"},"stream":{"type":["string","null"]},"covered_through":{"type":["string","null"],"format":"date-time"},"next_scan_at":{"type":["string","null"],"format":"date-time"},"lag_seconds":{"type":["integer","null"],"minimum":0},"consecutive_failures":{"type":["integer","null"],"minimum":0},"last_error_code":{"type":["string","null"]},"next_chain_block":{"type":["string","null"]}}},"ConsoleAudit":{"type":"object","additionalProperties":false,"required":["id","action","actor_type","actor_ref","subject_type","subject_id","reason","occurred_at"],"properties":{"id":{"type":"string","format":"uuid"},"action":{"type":"string"},"actor_type":{"type":"string"},"actor_ref":{"type":"string"},"subject_type":{"type":"string"},"subject_id":{"type":"string"},"reason":{"type":["string","null"]},"occurred_at":{"type":"string","format":"date-time"}}},"ConsoleOverview":{"type":"object","additionalProperties":false,"required":["scope","orders","has_more","connections","totals","reconciliation","audit"],"properties":{"scope":{"$ref":"#/components/schemas/ConsoleScope"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleOrderRow"},"maxItems":25},"has_more":{"type":"boolean"},"connections":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleConnection"},"maxItems":100},"totals":{"$ref":"#/components/schemas/ConsoleTotals"},"reconciliation":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleReconciliation"},"maxItems":100},"audit":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleAudit"},"maxItems":100}}},"ConsoleAdjustment":{"type":"object","additionalProperties":false,"required":["adjustment_id","kind","status","money","external_ref","observed_at"],"properties":{"adjustment_id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"status":{"type":"string"},"money":{"anyOf":[{"$ref":"#/components/schemas/ConsoleMoney"},{"type":"null"}]},"external_ref":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"}}},"ConsolePaymentSummary":{"type":"object","additionalProperties":false,"required":["payment_id","order_ref","order_revision","environment","price","lifecycle","funding_status","resource_version","created_at","decision","verification","fulfillment","adjustments"],"properties":{"payment_id":{"type":"string","format":"uuid"},"order_ref":{"type":"string"},"order_revision":{"type":"integer","minimum":0},"environment":{"$ref":"#/components/schemas/Environment"},"price":{"$ref":"#/components/schemas/ConsoleMoney"},"lifecycle":{"type":"string"},"funding_status":{"type":"string"},"resource_version":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"decision":{"$ref":"#/components/schemas/Decision"},"verification":{"$ref":"#/components/schemas/Verification"},"fulfillment":{"$ref":"#/components/schemas/FulfillmentSummary"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleAdjustment"},"maxItems":1000}}},"ConsoleTransferDisplay":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"const":"transfer_instruction"},"token_address":{"type":"string"},"recipient":{"type":"string"},"network_id":{"type":"string"},"symbol":{"type":"string"},"representation":{"type":"string"},"chain_id":{"type":"integer","minimum":0}}},"ConsoleAttemptBinding":{"type":"object","additionalProperties":false,"required":["method","status"],"properties":{"method":{"type":"string"},"status":{"type":"string"}}},"ConsoleAttempt":{"type":"object","additionalProperties":false,"required":["attempt_id","mode","execution_status","connection_id","operation_id","binding","external_resources","created_at"],"properties":{"attempt_id":{"type":"string","format":"uuid"},"mode":{"type":"string"},"execution_status":{"type":"string"},"connection_id":{"type":"string","format":"uuid"},"operation_id":{"type":["string","null"],"format":"uuid"},"binding":{"$ref":"#/components/schemas/ConsoleAttemptBinding"},"external_resources":{"type":"array","items":{"$ref":"#/components/schemas/ExternalResource"}},"created_at":{"type":"string","format":"date-time"},"next_action":{"$ref":"#/components/schemas/ConsoleTransferDisplay"}}},"ConsoleDecisionRecord":{"type":"object","additionalProperties":false,"required":["id","version","status","verification_status","binding_status","funding_status","basis","reason_codes","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"string","pattern":"^[1-9][0-9]*$"},"status":{"type":"string"},"verification_status":{"type":"string"},"binding_status":{"type":"string"},"funding_status":{"type":"string"},"basis":{"type":"string"},"reason_codes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"}}},"ConsoleOperation":{"type":"object","additionalProperties":false,"required":["id","attempt_id","kind","status","last_error_code","next_recovery_at","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"attempt_id":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string"},"status":{"type":"string"},"last_error_code":{"type":["string","null"]},"next_recovery_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"ConsoleEvidence":{"type":"object","additionalProperties":false,"required":["id","basis","source_version","observed_at","hash","resource_type","external_resource_id"],"properties":{"id":{"type":"string","format":"uuid"},"basis":{"type":"string"},"source_version":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"resource_type":{"type":["string","null"]},"external_resource_id":{"type":["string","null"]}}},"ConsoleCommand":{"type":"object","additionalProperties":false,"required":["id","kind","delivery_status","execution_status","control_status","desired_version","created_at","receipt_result","receipt_at","applied_version","effect_reference","review_reasons"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"delivery_status":{"type":"string"},"execution_status":{"type":"string"},"control_status":{"type":"string"},"desired_version":{"type":"string","pattern":"^[1-9][0-9]*$"},"created_at":{"type":"string","format":"date-time"},"receipt_result":{"type":["string","null"]},"receipt_at":{"type":["string","null"],"format":"date-time"},"applied_version":{"type":["string","null"],"pattern":"^[1-9][0-9]*$"},"effect_reference":{"type":["string","null"]},"review_reasons":{"type":["array","null"],"items":{"type":"string"}}}},"ConsoleDelivery":{"type":"object","additionalProperties":false,"required":["id","command_id","status","attempt_count","next_attempt_at","last_error_code","delivered_at"],"properties":{"id":{"type":"string","format":"uuid"},"command_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"attempt_count":{"type":"integer","minimum":0},"next_attempt_at":{"type":"string","format":"date-time"},"last_error_code":{"type":["string","null"]},"delivered_at":{"type":["string","null"],"format":"date-time"}}},"ConsoleMovement":{"type":"object","additionalProperties":false,"required":["id","movement_type","canonical_movement_id","status","price","provider_occurred_at"],"properties":{"id":{"type":"string","format":"uuid"},"movement_type":{"type":"string"},"canonical_movement_id":{"type":"string"},"status":{"type":"string"},"chain_id":{"type":["string","null"],"pattern":"^[0-9]+$"},"chain_intent_verified":{"type":["boolean","null"]},"price":{"$ref":"#/components/schemas/ConsoleMoney"},"provider_occurred_at":{"type":"string","format":"date-time"}}},"ConsolePaymentDetail":{"type":"object","additionalProperties":false,"required":["scope","payment","attempts","decisions","operations","evidence","commands","deliveries","audit","movements"],"properties":{"scope":{"$ref":"#/components/schemas/ConsoleScope"},"payment":{"$ref":"#/components/schemas/ConsolePaymentSummary"},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleAttempt"},"maxItems":100},"decisions":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleDecisionRecord"},"maxItems":100},"operations":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleOperation"},"maxItems":100},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleEvidence"},"maxItems":100},"commands":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleCommand"},"maxItems":100},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleDelivery"},"maxItems":100},"audit":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleAudit"},"maxItems":100},"movements":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleMovement"},"maxItems":100}}},"Environment":{"type":"string","enum":["test","live"]},"EvmAddress":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"EvmHash":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"ChainSelectorId":{"type":"integer","enum":[1,8453,84532,11155111,31337,31339,728126428,3448148188,900003],"description":"Supported EVM or TRON chain selector. Use network_id for the network reference."},"ChainNetworkId":{"type":"string","pattern":"^(eip155:(1|8453|84532|11155111|31337|31339)|tron:(728126428|3448148188|900003|0x2b6653dc))$","description":"Decimal TRON identifiers are emitted. The hexadecimal TRON mainnet alias is accepted on connection creation."},"ChainFamily":{"type":"string","enum":["evm","tron"]},"StableDenomination":{"type":"string","enum":["stable:USDC","stable:USDT"],"description":"Order denomination, expressed in six decimal places."},"ChainTokenSymbol":{"type":"string","enum":["USDC","USDT"]},"ChainAssetRepresentation":{"type":"string","enum":["native","fixture"],"description":"Native tokens are used for live checkout."},"ChainAddress":{"oneOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"string","pattern":"^T[1-9A-HJ-NP-Za-km-z]{33}$"}]},"ChainQuoteTerms":{"type":"object","additionalProperties":false,"required":["chain_id","token_address","start_block","anchor_hash","starts_at_epoch"],"properties":{"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"family":{"$ref":"#/components/schemas/ChainFamily"},"denomination":{"$ref":"#/components/schemas/StableDenomination"},"symbol":{"$ref":"#/components/schemas/ChainTokenSymbol"},"representation":{"$ref":"#/components/schemas/ChainAssetRepresentation"},"token_address":{"$ref":"#/components/schemas/ChainAddress"},"start_block":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"First block eligible for observation."},"anchor_hash":{"$ref":"#/components/schemas/EvmHash"},"starts_at_epoch":{"type":"integer","minimum":1,"description":"Earliest eligible transfer time, as a UTC Unix timestamp in seconds."}}},"ChainAssets":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"array","maxItems":11,"items":{"type":"object","additionalProperties":false,"required":["asset","denomination","symbol","representation","token_address","chain_id","decimals","priority","finality","network_id","network_name","family"],"properties":{"asset":{"type":"string"},"denomination":{"$ref":"#/components/schemas/StableDenomination"},"symbol":{"$ref":"#/components/schemas/ChainTokenSymbol"},"representation":{"$ref":"#/components/schemas/ChainAssetRepresentation"},"token_address":{"$ref":"#/components/schemas/ChainAddress"},"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"network_name":{"type":"string"},"family":{"$ref":"#/components/schemas/ChainFamily"},"decimals":{"const":6},"priority":{"type":"integer","minimum":1,"maximum":6},"finality":{"const":"finalized"}}}}}},"CreateChainConnection":{"type":"object","additionalProperties":false,"required":["display_name"],"oneOf":[{"required":["chain_id"]},{"required":["network_id"]}],"properties":{"display_name":{"type":"string","minLength":1,"maxLength":128},"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"}}},"RegisterChainRecipients":{"type":"object","additionalProperties":false,"required":["recipients"],"properties":{"denomination":{"$ref":"#/components/schemas/StableDenomination","description":"Determines the denomination for recipient registration. Omission selects USDC on EVM or USDT on TRON. EVM recipients are shared before a quote is assigned."},"recipients":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["address","signature"],"properties":{"address":{"$ref":"#/components/schemas/ChainAddress","description":"Seller wallet address."},"signature":{"type":"string","writeOnly":true,"pattern":"^0x[0-9a-fA-F]{130}$","description":"Scoped EIP-191 proof on EVM or TIP-191 personal proof on TRON, encoded as hex."}}}}}},"ChainRecipients":{"type":"object","additionalProperties":false,"required":["connection_id","chain_id","addresses"],"properties":{"connection_id":{"type":"string","format":"uuid"},"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"denomination":{"$ref":"#/components/schemas/StableDenomination"},"addresses":{"type":"array","description":"Registered wallet addresses.","items":{"$ref":"#/components/schemas/ChainAddress"}}}},"Money":{"type":"object","properties":{"asset":{"type":"string","description":"A stablecoin denomination or exact registered chain asset.","minLength":1,"maxLength":160},"amount_atomic":{"type":"string","description":"Positive integer in the asset minor unit; never a float.","pattern":"^[1-9][0-9]{0,77}$"},"scale":{"type":"integer","minimum":0,"maximum":36}},"required":["asset","amount_atomic","scale"],"additionalProperties":false,"description":"The asset registry confirms scale. USDC 10.00 is amount_atomic=\"10000000\", scale=6."},"PaymentReceipt":{"type":"object","required":["payment_id","availability","confirmed_received"],"additionalProperties":false,"properties":{"payment_id":{"type":"string","format":"uuid"},"availability":{"type":"string","enum":["available","unavailable"],"description":"Available allows an empty array when no current finalized deposit remains."},"confirmed_received":{"type":"array","items":{"$ref":"#/components/schemas/ConfirmedReceiptTotal"}}}},"ConfirmedReceiptTotal":{"type":"object","required":["asset","amount_atomic","scale","symbol","network_id","network_name","last_confirmed_at"],"additionalProperties":false,"properties":{"asset":{"type":"string","minLength":1,"maxLength":160},"amount_atomic":{"type":"string","description":"Positive sum of finalized deposits, in the asset minor unit.","pattern":"^[1-9][0-9]*$"},"scale":{"type":"integer","minimum":0,"maximum":36},"symbol":{"type":["string","null"]},"network_id":{"anyOf":[{"$ref":"#/components/schemas/ChainNetworkId"},{"type":"null"}]},"network_name":{"type":["string","null"]},"last_confirmed_at":{"type":["string","null"],"format":"date-time","description":"Canonical chain timestamp of the latest included deposit."}}},"NonNegativeMoney":{"type":"object","properties":{"asset":{"type":"string","minLength":1,"maxLength":160},"amount_atomic":{"type":"string","pattern":"^(0|[1-9][0-9]{0,77})$"},"scale":{"type":"integer","minimum":0,"maximum":36}},"required":["asset","amount_atomic","scale"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"},"details":{"type":"object","additionalProperties":true}},"required":["code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"FulfillmentSpec":{"type":"object","properties":{"mode":{"type":"string","enum":["merchant_action","webhook_only"]},"action_ref":{"type":"string","description":"Stable per order business effect; reuse across payment/price retries.","minLength":1,"maxLength":128},"action":{"type":"string","minLength":1,"maxLength":128},"target_ref":{"type":"string","description":"Merchant-owned identity fixed before payment.","minLength":1,"maxLength":256},"endpoint_id":{"type":"string","format":"uuid"},"payload":{"type":"object","additionalProperties":true}},"required":["mode","action_ref","action","target_ref","endpoint_id","payload"],"additionalProperties":false,"description":"R1 has one immutable business action per Payment. Multi-item carts should be one merchant action with an immutable line snapshot; splitting business effects requires explicit independent action identities."},"CreatePayment":{"type":"object","properties":{"order_ref":{"type":"string","minLength":1,"maxLength":128},"order_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"customer_ref":{"type":"string","minLength":1,"maxLength":256},"price":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":"object","properties":{"asset":{"enum":["stable:USDC","stable:USDT"]},"scale":{"const":6}}}]},"allowed_connections":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":16},"policy_ref":{"type":"string","minLength":1,"maxLength":128},"expires_in_seconds":{"type":"integer","minimum":60,"maximum":86400,"default":1800},"fulfillment":{"$ref":"#/components/schemas/FulfillmentSpec"},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"maxProperties":20}},"required":["order_ref","order_revision","customer_ref","price","allowed_connections","policy_ref","expires_in_seconds","fulfillment"],"additionalProperties":false},"Assurance":{"type":"object","properties":{"kind":{"type":"string","enum":["none","provider_authorized","provider_capture","chain_included","chain_finalized","merchant_attested"]},"reversible":{"type":"boolean"},"details":{"type":"object","additionalProperties":true}},"required":["kind","reversible"],"additionalProperties":false},"Verification":{"type":"object","properties":{"status":{"type":"string","enum":["pending","valid","invalid","unavailable"]},"basis":{"anyOf":[{"type":"string","enum":["provider_api","provider_signed_event","canonical_chain","merchant_attestation"]},{"type":"null"}]},"binding":{"type":"string","enum":["bound","unbound","ambiguous"]},"assurance":{"$ref":"#/components/schemas/Assurance"},"checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reason_codes":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":32}},"required":["status","basis","binding","assurance","checked_at","reason_codes"],"additionalProperties":false},"Decision":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["awaiting","eligible","held","revoked"]},"reason_codes":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":32},"policy_ref":{"type":"string"},"observed_at":{"type":"string","format":"date-time"},"evidence_ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":0,"maxItems":100}},"required":["id","version","status","reason_codes","policy_ref","observed_at","evidence_ids"],"additionalProperties":false},"FulfillmentSummary":{"type":"object","properties":{"command_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"delivery_status":{"type":"string","enum":["pending","delivered","retrying","exhausted"]},"execution_status":{"type":"string","enum":["pending","applied","noop","failed","unknown"]}},"required":["command_id","delivery_status","execution_status"],"additionalProperties":false},"Adjustment":{"type":"object","properties":{"adjustment_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["refund","dispute","reversal","reorg","manual_review"]},"status":{"type":"string","description":"Provider-specific substate preserved."},"money":{"anyOf":[{"$ref":"#/components/schemas/NonNegativeMoney"},{"type":"null"}]},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed_at":{"type":"string","format":"date-time"}},"required":["adjustment_id","kind","status","money","external_ref","observed_at"],"additionalProperties":false},"Payment":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"payment_id":{"type":"string","format":"uuid"},"order_ref":{"type":"string"},"order_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"customer_ref":{"type":"string"},"price":{"$ref":"#/components/schemas/Money"},"allowed_connections":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":16},"policy_ref":{"type":"string"},"lifecycle":{"type":"string","enum":["open","expired","canceled","closed"]},"funding_status":{"type":"string","enum":["unfunded","partial","funded","excess"]},"verification":{"$ref":"#/components/schemas/Verification"},"decision":{"$ref":"#/components/schemas/Decision"},"fulfillment":{"$ref":"#/components/schemas/FulfillmentSummary"},"fulfillment_spec":{"$ref":"#/components/schemas/FulfillmentSpec"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/Adjustment"},"minItems":0,"maxItems":1000},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["merchant_id","project_id","environment","payment_id","order_ref","order_revision","customer_ref","price","allowed_connections","policy_ref","lifecycle","funding_status","verification","decision","fulfillment","fulfillment_spec","adjustments","expires_at","created_at","updated_at","resource_version"],"additionalProperties":false},"CreateQuote":{"type":"object","properties":{"connection_id":{"type":"string","format":"uuid"},"presentment_asset":{"type":"string","description":"Use the payment’s stablecoin denomination or the exact registered asset for the selected network.","minLength":1,"maxLength":160},"expires_in_seconds":{"type":"integer","minimum":30,"maximum":1800,"default":900}},"required":["connection_id","presentment_asset","expires_in_seconds"],"additionalProperties":false},"Quote":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"quote_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"connection_id":{"type":"string","format":"uuid"},"pricing_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"payable":{"$ref":"#/components/schemas/Money"},"chain":{"$ref":"#/components/schemas/ChainQuoteTerms"},"recipient_account":{"type":"string"},"pricing_terms_hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["merchant_id","project_id","environment","quote_id","payment_id","connection_id","pricing_revision","payable","recipient_account","pricing_terms_hash","expires_at","created_at"],"additionalProperties":false,"description":"Quote is immutable. Server derives payable and recipient from registered Payment/Connection; callers cannot redirect funds."},"ExternalResource":{"type":"object","properties":{"type":{"type":"string","enum":["chain_transaction"]},"id":{"type":"string","minLength":1,"maxLength":256}},"required":["type","id"],"additionalProperties":false},"CreateAttempt":{"type":"object","properties":{"connection_id":{"type":"string","format":"uuid"},"quote_id":{"type":"string","format":"uuid"}},"required":["connection_id","quote_id"],"additionalProperties":false},"TransferInstructionAction":{"type":"object","properties":{"type":{"const":"transfer_instruction"},"quote_id":{"type":"string","format":"uuid"},"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"token_address":{"$ref":"#/components/schemas/ChainAddress"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"family":{"$ref":"#/components/schemas/ChainFamily"},"denomination":{"$ref":"#/components/schemas/StableDenomination"},"symbol":{"$ref":"#/components/schemas/ChainTokenSymbol"},"representation":{"$ref":"#/components/schemas/ChainAssetRepresentation"},"starts_at_epoch":{"type":"integer","minimum":1,"description":"Earliest eligible transfer time, as a UTC Unix timestamp in seconds."},"expires_at":{"type":"string","format":"date-time"},"recipient":{"type":"string"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"payable":{"$ref":"#/components/schemas/Money"}},"required":["type","quote_id","chain_id","token_address","starts_at_epoch","expires_at","recipient","reference","payable"],"additionalProperties":false,"description":"Watch-only stablecoin payment with the exact registered deployment and permanently assigned recipient in the quote."},"NoAction":{"type":"object","properties":{"type":{"const":"none"}},"required":["type"],"additionalProperties":false},"NextAction":{"oneOf":[{"$ref":"#/components/schemas/TransferInstructionAction"},{"$ref":"#/components/schemas/NoAction"}],"discriminator":{"propertyName":"type","mapping":{"transfer_instruction":"#/components/schemas/TransferInstructionAction","none":"#/components/schemas/NoAction"}}},"Binding":{"type":"object","properties":{"status":{"type":"string","enum":["bound","unbound","ambiguous"]},"method":{"type":"string","enum":["provider_resource_mapping","provider_invoice_reference","unique_recipient","invoice_event","merchant_attestation"]},"reference":{"type":"string"},"registered_at":{"type":"string","format":"date-time"},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["status","method","reference","registered_at","verified_at"],"additionalProperties":false},"Attempt":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"attempt_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"quote_id":{"type":"string","format":"uuid"},"connection_id":{"type":"string","format":"uuid"},"mode":{"type":"string","enum":["managed","external"]},"execution_status":{"type":"string","enum":["created","requires_action","processing","unknown","succeeded","failed","canceled"]},"operation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"external_resources":{"type":"array","items":{"$ref":"#/components/schemas/ExternalResource"},"minItems":0,"maxItems":32},"binding":{"$ref":"#/components/schemas/Binding"},"next_action":{"$ref":"#/components/schemas/NextAction"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["merchant_id","project_id","environment","attempt_id","payment_id","quote_id","connection_id","mode","execution_status","operation_id","external_resources","binding","next_action","created_at","updated_at","resource_version"],"additionalProperties":false,"description":"A transfer instruction identifies the registered asset and assigned recipient for an unfinished quote. The Worker verifies funds from finalized chain evidence. The transfer instruction is available while the quote can accept payment.","allOf":[{"if":{"properties":{"execution_status":{"const":"unknown"}}},"then":{"properties":{"next_action":{"$ref":"#/components/schemas/NoAction"}}}}]},"Operation":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"operation_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["create_attempt","confirm_attempt","cancel_payment","verify_payment","recover_operation","validate_connection","retry_delivery"]},"status":{"type":"string","enum":["prepared","running","unknown","succeeded","failed","review_required"]},"resource_id":{"type":"string","format":"uuid"},"request_hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"provider_request_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"result_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason_codes":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":32},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"next_check_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["merchant_id","project_id","environment","operation_id","kind","status","resource_id","request_hash","provider_request_ref","result_ref","reason_codes","created_at","updated_at","next_check_at"],"additionalProperties":false},"AttemptMutationResult":{"type":"object","properties":{"attempt":{"$ref":"#/components/schemas/Attempt"},"operation":{"anyOf":[{"$ref":"#/components/schemas/Operation"},{"type":"null"}]}},"required":["attempt","operation"],"additionalProperties":false},"BillingPlanId":{"type":"string","enum":["sandbox","starter","growth","scale"]},"PaidBillingPlanId":{"type":"string","enum":["starter","growth","scale"]},"BillingPrice":{"type":"object","properties":{"asset":{"$ref":"#/components/schemas/StableDenomination"},"amount_atomic":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})$"},"scale":{"const":6}},"required":["asset","amount_atomic","scale"],"additionalProperties":false},"BillingPlan":{"type":"object","properties":{"plan_id":{"$ref":"#/components/schemas/BillingPlanId"},"environment":{"$ref":"#/components/schemas/Environment"},"price":{"$ref":"#/components/schemas/BillingPrice","description":"The plan's reference price in USDC."},"prices":{"type":"array","description":"Fixed nominal prices in each supported subscription asset. Availability depends on collection_options.","items":{"$ref":"#/components/schemas/BillingPrice"}},"request_limit":{"type":"integer","minimum":1},"period_days":{"type":["integer","null"],"enum":[30,null],"description":"The free test plan uses UTC calendar months."}},"required":["plan_id","environment","price","prices","request_limit","period_days"],"additionalProperties":false},"BillingPlans":{"type":"object","properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlan"}},"collection_options":{"type":"array","description":"Currently offered collection networks and settlement assets with available recipients.","items":{"$ref":"#/components/schemas/BillingCollectionOption"}}},"required":["plans"],"additionalProperties":false},"BillingCollectionOption":{"type":"object","properties":{"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"network_name":{"type":"string"},"family":{"$ref":"#/components/schemas/ChainFamily"},"asset":{"$ref":"#/components/schemas/StableDenomination"},"scale":{"const":6},"is_default":{"type":"boolean"}},"required":["network_id","network_name","family","asset","scale","is_default"],"additionalProperties":false},"BillingSubscription":{"type":"object","properties":{"environment":{"$ref":"#/components/schemas/Environment"},"status":{"type":"string","enum":["active","inactive"]},"plan_id":{"anyOf":[{"$ref":"#/components/schemas/BillingPlanId"},{"type":"null"}]},"period_start":{"type":["string","null"],"format":"date-time"},"period_end":{"type":["string","null"],"format":"date-time"},"request_limit":{"type":"integer","minimum":0},"requests_used":{"type":"integer","minimum":0}},"required":["environment","status","plan_id","period_start","period_end","request_limit","requests_used"],"additionalProperties":false},"CreateBillingInvoice":{"type":"object","properties":{"plan_id":{"$ref":"#/components/schemas/PaidBillingPlanId"},"payer_address":{"$ref":"#/components/schemas/ChainAddress"},"checkout_session_ref":{"$ref":"#/components/schemas/ChainCheckoutSessionRef"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId","description":"Collection network offered in BillingPlans. Ethereum and Base settle in USDC, TRON settles in USDT. The default connection is used when omitted."}},"required":["plan_id","payer_address","checkout_session_ref"],"additionalProperties":false},"BillingInvoice":{"type":"object","properties":{"invoice_id":{"type":"string","format":"uuid"},"plan_id":{"$ref":"#/components/schemas/PaidBillingPlanId"},"environment":{"$ref":"#/components/schemas/Environment"},"status":{"type":"string","enum":["pending","reconciling","active","scheduled","expired","revoked"],"description":"Reconciling means a wallet-authorized invoice still awaits final reconciliation after transaction submission or quote expiry. Resume that invoice and wait before paying another one."},"price":{"$ref":"#/components/schemas/BillingPrice"},"quote":{"$ref":"#/components/schemas/Quote"},"intent":{"$ref":"#/components/schemas/ChainIntent"},"period_start":{"type":["string","null"],"format":"date-time"},"period_end":{"type":["string","null"],"format":"date-time"}},"required":["invoice_id","plan_id","environment","status","price","quote","intent","period_start","period_end"],"additionalProperties":false},"BillingInvoiceList":{"type":"object","properties":{"invoices":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/BillingInvoice"}}},"required":["invoices"],"additionalProperties":false},"BillingKeyRequest":{"type":"object","additionalProperties":false},"BillingKey":{"type":"object","properties":{"key_id":{"type":"string","format":"uuid"},"token":{"type":"string","pattern":"^sp_(test|live)_[0-9a-f]{16}\\.[A-Za-z0-9_-]{43}$"},"environment":{"$ref":"#/components/schemas/Environment"}},"required":["key_id","token","environment"],"additionalProperties":false},"TestBillingKey":{"allOf":[{"$ref":"#/components/schemas/BillingKey"},{"type":"object","properties":{"environment":{"const":"test"},"token":{"type":"string","pattern":"^sp_test_[0-9a-f]{16}\\.[A-Za-z0-9_-]{43}$"}}}]},"ChainCheckoutSessionRef":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","description":"Stable opaque reference assigned by the merchant server to the authenticated buyer checkout."},"ChainIntentSignature":{"type":"string","pattern":"^0x[0-9A-Fa-f]{130}$","description":"A 0x-prefixed 65-byte wallet signature."},"ChainIntentTransactionId":{"type":"string","pattern":"^(0x)?[0-9A-Fa-f]{64}$","description":"EVM and TRON IDs are canonicalized to lowercase 0x-prefixed hex. TRON accepts bare hex."},"CreateChainIntent":{"type":"object","properties":{"checkout_session_ref":{"$ref":"#/components/schemas/ChainCheckoutSessionRef"},"payer_address":{"$ref":"#/components/schemas/ChainAddress"}},"required":["checkout_session_ref","payer_address"],"additionalProperties":false},"AuthorizeChainIntent":{"type":"object","properties":{"checkout_session_ref":{"$ref":"#/components/schemas/ChainCheckoutSessionRef"},"signature":{"$ref":"#/components/schemas/ChainIntentSignature"}},"required":["checkout_session_ref","signature"],"additionalProperties":false},"SubmitChainIntent":{"type":"object","properties":{"checkout_session_ref":{"$ref":"#/components/schemas/ChainCheckoutSessionRef"},"transaction_id":{"$ref":"#/components/schemas/ChainIntentTransactionId"},"signature":{"$ref":"#/components/schemas/ChainIntentSignature"}},"required":["checkout_session_ref","transaction_id","signature"],"additionalProperties":false},"ChainIntent":{"type":"object","properties":{"intent_id":{"type":"string","format":"uuid"},"quote_id":{"type":"string","format":"uuid"},"family":{"$ref":"#/components/schemas/ChainFamily"},"payer_address":{"$ref":"#/components/schemas/ChainAddress"},"expires_at":{"type":"string","format":"date-time"},"signing_message":{"type":"string","minLength":1,"maxLength":2048,"description":"Exact UTF-8 message to sign for this checkout and payer. Preserve line endings and spacing."},"status":{"type":"string","enum":["pending","authorized","submitted"]},"transaction_id":{"anyOf":[{"$ref":"#/components/schemas/ChainIntentTransactionId"},{"type":"null"}]}},"required":["intent_id","quote_id","family","payer_address","expires_at","signing_message","status","transaction_id"],"additionalProperties":false},"VerifyRequest":{"type":"object","properties":{"attempt_id":{"type":"string","format":"uuid"},"reason":{"type":"string","enum":["buyer_return","merchant_request","reconciliation","support_retry"]}},"required":["reason"],"additionalProperties":false},"CancelPayment":{"type":"object","properties":{"expected_resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["expected_resource_version","reason"],"additionalProperties":false,"description":"Stops new transfer attempts immediately. Previously sent or in-flight transfers can still settle on-chain."},"ReviewRequest":{"type":"object","properties":{"expected_resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"action":{"type":"string","enum":["accept_late_payment","accept_unattributed_chain_payment","keep_on_hold","reject_fulfillment"]},"movement_id":{"type":"string","format":"uuid","description":"Verified on-chain receipt to apply when accepting an unattributed payment."},"allow_late_payment":{"type":"boolean","description":"Explicit operator approval for the specified movement after expiry."},"reason":{"type":"string","description":"Required human/business justification; not a replacement payment proof.","minLength":8,"maxLength":2000}},"required":["expected_resource_version","action","reason"],"additionalProperties":false,"allOf":[{"if":{"properties":{"action":{"const":"accept_unattributed_chain_payment"}}},"then":{"required":["movement_id"]},"else":{"not":{"anyOf":[{"required":["movement_id"]},{"required":["allow_late_payment"]}]}}}],"description":"Narrow audited business exception. accept_late_payment only accepts independently valid, bound, correctly funded evidence held for timing. accept_unattributed_chain_payment can override missing wallet approval only for the named verified movement. Neither action overrides amount, payee, account, asset, evidence integrity or duplicate allocation."},"ReviewResult":{"type":"object","properties":{"review_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["accept_late_payment","accept_unattributed_chain_payment","keep_on_hold","reject_fulfillment"]},"previous_decision_id":{"type":"string","format":"uuid"},"decision":{"$ref":"#/components/schemas/Decision"},"actor_ref":{"type":"string","description":"Server-derived authenticated principal; caller cannot choose it."},"reason":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["review_id","payment_id","action","previous_decision_id","decision","actor_ref","reason","created_at"],"additionalProperties":false,"description":"Immutable review/audit record plus resulting decision committed together. review_id may be the audit_events primary key. Existing grant identity is reused; no duplicate grant or automatic compensation is manufactured."},"Capabilities":{"type":"object","properties":{"create_checkout":{"type":"boolean"},"confirm_payment":{"type":"boolean"},"retrieve_evidence":{"type":"boolean"},"signed_events":{"type":"boolean"},"reconcile_changes":{"type":"boolean"},"observe_refunds":{"type":"boolean"},"observe_disputes":{"type":"boolean"},"enforce_expiry":{"type":"boolean"},"binding_methods":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":16}},"required":["create_checkout","confirm_payment","retrieve_evidence","signed_events","reconcile_changes","observe_refunds","observe_disputes","enforce_expiry","binding_methods"],"additionalProperties":false},"Connection":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"connection_id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["evm","tron"]},"chain_id":{"$ref":"#/components/schemas/ChainSelectorId"},"network_id":{"$ref":"#/components/schemas/ChainNetworkId"},"network_name":{"type":"string"},"display_name":{"type":"string"},"mode":{"type":"string","enum":["observe","initiate"]},"expected_provider_account_id":{"type":"string"},"provider_account_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"identity_verified":{"type":"boolean"},"status":{"type":"string","enum":["unvalidated","ready","disabled","error"]},"capabilities":{"$ref":"#/components/schemas/Capabilities"},"return_origins":{"type":"array","items":{"type":"string","format":"uri"},"minItems":0,"maxItems":1000},"validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["merchant_id","project_id","environment","connection_id","provider","display_name","mode","expected_provider_account_id","provider_account_id","identity_verified","status","capabilities","return_origins","validated_at","created_at","updated_at","resource_version"],"additionalProperties":false,"description":"Ready chain connections can be used for new payments.","allOf":[{"if":{"properties":{"status":{"const":"ready"}}},"then":{"properties":{"identity_verified":{"const":true},"provider_account_id":{"type":"string","minLength":1}}}},{"if":{"properties":{"identity_verified":{"const":true}}},"then":{"properties":{"provider_account_id":{"type":"string","minLength":1}}}}]},"ConnectionDisable":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"expected_resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["reason","expected_resource_version"],"additionalProperties":false},"CreateWebhookEndpoint":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS in live. Local test exception only explicit dev allowlist.","format":"uri","maxLength":2048},"description":{"type":"string","maxLength":256},"event_types":{"type":"array","items":{"type":"string","enum":["fulfillment.requested","payment.decision_changed","payment.adjusted","payment.review_required","fulfillment.result_recorded"]},"minItems":1,"maxItems":5}},"required":["url","event_types"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"endpoint_id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"event_types":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":1000},"status":{"type":"string","enum":["active","disabled"]},"signing_key_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["merchant_id","project_id","environment","endpoint_id","url","event_types","status","signing_key_id","created_at","updated_at"],"additionalProperties":false,"description":"Secret is returned only in the one-time creation/rotation envelope, not reads."},"EndpointSecret":{"type":"object","properties":{"key_id":{"type":"string","format":"uuid"},"secret_base64url":{"type":"string","description":"32 random bytes, unpadded base64url. Display once and redact.","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$"},"not_before":{"type":"string","format":"date-time"},"previous_key_accept_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["key_id","secret_base64url","not_before","previous_key_accept_until"],"additionalProperties":false},"EndpointCreated":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"signing_secret":{"$ref":"#/components/schemas/EndpointSecret"}},"required":["endpoint","signing_secret"],"additionalProperties":false},"RotateWebhookSecret":{"type":"object","properties":{"overlap_seconds":{"type":"integer","minimum":0,"maximum":86400,"default":3600}},"required":["overlap_seconds"],"additionalProperties":false},"FulfillmentCommand":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"command_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"order_ref":{"type":"string"},"action_ref":{"type":"string"},"grant_key":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["grant","revoke","adjust","reinstate"]},"desired_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"decision_id":{"type":"string","format":"uuid"},"target_ref":{"type":"string"},"action":{"type":"string"},"payload":{"type":"object","additionalProperties":true},"payload_hash":{"type":"string","description":"Lowercase SHA256 hex of RFC8785 JCS(payload) UTF8.","pattern":"^[0-9a-f]{64}$"},"delivery_status":{"type":"string","enum":["pending","delivered","retrying","exhausted"]},"execution_status":{"type":"string","enum":["pending","applied","noop","failed","unknown"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["merchant_id","project_id","environment","command_id","payment_id","order_ref","action_ref","grant_key","kind","desired_version","decision_id","target_ref","action","payload","payload_hash","delivery_status","execution_status","created_at","updated_at"],"additionalProperties":false,"description":"Immutable semantic fields. desired_version is monotonic across commands targeting the same grant resource. Delivery/execution projections may change. Generic R1 auto-reversal is review; typed compensation requires explicit policy."},"ClaimRequest":{"type":"object","properties":{"execution_id":{"type":"string","format":"uuid"},"instance_id":{"type":"string","minLength":1,"maxLength":128},"expected_desired_version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["execution_id","instance_id","expected_desired_version"],"additionalProperties":false,"description":"Stable execution identity. Replaying its key preserves claim identity but always re-evaluates current validity; no stale successful cache."},"Claim":{"type":"object","properties":{"claim_id":{"type":"string","format":"uuid"},"command_id":{"type":"string","format":"uuid"},"execution_id":{"type":"string","format":"uuid"},"decision":{"type":"string","enum":["execute","superseded","blocked","review_required","expired"]},"valid":{"type":"boolean"},"generation":{"type":"integer","minimum":1,"maximum":9007199254740991},"decision_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"desired_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"issued_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"reason_codes":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":32}},"required":["claim_id","command_id","execution_id","decision","valid","generation","decision_version","desired_version","issued_at","expires_at","reason_codes"],"additionalProperties":false,"description":"valid=true iff decision=execute and current claim is unexpired/not revoked. HTTP 200 can contain valid=false. A claim is not a distributed transaction; later external refunds may require compensation.","allOf":[{"if":{"properties":{"decision":{"const":"execute"}}},"then":{"properties":{"valid":{"const":true}}},"else":{"properties":{"valid":{"const":false}}}}]},"FulfillmentResultInput":{"type":"object","properties":{"execution_id":{"type":"string","format":"uuid"},"claim_id":{"type":"string","format":"uuid"},"lease_generation":{"type":"integer","minimum":1,"maximum":9007199254740991},"result":{"type":"string","enum":["applied","noop","failed","unknown"]},"reason_code":{"type":"string","description":"Required for noop, e.g. ALREADY_APPLIED, SUPERSEDED, NO_EFFECT_REQUIRED. Explain why no new effect occurred.","minLength":1,"maxLength":128},"applied_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"effect_reference":{"type":"string","minLength":1,"maxLength":256},"applied_at":{"type":"string","format":"date-time"},"error_code":{"type":"string","minLength":1,"maxLength":128},"error_message":{"type":"string","maxLength":1000}},"required":["execution_id","claim_id","lease_generation","result"],"additionalProperties":false,"description":"applied requires applied_version, applied_at and effect_reference. noop requires reason_code; known-existing-effect metadata is optional only as a complete group, never invented for no effect. Failed requires error_code. The server validates claim ownership but records late results even if lease expired/canceled. Contradictory results are retained as conflicts, not last-write-wins.","allOf":[{"if":{"properties":{"result":{"const":"applied"}}},"then":{"required":["applied_version","effect_reference","applied_at"]}},{"if":{"properties":{"result":{"const":"noop"}}},"then":{"required":["reason_code"]}},{"if":{"properties":{"result":{"const":"failed"}}},"then":{"required":["error_code"]}},{"if":{"anyOf":[{"required":["applied_version"]},{"required":["effect_reference"]},{"required":["applied_at"]}]},"then":{"required":["applied_version","effect_reference","applied_at"]}}]},"FulfillmentResult":{"type":"object","properties":{"result_id":{"type":"string","format":"uuid"},"command_id":{"type":"string","format":"uuid"},"execution_id":{"type":"string","format":"uuid"},"result":{"type":"string","enum":["applied","noop","failed","unknown"]},"reason_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"applied_version":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"effect_reference":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"received_at":{"type":"string","format":"date-time"},"review_required":{"type":"boolean"},"reason_codes":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":32}},"required":["result_id","command_id","execution_id","result","reason_code","applied_version","effect_reference","applied_at","received_at","review_required","reason_codes"],"additionalProperties":false,"allOf":[{"if":{"properties":{"result":{"const":"applied"}}},"then":{"properties":{"applied_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"effect_reference":{"type":"string","minLength":1},"applied_at":{"type":"string","format":"date-time"}}}},{"if":{"properties":{"result":{"const":"noop"}}},"then":{"properties":{"reason_code":{"type":"string","minLength":1,"maxLength":128}}}},{"oneOf":[{"properties":{"applied_version":{"type":"null"},"effect_reference":{"type":"null"},"applied_at":{"type":"null"}}},{"properties":{"applied_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"effect_reference":{"type":"string","minLength":1},"applied_at":{"type":"string","format":"date-time"}}}]}]},"RetryDelivery":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false,"description":"Retries the same command/event identity. Does not create another grant or reset an applied/unknown effect to pending."},"EventEnvelope":{"type":"object","properties":{"merchant_id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"environment":{"$ref":"#/components/schemas/Environment"},"schema_type":{"const":"stablepay.event.v1"},"event_id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["fulfillment.requested","payment.decision_changed","payment.adjusted","payment.review_required","fulfillment.result_recorded"]},"occurred_at":{"type":"string","format":"date-time"},"resource_id":{"type":"string","format":"uuid"},"resource_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"oneOf":[{"$ref":"#/components/schemas/FulfillmentEventData"},{"$ref":"#/components/schemas/PaymentEventData"},{"$ref":"#/components/schemas/ResultEventData"}]}},"required":["merchant_id","project_id","environment","schema_type","event_id","type","occurred_at","resource_id","resource_version","data"],"additionalProperties":false,"description":"Event body is immutable. Delivery ID/timestamp/signature are headers and refreshed per network attempt. Consumers fetch current resource/claim when freshness matters.","allOf":[{"if":{"properties":{"type":{"const":"fulfillment.requested"}}},"then":{"properties":{"data":{"$ref":"#/components/schemas/FulfillmentEventData"}}}},{"if":{"properties":{"type":{"enum":["payment.decision_changed","payment.adjusted","payment.review_required"]}}},"then":{"properties":{"data":{"$ref":"#/components/schemas/PaymentEventData"}}}},{"if":{"properties":{"type":{"const":"fulfillment.result_recorded"}}},"then":{"properties":{"data":{"$ref":"#/components/schemas/ResultEventData"}}}}]},"FulfillmentEventData":{"type":"object","properties":{"kind":{"const":"fulfillment_command"},"command":{"$ref":"#/components/schemas/FulfillmentCommand"}},"required":["kind","command"],"additionalProperties":false},"PaymentEventData":{"type":"object","properties":{"kind":{"const":"payment_snapshot"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["kind","payment"],"additionalProperties":false},"ResultEventData":{"type":"object","properties":{"kind":{"const":"fulfillment_result"},"result":{"$ref":"#/components/schemas/FulfillmentResult"}},"required":["kind","result"],"additionalProperties":false},"PaymentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"},"minItems":0,"maxItems":100},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false},"AttemptList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Attempt"},"minItems":0,"maxItems":100},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false},"ConnectionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Connection"},"minItems":0,"maxItems":100},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false},"EventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EventEnvelope"},"minItems":0,"maxItems":100},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}