{"openapi":"3.1.0","info":{"title":"Voltage API","description":"Unified API documentation for Voltage Payments and Checkout","version":"1.0.0"},"servers":[{"url":"/v1"}],"paths":{"/organizations/{organization_id}/assets":{"get":{"tags":["Assets"],"summary":"All supported assets on a given network for an organization","operationId":"get_all_organization_supported_assets","parameters":[{"name":"network","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Network"}]}},{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved all organization supported assets for a network","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportedAssets"}}}},"400":{"description":"Request parameters, body, or credentials could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_RequestBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_credentials"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve organization supported assets, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/wallets":{"get":{"tags":["Wallets"],"summary":"Get all wallets in an organization","operationId":"get_all_organizations_wallets_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to retrieve wallets from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"query","description":"Return only wallets in this environment.","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"inactive","in":"query","description":"Include inactive wallets in addition to active wallets. Defaults to false.","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"Successfully retrieved organization's wallets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Wallet"}}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the organization's wallets, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"post":{"tags":["Wallets"],"summary":"Create a new wallet","operationId":"create_wallet","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the wallet in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWalletRequest"}}},"required":true},"responses":{"202":{"description":"Successfully requested a new wallet be created"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a wallet, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/wallets/{wallet_id}":{"get":{"tags":["Wallets"],"summary":"Get a wallet","operationId":"get_wallet","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the wallet in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID to retrieve","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved a wallet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the wallet, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found for given id in provided organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"delete":{"tags":["Wallets"],"summary":"Delete a wallet","operationId":"delete_wallet","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to delete the wallet in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully requested wallet deletion"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to delete a wallet, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found for given id in provided organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"patch":{"tags":["Wallets"],"summary":"Update a wallet","operationId":"update_wallet","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get the wallet in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"ID of wallet to update","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalletRequest"}}},"required":true},"responses":{"202":{"description":"Successfully submitted commands to update wallet"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to update wallet, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found with provided id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/wallets/{wallet_id}/ledger":{"get":{"tags":["Wallets"],"summary":"Get a wallet's transaction history","operationId":"get_wallet_ledger_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the wallet in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID to retrieve the ledger for","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"payment_id","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"end_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"sort_key","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/LedgerSortKey"}]}},{"name":"sort_order","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortOrder"}]}}],"responses":{"200":{"description":"Successfully retrieved a wallet's ledger","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ledger"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the wallet ledger, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found for given id in provided organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/wallets/{wallet_id}/policies":{"get":{"tags":["Wallet Policies"],"summary":"Get all policies on a given wallet by its id as a user","operationId":"get_wallet_policies","parameters":[{"name":"organization_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved wallet policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletPolicies"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletPolicyBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"no_updates_provided"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"Organization READ access required, or insufficient environment-scope access for the requested environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found for the given id in the provided organization, or no policies found for the wallet after successful wallet lookup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletPolicyNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_policies_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"patch":{"tags":["Wallet Policies"],"summary":"Update a wallet's policies as a user","operationId":"update_wallet_policies","parameters":[{"name":"organization_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalletPolicyRequest"}}},"required":true},"responses":{"202":{"description":"Successfully updated wallet policies"},"400":{"description":"Badly formatted request or no updates provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletPolicyBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"no_updates_provided"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"Organization WRITE access required, or insufficient environment-scope access for the requested environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No wallet found for the given id in the provided organization, or no policies found for the wallet after successful wallet lookup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WalletPolicyNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_policies_not_found"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/payments":{"get":{"tags":["Payments"],"summary":"Get all payments for an organization","operationId":"get_payments","parameters":[{"name":"organization_id","in":"path","description":"Organization ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","description":"Deprecated: offset pagination is retained only for existing clients.\nPrefer `pagination=cursor` on the first page and `cursor=<next_cursor>` on later pages.\nCursor pagination omits the expensive total-count query, which massively benefits long-lived wallets.","required":false,"deprecated":true,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"limit","in":"query","description":"Page size. Defaults to 100. Used by both cursor and deprecated offset pagination.\nNew clients should pair this with `pagination=cursor` or `cursor`.","required":false,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"cursor","in":"query","description":"Cursor returned as `next_cursor` by the previous payments response.\nSupplying this automatically uses cursor pagination and omits `total`.","required":false,"schema":{"type":["string","null"]}},{"name":"pagination","in":"query","description":"Pagination strategy. Defaults to `offset` for backwards compatibility.\nNew clients should send `pagination=cursor` for the first page, then pass `next_cursor` as `cursor`.\nCursor pagination avoids counting the full result set, which is a major win for long-lived wallets.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentPaginationMode"}]}},{"name":"wallet_id","in":"query","description":"Return only payments for this wallet.","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"line_of_credit_id","in":"query","description":"Return only payments associated with this line of credit.","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"payment_category","in":"query","description":"Return only standard payments or only treasury movements.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentCategory"}]}},{"name":"metadata","in":"query","description":"Filter payments by metadata key/value pairs. When multiple metadata fields are supplied,\npayments must match all supplied key/value pairs. Example:\nmetadata[external_id]=payment-123&metadata[tenant_id]=tenant-a.","required":false,"schema":{"type":"object"},"style":"deepObject","explode":true},{"name":"statuses","in":"query","description":"Payment states to include. Encode repeated values as `statuses[]=completed&statuses[]=failed`.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentStatus"}}},{"name":"sort_key","in":"query","description":"Field used to order results. Repeat it unchanged when following a cursor.\n`updated_at` is an ordering option, not a monotonic reconciliation watermark.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortKey"}]}},{"name":"sort_order","in":"query","description":"Sort direction. Repeat it unchanged when following a cursor.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortOrder"}]}},{"name":"kind","in":"query","description":"Return only one payment rail/type.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentKind"}]}},{"name":"direction","in":"query","description":"Return only sends or only receives.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentDirection"}]}},{"name":"end_date","in":"query","description":"Inclusive upper bound for the payment creation time, as RFC 3339.","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"start_date","in":"query","description":"Inclusive lower bound for the payment creation time, as RFC 3339.","required":false,"schema":{"type":["string","null"],"format":"date-time"}}],"responses":{"200":{"description":"Successfully found payments; returns an empty collection when no payments match. For cursor pagination, send pagination=cursor on the first page, then pass next_cursor as cursor while repeating the same filters and sort. Branch on each item's direction: sends use data.outflows; receives use data.receipts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payments"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get a payment, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}},"503":{"description":"Payment data is temporarily unavailable; retry the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"post":{"tags":["Payments"],"summary":"Create a new payment","operationId":"create_payment","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the payment in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create the payment in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Send or receive a payment. Amount objects in request bodies need only currency and amount; the unit is derived from currency. Optional metadata belongs at the top level of the payment request. A standard any-amount receive requires an effective receive processing fee rate of zero or no configured rate. A nonzero rate causes the asynchronous payment to fail before invoice or URI generation. The Payments guide above documents every supported request shape and preserves the complete quote -> payment workflows for USD wallets. This endpoint returns an empty 202; read the payment by the submitted ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequest"},"examples":{"compliance_test_reflex_receive":{"summary":"Compliance test: Reflex Lightning receive","description":"Reserved description used to exercise a Reflex approval policy failure.","value":{"amount":{"amount":100000,"currency":"btc"},"description":"VOLTAGE_COMPLIANCE_550e8400-e29b-41d4-a716-446655440000","id":"88ca843c-bdaa-44b6-965a-39ac550fcef8","metadata":{"external_id":"compliance-test-123"},"payment_kind":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"receive_payment_bip21":{"summary":"Create a fixed-amount BIP21 receive","description":"Generates a unified receive request for 150,000 sats.","value":{"amount":{"amount":150000000,"currency":"btc"},"description":"Order 123","id":"d59eeccd-1c06-4567-92af-ddeabbcfa9a6","metadata":{"external_id":"order-123"},"payment_kind":"bip21","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"receive_payment_bolt11":{"summary":"Create a fixed-amount Lightning receive","description":"Creates a Lightning invoice for 150 sats.","value":{"amount":{"amount":150000,"currency":"btc"},"description":"Order 123","expiration":3600,"id":"11ca843c-bdaa-44b6-965a-39ac550fcef7","metadata":{"external_id":"order-123"},"payment_kind":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"receive_payment_bolt11_any_amount":{"summary":"Create an any-amount Lightning receive","description":"Any-amount receives are BTC-only. Omit every amount field. A standard receive requires an effective receive processing fee rate of zero or no configured rate.","value":{"currency":"btc","description":"Customer-selected amount","expiration":3600,"id":"38b8c77c-46d4-4f38-bc70-e56275f42d05","metadata":{"external_id":"payment-123"},"payment_kind":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"receive_payment_onchain":{"summary":"Create a fixed-amount on-chain receive","description":"Creates an on-chain receive for 150,000 sats.","value":{"amount":{"amount":150000000,"currency":"btc"},"description":"Order 123","expiration":3600,"id":"f307356b-6081-4d71-ac3a-b422a92705ce","metadata":{"external_id":"order-123"},"payment_kind":"onchain","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"receive_payment_taprootasset":{"summary":"Create a fixed-amount Taproot Asset receive","description":"The amount uses the asset's smallest base unit.","value":{"amount":{"amount":150000,"currency":"asset:034d8de991e76a6994753ddb4505d354873f96a1aa400a82eac1ee4fd443cfd62e"},"description":"Asset invoice","id":"bd2edc87-4049-4524-aa3f-f9b526d3d006","metadata":{"external_id":"asset-payment-123"},"payment_kind":"taprootasset","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"send_payment_bip21_btc":{"summary":"Send a BIP21 request from a BTC wallet","description":"The URI supplies the on-chain amount; the service can use an embedded Lightning invoice when present.","value":{"currency":"btc","data":{"address":"bitcoin:bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh?amount=0.0015&label=Order%20123","max_fee":{"amount":1000000,"currency":"btc"}},"id":"4ace0f69-ce4f-4859-b6d5-d64289290327","metadata":{"external_id":"order-123"},"type":"bip21","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"send_payment_bolt11_btc":{"summary":"Send Lightning from a BTC wallet","description":"The amount and maximum fee are in millisatoshis.","value":{"currency":"btc","data":{"amount":{"amount":150000,"currency":"btc"},"max_fee":{"amount":1000,"currency":"btc"},"payment_request":"lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz"},"id":"68d00852-8dd8-4c71-94d2-91c84695da78","metadata":{"external_id":"payment-123"},"type":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"send_payment_onchain_btc":{"summary":"Send on-chain from a BTC wallet","description":"150,000,000 msats is 150,000 sats; the fee limit is 1,000 sats.","value":{"currency":"btc","data":{"address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","amount":{"amount":150000000,"currency":"btc"},"description":"Order 123","max_fee":{"amount":1000000,"currency":"btc"}},"id":"77cf6256-88b7-40cd-922b-447a19c5f693","metadata":{"external_id":"order-123"},"type":"onchain","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"workflow_usd_receive":{"summary":"USD quote -> fixed Lightning receive","description":"This is the payment request from step 3 of the complete USD-to-BTC quote workflow in the Payments guide above. The guide preserves all four copyable quote, poll, payment, and poll steps.","value":{"amount":{"amount":1000,"currency":"usd"},"description":"Receive $10.00","expiration":3600,"id":"ea7de788-60c4-428c-836d-0357df08bdd7","metadata":{"external_id":"payment-123"},"payment_kind":"bolt11","quote_id":"87654321-4321-8765-cba9-fed987654321","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"workflow_usd_to_btc":{"summary":"USD wallet quote -> Lightning payment","description":"This is the payment request from step 3 of the complete BTC-to-USD quote workflow in the Payments guide above. The guide preserves all four copyable quote, poll, payment, and poll steps.","value":{"currency":"usd","data":{"amount":{"amount":150000,"currency":"btc"},"max_fee":{"amount":1000,"currency":"btc"},"payment_request":"lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz"},"id":"68d00852-8dd8-4c71-94d2-91c84695da78","metadata":{"external_id":"payment-123"},"quote_id":"12345678-1234-5678-9abc-def012345678","type":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}}}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous processing. The response body is empty; poll GET /payments/{payment_id} using the submitted ID."},"400":{"description":"Badly formatted request - for USD wallets, ensure quote_id is provided and valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a payment, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"409":{"description":"Payment with that ID already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentConflictError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"payment_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"payment_exists"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/treasury_movements":{"post":{"tags":["Payments"],"summary":"Create a treasury movement","operationId":"create_treasury_movement","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the treasury movement in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create the treasury movement in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Contact Voltage to request access. Voltage must approve and enable treasury movements for your organization. Move the wallet owner's own funds into or out of a wallet. A receive creates an incoming treasury movement. A send creates an outgoing treasury movement. The request uses the normal payment shape and validation, but the server assesses no processing fee. Network and provider fees still apply. This endpoint returns an empty 202; read the payment by the submitted ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequest"},"examples":{"treasury_receive":{"summary":"Receive the wallet owner's funds","value":{"amount":{"amount":150000000,"currency":"btc"},"description":"Treasury receive","id":"a67fc392-16f7-4dca-b7d2-ae47f91b0fd7","metadata":{"external_id":"merchant-treasury-receive-123"},"payment_kind":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"treasury_send":{"summary":"Send the wallet owner's funds","value":{"currency":"btc","data":{"address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","amount":{"amount":150000000,"currency":"btc"},"max_fee":{"amount":1000000,"currency":"btc"}},"id":"6bc631c5-eaac-4b13-8a17-4fe777695811","metadata":{"external_id":"merchant-treasury-send-123"},"type":"onchain","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}}}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous processing. The response body is empty; poll GET /payments/{payment_id} using the submitted ID."},"400":{"description":"Treasury movements are not enabled, request validation failed, the line of credit is not ready or is disabled, or a required quote is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a treasury movement, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"The wallet or its line of credit was not found in the organization, environment, and wallet network","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_not_found"}}}}}}},"409":{"description":"Payment with that ID already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentConflictError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"payment_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"payment_exists"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/payments/check":{"post":{"tags":["Payments"],"summary":"Check a new payment will be approved for sending","operationId":"check_payment","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the payment in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create the payment in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Start an asynchronous policy-check-only send. Amount objects in the request need only currency and amount; the unit is derived from currency. Optional metadata belongs at the top level. This is not a synchronous fee or quote preview. Use it only for unquoted direct sends: attaching a quote consumes that single-use quote, so it cannot be reused by POST /payments. Do not use this endpoint in the quote -> payment workflows or with explicit swap routing. The response body is empty; poll the submitted payment ID until its status is approved or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPaymentRequest"},"examples":{"check_payment_bip21":{"summary":"Policy-check a direct BIP21 send","value":{"currency":"btc","data":{"address":"bitcoin:bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh?amount=0.0015&label=Order%20123","max_fee":{"amount":1000000,"currency":"btc"}},"id":"4ace0f69-ce4f-4859-b6d5-d64289290327","metadata":{"external_id":"payment-check-123"},"type":"bip21","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"check_payment_bolt11":{"summary":"Policy-check a direct Lightning send","value":{"currency":"btc","data":{"amount":{"amount":150000,"currency":"btc"},"max_fee":{"amount":1000,"currency":"btc"},"payment_request":"lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz"},"id":"68d00852-8dd8-4c71-94d2-91c84695da78","metadata":{"external_id":"payment-check-123"},"type":"bolt11","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}},"check_payment_onchain":{"summary":"Policy-check a direct on-chain send","value":{"currency":"btc","data":{"address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","amount":{"amount":150000000,"currency":"btc"},"max_fee":{"amount":1000000,"currency":"btc"}},"id":"77cf6256-88b7-40cd-922b-447a19c5f693","metadata":{"external_id":"payment-check-123"},"type":"onchain","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}}}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous policy checking. The response body is empty; poll GET /payments/{payment_id} until the payment is approved or failed."},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a payment, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"409":{"description":"Payment with that ID already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentConflictError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"payment_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"payment_exists"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/payments/summary":{"get":{"tags":["Payments"],"summary":"Get a payment summary for an organization","operationId":"get_payment_summary","parameters":[{"name":"organization_id","in":"path","description":"Organization ID the payments are in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID the payments are in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"line_of_credit_id","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"include_inactive","in":"query","description":"Include inactive wallets and disabled lines of credit. Defaults to false.","required":false,"schema":{"type":["boolean","null"]}},{"name":"metadata","in":"query","description":"Filter payments by metadata key/value pairs. When multiple metadata fields are supplied,\npayments must match all supplied key/value pairs. Example:\nmetadata[external_id]=payment-123&metadata[tenant_id]=tenant-a.","required":false,"schema":{"type":"object"},"style":"deepObject","explode":true},{"name":"statuses","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentStatus"}}},{"name":"kind","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentKind"}]}},{"name":"direction","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentDirection"}]}},{"name":"end_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"start_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}}],"responses":{"200":{"description":"Successfully summarized matching payments by status, direction, currency, and type. Returns zero counts and empty maps when no payments match.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSummary"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get payment summary, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}},"503":{"description":"Payment data is temporarily unavailable; retry the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/wallets/{wallet_id}/payments/summary":{"get":{"tags":["Payments"],"summary":"Get a payment summary for a wallet","operationId":"get_wallet_payment_summary","parameters":[{"name":"organization_id","in":"path","description":"Organization ID the wallet is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"path","description":"Wallet ID to summarize payments for","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_inactive","in":"query","description":"Include inactive wallets and disabled lines of credit. Defaults to false.","required":false,"schema":{"type":["boolean","null"]}},{"name":"metadata","in":"query","description":"Filter payments by metadata key/value pairs. When multiple metadata fields are supplied,\npayments must match all supplied key/value pairs. Example:\nmetadata[external_id]=payment-123&metadata[tenant_id]=tenant-a.","required":false,"schema":{"type":"object"},"style":"deepObject","explode":true},{"name":"statuses","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentStatus"}}},{"name":"direction","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentDirection"}]}},{"name":"kind","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentKind"}]}},{"name":"end_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"start_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}}],"responses":{"200":{"description":"Successfully summarized matching payments for a wallet. Returns zero counts and empty buckets when no payments match.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentWalletSummary"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get wallet payment summary, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}},"503":{"description":"Payment data is temporarily unavailable; retry the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}":{"get":{"tags":["Payments"],"summary":"Get a payment for an organization","operationId":"get_payment","parameters":[{"name":"organization_id","in":"path","description":"Organization ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"payment_id","in":"path","description":"Payment ID for the payment","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully found the payment. Branch first on direction: sends expose data.outflows and a route; receives expose data.receipts. Cross-currency payments can include data.market_quote and exchanges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get a payment, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No payment with that ID found in this organization and environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}},"503":{"description":"Payment data is temporarily unavailable; retry the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}/history":{"get":{"tags":["Payments"],"summary":"Get the history of a payment","operationId":"get_payment_history","parameters":[{"name":"organization_id","in":"path","description":"Organization ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID the payment is in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"payment_id","in":"path","description":"Payment ID for the payment","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully requested the history of a payment. Returns an empty events array when no payment is present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentHistory"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get this payment's history, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}},"503":{"description":"Payment data is temporarily unavailable; retry the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_PaymentError"},"examples":{"error":{"summary":"Error response","value":{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/lines_of_credit/{line_id}/sandbox":{"patch":{"tags":["Lines of Credit"],"summary":"Update sandbox settings for a line of credit","description":"This endpoint is only available for non-mainnet lines of credit. The\n`disable` field only accepts `true` — once disabled, a line of credit\ncannot be re-enabled through this endpoint. Contact an administrator to\nre-enable a disabled line of credit.","operationId":"update_sandbox_line_of_credit","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to update the line of credit in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to update the line of credit in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"line_id","in":"path","description":"ID of line of credit to update","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSandboxLineOfCreditRequest"}}},"required":true},"responses":{"202":{"description":"Sandbox line of credit update accepted"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to update this line of credit, attempted to update a mainnet line of credit, or attempted to re-enable a disabled line of credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"not_allowed"}}}}}}},"404":{"description":"No line of credit found with provided id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_not_found_in_organization"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/lines_of_credit/{line_id}/summary":{"get":{"tags":["Lines of Credit"],"summary":"Retrieve a summary of a line of credit","operationId":"get_line_of_credit_summary_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get the line of credit in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"line_id","in":"path","description":"ID of line of credit to update","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved a line of credit summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryLineOfCredit"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the line of credit found, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"not_allowed"}}}}}}},"404":{"description":"No line of credit found for given id in provided organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_not_found_in_organization"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/lines_of_credit/summaries":{"get":{"tags":["Lines of Credit"],"summary":"Retrieve summaries for all lines of credit for an organization","operationId":"get_lines_of_credit_summaries_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get the line of credit in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"network","in":"query","description":"Return only lines of credit for this network.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SupportedNetwork"}]}},{"name":"environment_ids","in":"query","description":"Return only lines of credit in these environments.","required":false,"schema":{"type":["array","null"],"items":{"type":"string","format":"uuid"}}},{"name":"include_disabled","in":"query","description":"Include disabled lines of credit in addition to active lines of credit. Defaults to false.","required":false,"schema":{"type":["boolean","null"],"default":false}}],"responses":{"200":{"description":"Successfully retrieved lines of credit","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SummaryLineOfCredit"}}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the lines of credit found, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_LineOfCreditForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"not_allowed"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/bills/{bill_id}":{"get":{"tags":["Billing"],"summary":"Retrieves a specific bill for an organization.","operationId":"get_bill_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get the line of credit in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved bill","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillRead"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_BillBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_cannot_be_reconciled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the bill found, organization BILLING access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"No bill found in provided organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_BillNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"bill_not_found_in_organization"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"bearer_token":[]},{"api_key":[]}]}},"/organizations/{organization_id}/bills":{"get":{"tags":["Billing"],"summary":"Retrieves all bills for an organization.","operationId":"get_bills_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get the bill","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"line_of_credit_id","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"statuses","in":"query","description":"Filter bills by one or more statuses.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/BillStatus"}}},{"name":"sort_key","in":"query","description":"Sort field for paginated bills. Defaults to `created_at`.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BillListSortKey"}]}},{"name":"sort_order","in":"query","description":"Sort direction for `created_at`.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortOrder"}]}},{"name":"cursor","in":"query","description":"Cursor returned as `next_cursor` by the previous bills response.","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","description":"Page size. Defaults to 25 and is capped at 500.","required":false,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"exclude_zero_amount_bills","in":"query","description":"Exclude bills whose amount due is zero.","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"Successfully retrieved bills","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPage"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_BillBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_cannot_be_reconciled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the bill found, organization BILLING access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/bills/summary":{"get":{"tags":["Billing"],"summary":"Retrieves a summary of visible bills for an organization","operationId":"get_bill_summary_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to summarize bills for","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"line_of_credit_id","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"statuses","in":"query","description":"Filter bills by one or more statuses","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/BillStatus"}}},{"name":"exclude_zero_amount_bills","in":"query","description":"Exclude bills whose amount due is zero.","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"Successfully retrieved bill summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillSummary"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_BillBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_cannot_be_reconciled"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retrieve the bill summary, organization BILLING access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/webhooks":{"get":{"tags":["Webhooks"],"summary":"Get all webhooks for an organization and environment with filter","operationId":"get_webhooks_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_ids","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string","format":"uuid"}}},{"name":"statuses","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WebhookStatus"}}},{"name":"sort_key","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortKey"}]}},{"name":"sort_order","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortOrder"}]}}],"responses":{"200":{"description":"Successfully retrieved webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookRead"}},"examples":{"All Event Types Example":{"value":[{"created_at":"2025-04-29T17:09:11.299Z","deleted_at":null,"environment_id":"123e4567-e89b-12d3-a456-426614174000","events":[{"send":["succeeded","failed"]},{"receive":["generated","refreshed","expired","succeeded","completed","failed"]},{"test":["created"]}],"id":"123e4567-e89b-12d3-a456-426614174000","name":"some name","organization_id":"123e4567-e89b-12d3-a456-426614174000","status":"active","stopped_at":null,"updated_at":"2025-04-29T17:09:11.299Z","url":"http://example.com"}]},"Receive Event Example":{"value":[{"created_at":"2025-04-29T17:09:11.299Z","deleted_at":null,"environment_id":"123e4567-e89b-12d3-a456-426614174000","events":[{"receive":["generated","refreshed","expired","succeeded","completed","failed"]}],"id":"123e4567-e89b-12d3-a456-426614174000","name":"some name","organization_id":"123e4567-e89b-12d3-a456-426614174000","status":"active","stopped_at":null,"updated_at":"2025-04-29T17:09:11.299Z","url":"http://example.com"}]},"Send Event Example":{"value":[{"created_at":"2025-04-29T17:09:11.299Z","deleted_at":null,"environment_id":"123e4567-e89b-12d3-a456-426614174000","events":[{"send":["succeeded","failed"]}],"id":"123e4567-e89b-12d3-a456-426614174000","name":"some name","organization_id":"123e4567-e89b-12d3-a456-426614174000","status":"active","stopped_at":null,"updated_at":"2025-04-29T17:09:11.299Z","url":"http://example.com"}]},"Test Event Example":{"value":[{"created_at":"2025-04-29T17:09:11.299Z","deleted_at":null,"environment_id":"123e4567-e89b-12d3-a456-426614174000","events":[{"test":["created"]}],"id":"123e4567-e89b-12d3-a456-426614174000","name":"some name","organization_id":"123e4567-e89b-12d3-a456-426614174000","status":"active","stopped_at":null,"updated_at":"2025-04-29T17:09:11.299Z","url":"http://example.com"}]}}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get webhooks, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks":{"post":{"tags":["Webhooks"],"summary":"Create a new webhook","operationId":"create_webhook","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the webhook in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create the webhook in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWebhookRequest"}}},"required":true},"responses":{"202":{"description":"Successfully requested a new webhook be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPlainSecret"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"409":{"description":"Webhook already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookConflictError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_exists"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook","operationId":"get_webhook","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of webhook to retrieve","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRead"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get webhook, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"delete_webhook","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to delete webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to delete webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of webhook to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully submitted delete webhook request"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to delete webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"patch":{"tags":["Webhooks"],"summary":"Update webhook details","operationId":"update_webhook","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create the webhook in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create the webhook in","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"Webhook ID to update","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}},"required":true},"responses":{"202":{"description":"Successfully requested update webhook"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to update a webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/keys":{"post":{"tags":["Webhooks"],"summary":"Rotate a webhook shared secret","operationId":"generate_webhook_key","parameters":[{"name":"organization_id","in":"path","description":"Organization ID containing the webhook","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID containing the webhook","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"Webhook ID whose shared secret will be rotated","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully generated a new webhook shared secret and submitted the key rotation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPlainSecret"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to rotate the webhook shared secret, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Test a webhook","operationId":"test_webhook","parameters":[{"name":"organization_id","in":"path","description":"Organization ID of the webhook to use","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID of the webhook to use","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"Webhook to initiate the delivery on","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestWebhookRequest"},"examples":{"receive_webhook_test":{"summary":"Test Receive Webhook Example","description":"Example of testing a webhook delivery for a payment receive event","value":{"delivery_id":"123e4567-e89b-12d3-a456-426614174002","payload":{"detail":{"data":{"bip21_uri":"lightning:lntbs10n1p4ft36app509h8j7cecenwaktcsrshu6cx4xsczarwfj4nl4tfjq6y7rz79vmqdqqcqzzsxqrrsssp5grs2zd2al99uw93vja4mc5wus9lshcjteuqwef2xkhlp9ppmkens9qxpqysgqmn4s544p8p0263cv83s3c3qjv69z3xxy3fh64ny2y766mfnqfxrrhjj8s7h0lrkxux23dfyzxfydvgjhrsw2p8z0nw54en5a9rvk4kgqxkh73g","created_at":"2026-08-31T18:26:36.755004Z","currency":"btc","data":{"amount":{"amount":1000,"currency":"btc","unit":"msats"},"amount_msats":1000,"expiration":null,"market_quote":null,"memo":null,"payment_request":"lntbs10n1p4ft36app509h8j7cecenwaktcsrshu6cx4xsczarwfj4nl4tfjq6y7rz79vmqdqqcqzzsxqrrsssp5grs2zd2al99uw93vja4mc5wus9lshcjteuqwef2xkhlp9ppmkens9qxpqysgqmn4s544p8p0263cv83s3c3qjv69z3xxy3fh64ny2y766mfnqfxrrhjj8s7h0lrkxux23dfyzxfydvgjhrsw2p8z0nw54en5a9rvk4kgqxkh73g","receipts":[{"data":{"ledger_id":"d16e51e9-6ca6-4fcf-a606-611f64376ed1","payment_hash":"796e797b19c666eed97880e17e6b06a9a181746e4cab3fd56990344f0c5e2b36","preimage":"aa64118aace7061201530deb9916d4c9a8f02d2466a1c3faf458c40668453f55"},"type":"lightning"}]},"direction":"receive","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"frozen":[],"id":"123e4567-e89b-12d3-a456-426614174003","organization_id":"123e4567-e89b-12d3-a456-426614174000","payment_category":"standard","requested_amount":{"amount":1000,"currency":"btc","unit":"msats"},"status":"completed","type":"bolt11","updated_at":"2026-08-31T18:26:41.641532Z","wallet_id":"123e4567-e89b-12d3-a456-426614174000"},"event":"completed"},"type":"receive"}}},"send_webhook_test":{"summary":"Test Send Webhook Example","description":"Example of testing a webhook delivery for a payment send event","value":{"delivery_id":"123e4567-e89b-12d3-a456-426614174001","payload":{"detail":{"data":{"created_at":"2026-08-31T18:17:39.035614Z","currency":"btc","data":{"amount":{"amount":1000,"currency":"btc","unit":"msats"},"amount_msats":1000,"fee_msats":0,"fees":{"amount":0,"currency":"btc","unit":"msats"},"market_quote":null,"max_fee":{"amount":10000,"currency":"btc","unit":"msats"},"max_fee_msats":10000,"memo":null,"outflows":[{"data":{"ledger_id":"b732cb3c-a39d-49c4-b5c8-745a133171c9","payment_hash":"32cd75c081e40838a9b9310cea864d60b67bda25df0212381c53964d59b3bcfa","preimage":"1fa8d860e6a891170fe13f783cf2c9b87ca29d2f873b82393574d9d66009fb0f"},"type":"lightning"}],"payment_request":"lntbs10n1p4ft32zpp5xtxhtsypusyr32dexyxw4pjdvzm8hk39muppywqu2wty6kdnhnaqdqqcqzzsxqrrsssp5hm80q294tjuksj52gj2y4scvscuxd8rmx7twp8f70eszeu5ytyxq9qxpqysgqchfmyc9805wu53a0vtqksk5d8ll5zgme25tyj8k99wwd4a35ur7sttchxtx4fnrqeaa787qvhtx9u4zntn8gvmm3c68kes53w3k776gqhwa8rp"},"direction":"send","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"id":"123e4567-e89b-12d3-a456-426614174000","organization_id":"123e4567-e89b-12d3-a456-426614174000","payment_category":"standard","route":"direct","status":"completed","type":"bolt11","updated_at":"2026-08-31T18:17:40.175095Z","wallet_id":"123e4567-e89b-12d3-a456-426614174000"},"event":"succeeded"},"type":"send"}}},"test_webhook_test":{"summary":"Simple Test Webhook Example","description":"Example of testing a webhook with a simple test payload for verification","value":{"delivery_id":"123e4567-e89b-12d3-a456-426614174004","payload":{"detail":{"data":"This is a test webhook delivery to verify endpoint configuration and connectivity","event":"created"},"type":"test"}}}}}},"required":true},"responses":{"202":{"description":"Successfully requested a new webhook delivery be started with provided payload"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to submit delivery via a webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/start":{"post":{"tags":["Webhooks"],"summary":"Start a webhook","operationId":"start_webhook_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to start webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to start webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of webhook to start","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully submitted start webhook request"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to start webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/stop":{"post":{"tags":["Webhooks"],"summary":"Stop a webhook","operationId":"stop_webhook_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to stop webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to stop webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of Webhook to stop","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully submitted stop webhook request"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to stop webhooks, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Get all webhook deliveries for a given webhook in an organization and environment with filter","operationId":"get_webhook_deliveries_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of Webhook to retrieve deliveries from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"statuses","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DeliveryStatus"}}},{"name":"sort_key","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortKey"}]}},{"name":"sort_order","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SortOrder"}]}},{"name":"cursor","in":"query","description":"Cursor returned as `next_cursor` by the previous webhook deliveries response.","required":false,"schema":{"type":["string","null"]}},{"name":"pagination","in":"query","description":"Pagination strategy. Defaults to `offset` for backwards compatibility.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WebhookDeliveryPaginationMode"}]}},{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}},{"name":"offset","in":"query","description":"Deprecated: offset pagination is retained only for existing clients.","required":false,"deprecated":true,"schema":{"type":["integer","null"],"format":"u-int32","minimum":0}}],"responses":{"200":{"description":"Successfully retrieved webhook deliveries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveries"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get webhook deliveries, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/deliveries/summary":{"get":{"tags":["Webhooks"],"summary":"Get a count summary of webhook deliveries for a given webhook in an organization and environment.","description":"Counts are exact when the planner estimates 100,000 or fewer matching rows. For larger\nresult sets, the endpoint returns a PostgreSQL planner estimate and marks\n`total_count_accuracy` as `estimated`; estimates are based on statistics refreshed by\nautovacuum/ANALYZE and may lag recent inserts.","operationId":"get_webhook_delivery_summary_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of Webhook to summarize deliveries from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"statuses","in":"query","description":"Restrict the summary count to one or more delivery statuses.\n\nOmit this parameter to count deliveries in all statuses.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DeliveryStatus"}}}],"responses":{"200":{"description":"Successfully retrieved webhook delivery count summary. Counts are exact when the planner estimates 100,000 or fewer matching rows; larger result sets return a PostgreSQL planner estimate with total_count_accuracy=estimated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliverySummary"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get webhook deliveries, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/deliveries/{delivery_id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook delivery","operationId":"get_webhook_delivery","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get webhooks from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of Webhook to retrieve delivery from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delivery_id","in":"path","description":"ID of Webhook Delivery to retrieve","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved webhook delivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryRead"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get webhook delivery, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook or webhook delivery does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/deliveries/{delivery_id}/abandon":{"post":{"tags":["Webhooks"],"summary":"Abandon a webhook delivery","operationId":"abandon_webhook_delivery","parameters":[{"name":"organization_id","in":"path","description":"Organization ID of the webhook to use","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID of the webhook to use","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"Webhook to abandon the delivery on","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delivery_id","in":"path","description":"Delivery ID to abandon","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully requested an abandoned webhook delivery"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to submit abandon via a webhook, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/deliveries/{delivery_id}/retry":{"post":{"tags":["Webhooks"],"summary":"Retry a webhook delivery","operationId":"retry_webhook_delivery","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to retry webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to retry webhook from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","description":"ID of webhook to retry","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delivery_id","in":"path","description":"ID of webhook delivery to retry","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Successfully submitted webhook delivery retry request"},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to retry webhook delivery, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Webhook or webhook delivery does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_WebhookNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/quotes":{"get":{"tags":["Quoting (USD managed line of credit only)"],"summary":"Get all quotes for an organization and environment with filter","operationId":"get_quotes_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get quotes from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get quotes from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wallet_id","in":"query","description":"Return only quotes associated with this wallet","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"network","in":"query","description":"Return only quotes for this network","required":false,"schema":{"$ref":"#/components/schemas/Network"}},{"name":"limit","in":"query","description":"Maximum number of quotes to return; defaults to 100","required":false,"schema":{"type":"integer","format":"u-int32","minimum":0}},{"name":"offset","in":"query","description":"Number of quotes to skip; defaults to 0","required":false,"schema":{"type":"integer","format":"u-int32","minimum":0}}],"responses":{"200":{"description":"Successfully retrieved quotes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quotes"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_QuotingBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"target_currency":"btc","target_precision":{"currency":"usd","precision":"cents"}},"detail":"Human-readable error detail","type":"mismatch_target_precision"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get quotes, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"post":{"tags":["Quoting (USD managed line of credit only)"],"summary":"Request a currency conversion quote.","description":"Supply the quote ID in the request body. A successful request returns `202 Accepted`\nwithout a response body; poll the quote endpoint with that ID for the result.","operationId":"request_a_quote","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to create a quote for","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to create a quote in","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewQuoteRequest"},"examples":{"btc_to_usd_quote":{"summary":"Quote a known 0.001 BTC payment in USD","description":"Use this direction when a USD wallet is paying a known BTC invoice or on-chain amount. Reuse the exact BTC amount in the payment request.","value":{"amount":{"amount":100000000,"currency":"btc"},"id":"87654321-4321-8765-cba9-fed987654321","line_of_credit_id":"7df75323-84f1-4699-97da-776380a0aa81","network":"mainnet","to":"usd"}},"usd_to_btc_quote":{"summary":"Quote a $10.00 USD-denominated receive in BTC","description":"Use this direction when the customer-facing amount is known in USD. The complete quote -> receive workflow is in the Payments guide.","value":{"amount":{"amount":1000,"currency":"usd"},"id":"12345678-1234-5678-9abc-def012345678","line_of_credit_id":"7df75323-84f1-4699-97da-776380a0aa81","network":"mainnet","to":"btc"}}}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous quote generation. The response body is empty; poll GET /quotes/{quote_id} using the submitted ID before using the quote."},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_QuotingBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"target_currency":"btc","target_precision":{"currency":"usd","precision":"cents"}},"detail":"Human-readable error detail","type":"mismatch_target_precision"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to create a new request for a quote, organization WRITE access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"409":{"description":"Quote generation already initiated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_QuotingConflictError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_already_exists"}}}}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonPayloadTooLargeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}}}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnsupportedMediaTypeError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}}}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_JsonUnprocessableEntityError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/quotes/{quote_id}":{"get":{"tags":["Quoting (USD managed line of credit only)"],"summary":"Get a quote","operationId":"get_a_quote_as_user","parameters":[{"name":"organization_id","in":"path","description":"Organization ID to get quote from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment ID to get quote from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"quote_id","in":"path","description":"ID of quote to retrieve","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully retrieved a quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotingRead"}}}},"400":{"description":"Badly formatted request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_QuotingBadRequestError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"target_currency":"btc","target_precision":{"currency":"usd","precision":"cents"}},"detail":"Human-readable error detail","type":"mismatch_target_precision"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthUnauthorizedError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}}}}}},"403":{"description":"No access to get a quote, organization READ access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_AuthForbiddenError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"access_rights"}}}}}}},"404":{"description":"Quote does not exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_QuotingNotFoundError"},"examples":{"error":{"summary":"Error response","value":{"error":{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_not_found"}}}}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse_InternalServerError"},"examples":{"error":{"summary":"Error response","value":{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}}}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/checkout/events":{"get":{"tags":["Checkout Event Streams"],"summary":"Connect to checkout events.","operationId":"get_events","parameters":[{"name":"stream_token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Server-sent checkout events. Each EventSource message uses an event name and a JSON data payload.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/CheckoutServerSentEventDoc"}}}},"400":{"description":"Query parameters could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"Checkout stream token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"Checkout origin is not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}},"security":[{"checkout_stream_token":[]}]}},"/checkout/streams":{"post":{"tags":["Checkout Event Streams"],"summary":"Create a checkout event stream token.","operationId":"create_event_stream_token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventStreamRequest"}}},"required":true},"responses":{"201":{"description":"Event stream token was created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventStreamResponse"}}}},"400":{"description":"Request body or checkout token list could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"A checkout session token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"Checkout origin is not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}}}},"/organizations/{organization_id}/environments/{environment_id}/checkout/settings":{"get":{"tags":["Checkout Settings"],"summary":"Get checkout settings for an environment.","operationId":"get_settings","parameters":[{"name":"organization_id","in":"path","description":"Organization that owns the environment","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment whose checkout settings should be returned","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Checkout settings for the environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentSettingsResponse"}}}},"400":{"description":"Credentials, path parameters, or environment scope could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"The authenticated caller does not have read access to the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"404":{"description":"Checkout settings have not been explicitly configured for the environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]},"put":{"tags":["Checkout Settings"],"summary":"Update checkout settings for an environment.","operationId":"update_settings","parameters":[{"name":"organization_id","in":"path","description":"Organization that owns the environment","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment whose checkout settings should be updated","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnvironmentSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Checkout settings were updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentSettingsResponse"}}}},"400":{"description":"Request body, credentials, or environment scope could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"The authenticated caller does not have write access to the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/organizations/{organization_id}/environments/{environment_id}/checkout/sessions":{"post":{"tags":["Checkout Sessions"],"summary":"Create a checkout session.","operationId":"create_session","parameters":[{"name":"organization_id","in":"path","description":"Organization that owns the checkout session","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"environment_id","in":"path","description":"Environment that owns the checkout session","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequest"}}},"required":true},"responses":{"201":{"description":"Checkout session was created or idempotently replayed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionResponse"}}}},"400":{"description":"Request body, credentials, or environment scope could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"The authenticated caller does not have write access to the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"409":{"description":"Checkout session id was already used with different immutable inputs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"415":{"description":"Expected a JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"422":{"description":"Request JSON data is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}},"security":[{"api_key":[]},{"bearer_token":[]}]}},"/checkout/sessions/{session_id}":{"get":{"tags":["Checkout Sessions"],"summary":"Get a browser-safe checkout session.","operationId":"get_session","parameters":[{"name":"session_id","in":"path","description":"Checkout session ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Authorization","in":"header","description":"Bearer checkout session token returned by the create checkout session endpoint","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Checkout session state visible to a browser widget","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserCheckoutSession"}}}},"202":{"description":"Checkout session exists but its payment projection is not ready yet; retry after x-retry-after-ms or Retry-After","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Standards-compatible retry delay in whole seconds"},"x-retry-after-ms":{"schema":{"type":"string"},"description":"Milliseconds the browser should wait before retrying the session read"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserCheckoutSession"}}}},"400":{"description":"Request path or headers could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"401":{"description":"Checkout token is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"403":{"description":"Checkout token or origin is not allowed to read this session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"404":{"description":"Checkout session was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"409":{"description":"Checkout session payment cannot be exposed to the browser widget","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}},"security":[{"checkout_session_token":[]}]}},"/checkout/sessions/{session_id}/allowed-origins":{"get":{"tags":["Checkout Sessions"],"summary":"Get the browser origin policy for a checkout session.","operationId":"get_session_allowed_origins","parameters":[{"name":"session_id","in":"path","description":"Checkout session ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Configured browser origin policy and allowlist for the checkout session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionAllowedOriginsResponse"}}}},"400":{"description":"The request path could not be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"404":{"description":"Checkout session was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}},"500":{"description":"Server failed to complete the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutErrorResponseDoc"}}}}}}}},"components":{"schemas":{"AchPaymentReceipt":{"type":"object","required":["idempotency_key","transfers"],"properties":{"idempotency_key":{"type":"string"},"transfers":{"type":"array","items":{"$ref":"#/components/schemas/UsdPayment"}}}},"Amount":{"oneOf":[{"type":"object","description":"Bitcoin amount in millisatoshis (msats) - the smallest unit of Bitcoin","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Amount in millisatoshis (msats)"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'msats' in responses","enum":["msats"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"USD amount in cents - the smallest unit of USD","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["usd"]},"amount":{"type":"integer","format":"int64","description":"Amount in cents"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'cents' in responses","enum":["cents"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset. Base units represent the raw integer value before applying decimal display formatting. For display purposes, divide by 10^decimal_display to get the human-readable amount.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - the smallest indivisible unit"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'base units' in responses","enum":["base units"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}}],"description":"Amount with currency specification. Requests require only currency and amount; unit is optional and ignored on input. Responses include the canonical unit derived from currency. All amounts are provided in the smallest unit of the currency (base units).","examples":[{"amount":100000000,"currency":"btc"},{"amount":150,"currency":"usd"},{"amount":1000000,"currency":"asset:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12"},{"amount":50000000,"currency":"btc","negative":true}]},"AmountExchange":{"type":"object","required":["ledger_id","quote","from_amount","to_amount"],"properties":{"ledger_id":{"type":"string","format":"uuid"},"quote_id":{"type":["string","null"],"format":"uuid","description":"We will only have a quote_id for market_quotes, peer_quotes will never have an id\nThese ids can be used to look up the quote from our quoting endpoints"},"quote":{"$ref":"#/components/schemas/Quote"},"from_amount":{"$ref":"#/components/schemas/Amount"},"to_amount":{"$ref":"#/components/schemas/Amount"}}},"ApiErrorWithCodeAndContext_PaymentErrorAmountMinimumContextType_PaymentErrorAmountMinimumCode_AmountMinimumContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_max_fee","invalid_on_chain_payment","invalid_amount"]},"code":{"type":"string","enum":["below_minimum"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field","provided_amount","min_amount"],"properties":{"field":{"type":"string"},"provided_amount":{"$ref":"#/components/schemas/Amount"},"min_amount":{"$ref":"#/components/schemas/Amount"}}}}},"ApiErrorWithCodeAndContext_PaymentErrorFeatureFlagContextType_PaymentErrorFeatureFlagCode_FeatureFlagContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["feature_flag_disabled"]},"code":{"type":"string","enum":["disabled"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["feature"],"properties":{"feature":{"type":"string"}}}}},"ApiErrorWithCodeAndContext_PaymentErrorMinLengthFieldContextType_PaymentErrorMinLengthFieldCode_FieldContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_memo","invalid_description"]},"code":{"type":"string","enum":["too_short"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field"],"properties":{"field":{"type":"string"},"min_length":{"type":["integer","null"],"format":"u-int64","minimum":0},"required":{"type":["boolean","null"]}}}}},"ApiErrorWithCodeAndContext_PaymentErrorOnChainFeeFloorContextType_PaymentErrorOnChainFeeFloorCode_OnChainFeeFloorContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_amount"]},"code":{"type":"string","enum":["onchain_fee_floor"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field","provided_amount","min_amount","estimated_fee"],"properties":{"field":{"type":"string"},"provided_amount":{"$ref":"#/components/schemas/Amount"},"min_amount":{"$ref":"#/components/schemas/Amount"},"estimated_fee":{"$ref":"#/components/schemas/Amount"}}}}},"ApiErrorWithCodeAndContext_PaymentErrorRequiredFieldContextType_PaymentErrorRequiredFieldCode_FieldContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["amount_required","max_fee_required","missing_payment_request","missing_address","quote_required"]},"code":{"type":"string","enum":["required"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field"],"properties":{"field":{"type":"string"},"min_length":{"type":["integer","null"],"format":"u-int64","minimum":0},"required":{"type":["boolean","null"]}}}}},"ApiErrorWithCodeAndContext_PaymentErrorValidationFieldsContextType_PaymentErrorValidationFieldsCode_ValidationFieldsContext":{"type":"object","required":["type","code","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_receive_payment"]},"code":{"type":"string","enum":["validation_failed"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"string"}}}}}},"ApiErrorWithContext_BillBadRequestBillIdType_BillIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["bill_already_processing_or_paid"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["bill_id"],"properties":{"bill_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_BillBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["line_of_credit_cannot_be_reconciled"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_id"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_BillNotFoundBillIdType_BillIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["bill_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["bill_id"],"properties":{"bill_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_BillNotFoundOrganizationIdType_OrganizationIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["bill_not_found_in_organization"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["organization_id"],"properties":{"organization_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_CheckoutIdempotencyConflictErrorType_SessionIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["idempotency_conflict"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["session_id"],"properties":{"session_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_CheckoutInvalidRequestErrorType_ValidationFieldsContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_request"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"string"}}}}}},"ApiErrorWithContext_CheckoutOriginForbiddenErrorType_OriginContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["checkout_origin_forbidden"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","properties":{"origin":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BrowserOrigin"}]}}}}},"ApiErrorWithContext_LineOfCreditBadRequestApplicationIdType_ApplicationIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["no_application_found","application_not_approved"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["application_id"],"properties":{"application_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_LineOfCreditBadRequestCurrencyType_CurrencyErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_currency","invalid_bank_details","unsupported_outer_billing_currency"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["currency"],"properties":{"currency":{"$ref":"#/components/schemas/Currency"}}}}},"ApiErrorWithContext_LineOfCreditBadRequestFeatureFlagType_FeatureFlagErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["feature_flag_disabled"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["feature"],"properties":{"feature":{"type":"string"}}}}},"ApiErrorWithContext_LineOfCreditBadRequestFieldType_FieldNameErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["missing_attribute"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field"],"properties":{"field":{"type":"string"}}}}},"ApiErrorWithContext_LineOfCreditBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["no_updates_provided","invalid_payment_defaults","billing_already_started"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_id"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_LineOfCreditBadRequestValidationFieldsType_ValidationFieldsContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["line_of_credit_not_valid"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"string"}}}}}},"ApiErrorWithContext_LineOfCreditForbiddenLineOfCreditIdType_LineOfCreditIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["not_allowed"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_id"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_LineOfCreditNotFoundLineOfCreditIdType_LineOfCreditIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["line_of_credit_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_id"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_LineOfCreditNotFoundOrganizationIdType_OrganizationIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["line_of_credit_not_found_in_organization"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["organization_id"],"properties":{"organization_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_PaymentBadRequestPaymentIdContextType_PaymentIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["payment_not_approved"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["payment_id"],"properties":{"payment_id":{"type":"string"}}}}},"ApiErrorWithContext_PaymentConflictPaymentIdContextType_PaymentIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["payment_exists"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["payment_id"],"properties":{"payment_id":{"type":"string"}}}}},"ApiErrorWithContext_PaymentErrorCursorContextType_CursorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_cursor"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["field","recovery"],"properties":{"field":{"type":"string"},"recovery":{"type":"string"}}}}},"ApiErrorWithContext_PaymentErrorPaymentIdContextType_PaymentIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["payment_not_found","payment_not_approved","payment_exists"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["payment_id"],"properties":{"payment_id":{"type":"string"}}}}},"ApiErrorWithContext_PaymentErrorWalletIdContextType_WalletIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["wallet_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_PaymentNotFoundPaymentIdContextType_PaymentIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["payment_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["payment_id"],"properties":{"payment_id":{"type":"string"}}}}},"ApiErrorWithContext_PaymentNotFoundWalletIdContextType_WalletIdContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["wallet_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_QuotingBadRequestCurrencyMismatchType_CurrencyMismatchErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["mismatch_currency"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_currency","source_currency","target_currency"],"properties":{"line_of_credit_currency":{"$ref":"#/components/schemas/Currency"},"source_currency":{"$ref":"#/components/schemas/Currency"},"target_currency":{"$ref":"#/components/schemas/Currency"}}}}},"ApiErrorWithContext_QuotingBadRequestTargetPrecisionMismatchType_TargetPrecisionMismatchErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["mismatch_target_precision"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["target_precision","target_currency"],"properties":{"target_precision":{"$ref":"#/components/schemas/TargetPrecision"},"target_currency":{"$ref":"#/components/schemas/Currency"}}}}},"ApiErrorWithContext_QuotingBadRequestValidationFieldsType_ValidationFieldsContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_quote_request"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"string"}}}}}},"ApiErrorWithContext_QuotingConflictQuoteIdType_QuoteIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["quote_already_exists"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["quote_id"],"properties":{"quote_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_QuotingNotFoundQuoteIdType_QuoteIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["quote_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["quote_id"],"properties":{"quote_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WalletBadRequestFeatureFlagType_FeatureFlagErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["feature_flag_disabled"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["feature"],"properties":{"feature":{"type":"string"}}}}},"ApiErrorWithContext_WalletBadRequestLineOfCreditIdType_WalletLineOfCreditErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["line_of_credit_disabled","missing_bank_details"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["line_of_credit_id"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"},"required_action":{"type":["string","null"]}}}}},"ApiErrorWithContext_WalletBadRequestValidationFieldsType_ValidationFieldsContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["invalid_request"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"string"}}}}}},"ApiErrorWithContext_WalletBadRequestWalletIdType_WalletIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["wallet_not_empty","wallet_not_credit_backed"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WalletNotFoundType_WalletIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["instance_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WalletPolicyBadRequestWalletIdType_WalletIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["no_updates_provided","wallet_policies_exist"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WalletPolicyNotFoundWalletIdType_WalletIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["wallet_policies_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["wallet_id"],"properties":{"wallet_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WebhookConflictWebhookIdType_WebhookIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["webhook_exists"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["webhook_id"],"properties":{"webhook_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WebhookNotFoundWebhookDeliveryIdType_WebhookDeliveryIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["webhook_delivery_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["webhook_delivery_id"],"properties":{"webhook_delivery_id":{"type":"string","format":"uuid"}}}}},"ApiErrorWithContext_WebhookNotFoundWebhookIdType_WebhookIdErrorContext":{"type":"object","required":["type","detail","context"],"properties":{"type":{"type":"string","enum":["webhook_not_found"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."},"context":{"type":"object","required":["webhook_id"],"properties":{"webhook_id":{"type":"string","format":"uuid"}}}}},"ApiError_AuthBadRequestErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["missing_credentials"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_AuthForbiddenErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["access_rights"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_AuthInternalServerErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["key_set_creation"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_AuthUnauthorizedErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["wrong_credentials","invalid_token","invalid_issuer"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_BillBadRequestNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["utils"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_CheckoutSimpleErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["access_rights","checkout_session_not_found","checkout_settings_not_found","checkout_token_forbidden","internal_error","invalid_checkout_token","invalid_issuer","invalid_parameter","missing_parameter","invalid_data","invalid_stream_token","invalid_syntax","invalid_token","key_set_creation","missing_checkout_token","missing_content_type","missing_credentials","payload_too_large","unsupported_payment_direction","wrong_credentials"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_InternalServerErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["internal_error"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_JsonPayloadTooLargeErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["payload_too_large"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_JsonUnprocessableEntityErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["invalid_data"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_JsonUnsupportedMediaTypeErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["missing_content_type"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_LineOfCreditBadRequestNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["utils","invalid_bitcoin_address","invalid_line_of_credit_limit","invalid_collateral_state","invalid_macaroon","invalid_outer_billing_configuration"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_PaymentBadRequestNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["utils","amount_match_failed","invalid_currency","invalid_bolt11_payment_request","environment_match_failed","invalid_payment","invalid_address","invalid_quote","invalid_network","invalid_amount","not_supported_network","invalid_filter"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_PaymentErrorNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["write_message","utils","read_failed","read_temporarily_unavailable","wallet_not_found","amount_match_failed","invalid_currency","invalid_bolt11_payment_request","environment_match_failed","invalid_payment","invalid_address","invalid_quote","invalid_network","invalid_amount","not_supported_network","invalid_filter"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_RequestBadRequestErrorType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["invalid_parameter","missing_parameter","invalid_syntax"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_WalletBadRequestNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["utils","line_of_credit_not_found","line_of_credit_not_ready","line_of_credit_cannot_allocate_wallet_limit","line_of_credit_network_mismatch","application_not_approved"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"ApiError_WebhookBadRequestNoContextType":{"type":"object","required":["type","detail"],"properties":{"type":{"type":"string","enum":["invalid_webhook"]},"detail":{"type":"string","description":"Human-readable error detail. Do not branch on this text."}}},"Asset":{"type":"string","format":"binary","description":"Group key of the asset - 66-character hex string representing the Taproot Asset group key","pattern":"^[a-fA-F0-9]{66}$"},"AssetAmount":{"type":"object","required":["asset","amount"],"properties":{"asset":{"$ref":"#/components/schemas/Asset","description":"The group key of the Taproot Asset"},"amount":{"type":"integer","format":"u-int64","description":"The amount in the smallest unit of the asset","minimum":0}}},"AuthForbiddenError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_AuthForbiddenErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"access_rights"}],"discriminator":{"propertyName":"type","mapping":{"access_rights":"#/components/schemas/ApiError_AuthForbiddenErrorType"}}},"AuthUnauthorizedError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_AuthUnauthorizedErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"wrong_credentials"}],"discriminator":{"propertyName":"type","mapping":{"invalid_issuer":"#/components/schemas/ApiError_AuthUnauthorizedErrorType","invalid_token":"#/components/schemas/ApiError_AuthUnauthorizedErrorType","wrong_credentials":"#/components/schemas/ApiError_AuthUnauthorizedErrorType"}}},"Balance":{"type":"object","required":["id","wallet_id","effective_time","available","total","network","currency"],"properties":{"id":{"type":"string","format":"uuid"},"wallet_id":{"type":"string","format":"uuid"},"effective_time":{"type":"string","format":"date-time"},"available":{"$ref":"#/components/schemas/SignedAmount"},"total":{"$ref":"#/components/schemas/SignedAmount"},"network":{"$ref":"#/components/schemas/Network"},"currency":{"$ref":"#/components/schemas/Currency"}}},"BankAccountPurpose":{"type":"string","description":"Describes what a bank account is used for in ACH billing.","enum":["collection","payout","fee"]},"BillAchStatus":{"type":"string","enum":["submitted","processing","succeeded","failed"]},"BillBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_BillBadRequestNoContextType"},{"$ref":"#/components/schemas/ApiErrorWithContext_BillBadRequestBillIdType_BillIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_BillBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_cannot_be_reconciled"}],"discriminator":{"propertyName":"type","mapping":{"bill_already_processing_or_paid":"#/components/schemas/ApiErrorWithContext_BillBadRequestBillIdType_BillIdErrorContext","invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","line_of_credit_cannot_be_reconciled":"#/components/schemas/ApiErrorWithContext_BillBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","utils":"#/components/schemas/ApiError_BillBadRequestNoContextType"}}},"BillCoverage":{"oneOf":[{"type":"object","required":["bill_at","type"],"properties":{"bill_at":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["one_time"]}}},{"type":"object","required":["start_at","end_at","type"],"properties":{"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["period"]}}}],"description":"Coverage captured by one scheduled component of a Bill."},"BillCurrencyStatusSummary":{"type":"object","required":["bill_total_count","inflight_total_count","total_due_base_units"],"properties":{"bill_total_count":{"type":"integer","format":"u-int64","minimum":0},"inflight_total_count":{"type":"integer","format":"u-int64","minimum":0},"total_due_base_units":{"type":"integer","format":"int64"}}},"BillCurrencySummary":{"type":"object","required":["bill_total_count","inflight_total_count","total_due_base_units","oldest_created_at","newest_created_at","by_status"],"properties":{"bill_total_count":{"type":"integer","format":"u-int64","minimum":0},"inflight_total_count":{"type":"integer","format":"u-int64","minimum":0},"total_due_base_units":{"type":"integer","format":"int64"},"oldest_created_at":{"type":"string","format":"date-time"},"newest_created_at":{"type":"string","format":"date-time"},"by_status":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/BillCurrencyStatusSummary"},"propertyNames":{"type":"string"}}}},"BillListSortKey":{"type":"string","enum":["created_at"]},"BillNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_BillNotFoundBillIdType_BillIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_BillNotFoundOrganizationIdType_OrganizationIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"bill_not_found_in_organization"}],"discriminator":{"propertyName":"type","mapping":{"bill_not_found":"#/components/schemas/ApiErrorWithContext_BillNotFoundBillIdType_BillIdErrorContext","bill_not_found_in_organization":"#/components/schemas/ApiErrorWithContext_BillNotFoundOrganizationIdType_OrganizationIdErrorContext"}}},"BillPage":{"type":"object","required":["items","limit","has_more"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BillRead"}},"limit":{"type":"integer","format":"u-int32","minimum":0},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}},"BillRead":{"type":"object","description":"All BTC amounts are expressed in millisatoshis (`msats`).","required":["id","organization_id","line_of_credit_id","start_time","end_time","period_length","status","settlement_type","wallet_ids","invoice","amt_due","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"line_of_credit_id":{"type":"string","format":"uuid"},"fulfillment_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"All fulfillment ids associated with the bill. ACH bills may have more\nthan one fulfillment when fee and settlement legs are submitted separately."},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":"string","format":"date-time"},"period_length":{"$ref":"#/components/schemas/ReconciliationFrequency"},"status":{"$ref":"#/components/schemas/BillStatus"},"settlement_type":{"$ref":"#/components/schemas/SettlementType","description":"The overall settlement type for this bill.\nCollection means customer owes us, Payout means we owe customer.\nComputed by `Invoice::settlement_type()`: sums the net totals of all line items,\nsubtracts the service fee, and returns `Collection` if the result is negative,\n`Payout` otherwise. Falls back to the \"any line item is Collection\" rule only\nwhen the net calculation fails."},"wallet_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"invoice":{"$ref":"#/components/schemas/Invoice"},"scheduled_sections":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledBillingSectionRead"},"description":"Fixed-contract and processing-fee components captured by this Bill."},"volume_fee_percentage":{"$ref":"#/components/schemas/VolumeFeePercentage","description":"Voltage's configured volume-fee rate snapshot. A number is a flat rate;\n`{ send, receive }` represents directional rates. This does not describe\nprocessing fee rates."},"settlement_fee_percentage":{"$ref":"#/components/schemas/SettlementFeePercentage","description":"Settlement-fee rate captured when this bill was initiated."},"payout_holdback":{"$ref":"#/components/schemas/PayoutHoldback","description":"Payout holdback configuration captured when this bill was initiated."},"amt_due":{"$ref":"#/components/schemas/Amount","description":"Unsigned settlement magnitude. Interpret its direction using\n`settlement_type`: Collection means the customer owes Voltage; Payout\nmeans Voltage owes the customer. Processing fees are not added to\nthis amount as a second charge."},"ln_invoice":{"type":["string","null"]},"address":{"type":["string","null"]},"amt_paid":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"A bill may be paid for more than what was requested\nThe real value paid is marked here"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"queued_at":{"type":["string","null"],"format":"date-time","description":"When the bill entered the ACH batch queue."},"fulfillment_requested_at":{"type":["string","null"],"format":"date-time","description":"When the bill was submitted to fulfillment for ACH processing."},"ach":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BillReadAchDetails"}]},"payment_received_at":{"type":["string","null"],"format":"date-time","description":"When payment was reported by fulfillment."},"paid_at":{"type":["string","null"],"format":"date-time","description":"When the bill was marked paid."},"settled_at":{"type":["string","null"],"format":"date-time","description":"When wallet settlement completed for the bill."},"voided_at":{"type":["string","null"],"format":"date-time","description":"When the bill was voided."},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BillingError"}]},"failed_at":{"type":["string","null"],"format":"date-time"}}},"BillReadAch":{"type":"object","required":["fulfillment_id","amount","status"],"properties":{"ach_id":{"type":["string","null"],"format":"uuid","description":"Stable Voltage identifier for this ACH leg when available. This is not a provider/bank identifier."},"fulfillment_id":{"type":"string","format":"uuid"},"purpose":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BankAccountPurpose"}]},"amount":{"$ref":"#/components/schemas/Amount"},"status":{"$ref":"#/components/schemas/BillAchStatus"},"submitted_at":{"type":["string","null"],"format":"date-time"},"processing_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"}}},"BillReadAchDetails":{"type":"object","properties":{"queued_at":{"type":["string","null"],"format":"date-time","description":"When the bill entered the ACH batch queue."},"submitted_at":{"type":["string","null"],"format":"date-time","description":"First time any ACH leg for this bill was submitted to fulfillment."},"processing_at":{"type":["string","null"],"format":"date-time","description":"First time any ACH leg for this bill was reported as processing."},"transfers":{"type":"array","items":{"$ref":"#/components/schemas/BillReadAch"}}}},"BillStatus":{"type":"string","enum":["payment_due","queued","processing","paid","void","failed"]},"BillStatusSummary":{"type":"object","required":["bill_total_count","inflight_total_count"],"properties":{"bill_total_count":{"type":"integer","format":"u-int64","minimum":0},"inflight_total_count":{"type":"integer","format":"u-int64","minimum":0}}},"BillSummary":{"type":"object","required":["organization_id","bill_total_count","inflight_total_count","amount_units","by_currency","by_status"],"properties":{"organization_id":{"type":"string","format":"uuid"},"line_of_credit_id":{"type":["string","null"],"format":"uuid"},"bill_total_count":{"type":"integer","format":"u-int64","minimum":0},"inflight_total_count":{"type":"integer","format":"u-int64","minimum":0},"amount_units":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"by_currency":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/BillCurrencySummary"},"propertyNames":{"type":"string"}},"by_status":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/BillStatusSummary"},"propertyNames":{"type":"string"}}}},"BillingError":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/BillingErrorType"},"detail":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BillingErrorDetail"}]},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BillingErrorContext"}]}}},"BillingErrorContext":{"oneOf":[{"$ref":"#/components/schemas/BillingErrorMessageContext"},{"$ref":"#/components/schemas/BillingMaxRetriesExceededContext"}]},"BillingErrorDetail":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/FulfillmentEventError"},{"type":"integer","format":"u-int8","minimum":0}]},"BillingErrorMessageContext":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"BillingErrorType":{"type":"string","enum":["write_message","fulfillment_failure","transfer_failure","max_retries_exceeded"]},"BillingMaxRetriesExceededContext":{"type":"object","required":["max_retries"],"properties":{"max_retries":{"type":"integer","format":"u-int8","minimum":0}}},"BroadcastFeeAboveMaxContext":{"type":"object","required":["estimated_fee_sats","max_fee_sats","target_blocks"],"properties":{"estimated_fee_sats":{"type":"integer","format":"u-int64","minimum":0},"max_fee_sats":{"type":"integer","format":"u-int64","minimum":0},"target_blocks":{"type":"integer","format":"u-int16","minimum":0}},"additionalProperties":false},"BrowserCheckoutPayment":{"type":"object","required":["id","status","kind"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/ReceiveStatus"},"kind":{"$ref":"#/components/schemas/PaymentKind"},"bip21_uri":{"type":["string","null"]},"payment_request":{"type":["string","null"]},"amount":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount"}]},"requested_amount":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount"}]}}},"BrowserCheckoutSession":{"type":"object","required":["id","expires_at","metadata","origin_policy","allowed_origins"],"properties":{"id":{"type":"string","format":"uuid"},"expires_at":{"type":"string","format":"date-time"},"payment":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BrowserCheckoutPayment"}]},"metadata":{"type":"object"},"origin_policy":{"$ref":"#/components/schemas/OriginPolicy"},"allowed_origins":{"type":"array","items":{"$ref":"#/components/schemas/BrowserOrigin"}}}},"BrowserOrigin":{"type":"string","example":"https://shop.example"},"BtcAmount":{"type":"integer","format":"u-int64","minimum":0},"BtcPrecision":{"type":"string","description":"Precision level for BTC amounts in quote conversions.","enum":["sats","msats"]},"CapturedEvent":{"type":"object","required":["hold_id","payment_id","amount","effective_time"],"properties":{"hold_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount","description":"Total amount debited from the wallet."},"payment_breakdown":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WalletPaymentBreakdown","description":"Fee details when available. Omitted for historical entries."}]},"effective_time":{"type":"string","format":"date-time"}}},"CheckoutError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_CheckoutSimpleErrorType"},{"$ref":"#/components/schemas/ApiErrorWithContext_CheckoutInvalidRequestErrorType_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_CheckoutOriginForbiddenErrorType_OriginContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_CheckoutIdempotencyConflictErrorType_SessionIdContext"}]},"CheckoutErrorResponseDoc":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/CheckoutError"}}},"CheckoutPaymentChangedEvent":{"type":"object","required":["session_id","payment_id","status"],"properties":{"session_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/ReceiveStatus"}}},"CheckoutPaymentKindDoc":{"type":"string","enum":["bolt11","onchain","bip21","taprootasset"]},"CheckoutPaymentUpdatedEvent":{"type":"object","required":["session_id","payment_id","payment"],"properties":{"session_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"payment":{"$ref":"#/components/schemas/BrowserCheckoutPayment"}}},"CheckoutRedirectUrls":{"type":"object","properties":{"success":{"type":"string"},"failure":{"type":"string"}},"additionalProperties":false},"CheckoutServerSentEventDataDoc":{"oneOf":[{"$ref":"#/components/schemas/CheckoutSnapshotEvent"},{"$ref":"#/components/schemas/CheckoutPaymentUpdatedEvent"},{"$ref":"#/components/schemas/CheckoutPaymentChangedEvent"}]},"CheckoutServerSentEventDoc":{"type":"object","required":["event","data"],"properties":{"event":{"$ref":"#/components/schemas/CheckoutServerSentEventName","description":"EventSource event name. Use this with the browser `EventSource.addEventListener` API."},"data":{"$ref":"#/components/schemas/CheckoutServerSentEventDataDoc","description":"JSON payload carried in the SSE `data:` field."}}},"CheckoutServerSentEventName":{"type":"string","enum":["snapshot","payment.updated","payment.changed"]},"CheckoutSessionAllowedOriginsResponse":{"type":"object","required":["origin_policy","allowed_origins"],"properties":{"origin_policy":{"$ref":"#/components/schemas/OriginPolicy","description":"Policy controlling which browser origins may access the session."},"allowed_origins":{"type":"array","items":{"$ref":"#/components/schemas/BrowserOrigin"},"description":"Exact customer origins configured for the session's environment. Used\nonly with the allowlist policy."}}},"CheckoutSnapshotEvent":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/BrowserCheckoutSession"}}}},"CollateralStatus":{"oneOf":[{"type":"object","required":["secured"],"properties":{"secured":{"$ref":"#/components/schemas/SecuredStatus"}}},{"type":"object","required":["verified"],"properties":{"verified":{"$ref":"#/components/schemas/VerifiedStatus"}}}]},"CreateCheckoutSessionRequest":{"type":"object","required":["id","wallet_id","payment_kind","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"wallet_id":{"type":"string","format":"uuid"},"payment_id":{"type":["string","null"],"format":"uuid","description":"Optional unique customer-supplied payment ID, returned as\n`detail.data.id` in payment webhooks. A payment ID is generated when\nomitted."},"amount":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Fixed checkout amount. Bitcoin receive kinds accept BTC or USD; USD\nrequires a USD-backed line of credit. Taproot asset receives require a\nmatching asset amount. Omit only for any-amount Bolt11 or BIP21 sessions."}]},"currency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Currency","description":"Optional explicit currency. For fixed amounts this must match the amount\ncurrency; when amount is omitted it defaults to BTC."}]},"payment_kind":{"$ref":"#/components/schemas/CheckoutPaymentKindDoc","description":"Receive type. OnChain and BIP21 require their organization feature\nflags. OnChain and TaprootAsset require fixed amounts; only Bolt11 and\nBIP21 support any-amount sessions."},"expires_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"payment_metadata":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"metadata":{"type":"object"},"redirect_urls":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CheckoutRedirectUrls"}]}}},"CreateCheckoutSessionResponse":{"type":"object","required":["id","payment_id","checkout_token","checkout_url","expires_at","origin_policy","allowed_origins"],"properties":{"id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"checkout_token":{"type":"string"},"checkout_url":{"type":"string","example":"https://checkout.voltage.cloud/#vlt_co_..."},"expires_at":{"type":"string","format":"date-time"},"origin_policy":{"$ref":"#/components/schemas/OriginPolicy"},"allowed_origins":{"type":"array","items":{"$ref":"#/components/schemas/BrowserOrigin"}}}},"CreateEventStreamRequest":{"type":"object","required":["checkout_tokens"],"properties":{"checkout_tokens":{"type":"array","items":{"type":"string"}}}},"CreateEventStreamResponse":{"type":"object","required":["stream_token","events_url","expires_at"],"properties":{"stream_token":{"type":"string"},"events_url":{"type":"string","example":"https://voltageapi.com/v1/checkout/events?stream_token=vlt_cos_..."},"expires_at":{"type":"string","format":"date-time"}}},"CreditReversalFrozen":{"type":"object","description":"Details for an admin-initiated credit reversal. Used to claw back a wallet credit\nthat was issued in error (e.g. due to a bug), in any supported currency.","required":["amount","reason"],"properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"The credited amount to reverse, in the same currency it was credited"},"reason":{"type":"string","description":"Human-readable reason for the reversal"}}},"CreditedEvent":{"type":"object","required":["credit_id","payment_id","amount","effective_time"],"properties":{"credit_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount","description":"Net amount credited to the wallet."},"payment_breakdown":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WalletPaymentBreakdown","description":"Fee details when available. Omitted for historical entries."}]},"effective_time":{"type":"string","format":"date-time"}}},"Currency":{"type":"string","description":"Currency type: 'btc', 'usd', or 'asset:' followed by 64-character hex string","examples":["btc","usd","asset:022003cdbdf894b7d5caadca525a576f1825c121dd461a1be7bd19b91d48222892"],"pattern":"^(btc|usd|asset:[a-fA-F0-9]{66})$"},"DeliveryStatus":{"type":"string","enum":["attempting","succeeded","failed","abandoned"],"example":"succeeded"},"DepositedEvent":{"type":"object","required":["deposit_id","amount","effective_time"],"properties":{"deposit_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount"},"effective_time":{"type":"string","format":"date-time"}}},"DirectionalPaymentActivity":{"type":"object","required":["send","receive"],"properties":{"send":{"$ref":"#/components/schemas/PaymentActivityBucket"},"receive":{"$ref":"#/components/schemas/PaymentActivityBucket"}}},"EnvironmentSettingsResponse":{"type":"object","required":["organization_id","environment_id","origin_policy","allowed_origins","updated_at"],"properties":{"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"origin_policy":{"$ref":"#/components/schemas/OriginPolicy"},"allowed_origins":{"type":"array","items":{"$ref":"#/components/schemas/BrowserOrigin"}},"updated_at":{"type":"string","format":"date-time"}}},"ErrorResponse_AuthForbiddenError":{"type":"object","title":"AuthForbiddenError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/AuthForbiddenError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"access_rights"}}]},"ErrorResponse_AuthUnauthorizedError":{"type":"object","title":"AuthUnauthorizedError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/AuthUnauthorizedError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"wrong_credentials"}}]},"ErrorResponse_BillBadRequestError":{"type":"object","title":"BillBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/BillBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_cannot_be_reconciled"}}]},"ErrorResponse_BillNotFoundError":{"type":"object","title":"BillNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/BillNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"bill_not_found_in_organization"}}]},"ErrorResponse_InternalServerError":{"type":"object","title":"InternalServerError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/InternalServerError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"key_set_creation"}}]},"ErrorResponse_JsonPayloadTooLargeError":{"type":"object","title":"JsonPayloadTooLargeError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/JsonPayloadTooLargeError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"payload_too_large"}}]},"ErrorResponse_JsonUnprocessableEntityError":{"type":"object","title":"JsonUnprocessableEntityError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/JsonUnprocessableEntityError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"invalid_data"}}]},"ErrorResponse_JsonUnsupportedMediaTypeError":{"type":"object","title":"JsonUnsupportedMediaTypeError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/JsonUnsupportedMediaTypeError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"missing_content_type"}}]},"ErrorResponse_LineOfCreditBadRequestError":{"type":"object","title":"LineOfCreditBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/LineOfCreditBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}]},"ErrorResponse_LineOfCreditForbiddenError":{"type":"object","title":"LineOfCreditForbiddenError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/LineOfCreditForbiddenError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"not_allowed"}}]},"ErrorResponse_LineOfCreditNotFoundError":{"type":"object","title":"LineOfCreditNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/LineOfCreditNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_not_found_in_organization"}}]},"ErrorResponse_PaymentBadRequestError":{"type":"object","title":"PaymentBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/PaymentBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}]},"ErrorResponse_PaymentConflictError":{"type":"object","title":"PaymentConflictError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/PaymentConflictError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"payment_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"payment_exists"}}]},"ErrorResponse_PaymentError":{"type":"object","title":"PaymentError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/PaymentError","description":"Status-specific error payload. Expand `PaymentError` to see the valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}]},"ErrorResponse_PaymentNotFoundError":{"type":"object","title":"PaymentNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/PaymentNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_not_found"}}]},"ErrorResponse_QuotingBadRequestError":{"type":"object","title":"QuotingBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/QuotingBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"target_currency":"btc","target_precision":{"currency":"usd","precision":"cents"}},"detail":"Human-readable error detail","type":"mismatch_target_precision"}}]},"ErrorResponse_QuotingConflictError":{"type":"object","title":"QuotingConflictError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/QuotingConflictError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_already_exists"}}]},"ErrorResponse_QuotingNotFoundError":{"type":"object","title":"QuotingNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/QuotingNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_not_found"}}]},"ErrorResponse_RequestBadRequestError":{"type":"object","title":"RequestBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/RequestBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"missing_credentials"}}]},"ErrorResponse_WalletBadRequestError":{"type":"object","title":"WalletBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WalletBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}}]},"ErrorResponse_WalletNotFoundError":{"type":"object","title":"WalletNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WalletNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}}]},"ErrorResponse_WalletPolicyBadRequestError":{"type":"object","title":"WalletPolicyBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WalletPolicyBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"no_updates_provided"}}]},"ErrorResponse_WalletPolicyNotFoundError":{"type":"object","title":"WalletPolicyNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WalletPolicyNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_policies_not_found"}}]},"ErrorResponse_WebhookBadRequestError":{"type":"object","title":"WebhookBadRequestError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WebhookBadRequestError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"detail":"Human-readable error detail","type":"invalid_webhook"}}]},"ErrorResponse_WebhookConflictError":{"type":"object","title":"WebhookConflictError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WebhookConflictError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"webhook_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_exists"}}]},"ErrorResponse_WebhookNotFoundError":{"type":"object","title":"WebhookNotFoundError response","description":"JSON error envelope. Branch on `error.type`; when present, `error.code` is the narrower machine-readable reason and `error.context` contains the structured fields for that type/code.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/WebhookNotFoundError","description":"Status-specific error payload. Expand this schema to see valid `type`, `code`, and `context` combinations."}},"examples":[{"error":{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}}]},"EventHistory":{"type":"object","required":["event_type","time","position"],"properties":{"event_type":{"type":"string"},"error":{"type":["string","null"]},"time":{"type":"string","format":"date-time"},"position":{"type":"integer","format":"int64"}}},"EventTypes":{"oneOf":[{"type":"object","required":["send"],"properties":{"send":{"$ref":"#/components/schemas/SendEventTypes"}}},{"type":"object","required":["receive"],"properties":{"receive":{"$ref":"#/components/schemas/ReceiveEventTypes"}}},{"type":"object","required":["test"],"properties":{"test":{"$ref":"#/components/schemas/TestEventTypes"}}}]},"Exchanges":{"type":"array","items":{"$ref":"#/components/schemas/AmountExchange"}},"Expiration":{"type":"integer","format":"u-int32","description":"The amount of time a payment invoice is valid for, in seconds.","minimum":0},"FixedContractBillingTerms":{"oneOf":[{"type":"object","required":["amount","bill_at","type"],"properties":{"amount":{"$ref":"#/components/schemas/Amount"},"bill_at":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["one_time"]}}},{"type":"object","required":["annual_value","installment_cadence","anchor_at","type"],"properties":{"annual_value":{"$ref":"#/components/schemas/Amount"},"installment_cadence":{"$ref":"#/components/schemas/OuterBillingCadence"},"anchor_at":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["annual"]}}}],"description":"Terms for a fixed contract that is billed independently from ordinary reconciliation."},"Frozen":{"type":"array","items":{"$ref":"#/components/schemas/PaymentFrozenDetails"}},"FulfillmentEventError":{"oneOf":[{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["InvalidBolt11Invoice"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"type":"string"},"type":{"type":"string","enum":["InvalidAddress"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"type":"string"},"type":{"type":"string","enum":["InvalidTaprootAssetPayment"]}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["MissingPaymentRequest"]}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["MissingPeerQuote"]}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["MissingAddress"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"type":"integer","format":"u-int64","minimum":0},"type":{"type":"string","enum":["InvalidPaymentAmount"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/FulfillmentPaymentFailureDetailDoc"},"type":{"type":"string","enum":["PaymentFailure"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/FulfillmentProviderFailureDetailDoc"},"type":{"type":"string","enum":["ProviderFailure"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"type":"string"},"type":{"type":"string","enum":["PolicyViolation"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/PaymentKind"},"type":{"type":"string","enum":["UnsupportedSendPaymentKind"]}}}]},"FulfillmentPaymentFailureCode":{"type":"string","enum":["no_route","transaction_build_failed","node_permission_denied","broadcast_failed","broadcast_fee_above_max"]},"FulfillmentPaymentFailureDetailDoc":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/FulfillmentPaymentFailureCode"}]},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentErrorContext"}]}}},"FulfillmentProviderFailureCode":{"type":"string","enum":["upstream_failure"]},"FulfillmentProviderFailureDetailDoc":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/FulfillmentProviderFailureCode"}]}}},"HashMap":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"HeldEvent":{"type":"object","required":["hold_id","payment_id","amount","effective_time"],"properties":{"hold_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount"},"effective_time":{"type":"string","format":"date-time"}}},"Hold":{"type":"object","required":["id","amount","effective_time"],"properties":{"id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/SignedAmount"},"effective_time":{"type":"string","format":"date-time"}}},"InfraConfigReadonly":{"oneOf":[{"type":"object","required":["config","type"],"properties":{"config":{"$ref":"#/components/schemas/LndConfigReadonly"},"type":{"type":"string","enum":["lnd_node"]}}},{"type":"object","required":["config","type"],"properties":{"config":{"$ref":"#/components/schemas/LndConfigReadonly"},"type":{"type":"string","enum":["taproot_asset_node"]}}}]},"InternalServerError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_InternalServerErrorType"},{"$ref":"#/components/schemas/ApiError_AuthInternalServerErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"key_set_creation"}],"discriminator":{"propertyName":"type","mapping":{"internal_error":"#/components/schemas/ApiError_InternalServerErrorType","key_set_creation":"#/components/schemas/ApiError_AuthInternalServerErrorType"}}},"InvalidAddressContext":{"type":"object","required":["address"],"properties":{"address":{"type":"string"}},"additionalProperties":false},"InvalidPaymentAmountContext":{"type":"object","required":["amount"],"properties":{"amount":{"$ref":"#/components/schemas/Amount"}},"additionalProperties":false},"InvalidProcessingFeeRatesContext":{"type":"object","required":["direction","basis_points","max_basis_points"],"properties":{"direction":{"$ref":"#/components/schemas/PaymentDirection"},"basis_points":{"type":"integer","format":"u-int16","minimum":0},"max_basis_points":{"type":"integer","format":"u-int16","minimum":0}}},"Invoice":{"type":"object","required":["line_of_credit_id","line_items","created_at","due_date","service_fee"],"properties":{"line_of_credit_id":{"type":"string","format":"uuid"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"created_at":{"type":"string","format":"date-time"},"due_date":{"type":"string","format":"date-time"},"service_fee":{"$ref":"#/components/schemas/Amount","description":"Voltage's invoice-level service fee. This is separate from processing\nfees assessed on payments."},"settlement_fee":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Customer fee calculated from the gross ordinary USD ACH payout after\nholdback, excluding outer-billing credits."}]}}},"JsonPayloadTooLargeError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_JsonPayloadTooLargeErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"payload_too_large"}],"discriminator":{"propertyName":"type","mapping":{"payload_too_large":"#/components/schemas/ApiError_JsonPayloadTooLargeErrorType"}}},"JsonUnprocessableEntityError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_JsonUnprocessableEntityErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"invalid_data"}],"discriminator":{"propertyName":"type","mapping":{"invalid_data":"#/components/schemas/ApiError_JsonUnprocessableEntityErrorType"}}},"JsonUnsupportedMediaTypeError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_JsonUnsupportedMediaTypeErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"missing_content_type"}],"discriminator":{"propertyName":"type","mapping":{"missing_content_type":"#/components/schemas/ApiError_JsonUnsupportedMediaTypeErrorType"}}},"Ledger":{"type":"object","required":["items","offset","limit","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEvent"}},"offset":{"type":"integer","format":"u-int32","minimum":0},"limit":{"type":"integer","format":"u-int32","minimum":0},"total":{"type":"integer","format":"u-int32","minimum":0}}},"LedgerEvent":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/CreditedEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["credited"]}}}]},{"allOf":[{"$ref":"#/components/schemas/CapturedEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["captured"]}}}]},{"allOf":[{"$ref":"#/components/schemas/HeldEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["held"]}}}]},{"allOf":[{"$ref":"#/components/schemas/ReleasedEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["released"]}}}]},{"allOf":[{"$ref":"#/components/schemas/DepositedEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["deposited"]}}}]},{"allOf":[{"$ref":"#/components/schemas/WithdrawnEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["withdrawn"]}}}]}]},"LedgerSortKey":{"type":"string","enum":["effective_time","message_time","time_and_effective_time"]},"LightningPaymentReceipt":{"type":"object","required":["preimage","payment_hash"],"properties":{"preimage":{"type":"string","description":"Settled lightning preimage"},"payment_hash":{"type":"string","description":"Settled lightning payment_hah"},"ledger_id":{"type":["string","null"],"format":"uuid","description":"Maps to either the hold_id or credit_id associated with this part of the payment"}}},"LineItem":{"type":"object","required":["wallet_id","currency","amount_total","settlement_type","total_transactions_sent","amount_sent","total_transactions_received","amount_received","volume_fee"],"properties":{"wallet_id":{"type":"string","format":"uuid"},"starting_balance":{"$ref":"#/components/schemas/SignedAmount","description":"Wallet balance at the start of the billing period. A positive BTC\nbalance can offset BTC collection principal."},"currency":{"$ref":"#/components/schemas/Currency"},"amount_total":{"$ref":"#/components/schemas/Amount","description":"Absolute net wallet movement during the billing period:\n`abs(amount_sent - amount_received)`."},"settlement_type":{"$ref":"#/components/schemas/SettlementType","description":"Direction of this line item's net settlement after Voltage volume and\ninterest fees are considered."},"total_transactions_sent":{"type":"integer","format":"u-int64","minimum":0},"amount_sent":{"$ref":"#/components/schemas/Amount","description":"Gross wallet debits during the period. For processing-fee sends this is\nprincipal plus network fee plus send processing fee."},"total_transactions_received":{"type":"integer","format":"u-int64","minimum":0},"amount_received":{"$ref":"#/components/schemas/Amount","description":"Gross wallet credits during the period. For processing-fee receives this\nis normally receiver principal; the payer-funded fee is not credited\nto the wallet and is reported in `processing_fees.receive`."},"processing_fees":{"$ref":"#/components/schemas/ProcessingFees","description":"Gross processing fees collected by payments represented in this\nline item, split into `total`, `send`, and `receive` amounts. Billing\nprojects these values from `payment_breakdown.processing_fee` when the\nline-of-credit configuration is captured at bill initiation."},"payment_activity":{"$ref":"#/components/schemas/PaymentActivity","description":"Distinct payment counts and volume-fee bases by category and direction.\nHistorical invoices omit this field because the category cannot be\nreconstructed reliably after generation."},"volume_fee":{"$ref":"#/components/schemas/VolumeFee","description":"Voltage's usage-based billing charge. Flat-rate configurations\nserialize as one Amount; directional configurations serialize as\n`{ total, send, receive }`."},"interest_fee":{"$ref":"#/components/schemas/Amount","description":"Voltage's interest charge for this wallet and billing period."},"payout_holdback":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Actual portion of this line item's USD payout retained in its wallet.\nThis is a payout reserve, not a fee. The bill-level `payout_holdback`\nfield contains the snapshotted configuration."}]}}},"LineOfCreditBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestApplicationIdType_ApplicationIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestFieldType_FieldNameErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestCurrencyType_CurrencyErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestValidationFieldsType_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestFeatureFlagType_FeatureFlagErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}],"discriminator":{"propertyName":"type","mapping":{"application_not_approved":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestApplicationIdType_ApplicationIdErrorContext","billing_already_started":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext","feature_flag_disabled":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestFeatureFlagType_FeatureFlagErrorContext","invalid_bank_details":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestCurrencyType_CurrencyErrorContext","invalid_bitcoin_address":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType","invalid_collateral_state":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType","invalid_currency":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestCurrencyType_CurrencyErrorContext","invalid_line_of_credit_limit":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType","invalid_macaroon":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType","invalid_outer_billing_configuration":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType","invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_payment_defaults":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","line_of_credit_not_valid":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestValidationFieldsType_ValidationFieldsContext","missing_attribute":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestFieldType_FieldNameErrorContext","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","no_application_found":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestApplicationIdType_ApplicationIdErrorContext","no_updates_provided":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestLineOfCreditIdType_LineOfCreditIdErrorContext","unsupported_outer_billing_currency":"#/components/schemas/ApiErrorWithContext_LineOfCreditBadRequestCurrencyType_CurrencyErrorContext","utils":"#/components/schemas/ApiError_LineOfCreditBadRequestNoContextType"}}},"LineOfCreditForbiddenError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_AuthForbiddenErrorType"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditForbiddenLineOfCreditIdType_LineOfCreditIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"line_of_credit_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"not_allowed"}],"discriminator":{"propertyName":"type","mapping":{"access_rights":"#/components/schemas/ApiError_AuthForbiddenErrorType","not_allowed":"#/components/schemas/ApiErrorWithContext_LineOfCreditForbiddenLineOfCreditIdType_LineOfCreditIdErrorContext"}}},"LineOfCreditNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditNotFoundLineOfCreditIdType_LineOfCreditIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_LineOfCreditNotFoundOrganizationIdType_OrganizationIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"organization_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"line_of_credit_not_found_in_organization"}],"discriminator":{"propertyName":"type","mapping":{"line_of_credit_not_found":"#/components/schemas/ApiErrorWithContext_LineOfCreditNotFoundLineOfCreditIdType_LineOfCreditIdErrorContext","line_of_credit_not_found_in_organization":"#/components/schemas/ApiErrorWithContext_LineOfCreditNotFoundOrganizationIdType_OrganizationIdErrorContext"}}},"LndConfigReadonly":{"type":"object","required":["host"],"properties":{"host":{"type":"string"}}},"MarketQuote":{"type":"object","required":["from","to","rate","quoted_at"],"properties":{"from":{"$ref":"#/components/schemas/Currency"},"to":{"$ref":"#/components/schemas/Currency"},"rate":{"$ref":"#/components/schemas/rate-string"},"quoted_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"MaxPaymentSize":{"type":"object","required":["id","max_size_sats","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"max_size_sats":{"type":"integer","format":"u-int64","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"NamedAsset":{"type":"object","required":["asset","name","network","decimal_display"],"properties":{"asset":{"$ref":"#/components/schemas/Asset"},"name":{"type":"string"},"network":{"$ref":"#/components/schemas/Network"},"decimal_display":{"type":"integer","format":"u-int8","description":"The number of decimal places to shift the decimal point left when displaying asset amounts.\nFor example, if a USD stablecoin has decimal_display = 6, then 1,000,000 base units (10^6) equals 1 \"whole unit\" (i.e., $1.000000).\nAll amounts are provided through this API in the smallest unit of the asset (base units). Clients can use the decimal_display value to convert base units to whole units for display purposes.\nLightning Labs recommends using a decimal_display value of 6 for currencies that use smaller subunits than two decimal places (such as cents for USD/EUR, pence for GBP, etc.).","minimum":0}}},"Network":{"type":"string","enum":["mainnet","testnet","signet","mutinynet","none"]},"NewQuoteRequest":{"type":"object","required":["id","line_of_credit_id","network","amount","to"],"properties":{"id":{"type":"string","format":"uuid"},"line_of_credit_id":{"type":"string","format":"uuid","description":"Line of credit used for access and currency validation.\nIts currency must match either `amount.currency` or `to`."},"network":{"$ref":"#/components/schemas/Network"},"amount":{"$ref":"#/components/schemas/Amount","description":"Exact known amount to convert from. Request bodies need only `currency` and `amount`;\n`unit` is derived from `currency` and may be omitted.\nFor a USD wallet paying a known BTC amount, use that BTC amount and set `to` to USD.\nFor a USD-denominated receive, use the USD amount and set `to` to BTC."},"to":{"$ref":"#/components/schemas/Currency","description":"Currency to convert `amount` into."},"target_precision":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TargetPrecision","description":"Precision for the converted (target) amount. The currency in this field must match `to`.\nDefaults to `sats` for BTC targets and `cents` for USD targets when omitted."}]}}},"NewWalletRequest":{"type":"object","required":["id","environment_id","line_of_credit_id","name","network","limit"],"properties":{"id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"line_of_credit_id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":256,"minLength":3},"network":{"$ref":"#/components/schemas/SupportedNetwork"},"limit":{"type":"integer","format":"u-int64","description":"If limit is set to 0, no credit will be available for this wallet.","example":100000000,"minimum":0},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}},"example":{"environment_id":"123e4567-e89b-12d3-a456-426614174000","id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2","limit":100000000,"line_of_credit_id":"7df75323-84f1-4699-97da-776380a0aa81","metadata":{"tag":"testing wallet"},"name":"testing","network":"mutinynet"}},"NewWebhookRequest":{"type":"object","required":["id","url","name","events"],"properties":{"id":{"type":"string","format":"uuid","description":"Client-generated webhook registration ID.\nEach outbound delivery includes this value in `x-voltage-webhook-id`.","example":"b0fc9829-f139-4035-bb14-4a4b6cd58f0e"},"url":{"type":"string","example":"https://example.com"},"name":{"type":"string","example":"some name"},"events":{"type":"array","items":{"$ref":"#/components/schemas/EventTypes"},"example":[{"send":"succeeded"},{"send":"failed"},{"receive":"succeeded"},{"receive":"completed"},{"receive":"failed"}]}}},"OfacCompliant":{"type":"object","required":["id","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"}}},"OnChainPaymentFrozen":{"type":"object","required":["tx_id","address","amount_sats","reason"],"properties":{"tx_id":{"type":"string","description":"The hex encoded bitcoin transaction id","example":"a22ec88f7a84a705466c9cd8d37024155ffa7930300fcee4fed9e5cc4e25904e"},"address":{"type":"string","description":"The bitcoin address that received the tainted funds","example":"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"},"amount_sats":{"type":"integer","format":"u-int64","description":"The amount of tainted funds in sats to freeze","minimum":0},"reason":{"$ref":"#/components/schemas/Reasons","description":"Reason why the funds were frozen"}}},"OnChainPaymentReceipt":{"type":"object","required":["required_confirmations_num","tx_id","amount_sats"],"properties":{"required_confirmations_num":{"type":"integer","format":"u-int16","description":"The number of confirmations required for the transaction to be considered complete","minimum":0},"tx_id":{"type":"string","description":"The hex encoded bitcoin transaction id"},"ledger_id":{"type":["string","null"],"format":"uuid","description":"Maps to either the hold_id or credit_id associated with this part of the payment"},"height_mined_at":{"type":["integer","null"],"format":"u-int64","description":"The height of the block that mined the transaction","minimum":0},"amount_sats":{"type":"integer","format":"u-int64","description":"The amount of the transaction in sats","minimum":0},"sanctioned_info":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SanctionedTxInfo","description":"The amount from a sanctioned source in sats and omitted from received value"}]},"mined_at":{"type":["integer","null"],"format":"u-int64","description":"The unix timestamp (seconds) of the block that mined the transaction.\nUsed to compare against quote expiration to determine if the first\nconfirmation arrived before the quote expired.","minimum":0},"is_pending":{"type":"boolean","description":"We've detected the payment but is hasn't reached the required confirmations to be considered \"settled\""}}},"OriginPolicy":{"type":"string","enum":["deny_all","allowlist","allow_all"]},"OuterBillingCadence":{"type":"string","description":"The interval at which an outer-billing configuration produces Bills.","enum":["monthly","quarterly","annually"]},"Payload":{"oneOf":[{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/SendPayload"},"type":{"type":"string","enum":["send"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/ReceivePayload"},"type":{"type":"string","enum":["receive"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/TestPayload"},"type":{"type":"string","enum":["test"]}}}]},"Payment":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SendPayment"},{"type":"object","required":["direction"],"properties":{"direction":{"type":"string","enum":["send"]}}}]},{"allOf":[{"$ref":"#/components/schemas/ReceivePayment"},{"type":"object","required":["direction"],"properties":{"direction":{"type":"string","enum":["receive"]}}}]}],"examples":[{"created_at":"2025-02-12T21:22:50.30219Z","currency":"btc","data":{"address":"tb1pzkhtj4ld86g9c49du5yagnncfrm0s489t76vmrwmt2ecxfnf7spsvjte49","amount":{"amount":150000000,"currency":"btc","unit":"msats"},"amount_sats":150000,"fee_sats":250,"fees":{"amount":250000,"currency":"btc","unit":"msats"},"label":null,"market_quote":null,"max_fee":{"amount":1000000,"currency":"btc","unit":"msats"},"max_fee_sats":1000,"outflows":[{"data":{"rail":"onchain","receipt":{"data":{"amount_sats":150000,"height_mined_at":1888021,"is_pending":false,"ledger_id":"0c16fd8e-ce4d-42fe-9d0b-3069244eb66c","mined_at":1739395372,"required_confirmations_num":1,"sanctioned_info":null,"tx_id":"a22ec88f7a84a705466c9cd8d37024155ffa7930300fcee4fed9e5cc4e25904e"},"type":"onchain"},"step":"target_claimed"},"type":"swap"}]},"direction":"send","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"id":"2ec1e783-19b4-4c10-8181-66336a6232bd","organization_id":"b0684ab8-1130-46af-8f70-71519442f108","payment_breakdown":{"network_fee":{"amount":150000,"currency":"btc","unit":"msats"},"principal":{"amount":150000000,"currency":"btc","unit":"msats"},"processing_fee":{"amount":100000,"currency":"btc","unit":"msats"}},"route":"swap","status":"completed","type":"onchain","updated_at":"2025-02-12T21:23:03.173159Z","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"},{"bip21_uri":"lightning:lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz","created_at":"2025-02-12T21:21:21.744713Z","currency":"btc","data":{"amount":{"amount":150000,"currency":"btc","unit":"msats"},"amount_msats":150000,"expiration":3600,"market_quote":null,"memo":"Order 123","payment_request":"lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz","receipts":[{"data":{"ledger_id":"03d87c6d-2cf8-414b-929a-eceeb4c896ed","payment_hash":"2222222222222222222222222222222222222222222222222222222222222222","preimage":"1111111111111111111111111111111111111111111111111111111111111111"},"type":"lightning"}]},"direction":"receive","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"frozen":[],"id":"11ca843c-bdaa-44b6-965a-39ac550fcef7","organization_id":"b0684ab8-1130-46af-8f70-71519442f108","requested_amount":{"amount":150000,"currency":"btc","unit":"msats"},"status":"completed","type":"bolt11","updated_at":"2025-02-12T21:23:03.173159Z","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}]},"PaymentActivity":{"type":"object","description":"Payment volume represented by a bill line item, grouped for customer and\nrevenue review.","required":["standard","treasury"],"properties":{"standard":{"$ref":"#/components/schemas/DirectionalPaymentActivity"},"treasury":{"$ref":"#/components/schemas/DirectionalPaymentActivity"}}},"PaymentActivityBucket":{"type":"object","required":["count","volume"],"properties":{"count":{"type":"integer","format":"u-int64","minimum":0},"volume":{"$ref":"#/components/schemas/Amount"}}},"PaymentBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/PaymentDomainBadRequestError"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}]},"PaymentBreakdown":{"type":"object","description":"Best-available aggregate amounts for a payment.\n\nUnlike [`crate::WalletPaymentBreakdown`], this public read-model summary\nintentionally omits per-settlement processing fee metadata. A receive can be\nfunded by multiple settlement increments whose classifications differ, but\ntheir monetary components can still be safely aggregated. Before wallet\nsettlement is confirmed, rail amounts are converted to the payment's\ndisplay currency using its quote. Confirmed wallet-settlement amounts take\nprecedence when available.","required":["principal","network_fee","processing_fee"],"properties":{"principal":{"$ref":"#/components/schemas/Amount","description":"Payment principal before network and processing fees."},"network_fee":{"$ref":"#/components/schemas/Amount","description":"Aggregate recorded network/provider fees for the payment. For a\nswap-backed send, this rolls up every recorded Lightning routing and\nBitcoin mining fee across both swap legs. A Bitcoin fee is known from\nthe published transaction and does not imply block confirmation."},"processing_fee":{"$ref":"#/components/schemas/Amount","description":"Processing fee assessed for the payment."}}},"PaymentBucketSummary":{"type":"object","required":["direction","status","currency","kind","total_count","oldest_created_at","newest_created_at"],"properties":{"direction":{"$ref":"#/components/schemas/PaymentDirection"},"status":{"$ref":"#/components/schemas/PaymentStatus"},"currency":{"$ref":"#/components/schemas/Currency"},"kind":{"$ref":"#/components/schemas/PaymentKind"},"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":"string","format":"date-time"},"newest_created_at":{"type":"string","format":"date-time"}}},"PaymentCategory":{"type":"string","enum":["standard","treasury"]},"PaymentConflictError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentConflictPaymentIdContextType_PaymentIdContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"payment_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"payment_exists"}],"discriminator":{"propertyName":"type","mapping":{"payment_exists":"#/components/schemas/ApiErrorWithContext_PaymentConflictPaymentIdContextType_PaymentIdContext"}}},"PaymentCountSummary":{"type":"object","required":["total_count","oldest_created_at","newest_created_at"],"properties":{"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":"string","format":"date-time"},"newest_created_at":{"type":"string","format":"date-time"}}},"PaymentDirection":{"type":"string","enum":["send","receive"]},"PaymentDomainBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_PaymentBadRequestNoContextType"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentBadRequestPaymentIdContextType_PaymentIdContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentErrorCursorContextType_CursorContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorRequiredFieldContextType_PaymentErrorRequiredFieldCode_FieldContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorMinLengthFieldContextType_PaymentErrorMinLengthFieldCode_FieldContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorAmountMinimumContextType_PaymentErrorAmountMinimumCode_AmountMinimumContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorOnChainFeeFloorContextType_PaymentErrorOnChainFeeFloorCode_OnChainFeeFloorContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorValidationFieldsContextType_PaymentErrorValidationFieldsCode_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorFeatureFlagContextType_PaymentErrorFeatureFlagCode_FeatureFlagContext"}]},"PaymentEnvironmentSummary":{"type":"object","required":["organization_id","total_count","oldest_created_at","newest_created_at"],"properties":{"organization_id":{"type":"string","format":"uuid"},"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":"string","format":"date-time"},"newest_created_at":{"type":"string","format":"date-time"}}},"PaymentError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_PaymentErrorNoContextType"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentErrorPaymentIdContextType_PaymentIdContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentErrorWalletIdContextType_WalletIdContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentErrorCursorContextType_CursorContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorRequiredFieldContextType_PaymentErrorRequiredFieldCode_FieldContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorMinLengthFieldContextType_PaymentErrorMinLengthFieldCode_FieldContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorAmountMinimumContextType_PaymentErrorAmountMinimumCode_AmountMinimumContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorOnChainFeeFloorContextType_PaymentErrorOnChainFeeFloorCode_OnChainFeeFloorContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorValidationFieldsContextType_PaymentErrorValidationFieldsCode_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithCodeAndContext_PaymentErrorFeatureFlagContextType_PaymentErrorFeatureFlagCode_FeatureFlagContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"code":"disabled","context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}]},"PaymentErrorContext":{"oneOf":[{"$ref":"#/components/schemas/BroadcastFeeAboveMaxContext"},{"$ref":"#/components/schemas/InvalidAddressContext"},{"$ref":"#/components/schemas/InvalidPaymentAmountContext"}],"description":"Typed context for payment errors.\n\n`PaymentErrorContext` is `#[serde(untagged)]`, so serde tries variants in\ndeclaration order. Future variants must have field shapes distinct from\nthe existing context structs, including `BroadcastFeeAboveMaxContext`\n(`estimated_fee_sats`, `max_fee_sats`, `target_blocks`),\n`InvalidAddressContext` (`address`), and `InvalidPaymentAmountContext`\n(`amount`). Payload structs deny unknown fields to avoid silently accepting\nfuture fields. Switch this enum to a tagged representation if future context\nvariants could overlap."},"PaymentFrozenDetails":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OnChainPaymentFrozen"},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/CreditReversalFrozen"},"type":{"type":"string","enum":["credit_reversal"]}}}]},"PaymentHistory":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventHistory"}}}},"PaymentKind":{"type":"string","enum":["bolt11","onchain","bip21","taprootasset","usdbatch"]},"PaymentLineOfCreditSummary":{"type":"object","required":["organization_id","environment_id","total_count","oldest_created_at","newest_created_at","buckets"],"properties":{"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":"string","format":"date-time"},"newest_created_at":{"type":"string","format":"date-time"},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBucketSummary"}}}},"PaymentNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentNotFoundPaymentIdContextType_PaymentIdContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_PaymentNotFoundWalletIdContextType_WalletIdContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_not_found"}],"discriminator":{"propertyName":"type","mapping":{"payment_not_found":"#/components/schemas/ApiErrorWithContext_PaymentNotFoundPaymentIdContextType_PaymentIdContext","wallet_not_found":"#/components/schemas/ApiErrorWithContext_PaymentNotFoundWalletIdContextType_WalletIdContext"}}},"PaymentOutflow":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OnChainPaymentReceipt"},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/LightningPaymentReceipt"},"type":{"type":"string","enum":["lightning"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/ShortCircuitPaymentReceipt"},"type":{"type":"string","enum":["shortcircuit"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/SwapPaymentReceipt"},"type":{"type":"string","enum":["swap"]}}}],"description":"Value leaving a wallet while a payment is executed.\n\nThe `type` discriminator is one of `onchain`, `lightning`, `shortcircuit`,\nor `swap`. A `swap` outflow records a swap lifecycle step and includes its\nrail-specific receipt in `data`."},"PaymentPaginationMode":{"type":"string","enum":["offset","cursor"]},"PaymentProcessingFee":{"type":"object","description":"Processing fee applied to a payment.\n\nThe amount is the server-calculated fee approved for a send or included in\nthe generated payer-facing amount for a receive. It remains in the\nprincipal's assessment currency so these payment terms stay stable across\nquote refreshes and settlement. [`PaymentBreakdown::processing_fee`] remains\nthe authoritative actual settled fee.","required":["basis_points","amount"],"properties":{"basis_points":{"type":"integer","format":"u-int16","description":"Exact configured rate. A value of `100` is 1% and `250` is 2.5%.","maximum":10000,"minimum":0},"amount":{"$ref":"#/components/schemas/Amount","description":"Server-calculated processing fee in the principal's assessment\ncurrency, including required base-unit rounding."}}},"PaymentReceipt":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OnChainPaymentReceipt"},"type":{"type":"string","enum":["OnChain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/ShortCircuitPaymentReceipt"},"type":{"type":"string","enum":["ShortCircuit"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/AchPaymentReceipt"},"type":{"type":"string","enum":["Ach"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/LightningPaymentReceipt"},"type":{"type":"string","enum":["Lightning"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/SwapPaymentReceipt"},"type":{"type":"string","enum":["Swap"]}}}]},"PaymentReceiveType":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","amount_msats"],"properties":{"payment_request":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Processing fee assessed for this receive, when configured."}]},"amount_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"memo":{"type":["string","null"]},"expiration":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Expiration"}]},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/ReadPaymentReceipt"}}}},"type":{"type":"string","enum":["bolt11"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","amount_sats","receipts"],"properties":{"address":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Processing fee assessed for this receive, when configured."}]},"amount_sats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"label":{"type":["string","null"]},"expiration":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Expiration"}]},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/ReadPaymentReceipt"}},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]}}},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","amount_msats","receipts"],"properties":{"payment_request":{"type":["string","null"]},"address":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Processing fee assessed for this receive, when configured."}]},"amount_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"description":{"type":["string","null"]},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/ReadPaymentReceipt"}},"expiration":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Expiration"}]},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]}}},"type":{"type":"string","enum":["bip21"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","asset"],"properties":{"payment_request":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount"},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Processing fee assessed for this receive, when configured."}]},"asset":{"$ref":"#/components/schemas/Asset"},"quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Quote"}]},"btc_amount":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BtcAmount"}]},"asset_amount":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AssetAmount"}]},"memo":{"type":["string","null"]},"expiration":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Expiration"}]},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/ReadPaymentReceipt"}}}},"type":{"type":"string","enum":["taprootasset"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["idempotency_key","direction","payments"],"properties":{"idempotency_key":{"type":"string","format":"uuid"},"direction":{"$ref":"#/components/schemas/UsdPaymentDirection"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/UsdPayment"}},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentReceipt"}}}},"type":{"type":"string","enum":["usdbatch"]}}}]},"PaymentRequest":{"oneOf":[{"type":"object","title":"Send Lightning Bolt11 Payment","description":"Send Lightning Bolt11 payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"Quote ID - required for USD wallets"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"$ref":"#/components/schemas/Currency"},"type":{"type":"string","enum":["bolt11"]},"data":{"type":"object","required":["payment_request"],"properties":{"payment_request":{"type":"string","description":"Lightning invoice - cannot be empty"},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_msats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Set to 0 to require a zero-fee route. If omitted, defaults to 1% of the payment amount or 1,000 msats, whichever is greater. Processing fees are additional. Legacy max_fee_msats alias is supported."}}}}},{"type":"object","title":"Send On-chain Bitcoin Payment","description":"Send on-chain Bitcoin payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"Quote ID - required for USD wallets"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"$ref":"#/components/schemas/Currency"},"type":{"type":"string","enum":["onchain"]},"data":{"type":"object","required":["address","amount"],"properties":{"address":{"type":"string","description":"Bitcoin address - cannot be empty"},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_sats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Processing fees are additional. Legacy max_fee_sats alias is supported."},"description":{"type":"string","description":"Optional payment description - if provided, cannot be empty"}}}}},{"type":"object","title":"Send BIP21 Unified Payment","description":"Send BIP21 unified payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"Quote ID - required for USD wallets"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"$ref":"#/components/schemas/Currency"},"type":{"type":"string","enum":["bip21"]},"data":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"BIP21 URI - cannot be empty"},"payment_request":{"type":"string","description":"Optional Lightning invoice - if provided, cannot be empty"},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_msats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Processing fees are additional. Legacy max_fee_msats alias is supported."},"description":{"type":"string","description":"Optional payment description - if provided, cannot be empty"}}}}},{"type":"object","title":"Send Taproot Asset Payment","description":"Send Taproot Asset payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"Quote ID - required for USD wallets"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"$ref":"#/components/schemas/Currency"},"type":{"type":"string","enum":["taprootasset"]},"data":{"type":"object","required":["payment_request","asset","amount","max_fee"],"properties":{"payment_request":{"type":"string","description":"Taproot asset invoice - cannot be empty"},"asset":{"$ref":"#/components/schemas/Asset"},"amount":{"oneOf":[{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - must be > 0","minimum":1},"unit":{"type":"string","description":"Unit identifier - always 'base units' for assets","enum":["base units"]}}}],"description":"Asset amount in base units - required for taproot asset sends, must be > 0"},"max_fee":{"oneOf":[{"type":"object","description":"Bitcoin fee amount in millisatoshis","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Fee amount in millisatoshis (msats) - must be > 0","minimum":1},"unit":{"type":"string","description":"Unit identifier - always 'msats' for Bitcoin","enum":["msats"]}}},{"type":"object","description":"Asset fee amount in base units","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Fee amount in base units of the asset - must be > 0","minimum":1},"unit":{"type":"string","description":"Unit identifier - always 'base units' for assets","enum":["base units"]}}}],"description":"Maximum network/provider fee - can be BTC or Asset. Configured processing fees are additional."}}}}},{"type":"object","title":"Receive Payment with Specific Amount","description":"Receive payment with specific amount - currency comes from amount object","required":["id","wallet_id","payment_kind","amount"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"Quote ID - required for USD wallets"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to receive the payment into"},"payment_kind":{"type":"string","enum":["bolt11","onchain","bip21","taprootasset"]},"amount":{"$ref":"#/components/schemas/Amount"},"description":{"type":"string","description":"Optional description/memo for the payment"},"expiration":{"type":"integer","description":"Optional receive expiration in seconds (default: 3600, max: 86400) - applies to bolt11, onchain, bip21, and taproot asset"}}},{"type":"object","title":"Receive Payment with Any Amount","description":"Receive payment with any amount. A standard receive requires an effective receive processing fee rate of zero or no configured rate. A nonzero rate causes the asynchronous payment to fail before invoice or URI generation.","required":["id","wallet_id","currency","payment_kind"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to receive the payment into"},"currency":{"type":"string","description":"Currency for any-amount invoices - must be 'btc'","enum":["btc"]},"payment_kind":{"type":"string","description":"Payment kind - only bolt11 and bip21 support any-amount","enum":["bolt11","bip21"]},"description":{"type":"string","description":"Optional description/memo for the payment"},"expiration":{"type":"integer","description":"Optional invoice expiration in seconds (default: 3600, max: 86400)"}}},{"type":"object","title":"LEGACY: Receive Payment (amount_msats)","description":"LEGACY: Receive payment with amount_msats field (backward compatibility)","required":["id","wallet_id","payment_kind","amount_msats"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to receive the payment into"},"currency":{"type":"string","description":"Currency (ignored in legacy format)","enum":["btc"]},"payment_kind":{"type":"string","enum":["bolt11","bip21"]},"amount_msats":{"type":"integer","format":"int64","description":"DEPRECATED: Amount in millisatoshis - use 'amount' object instead","minimum":1},"description":{"type":"string","description":"Optional description/memo for the payment"},"expiration":{"type":"integer","description":"Optional invoice expiration in seconds"}}},{"type":"object","title":"LEGACY: Receive Payment (amount_sats)","description":"LEGACY: Receive payment with amount_sats field (backward compatibility)","required":["id","wallet_id","payment_kind","amount_sats"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to receive the payment into"},"currency":{"type":"string","description":"Currency (ignored in legacy format)","enum":["btc"]},"payment_kind":{"type":"string","enum":["onchain"]},"amount_sats":{"type":"integer","format":"int64","description":"DEPRECATED: Amount in satoshis - use 'amount' object instead","minimum":1},"description":{"type":"string","description":"Optional description/memo for the payment"}}}],"description":"Payment request for sending or receiving Bitcoin, USD, and Taproot Assets.\n\nNOTE: USD wallets require a quote_id for currency conversion. The quote must have USD involved (either 'from' or 'to' field).\n\nRESPONSE: For USD payments, the response will include a 'market_quote' field embedded within the payment's data object showing the exchange rate (from/to currencies, rate, and timestamp) used for the currency conversion."},"PaymentRoute":{"type":"string","enum":["direct","swap"]},"PaymentSendType":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","max_fee","amount_msats","max_fee_msats"],"properties":{"payment_request":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"max_fee":{"$ref":"#/components/schemas/Amount","description":"The maximum network/provider fee for this payment. Configured\nprocessing fees are additional and do not count against it."},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"The total actual fee charged: network/provider plus processing fee."}]},"amount_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"max_fee_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `max_fee` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"fee_msats":{"type":["integer","null"],"format":"u-int64","description":"@deprecated Use `fees` instead. Includes network/provider and\nprocessing fees. This field will be removed in a future version.","deprecated":true,"minimum":0},"memo":{"type":["string","null"]},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]},"outflows":{"type":"array","items":{"$ref":"#/components/schemas/PaymentOutflow"}}}},"type":{"type":"string","enum":["bolt11"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","max_fee","amount_sats","max_fee_sats"],"properties":{"address":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"max_fee":{"$ref":"#/components/schemas/Amount","description":"The maximum network/provider fee for this payment. Configured\nprocessing fees are additional and do not count against it."},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"The total actual fee charged: network/provider plus processing fee."}]},"amount_sats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"max_fee_sats":{"type":"integer","format":"u-int64","description":"@deprecated Use `max_fee` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"fee_sats":{"type":["integer","null"],"format":"u-int64","description":"@deprecated Use `fees` instead. Includes network/provider and\nprocessing fees. This field will be removed in a future version.","deprecated":true,"minimum":0},"label":{"type":["string","null"]},"outflows":{"type":"array","items":{"$ref":"#/components/schemas/PaymentOutflow"}},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]}}},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["amount","max_fee","amount_msats","max_fee_msats"],"properties":{"payment_request":{"type":["string","null"]},"address":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount for this payment"},"max_fee":{"$ref":"#/components/schemas/Amount","description":"The maximum network/provider fee for this payment. Configured\nprocessing fees are additional and do not count against it."},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"The total actual fee charged: network/provider plus processing fee."}]},"amount_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `amount` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"max_fee_msats":{"type":"integer","format":"u-int64","description":"@deprecated Use `max_fee` instead. This field will be removed in a future version.","deprecated":true,"minimum":0},"fee_msats":{"type":["integer","null"],"format":"u-int64","description":"@deprecated Use `fees` instead. Includes network/provider and\nprocessing fees. This field will be removed in a future version.","deprecated":true,"minimum":0},"description":{"type":["string","null"]},"outflows":{"type":"array","items":{"$ref":"#/components/schemas/PaymentOutflow"}},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]}}},"type":{"type":"string","enum":["bip21"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["payment_request","asset","amount"],"properties":{"payment_request":{"type":"string"},"max_fee":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"The maximum network/provider fee. Configured processing fees\nare additional and do not count against it."}]},"fees":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"The total actual fee charged: network/provider plus processing fee."}]},"asset":{"$ref":"#/components/schemas/Asset"},"amount":{"$ref":"#/components/schemas/Amount"},"peer_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PeerQuote"}]},"memo":{"type":["string","null"]},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]},"outflows":{"type":"array","items":{"$ref":"#/components/schemas/PaymentOutflow"}}}},"type":{"type":"string","enum":["taprootasset"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"type":"object","required":["idempotency_key","direction","payments"],"properties":{"idempotency_key":{"type":"string","format":"uuid"},"direction":{"$ref":"#/components/schemas/UsdPaymentDirection"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/UsdPayment"}},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentReceipt"}},"market_quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MarketQuote"}]}}},"type":{"type":"string","enum":["usdbatch"]}}}]},"PaymentStatus":{"type":"string","enum":["sending","receiving","approved","generating","expired","failed","completed"]},"PaymentSummary":{"type":"object","required":["total_count","by_organization_id","by_environment_id","by_line_of_credit_id"],"properties":{"organization_id":{"type":["string","null"],"format":"uuid"},"environment_id":{"type":["string","null"],"format":"uuid"},"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":["string","null"],"format":"date-time"},"newest_created_at":{"type":["string","null"],"format":"date-time"},"by_organization_id":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PaymentCountSummary"},"propertyNames":{"type":"string","format":"uuid"}},"by_environment_id":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PaymentEnvironmentSummary"},"propertyNames":{"type":"string","format":"uuid"}},"by_line_of_credit_id":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PaymentLineOfCreditSummary"},"propertyNames":{"type":"string","format":"uuid"}}}},"PaymentWalletSummary":{"type":"object","required":["wallet_id","organization_id","environment_id","total_count","buckets"],"properties":{"wallet_id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"line_of_credit_id":{"type":["string","null"],"format":"uuid"},"total_count":{"type":"integer","format":"u-int64","minimum":0},"oldest_created_at":{"type":["string","null"],"format":"date-time"},"newest_created_at":{"type":["string","null"],"format":"date-time"},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBucketSummary"}}}},"Payments":{"type":"object","required":["items","offset","limit"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"offset":{"type":"integer","format":"u-int32","description":"Deprecated offset used by offset pagination. In cursor mode this is 0.\nUse `next_cursor` and `has_more` for pagination.","deprecated":true,"minimum":0},"limit":{"type":"integer","format":"u-int32","minimum":0},"total":{"type":["integer","null"],"format":"u-int32","description":"Deprecated total count. Present only for offset pagination and omitted for cursor pagination because counting large payment histories is expensive.","deprecated":true,"minimum":0},"next_cursor":{"type":["string","null"],"description":"Cursor to pass as the `cursor` query parameter for the next page.\nUse cursor pagination where possible, especially for long-lived wallets."},"has_more":{"type":"boolean","description":"True when another page is available."}},"example":{"has_more":false,"items":[{"created_at":"2025-02-12T21:22:50.30219Z","currency":"btc","data":{"address":"tb1pzkhtj4ld86g9c49du5yagnncfrm0s489t76vmrwmt2ecxfnf7spsvjte49","amount":{"amount":150000000,"currency":"btc","unit":"msats"},"amount_sats":150000,"fee_sats":250,"fees":{"amount":250000,"currency":"btc","unit":"msats"},"label":null,"market_quote":null,"max_fee":{"amount":1000000,"currency":"btc","unit":"msats"},"max_fee_sats":1000,"outflows":[{"data":{"rail":"onchain","receipt":{"data":{"amount_sats":150000,"height_mined_at":1888021,"is_pending":false,"ledger_id":"0c16fd8e-ce4d-42fe-9d0b-3069244eb66c","mined_at":1739395372,"required_confirmations_num":1,"sanctioned_info":null,"tx_id":"a22ec88f7a84a705466c9cd8d37024155ffa7930300fcee4fed9e5cc4e25904e"},"type":"onchain"},"step":"target_claimed"},"type":"swap"}]},"direction":"send","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"id":"2ec1e783-19b4-4c10-8181-66336a6232bd","organization_id":"b0684ab8-1130-46af-8f70-71519442f108","payment_breakdown":{"network_fee":{"amount":150000,"currency":"btc","unit":"msats"},"principal":{"amount":150000000,"currency":"btc","unit":"msats"},"processing_fee":{"amount":100000,"currency":"btc","unit":"msats"}},"route":"swap","status":"completed","type":"onchain","updated_at":"2025-02-12T21:23:03.173159Z","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"},{"bip21_uri":"lightning:lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz","created_at":"2025-02-12T21:21:21.744713Z","currency":"btc","data":{"amount":{"amount":150000,"currency":"btc","unit":"msats"},"amount_msats":150000,"expiration":3600,"market_quote":null,"memo":"Order 123","payment_request":"lntbs1500n1pn5w25ypp59sfhx5llskdp6rmsmmq3zs86xey6l4y9wkzvkjl5v2cw0ex7xd4sdqqcqzzsxqyz5vqsp5u333jtc7lh0qvkusq5ntcpm3n2jjx6tw8jz7zvpqpnt3v8e572eq9qxpqysgq4hm7n79tnk76j4ll4f7ey9mmxdyj5pwzcmyqgxtgz40vjg9w58wq73040qvuurj83jakt2zws6y9qgzg2f6gtnj3ajf0mj4gw4mdt2cqhr2tpz","receipts":[{"data":{"ledger_id":"03d87c6d-2cf8-414b-929a-eceeb4c896ed","payment_hash":"2222222222222222222222222222222222222222222222222222222222222222","preimage":"1111111111111111111111111111111111111111111111111111111111111111"},"type":"lightning"}]},"direction":"receive","environment_id":"123e4567-e89b-12d3-a456-426614174000","error":null,"exchanges":[],"frozen":[],"id":"11ca843c-bdaa-44b6-965a-39ac550fcef7","organization_id":"b0684ab8-1130-46af-8f70-71519442f108","requested_amount":{"amount":150000,"currency":"btc","unit":"msats"},"status":"completed","type":"bolt11","updated_at":"2025-02-12T21:23:03.173159Z","wallet_id":"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2"}],"limit":2,"next_cursor":null,"offset":0,"total":2}},"PayoutHoldback":{"oneOf":[{"type":"object","description":"Send the full payout.","required":["mode"],"properties":{"mode":{"type":"string","enum":["none"]}}},{"type":"object","description":"Retain enough from the current payout to reach a target USD reserve.","required":["amount","mode"],"properties":{"amount":{"type":"integer","format":"u-int64","description":"Target reserve in cents. Funds above the target are not released automatically.","minimum":0},"mode":{"type":"string","enum":["fixed"]}}},{"type":"object","description":"Retain a percentage of each bill's gross USD payout.","required":["percentage","mode"],"properties":{"percentage":{"type":"number","format":"double","description":"Percentage from 0 through 100, inclusive.","maximum":100,"minimum":0},"mode":{"type":"string","enum":["percentage"]}}}],"description":"Controls how much of an ACH payout remains in the customer's USD wallets.\n\nFixed holdbacks are target reserves expressed in USD base units (cents).\nPercentage holdbacks apply to the current bill's gross ACH payout."},"PeerQuote":{"type":"object","required":["from","to","rfq","peer","expires_at"],"properties":{"from":{"$ref":"#/components/schemas/Currency"},"to":{"$ref":"#/components/schemas/Currency"},"rfq":{"$ref":"#/components/schemas/RfqQuote"},"peer":{"type":"string"},"channel_scids":{"type":"array","items":{"type":"integer","format":"u-int64","minimum":0}},"expires_at":{"type":"string","format":"date-time"}}},"PendingSettlement":{"type":"object","required":["id","amount","settlement_type","effective_time"],"properties":{"id":{"type":"string","format":"uuid"},"bill_id":{"type":["string","null"],"format":"uuid"},"amount":{"$ref":"#/components/schemas/SignedAmount"},"settlement_type":{"$ref":"#/components/schemas/SettlementType"},"effective_time":{"type":"string","format":"date-time"}}},"Policies":{"type":"array","items":{"$ref":"#/components/schemas/Policy"}},"Policy":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/MaxPaymentSize"},"type":{"type":"string","enum":["max_payment_size"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/TransactionVelocity"},"type":{"type":"string","enum":["transaction_velocity"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/SendVolumeLimit"},"type":{"type":"string","enum":["send_volume_limit"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/ReflexApproval"},"type":{"type":"string","enum":["reflex_approval"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OfacCompliant"},"type":{"type":"string","enum":["ofac_compliant"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/ProcessingFeePolicy"},"type":{"type":"string","enum":["processing_fee"]}}}]},"PolicyNotFoundContext":{"type":"object","required":["policy_id"],"properties":{"policy_id":{"type":"string","format":"uuid"}}},"ProcessingFee":{"type":"object","description":"Processing fee charged for a payment.","required":["amount","basis_points","payment_classification"],"properties":{"amount":{"$ref":"#/components/schemas/Amount"},"basis_points":{"type":"integer","format":"u-int16","minimum":0},"payment_classification":{"$ref":"#/components/schemas/ProcessingFeeClassification"}}},"ProcessingFeeClassification":{"type":"object","description":"Payment type and route associated with the fee.","required":["kind","route"],"properties":{"kind":{"$ref":"#/components/schemas/PaymentKind"},"route":{"$ref":"#/components/schemas/ProcessingFeeRoute"}}},"ProcessingFeePolicy":{"type":"object","description":"Processing fee rates for this wallet.","required":["id","rates","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"rates":{"$ref":"#/components/schemas/ProcessingFeeRates"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProcessingFeeRates":{"type":"object","description":"Fixed-precision processing fee rates applied to payment principal amounts.\n\nA value of `100` is 1%, `250` is 2.5%, and zero explicitly disables the\nfee for that direction.","required":["send_basis_points","receive_basis_points"],"properties":{"send_basis_points":{"type":"integer","format":"u-int16","maximum":10000,"minimum":0},"receive_basis_points":{"type":"integer","format":"u-int16","description":"Rate for receives. A nonzero effective rate requires a fixed amount for\nstandard Bolt11 and BIP21 receives.","maximum":10000,"minimum":0}}},"ProcessingFeeRoute":{"type":"string","enum":["direct","swap","short_circuit"]},"ProcessingFeeSplitTerms":{"type":"object","description":"Terms for splitting a counterparty's share of customer processing fees.\n\nThis share determines the portion of collected fees owed to the counterparty. It is distinct\nfrom [`crate::ProcessingFeeRates`], which determines the customer charges and may use different\nrates for send and receive payments.","required":["counterparty_share_basis_points","cadence","anchor_at"],"properties":{"counterparty_share_basis_points":{"type":"integer","format":"u-int16","maximum":10000,"minimum":0},"cadence":{"$ref":"#/components/schemas/OuterBillingCadence"},"anchor_at":{"type":"string","format":"date-time"}}},"ProcessingFees":{"type":"object","description":"Processing fees collected during a billing period.\n\nThese informational revenue-accounting amounts report gross end-customer\nfees by direction, separately from wallet settlement, the bill amount due,\nand Voltage's volume fee.","required":["total","send","receive"],"properties":{"total":{"$ref":"#/components/schemas/Amount","description":"Gross processing fees collected in both directions. This always\nequals `send + receive`."},"send":{"$ref":"#/components/schemas/Amount","description":"Processing fees collected on sends. A send fee is already part\nof the wallet debit reported by `LineItem.amount_sent`."},"receive":{"$ref":"#/components/schemas/Amount","description":"Payer-funded processing fees collected on receives. A receive\nfee is outside the wallet credit reported by `LineItem.amount_received`."}}},"Quote":{"oneOf":[{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/PeerQuote"},"type":{"type":"string","enum":["peer_rfq"]}}},{"type":"object","required":["detail","type"],"properties":{"detail":{"$ref":"#/components/schemas/MarketQuote"},"type":{"type":"string","enum":["market_rate"]}}}]},"Quotes":{"type":"object","required":["items","offset","limit","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/QuotingRead"}},"offset":{"type":"integer","format":"u-int32","minimum":0},"limit":{"type":"integer","format":"u-int32","minimum":0},"total":{"type":"integer","format":"u-int32","minimum":0}}},"QuotingAccountNotFoundContext":{"type":"object","required":["network","currency"],"properties":{"network":{"$ref":"#/components/schemas/Network"},"currency":{"$ref":"#/components/schemas/Currency"}}},"QuotingBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestValidationFieldsType_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestCurrencyMismatchType_CurrencyMismatchErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestTargetPrecisionMismatchType_TargetPrecisionMismatchErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"target_currency":"btc","target_precision":{"currency":"usd","precision":"cents"}},"detail":"Human-readable error detail","type":"mismatch_target_precision"}],"discriminator":{"propertyName":"type","mapping":{"invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_quote_request":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestValidationFieldsType_ValidationFieldsContext","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","mismatch_currency":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestCurrencyMismatchType_CurrencyMismatchErrorContext","mismatch_target_precision":"#/components/schemas/ApiErrorWithContext_QuotingBadRequestTargetPrecisionMismatchType_TargetPrecisionMismatchErrorContext","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType"}}},"QuotingConflictError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_QuotingConflictQuoteIdType_QuoteIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_already_exists"}],"discriminator":{"propertyName":"type","mapping":{"quote_already_exists":"#/components/schemas/ApiErrorWithContext_QuotingConflictQuoteIdType_QuoteIdErrorContext"}}},"QuotingEventErrorContext":{"oneOf":[{"$ref":"#/components/schemas/QuotingMessageContext"},{"$ref":"#/components/schemas/QuotingInvalidCurrencyPairContext"},{"$ref":"#/components/schemas/QuotingAccountNotFoundContext"},{"$ref":"#/components/schemas/QuotingQuoteExpiredContext"},{"$ref":"#/components/schemas/QuotingQuoteAlreadyConsumedContext"},{"$ref":"#/components/schemas/QuotingQuoteFailedContext"},{"$ref":"#/components/schemas/QuotingInvalidNetworkContext"}]},"QuotingEventErrorDetail":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/QuotingInvalidCurrencyPairContext"},{"$ref":"#/components/schemas/QuotingAccountNotFoundContext"},{"type":"string","format":"date-time"},{"$ref":"#/components/schemas/QuotingInvalidNetworkContext"}]},"QuotingEventErrorRead":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/QuotingEventErrorReadType"},"detail":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuotingEventErrorDetail"}]},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuotingEventErrorContext"}]}}},"QuotingEventErrorReadType":{"type":"string","enum":["account","exchange","price","invalid_currency_pair","account_not_found_in_tracking","account_not_found_in_store","coin_price","accounts_tracking","accounts_store","quote_not_created","quote_expired","quote_already_consumed","quote_never_created","quote_failed","invalid_network"]},"QuotingInvalidCurrencyPairContext":{"type":"object","required":["from","to","error"],"properties":{"from":{"$ref":"#/components/schemas/Currency"},"to":{"$ref":"#/components/schemas/Currency"},"error":{"type":"string"}}},"QuotingInvalidNetworkContext":{"type":"object","required":["quote_network","requested_network"],"properties":{"quote_network":{"$ref":"#/components/schemas/Network"},"requested_network":{"$ref":"#/components/schemas/Network"}}},"QuotingMessageContext":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"QuotingNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_QuotingNotFoundQuoteIdType_QuoteIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"quote_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"quote_not_found"}],"discriminator":{"propertyName":"type","mapping":{"quote_not_found":"#/components/schemas/ApiErrorWithContext_QuotingNotFoundQuoteIdType_QuoteIdErrorContext"}}},"QuotingQuoteAlreadyConsumedContext":{"type":"object","required":["consumed_at"],"properties":{"consumed_at":{"type":"string","format":"date-time"}}},"QuotingQuoteExpiredContext":{"type":"object","required":["expired_at"],"properties":{"expired_at":{"type":"string","format":"date-time"}}},"QuotingQuoteFailedContext":{"type":"object","required":["failed_at"],"properties":{"failed_at":{"type":"string","format":"date-time"}}},"QuotingRead":{"type":"object","required":["id","amount","to","network","organization_id","requested_at"],"properties":{"id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount"},"to":{"$ref":"#/components/schemas/Currency"},"network":{"$ref":"#/components/schemas/Network"},"organization_id":{"type":"string","format":"uuid"},"wallet_id":{"type":["string","null"],"format":"uuid"},"target_precision":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TargetPrecision"}]},"requested_at":{"type":"string","format":"date-time"},"quote":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Quote"}]},"created_at":{"type":["string","null"],"format":"date-time"},"consumed_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuotingEventErrorRead"}]}}},"ReadPaymentReceipt":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OnChainPaymentReceipt"},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/LightningPaymentReceipt"},"type":{"type":"string","enum":["lightning"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/ShortCircuitPaymentReceipt"},"type":{"type":"string","enum":["shortcircuit"]}}}]},"Reasons":{"oneOf":[{"type":"string","enum":["ofac_non_compliant_address"]},{"type":"object","required":["other"],"properties":{"other":{"type":"string"}}}]},"ReceiveErrorCode":{"type":"string","description":"Narrower machine-readable reason for a receive payment error.\n\nThis is only emitted when it adds more detail than the coarse `type`.","enum":["receive_failed","expired","rejected","insufficient_funds","hold_not_found","invalid_bolt11_invoice","invalid_payment_amount","invalid_address","missing_address","missing_payment_request","incorrect_currency","quote_failed","exchange_transfer_failed","upstream_failure","no_route","transaction_build_failed","node_permission_denied","broadcast_failed","broadcast_fee_above_max"]},"ReceiveErrorWire":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Coarse machine-readable error category."},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ReceiveErrorCode","description":"Narrower machine-readable reason for branching in client code.\n\nWhen omitted, clients should branch on `type`."}]},"detail":{"type":["string","null"],"description":"Human-readable explanation of the failure."},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentErrorContext","description":"Structured facts for this specific error type/code."}]}},"example":{"code":"node_permission_denied","detail":"Failed to build transaction FinalizePsbt failed: code: 'Unknown error', message: \"permission denied\"","type":"receive_failed"}},"ReceiveEventTypes":{"type":"string","enum":["generated","detected","refreshed","expired","succeeded","completed","failed"],"example":"succeeded"},"ReceivePayload":{"type":"object","required":["event","data"],"properties":{"event":{"$ref":"#/components/schemas/ReceiveEventTypes"},"data":{"$ref":"#/components/schemas/Payment"}}},"ReceivePayment":{"allOf":[{"$ref":"#/components/schemas/PaymentReceiveType"},{"type":"object","required":["id","wallet_id","organization_id","environment_id","created_at","updated_at","currency","status"],"properties":{"id":{"type":"string","format":"uuid"},"wallet_id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"payment_category":{"$ref":"#/components/schemas/PaymentCategory"},"metadata":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/HashMap"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"requested_amount":{"$ref":"#/components/schemas/Amount"},"status":{"$ref":"#/components/schemas/ReceiveStatus"},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ReceiveErrorWire"}]},"frozen":{"$ref":"#/components/schemas/Frozen","description":"Funds of payment that have been frozen due to compliance requirements"},"exchanges":{"$ref":"#/components/schemas/Exchanges"},"processing_fee":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentProcessingFee","description":"Processing fee included in the generated payer-facing amount, in the\nprincipal's assessment currency. Available before settlement and stable\nacross partial or excess payments. The authoritative actual settled fee\nis reported in `payment_breakdown.processing_fee`. Omitted when no\nprocessing fee applies."}]},"payment_breakdown":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentBreakdown","description":"Best-available aggregate payment components in the payment's display\ncurrency. Rail values are quote-converted until every current wallet\ncredit is confirmed. Omitted when no processing fee was assessed or\ncomponent data is unavailable."}]},"bip21_uri":{"type":"string","description":"Generated BIP21 URI. Lightning receives use the lightning: URI form; unified receives can include both on-chain and Lightning data."}}}]},"ReceiveStatus":{"type":"string","enum":["generating","receiving","expired","failed","completed"]},"ReconciliationFrequency":{"type":"string","enum":["daily","weekly","monthly","bi_monthly","never"]},"ReflexApproval":{"type":"object","required":["id","template_id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"template_id":{"type":"string","format":"uuid"},"threshold":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Amount","description":"Optional payment threshold below which reflex checks are skipped.\nSupports BTC or USD amounts. When set in USD, uses cached price for conversion."}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ReleasedEvent":{"type":"object","required":["hold_id","payment_id","currency","effective_time"],"properties":{"hold_id":{"type":"string","format":"uuid"},"payment_id":{"type":"string","format":"uuid"},"currency":{"$ref":"#/components/schemas/Currency"},"effective_time":{"type":"string","format":"date-time"}}},"RequestBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"missing_credentials"}],"discriminator":{"propertyName":"type","mapping":{"invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType"}}},"RfqQuote":{"type":"object","required":["id","rate"],"properties":{"id":{"type":"array","items":{"type":"integer","format":"u-int8","minimum":0}},"rate":{"$ref":"#/components/schemas/rate-string"}}},"SanctionedInput":{"type":"object","description":"Information about a sanctioned input","required":["outpoint","address","amount"],"properties":{"outpoint":{"type":"string","description":"The outpoint being spent (txid:vout)"},"address":{"type":"string","description":"The sanctioned address"},"amount":{"$ref":"#/components/schemas/Amount","description":"The amount from this input"}}},"SanctionedTxInfo":{"type":"object","description":"Information about a sanctioned transaction","required":["tx_id","sanctioned_inputs","sanctioned_value"],"properties":{"tx_id":{"type":"string","description":"Transaction ID"},"sanctioned_inputs":{"type":"array","items":{"$ref":"#/components/schemas/SanctionedInput"},"description":"Detailed information about each sanctioned input"},"sanctioned_value":{"$ref":"#/components/schemas/Amount","description":"Total value from sanctioned inputs"}}},"ScheduledBillingCalculationRead":{"oneOf":[{"type":"object","required":["terms","type"],"properties":{"terms":{"$ref":"#/components/schemas/FixedContractBillingTerms"},"type":{"type":"string","enum":["fixed_contract"]}}},{"type":"object","required":["terms","type"],"properties":{"terms":{"$ref":"#/components/schemas/ProcessingFeeSplitTerms"},"type":{"type":"string","enum":["processing_fee_split"]}}}]},"ScheduledBillingSectionRead":{"type":"object","required":["coverage","amount","settlement_type","calculation"],"properties":{"coverage":{"$ref":"#/components/schemas/BillCoverage"},"amount":{"$ref":"#/components/schemas/Amount"},"settlement_type":{"$ref":"#/components/schemas/SettlementType"},"calculation":{"$ref":"#/components/schemas/ScheduledBillingCalculationRead"}}},"SecuredStatus":{"type":"string","enum":["pending_deposit","partially_secured","secured"]},"SendError":{"type":"object","required":["type","detail"],"properties":{"type":{"$ref":"#/components/schemas/SendErrorType","description":"Coarse machine-readable error category."},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SendErrorCode","description":"Narrower machine-readable reason for branching in client code.\n\nWhen omitted, clients should branch on `type`."}]},"detail":{"type":"string","description":"Human-readable explanation of the failure."},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentErrorContext","description":"Structured facts for this specific error type/code."}]}},"example":{"code":"broadcast_fee_above_max","context":{"estimated_fee_sats":549,"max_fee_sats":300,"target_blocks":12},"detail":"Failed to broadcast transaction The fee (549 sats) to be mined in 12 blocks exceeds the maximum of 300 sats. Consider increasing your maximum fee or trying again later.","type":"send_failed"}},"SendErrorCode":{"type":"string","description":"Narrower machine-readable reason for a send payment error.\n\nThis is only emitted when it adds more detail than the coarse `type`.","enum":["rejected","hold_failed","send_failed","quote_failed","insufficient_funds","hold_not_found","invalid_bolt11_invoice","invalid_payment_amount","invalid_address","missing_address","missing_payment_request","incorrect_currency","exchange_transfer_failed","upstream_failure","no_route","transaction_build_failed","node_permission_denied","broadcast_failed","broadcast_fee_above_max"]},"SendErrorType":{"type":"string","description":"Coarse machine-readable category for a send payment error.","enum":["rejected","hold_failed","send_failed","quote_failed"]},"SendEventTypes":{"type":"string","enum":["succeeded","failed"],"example":"succeeded"},"SendPayload":{"type":"object","required":["event","data"],"properties":{"event":{"$ref":"#/components/schemas/SendEventTypes"},"data":{"$ref":"#/components/schemas/Payment"}}},"SendPayment":{"allOf":[{"$ref":"#/components/schemas/PaymentSendType"},{"type":"object","required":["id","wallet_id","organization_id","environment_id","created_at","updated_at","currency","status"],"properties":{"id":{"type":"string","format":"uuid"},"wallet_id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"payment_category":{"$ref":"#/components/schemas/PaymentCategory"},"route":{"$ref":"#/components/schemas/PaymentRoute"},"metadata":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/HashMap"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"status":{"$ref":"#/components/schemas/SendStatus"},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SendError"}]},"exchanges":{"$ref":"#/components/schemas/Exchanges"},"processing_fee":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentProcessingFee","description":"Processing fee approved for this payment, in the principal's assessment\ncurrency. Available before settlement and stable afterwards. The final\nassessed wallet-currency fee is reported in\n`payment_breakdown.processing_fee`, which remains authoritative. Omitted\nwhen no processing fee applies."}]},"payment_breakdown":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentBreakdown","description":"Best-available aggregate payment components in the payment's display\ncurrency. Rail values are quote-converted until wallet settlement is\nconfirmed. Omitted when no processing fee was assessed or component data\nis unavailable."}]}}}]},"SendPaymentRequest":{"oneOf":[{"type":"object","description":"Send Lightning Bolt11 payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"REQUIRED for USD wallets - Quote ID to convert USD to BTC before sending Lightning payment. Get from POST /quotes endpoint."},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"type":"string","description":"Wallet's line of credit currency: 'btc' for Bitcoin wallets, 'usd' for USD wallets","enum":["btc","usd"]},"type":{"type":"string","enum":["bolt11"]},"data":{"type":"object","required":["payment_request"],"properties":{"payment_request":{"type":"string","description":"Lightning BOLT11 invoice - cannot be empty. Standard Lightning Network payment request."},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_msats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Set to 0 to require a zero-fee route. If omitted, defaults to 1% of the payment amount or 1,000 msats, whichever is greater. Processing fees are additional. Legacy max_fee_msats alias is supported."}}}}},{"type":"object","description":"Send on-chain Bitcoin payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"REQUIRED for USD wallets - Quote ID to convert USD to BTC before sending on-chain payment."},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"type":"string","description":"Wallet's line of credit currency: 'btc' for Bitcoin wallets, 'usd' for USD wallets","enum":["btc","usd"]},"type":{"type":"string","enum":["onchain"]},"data":{"type":"object","required":["address","amount"],"properties":{"address":{"type":"string","description":"Bitcoin address - cannot be empty"},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_sats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Processing fees are additional. Legacy max_fee_sats alias is supported."},"description":{"type":"string","description":"Optional payment description - if provided, cannot be empty"}}}}},{"type":"object","description":"Send BIP21 unified payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"quote_id":{"type":"string","format":"uuid","description":"REQUIRED for USD wallets - Quote ID to convert USD to BTC before sending BIP21 payment."},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"type":"string","description":"Wallet's line of credit currency: 'btc' for Bitcoin wallets, 'usd' for USD wallets","enum":["btc","usd"]},"type":{"type":"string","enum":["bip21"]},"data":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"BIP21 URI - cannot be empty"},"payment_request":{"type":"string","description":"Optional Lightning invoice - if provided, cannot be empty"},"amount":{"$ref":"#/components/schemas/Amount","description":"Legacy amount_msats alias is supported."},"max_fee":{"$ref":"#/components/schemas/Amount","description":"Maximum network/provider fee. Processing fees are additional. Legacy max_fee_msats alias is supported."},"description":{"type":"string","description":"Optional payment description - if provided, cannot be empty"}}}}},{"type":"object","description":"Send Taproot Asset payment","required":["id","wallet_id","currency","type","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this payment request"},"metadata":{"type":"object","title":"Payment metadata","description":"Optional client-supplied string key/value metadata echoed on payment responses and webhook payloads. Keys are arbitrary client-defined names. Empty objects are omitted. Limits: up to 50 entries; each key up to 256 characters; each value up to 256 characters.","additionalProperties":{"type":"string","description":"Metadata value for one arbitrary client-defined metadata key.","maxLength":256,"x-additionalPropertiesName":"metadata_key"},"propertyNames":{"type":"string","description":"Arbitrary client-defined metadata key.","maxLength":256},"examples":[{"external_id":"payment-123","tenant_id":"tenant-a"}],"maxProperties":50},"flow_preference":{"oneOf":[{"type":"string","enum":["direct","swap"]},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["swap"]},"rail":{"type":"string","description":"Funding rail for an explicit swap flow. Omit for the current default opposite-rail swap funding rail.","enum":["lightning","onchain"]}}}],"description":"Optional fulfillment flow preference. Only supported for node-backed wallets whose line of credit has fulfillment infrastructure; credit-backed wallets without line-of-credit infrastructure must omit this field. Use 'swap' to force the default opposite-rail swap flow when supported. Use the object form to request an explicit swap funding rail; choosing the same rail as the payment is rejected."},"wallet_id":{"type":"string","format":"uuid","description":"Wallet ID to send the payment from"},"currency":{"$ref":"#/components/schemas/Currency"},"type":{"type":"string","enum":["taprootasset"]},"data":{"type":"object","required":["payment_request","asset","amount","max_fee"],"properties":{"payment_request":{"type":"string","description":"Taproot asset invoice - cannot be empty"},"asset":{"$ref":"#/components/schemas/Asset"},"amount":{"oneOf":[{"type":"object","description":"Asset amount in base units","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset"}}}],"description":"Asset amount - required for taproot asset sends"},"max_fee":{"oneOf":[{"type":"object","description":"Bitcoin fee amount in millisatoshis","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Fee amount in millisatoshis"}}},{"type":"object","description":"Asset fee amount in base units","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Fee amount in base units of the asset"}}}],"description":"Maximum network/provider fee - can be BTC or Asset. Configured processing fees are additional."}}}}}],"description":"Payment request for sending Bitcoin, USD, and Taproot Assets.\n\nNOTE: USD wallets require a quote_id for currency conversion. The quote must have USD involved (either 'from' or 'to' field).\n\nRESPONSE: For USD payments, the response will include a 'market_quote' field embedded within the payment's data object showing the exchange rate (from/to currencies, rate, and timestamp) used for the currency conversion."},"SendStatus":{"type":"string","enum":["sending","approved","failed","completed"]},"SendVolumeLimit":{"type":"object","required":["id","limit_sats","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"limit_sats":{"type":"integer","format":"u-int64","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SettlementFeePercentage":{"type":"number","format":"double","description":"Fee charged on gross payouts for the line of credit.","multipleOf":0.01,"maximum":100,"minimum":0},"SettlementType":{"type":"string","enum":["Collection","Payout"]},"ShortCircuitPaymentReceipt":{"type":"object","required":["amount_msats","offset_payment_id"],"properties":{"amount_msats":{"type":"integer","format":"u-int64","description":"The amount of the payment in msats","minimum":0},"offset_payment_id":{"type":"string","format":"uuid","description":"Payment that offset current payment amount"},"ledger_id":{"type":["string","null"],"format":"uuid","description":"Maps to either the hold_id or credit_id associated with this part of the payment"}}},"SignedAmount":{"allOf":[{"$ref":"#/components/schemas/Amount"},{"type":"object","required":["negative"],"properties":{"negative":{"type":"boolean"}}}],"example":{"amount":100000000,"currency":"btc","negative":false,"unit":"msats"}},"SortKey":{"type":"string","enum":["created_at","updated_at"]},"SortOrder":{"type":"string","enum":["ASC","DESC"]},"SummaryLineOfCredit":{"type":"object","required":["id","organization_id","network","environment_id","limit","allocated_limit","currency"],"properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"network":{"$ref":"#/components/schemas/Network"},"environment_id":{"type":"string","format":"uuid"},"limit":{"type":"integer","format":"u-int64","minimum":0},"allocated_limit":{"type":"integer","format":"u-int64","minimum":0},"currency":{"$ref":"#/components/schemas/Currency"},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CollateralStatus","description":"Will always be null for Waived collateral types"}]},"disabled_at":{"type":["string","null"],"format":"date-time"},"infrastructure":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InfraConfigReadonly"}]}}},"SupportedAssets":{"type":"object","required":["assets"],"properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/NamedAsset"}}},"example":{"assets":[{"asset":"037c01d8548a17561f9cb9e734f7c761437439815d43f8dd0e9a265c8024b2c725","decimal_display":6,"name":"Voltage Cash","network":"mutinynet"}]}},"SupportedNetwork":{"type":"string","enum":["mainnet","testnet3","mutinynet"]},"SwapPaymentReceipt":{"type":"object","required":["step","rail","receipt"],"properties":{"step":{"$ref":"#/components/schemas/SwapPaymentStep","description":"The swap lifecycle step represented by this outflow."},"rail":{"$ref":"#/components/schemas/SwapRail","description":"The payment rail used for this step."},"receipt":{"$ref":"#/components/schemas/SwapPaymentReceiptData","description":"The rail-specific receipt for this step."}}},"SwapPaymentReceiptData":{"oneOf":[{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/OnChainPaymentReceipt"},"type":{"type":"string","enum":["onchain"]}}},{"type":"object","required":["data","type"],"properties":{"data":{"$ref":"#/components/schemas/LightningPaymentReceipt"},"type":{"type":"string","enum":["lightning"]}}}]},"SwapPaymentStep":{"type":"string","enum":["source_payment_submitted","source_submitted","target_submitted","target_paid","target_claimed","target_confirmed","source_claimed"]},"SwapRail":{"type":"string","enum":["lightning","onchain"]},"TargetPrecision":{"oneOf":[{"type":"object","required":["precision","currency"],"properties":{"precision":{"$ref":"#/components/schemas/BtcPrecision"},"currency":{"type":"string","enum":["btc"]}}},{"type":"object","required":["precision","currency"],"properties":{"precision":{"$ref":"#/components/schemas/UsdPrecision"},"currency":{"type":"string","enum":["usd"]}}}],"description":"Controls the precision of the converted (target) amount in a quote.\n\nThe currency tag must match the quote's `to` currency. When omitted from a\nrequest, defaults are applied: `Btc(Sats)` for BTC targets, `Usd(Cents)` for USD targets."},"TestEventTypes":{"type":"string","enum":["created"],"example":"created"},"TestPayload":{"type":"object","required":["event","data"],"properties":{"event":{"$ref":"#/components/schemas/TestEventTypes"},"data":{"type":"string"}}},"TestWebhookRequest":{"type":"object","required":["delivery_id","payload"],"properties":{"delivery_id":{"type":"string","format":"uuid"},"payload":{"$ref":"#/components/schemas/Payload"}}},"TransactionVelocity":{"type":"object","required":["id","transactions_per_minute","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"transactions_per_minute":{"type":"integer","format":"u-int64","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"TransferIdNum":{"type":"string","description":"A string that can be used to pass data to the recipient bank. Examples are\nan invoice number or transaction reference number","pattern":"^[ -~]{1,15}$"},"UpdateEnvironmentSettingsRequest":{"type":"object","required":["origin_policy"],"properties":{"origin_policy":{"$ref":"#/components/schemas/OriginPolicy"},"allowed_origins":{"type":"array","items":{"$ref":"#/components/schemas/BrowserOrigin"}}}},"UpdateSandboxLineOfCreditRequest":{"type":"object","properties":{"limit":{"type":["integer","null"],"format":"u-int64","example":1000000000,"minimum":1},"disable":{"type":["boolean","null"],"description":"Disable this line of credit, preventing new wallet creation and payments.\nOnly `true` is accepted — re-enabling a disabled line of credit requires admin access."}},"example":{"disable":true,"limit":1000000000}},"UpdateWalletPolicyRequest":{"type":"object","properties":{"max_payment_size_sats":{"type":["integer","null"],"format":"u-int64","minimum":1},"transactions_per_minute":{"type":["integer","null"],"format":"u-int64","minimum":1},"send_volume_limit_sats":{"type":["integer","null"],"format":"u-int64","minimum":1},"template_id":{"type":["string","null"],"format":"uuid"},"ofac_compliant":{"type":["boolean","null"]},"processing_fee":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ProcessingFeeRates","description":"Supply exact rates to set a wallet override, JSON `null` to restore\nline-of-credit inheritance, or omit the field for no change."}]}},"additionalProperties":false},"UpdateWalletRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"a new name"}}},"UpdateWebhookRequest":{"type":"object","required":["events"],"properties":{"url":{"type":["string","null"],"example":"https://example.com"},"name":{"type":["string","null"],"example":"some name"},"events":{"type":"array","items":{"$ref":"#/components/schemas/EventTypes"},"description":"Provide all event types that the webhook should be subscribed,\nThe event types array will be replaced entirely inline with JSON Merge Patch (RFC 7396)"}}},"UsdAmount":{"type":"integer","format":"u-int64","minimum":0},"UsdPayment":{"type":"object","required":["amount","identification_number","loc_id","bill_id","status"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"Uniquely identifies each ACH transfer object. This is returned in the initial batch creation response"},"amount":{"$ref":"#/components/schemas/UsdAmount"},"identification_number":{"$ref":"#/components/schemas/TransferIdNum","description":"A unique ID used to correlate an ACH transfer in the Voltage system to\nthe transfer in the bank"},"loc_id":{"type":"string","format":"uuid"},"bill_id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/UsdPaymentStatus"},"provider_updated_at":{"type":["string","null"]},"error":{"type":["string","null"]},"purpose":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BankAccountPurpose","description":"Which bank account to route this payment to. `None` means use the\ndefault/single account (backward compatible with existing payments)."}]}}},"UsdPaymentDirection":{"type":"string","enum":["CREDIT","DEBIT"]},"UsdPaymentStatus":{"type":"string","enum":["UNINITIATED","PENDING","CANCELED","PROCESSING","PROCESSED","HOLD","SUCCEEDED","FAILED","CORRECTED"]},"UsdPrecision":{"type":"string","description":"Precision level for USD amounts in quote conversions.","enum":["cents"]},"VerifiedStatus":{"type":"string","enum":["pending_verification","verified"]},"VolumeFee":{"oneOf":[{"oneOf":[{"type":"object","description":"Bitcoin amount in millisatoshis (msats) - the smallest unit of Bitcoin","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Amount in millisatoshis (msats)"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'msats' in responses","enum":["msats"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"USD amount in cents - the smallest unit of USD","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["usd"]},"amount":{"type":"integer","format":"int64","description":"Amount in cents"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'cents' in responses","enum":["cents"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset. Base units represent the raw integer value before applying decimal display formatting. For display purposes, divide by 10^decimal_display to get the human-readable amount.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - the smallest indivisible unit"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'base units' in responses","enum":["base units"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}}],"description":"Amount with currency specification. Requests require only currency and amount; unit is optional and ignored on input. Responses include the canonical unit derived from currency. All amounts are provided in the smallest unit of the currency (base units).","examples":[{"amount":100000000,"currency":"btc"},{"amount":150,"currency":"usd"},{"amount":1000000,"currency":"asset:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12"},{"amount":50000000,"currency":"btc","negative":true}]},{"type":"object","required":["total","send","receive"],"properties":{"total":{"oneOf":[{"type":"object","description":"Bitcoin amount in millisatoshis (msats) - the smallest unit of Bitcoin","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Amount in millisatoshis (msats)"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'msats' in responses","enum":["msats"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"USD amount in cents - the smallest unit of USD","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["usd"]},"amount":{"type":"integer","format":"int64","description":"Amount in cents"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'cents' in responses","enum":["cents"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset. Base units represent the raw integer value before applying decimal display formatting. For display purposes, divide by 10^decimal_display to get the human-readable amount.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - the smallest indivisible unit"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'base units' in responses","enum":["base units"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}}],"description":"Amount with currency specification. Requests require only currency and amount; unit is optional and ignored on input. Responses include the canonical unit derived from currency. All amounts are provided in the smallest unit of the currency (base units).","examples":[{"amount":100000000,"currency":"btc"},{"amount":150,"currency":"usd"},{"amount":1000000,"currency":"asset:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12"},{"amount":50000000,"currency":"btc","negative":true}]},"send":{"oneOf":[{"type":"object","description":"Bitcoin amount in millisatoshis (msats) - the smallest unit of Bitcoin","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Amount in millisatoshis (msats)"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'msats' in responses","enum":["msats"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"USD amount in cents - the smallest unit of USD","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["usd"]},"amount":{"type":"integer","format":"int64","description":"Amount in cents"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'cents' in responses","enum":["cents"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset. Base units represent the raw integer value before applying decimal display formatting. For display purposes, divide by 10^decimal_display to get the human-readable amount.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - the smallest indivisible unit"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'base units' in responses","enum":["base units"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}}],"description":"Amount with currency specification. Requests require only currency and amount; unit is optional and ignored on input. Responses include the canonical unit derived from currency. All amounts are provided in the smallest unit of the currency (base units).","examples":[{"amount":100000000,"currency":"btc"},{"amount":150,"currency":"usd"},{"amount":1000000,"currency":"asset:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12"},{"amount":50000000,"currency":"btc","negative":true}]},"receive":{"oneOf":[{"type":"object","description":"Bitcoin amount in millisatoshis (msats) - the smallest unit of Bitcoin","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["btc"]},"amount":{"type":"integer","format":"int64","description":"Amount in millisatoshis (msats)"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'msats' in responses","enum":["msats"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"USD amount in cents - the smallest unit of USD","required":["currency","amount"],"properties":{"currency":{"type":"string","enum":["usd"]},"amount":{"type":"integer","format":"int64","description":"Amount in cents"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'cents' in responses","enum":["cents"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}},{"type":"object","description":"Asset amount in base units - the smallest indivisible unit of the asset. Base units represent the raw integer value before applying decimal display formatting. For display purposes, divide by 10^decimal_display to get the human-readable amount.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Asset currency in format 'asset:<66-character-hex-string>'","pattern":"^asset:[a-fA-F0-9]{66}$"},"amount":{"type":"integer","format":"int64","description":"Amount in base units of the asset - the smallest indivisible unit"},"unit":{"type":"string","description":"Optional and ignored in requests; serialized as 'base units' in responses","enum":["base units"]},"negative":{"type":"boolean","description":"Whether the amount is negative (optional, defaults to false)"}}}],"description":"Amount with currency specification. Requests require only currency and amount; unit is optional and ignored on input. Responses include the canonical unit derived from currency. All amounts are provided in the smallest unit of the currency (base units).","examples":[{"amount":100000000,"currency":"btc"},{"amount":150,"currency":"usd"},{"amount":1000000,"currency":"asset:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12"},{"amount":50000000,"currency":"btc","negative":true}]}}}],"description":"Volume fee amount. Flat fees serialize as an amount; split fees serialize with total, send, and receive amount components."},"VolumeFeePercentage":{"oneOf":[{"type":"number","format":"double","maximum":100,"minimum":0},{"type":"object","required":["send","receive"],"properties":{"send":{"type":"number","format":"double","description":"Send volume fee percentage","maximum":100,"minimum":0},"receive":{"type":"number","format":"double","description":"Receive volume fee percentage","maximum":100,"minimum":0}}}],"description":"Line of credit volume fee percentage. Use a number for flat-rate billing or an object with send and receive percentages for split billing."},"Wallet":{"type":"object","required":["id","active","created_at","updated_at","name","organization_id","environment_id","network","balances","holds"],"properties":{"id":{"type":"string","format":"uuid"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"deletion_failed_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"limit":{"type":["integer","null"],"format":"u-int64","minimum":0},"line_of_credit_id":{"type":["string","null"],"format":"uuid"},"network":{"$ref":"#/components/schemas/Network"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"balances":{"type":"array","items":{"$ref":"#/components/schemas/Balance"}},"holds":{"type":"array","items":{"$ref":"#/components/schemas/Hold"}},"pending_settlements":{"type":"array","items":{"$ref":"#/components/schemas/PendingSettlement"}},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WalletEventError"}]}}},"WalletBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_WalletBadRequestNoContextType"},{"$ref":"#/components/schemas/ApiErrorWithContext_WalletBadRequestLineOfCreditIdType_WalletLineOfCreditErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_WalletBadRequestWalletIdType_WalletIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_WalletBadRequestValidationFieldsType_ValidationFieldsContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_WalletBadRequestFeatureFlagType_FeatureFlagErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"feature":"payments"},"detail":"Human-readable error detail","type":"feature_flag_disabled"}],"discriminator":{"propertyName":"type","mapping":{"application_not_approved":"#/components/schemas/ApiError_WalletBadRequestNoContextType","feature_flag_disabled":"#/components/schemas/ApiErrorWithContext_WalletBadRequestFeatureFlagType_FeatureFlagErrorContext","invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_request":"#/components/schemas/ApiErrorWithContext_WalletBadRequestValidationFieldsType_ValidationFieldsContext","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","line_of_credit_cannot_allocate_wallet_limit":"#/components/schemas/ApiError_WalletBadRequestNoContextType","line_of_credit_disabled":"#/components/schemas/ApiErrorWithContext_WalletBadRequestLineOfCreditIdType_WalletLineOfCreditErrorContext","line_of_credit_network_mismatch":"#/components/schemas/ApiError_WalletBadRequestNoContextType","line_of_credit_not_found":"#/components/schemas/ApiError_WalletBadRequestNoContextType","line_of_credit_not_ready":"#/components/schemas/ApiError_WalletBadRequestNoContextType","missing_bank_details":"#/components/schemas/ApiErrorWithContext_WalletBadRequestLineOfCreditIdType_WalletLineOfCreditErrorContext","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","utils":"#/components/schemas/ApiError_WalletBadRequestNoContextType","wallet_not_credit_backed":"#/components/schemas/ApiErrorWithContext_WalletBadRequestWalletIdType_WalletIdErrorContext","wallet_not_empty":"#/components/schemas/ApiErrorWithContext_WalletBadRequestWalletIdType_WalletIdErrorContext"}}},"WalletEventError":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/WalletEventErrorType"},"detail":{"type":["string","null"]},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WalletEventErrorContext"}]}}},"WalletEventErrorContext":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"WalletEventErrorType":{"type":"string","enum":["InsufficientFunds","InsufficientBalanceWithdrawal","HoldNotFound","InsufficientLimit","IncorrectCurrency","InvalidPaymentBreakdown","PendingSettlementNotFound"]},"WalletNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_WalletNotFoundType_WalletIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"instance_not_found"}],"discriminator":{"propertyName":"type","mapping":{"instance_not_found":"#/components/schemas/ApiErrorWithContext_WalletNotFoundType_WalletIdErrorContext"}}},"WalletPaymentBreakdown":{"type":"object","description":"Breakdown of a payment amount and its fees.\n\nAll amounts use the same settlement currency.","required":["principal","network_fee","processing_fee"],"properties":{"principal":{"$ref":"#/components/schemas/Amount","description":"Payment amount before fees."},"network_fee":{"$ref":"#/components/schemas/Amount","description":"Network fee paid to complete the payment."},"processing_fee":{"$ref":"#/components/schemas/ProcessingFee","description":"Processing fee charged for the payment."}}},"WalletPolicies":{"type":"object","required":["id","policies","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":["string","null"],"format":"uuid"},"policies":{"$ref":"#/components/schemas/Policies"},"error":{"$ref":"#/components/schemas/WalletPolicyValidationError"},"updated_at":{"type":"string","format":"date-time"}}},"WalletPolicyBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiErrorWithContext_WalletPolicyBadRequestWalletIdType_WalletIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"no_updates_provided"}],"discriminator":{"propertyName":"type","mapping":{"invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","no_updates_provided":"#/components/schemas/ApiErrorWithContext_WalletPolicyBadRequestWalletIdType_WalletIdErrorContext","wallet_policies_exist":"#/components/schemas/ApiErrorWithContext_WalletPolicyBadRequestWalletIdType_WalletIdErrorContext"}}},"WalletPolicyErrorContext":{"oneOf":[{"$ref":"#/components/schemas/InvalidProcessingFeeRatesContext"},{"$ref":"#/components/schemas/PolicyNotFoundContext"}]},"WalletPolicyErrorType":{"type":"string","enum":["invalid_processing_fee_rates","multiple_processing_fee_policies","policy_not_found"]},"WalletPolicyNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_WalletPolicyNotFoundWalletIdType_WalletIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"wallet_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"wallet_policies_not_found"}],"discriminator":{"propertyName":"type","mapping":{"wallet_policies_not_found":"#/components/schemas/ApiErrorWithContext_WalletPolicyNotFoundWalletIdType_WalletIdErrorContext"}}},"WalletPolicyValidationError":{"type":"object","required":["type","detail"],"properties":{"type":{"$ref":"#/components/schemas/WalletPolicyErrorType"},"detail":{"type":"string"},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WalletPolicyErrorContext"}]}}},"WebhookBadRequestError":{"oneOf":[{"$ref":"#/components/schemas/ApiError_RequestBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_AuthBadRequestErrorType"},{"$ref":"#/components/schemas/ApiError_WebhookBadRequestNoContextType"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"detail":"Human-readable error detail","type":"invalid_webhook"}],"discriminator":{"propertyName":"type","mapping":{"invalid_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_syntax":"#/components/schemas/ApiError_RequestBadRequestErrorType","invalid_webhook":"#/components/schemas/ApiError_WebhookBadRequestNoContextType","missing_credentials":"#/components/schemas/ApiError_AuthBadRequestErrorType","missing_parameter":"#/components/schemas/ApiError_RequestBadRequestErrorType"}}},"WebhookConflictError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_WebhookConflictWebhookIdType_WebhookIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"webhook_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_exists"}],"discriminator":{"propertyName":"type","mapping":{"webhook_exists":"#/components/schemas/ApiErrorWithContext_WebhookConflictWebhookIdType_WebhookIdErrorContext"}}},"WebhookDeliveries":{"type":"object","required":["items","offset","limit"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryRead"}},"offset":{"type":"integer","format":"u-int32","description":"Deprecated offset used by offset pagination. In cursor mode this is 0.","deprecated":true,"minimum":0},"limit":{"type":"integer","format":"u-int32","minimum":0},"total":{"type":["integer","null"],"format":"u-int32","description":"Deprecated total count. Present only for offset pagination and omitted for cursor pagination.","deprecated":true,"minimum":0},"next_cursor":{"type":["string","null"],"description":"Cursor to pass as the `cursor` query parameter for the next page."},"has_more":{"type":"boolean","description":"True when another page is available."}}},"WebhookDeliveryErrorContext":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/WebhookHttpStatusContext"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["http_status"]}}}]},{"allOf":[{"$ref":"#/components/schemas/WebhookRateLimitedContext"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["rate_limited"]}}}]}]},"WebhookDeliveryErrorInfo":{"type":"object","required":["type","detail"],"properties":{"type":{"$ref":"#/components/schemas/WebhookDeliveryErrorType","description":"Coarse machine-readable error category."},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WebhookErrorCode","description":"Narrower machine-readable reason for branching in client code.\n\nWhen omitted, clients should branch on `type`."}]},"detail":{"type":"string","description":"Human-readable explanation of the delivery failure."},"context":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WebhookDeliveryErrorContext","description":"Structured facts for this specific error type/code."}]}},"example":{"code":"connection_timeout","detail":"Connection timeout while attempting to deliver webhook","type":"delivery_failed"}},"WebhookDeliveryErrorType":{"type":"string","description":"Coarse machine-readable category for a webhook delivery error.","enum":["delivery_failed"]},"WebhookDeliveryPaginationMode":{"type":"string","enum":["offset","cursor"]},"WebhookDeliveryRead":{"type":"object","required":["id","webhook_id","url","status","payload","created_at","updated_at","attempt_count"],"properties":{"id":{"type":"string","format":"uuid"},"webhook_id":{"type":"string","format":"uuid"},"organization_id":{"type":["string","null"],"format":"uuid"},"url":{"type":"string","example":"https://example.com"},"status":{"$ref":"#/components/schemas/DeliveryStatus"},"payload":{"$ref":"#/components/schemas/Payload"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"attempt_count":{"type":"integer","format":"int64"},"error":{"type":["string","null"],"description":"Deprecated free-form webhook delivery error string.\n\nUse `error_info` for machine-readable client handling.","deprecated":true},"error_info":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WebhookDeliveryErrorInfo","description":"Structured webhook delivery error details.\n\nClients should branch on `error_info.code ?? error_info.type`."}]},"status_code":{"type":["integer","null"],"format":"u-int16","example":200,"minimum":0}}},"WebhookDeliverySummary":{"type":"object","required":["webhook_id","statuses","total_count","total_count_accuracy"],"properties":{"webhook_id":{"type":"string","format":"uuid","description":"Webhook whose deliveries were summarized."},"statuses":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryStatus"},"description":"Delivery status filters included in the count.\n\nEmpty means all delivery statuses were counted."},"total_count":{"type":"integer","format":"u-int64","description":"Number of matching webhook deliveries.\n\nThis is exact when the planner estimates 100,000 or fewer matching rows.\nFor larger result sets the endpoint returns a PostgreSQL planner estimate\ninstead of running a slow exact count over millions of deliveries; check\n`total_count_accuracy`.","minimum":0},"total_count_accuracy":{"$ref":"#/components/schemas/WebhookDeliverySummaryCountAccuracy","description":"Whether `total_count` is exact or planner-estimated."}}},"WebhookDeliverySummaryCountAccuracy":{"type":"string","enum":["exact","estimated"]},"WebhookErrorCode":{"type":"string","description":"Narrower machine-readable reason for a webhook delivery failure.","enum":["http_client_error","http_server_error","rate_limited","connection_timeout","connection_refused","invalid_response","payload_too_large","authentication_failed","unexpected_error"]},"WebhookHttpStatusContext":{"type":"object","required":["status_code"],"properties":{"status_code":{"type":"integer","format":"u-int16","minimum":0}}},"WebhookNotFoundError":{"oneOf":[{"$ref":"#/components/schemas/ApiErrorWithContext_WebhookNotFoundWebhookIdType_WebhookIdErrorContext"},{"$ref":"#/components/schemas/ApiErrorWithContext_WebhookNotFoundWebhookDeliveryIdType_WebhookDeliveryIdErrorContext"}],"description":"Status-specific API error payload. Branch on `type`; when present, use `code` for the narrower machine-readable reason and `context` for structured fields.","examples":[{"context":{"webhook_delivery_id":"00000000-0000-0000-0000-000000000000"},"detail":"Human-readable error detail","type":"webhook_delivery_not_found"}],"discriminator":{"propertyName":"type","mapping":{"webhook_delivery_not_found":"#/components/schemas/ApiErrorWithContext_WebhookNotFoundWebhookDeliveryIdType_WebhookDeliveryIdErrorContext","webhook_not_found":"#/components/schemas/ApiErrorWithContext_WebhookNotFoundWebhookIdType_WebhookIdErrorContext"}}},"WebhookPlainSecret":{"type":"object","required":["id","shared_secret"],"properties":{"id":{"type":"string","format":"uuid","description":"Webhook registration ID sent in the `x-voltage-webhook-id` delivery header."},"shared_secret":{"type":"string","description":"Plain text shared secret used to verify the authenticity of the webhook payload.\nOnly ever shown to the user when creating a new webhook or updating the shared secret.\nStore this secret by webhook ID and select it before signature verification.","example":"<redacted-shared-secret>"}}},"WebhookRateLimitedContext":{"type":"object","required":["retry_after_seconds"],"properties":{"retry_after_seconds":{"type":"integer","format":"u-int64","minimum":0}}},"WebhookRead":{"type":"object","required":["id","organization_id","environment_id","url","name","events","status","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"environment_id":{"type":"string","format":"uuid"},"url":{"type":"string","example":"https://example.com"},"name":{"type":"string","example":"some name"},"events":{"type":"array","items":{"$ref":"#/components/schemas/EventTypes"}},"status":{"$ref":"#/components/schemas/WebhookStatus"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stopped_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}}},"WebhookStatus":{"type":"string","enum":["active","stopped","deleted"]},"WithdrawnEvent":{"type":"object","required":["withdraw_id","amount","effective_time"],"properties":{"withdraw_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Amount"},"effective_time":{"type":"string","format":"date-time"}}},"rate-string":{"type":"string","format":"rate","description":"Exchange rate in fixed-point `<coefficient>e<scale>` form, expressed as currency base units per 1 BTC. The value is coefficient / 10^scale; for example, `12345e2` is 123.45 base units per BTC. The `e` separates the coefficient and scale and is not scientific notation. Used for bidirectional conversions between BTC and other currencies."}},"securitySchemes":{"api_key":{"type":"apiKey","in":"header","name":"x-api-key","description":"Environment API key used to authenticate requests"},"bearer_token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"User JWT used to authenticate with the Bearer scheme"},"checkout_session_token":{"type":"http","scheme":"bearer","description":"Checkout session token returned by the create checkout session endpoint"},"checkout_stream_token":{"type":"apiKey","in":"query","name":"stream_token","description":"Short-lived checkout event stream token"}}},"tags":[{"name":"Wallets","description":"Manage wallets in an organization"},{"name":"Wallet Policies","description":"Manage wallet payment policies"},{"name":"Payments","description":"# Payments API guide\n\nUse the Payments API to send or receive over Lightning, on-chain Bitcoin, and\nBIP21, and to create supported Taproot Asset receives. Payment creation is\nasynchronous: you choose the payment ID, submit the request, and then read the\npayment by that ID until it reaches the state you need.\n\nThis guide uses API-key authentication. Replace the variables below with values\nfor your account:\n\n```bash\nexport VOLTAGE_API_URL=\"https://voltageapi.com/v1\"\nexport VOLTAGE_API_KEY=\"your-api-key\"\nexport ORGANIZATION_ID=\"your-organization-id\"\nexport ENVIRONMENT_ID=\"your-environment-id\"\nexport WALLET_ID=\"your-wallet-id\"\nexport LINE_OF_CREDIT_ID=\"your-line-of-credit-id\"\nexport NETWORK=\"mainnet\"\nexport BOLT11_INVOICE=\"the-recipient-invoice\"\n```\n\nSend either `x-api-key` or `Authorization: Bearer <token>` on a request. The\nexamples use `x-api-key`:\n\n```bash\n-H \"x-api-key: $VOLTAGE_API_KEY\" \\\n-H \"content-type: application/json\"\n```\n\n## The asynchronous payment lifecycle\n\nGenerate and persist a UUID before every payment request. `POST /payments`\nreturns an empty `202 Accepted`; it does not return the payment object. Poll\n`GET /payments/{payment_id}` using the same ID.\n\nThe write and read paths are eventually consistent, so the first read can\nbriefly return `404` after a successful `202`. Retry that read with bounded\nbackoff. Do not treat `202` as payment completion.\n\nSend payments use these states:\n\n```text\nsending -> approved -> completed\n        -> failed    -> failed\n\nFor a normal payment, approved is an intermediate state.\nFor POST /payments/check, approved or failed is terminal.\n```\n\nReceive payments use these states:\n\n```text\ngenerating -> receiving -> completed\n                       -> expired\n           -> failed\n```\n\nFor receives, wait until the generated payment contains the invoice, address,\nor BIP21 URI before giving it to the payer.\n\nExample payment poll:\n\n```bash\ncurl --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments/$PAYMENT_ID\"\n```\n\n## Amounts and currencies\n\nUse the `amount` object for new integrations:\n\n```json\n{\n  \"currency\": \"btc\",\n  \"amount\": 150000000\n}\n```\n\n`amount` is always an integer in the base unit selected by `currency`:\n\n| Currency | Request value | Response `unit` | Example |\n|---|---:|---|---|\n| `btc` | millisatoshis | `msats` | `150000000` = 150,000 sats |\n| `usd` | cents | `cents` | `1000` = $10.00 |\n| `asset:<group-key>` | asset base units | `base units` | `25` = 25 base units |\n\nFor request bodies, send only `currency` and `amount`; the server derives the\nunit from `currency`. An input `unit` is optional and informational, but new\nclients should omit it. Responses always include `unit`. For on-chain amounts,\nuse a multiple of 1,000 millisatoshis so the value is an exact number of\nsatoshis.\n\nOlder `amount_msats`, `max_fee_msats`, `amount_sats`, and `max_fee_sats` fields\nremain available for compatibility. Prefer `amount` and `max_fee` objects in new\ncode.\n\n### Processing fees\n\nThe amount you submit when creating a payment is the principal. A processing\nfee is separate from any network fee.\n\n```text\nSEND\nwallet pays ---------> principal + processing fee + network fee (when applicable)\nrecipient receives --> principal\n\nFIXED RECEIVE\npayer pays ----------> principal + processing fee\nwallet receives -----> principal\n\nSTANDARD ANY-AMOUNT RECEIVE\nzero or no effective receive fee --> payer selects principal\nnonzero effective receive fee ----> payment fails before request generation\n```\n\nOnce a fee is approved for a send or included in a generated receive, REST\nresponses and webhooks include immutable top-level fee terms:\n\n```json\n{\n  \"processing_fee\": {\n    \"basis_points\": 150,\n    \"amount\": {\n      \"currency\": \"btc\",\n      \"amount\": 15000,\n      \"unit\": \"msats\"\n    }\n  }\n}\n```\n\n`basis_points` is the frozen rate (`150` is 1.5%). `amount` is the exact\nserver-calculated fee after rounding and uses the same assessment currency as\nthe principal. Network fees are not included. The top-level `processing_fee`\nrecords the immutable fee approved for the original send or included in the\ngenerated receive amount; it is not a cap or a running settlement total.\n`payment_breakdown.processing_fee` is the authoritative aggregate fee actually\nsettled and may differ from—and, for a changed settled principal or an overpaid\nreceive, exceed—the top-level amount. Partial receive increments are processed\nindividually but allocated from the cumulative settled amount, so splitting an\notherwise exact same-currency payment does not itself increase the fee. The\ntop-level field is omitted for fee-free payments and historical payments whose\noriginal terms cannot be reconstructed.\n\nFor a fixed receive, submit only the principal. The generated invoice or BIP21\nURI contains the total amount the payer owes, while `requested_amount` remains\nthe principal.\n\nWhen present, `payment_breakdown` itemizes `principal`, `network_fee`, and\n`processing_fee`. On sends, `data.fees` combines applicable network and\nprocessing fees and can be present when no processing fee is assessed. On\nfee-bearing fixed receives, `data.fees` contains the payer-funded processing\nfee. It is omitted from fee-free receives. A standard any-amount receive is\navailable only when its effective receive processing fee rate is zero or is not\nconfigured.\n\nOn send requests, top-level `currency` is the wallet's line-of-credit currency.\nThe currency inside `data.amount` is the currency of the rail amount. For\nexample, a USD wallet paying a Bitcoin invoice uses top-level `\"currency\":\n\"usd\"` and a BTC `data.amount`.\n\n### Treasury movements\n\nUse `POST /organizations/{organization_id}/environments/{environment_id}/treasury_movements`\nonly to move the wallet owner's own funds. Use normal `POST /payments` for\nstandard payments.\n\nContact Voltage to request access before you use this endpoint. Voltage must\napprove and enable treasury movements for your organization.\n\nThe treasury endpoint accepts the same send and receive request shapes as\n`POST /payments`:\n\n- a receive creates an incoming treasury movement;\n- a send creates an outgoing treasury movement.\n\nThe server records `payment_category: \"treasury\"` and does not assess a\nprocessing fee. Network and provider fees still apply. Standard payments have\n`payment_category: \"standard\"`. Do not send `payment_category`,\n`processing_fee`, or a fee-waiver field in the request.\n\nTreasury volume is excluded from the volume fee. It still affects wallet\nbalances, settlement, and interest. Invoice line items expose standard and\ntreasury send and receive counts and volumes through `payment_activity`.\n\nThe category records the endpoint selected by the caller. Voltage can review\ntreasury activity after bill generation. An incorrectly declared movement can\nresult in a separate manual invoice outside the billing system. The original\npayment category and generated bill remain unchanged. See\n[Treasury movements](../treasury-movements.md) for the complete billing\ncontract.\n\nTreasury creation requires organization `Write` permission. The endpoint\nreturns an empty `202 Accepted`. Polling the normal payment read endpoint\nrequires organization `Read` permission.\n\n## Choose a request shape\n\nEvery send has this envelope. The `metadata` object shown here and in the\nexamples below is optional:\n\n```json\n{\n  \"id\": \"client-generated-payment-uuid\",\n  \"wallet_id\": \"wallet-uuid\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"currency\": \"btc\",\n  \"type\": \"bolt11\",\n  \"data\": {}\n}\n```\n\nEvery receive has this envelope:\n\n```json\n{\n  \"id\": \"client-generated-payment-uuid\",\n  \"wallet_id\": \"wallet-uuid\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"payment_kind\": \"bolt11\"\n}\n```\n\nUse this matrix to select the remaining fields:\n\n| Intent | Selector | Amount behavior | Required rail data |\n|---|---|---|---|\n| Send Lightning | `type: bolt11` | A fixed invoice supplies its amount; an amountless invoice needs `data.amount` | `data.payment_request` |\n| Send on-chain | `type: onchain` | Fixed; BTC `data.amount` is required | `data.address`, `data.amount` |\n| Send BIP21 | `type: bip21` | The URI, explicit data, or embedded invoice must resolve to a fixed amount | `data.address` containing a BIP21 URI or Bitcoin address |\n| Send Taproot Asset | `type: taprootasset` | No canonical customer request is published yet | Confirm enablement and the current request contract with Voltage |\n| Receive Lightning | `payment_kind: bolt11` | Fixed, or any amount for BTC when the effective receive processing fee rate is zero or is not configured | Fixed: `amount`; any: omit all amount fields |\n| Receive on-chain | `payment_kind: onchain` | Fixed only | `amount` |\n| Receive BIP21 | `payment_kind: bip21` | Fixed, or any amount for BTC when the effective receive processing fee rate is zero or is not configured | Fixed: `amount`; any: omit all amount fields |\n| Receive Taproot Asset | `payment_kind: taprootasset` | Fixed asset amount | Asset-currency `amount` |\n\nOn-chain and BIP21 operations can depend on the features enabled for the\norganization. Taproot Asset sends are intentionally not shown as a copyable\nworkflow because the current API request schema and asynchronous processor do\nnot agree on one canonical amount shape. Confirm the contract with Voltage\nbefore integrating that permutation.\n\n### Send Lightning\n\nFor a fixed-amount invoice, `data.amount` can be omitted. Supplying it explicitly\nis useful when you also request a quote because the amount must match the\ninvoice and quote exactly. An amountless invoice requires a positive BTC amount.\n\n`max_fee` is optional. When omitted for Lightning, the service uses the larger\nof 1% and 1 sat. On-chain sends use the larger of 1% and 263 sats.\nBIP21 uses the Lightning-style 1%-or-1-sat API default, so set `max_fee`\nexplicitly when an on-chain fallback needs a higher ceiling.\n\n```bash\nexport PAYMENT_ID=\"$(uuidgen)\"\n\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$PAYMENT_ID\",\n  \"wallet_id\": \"$WALLET_ID\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"currency\": \"btc\",\n  \"type\": \"bolt11\",\n  \"data\": {\n    \"payment_request\": \"$BOLT11_INVOICE\",\n    \"amount\": {\n      \"currency\": \"btc\",\n      \"amount\": 150000\n    },\n    \"max_fee\": {\n      \"currency\": \"btc\",\n      \"amount\": 1000\n    }\n  }\n}\nJSON\n```\n\n### Send on-chain\n\nThe amount is expressed in millisatoshis even though the payment settles\non-chain. The following sends 150,000 sats and permits up to 1,000 sats in fees:\n\n```json\n{\n  \"id\": \"68d00852-8dd8-4c71-94d2-91c84695da78\",\n  \"wallet_id\": \"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2\",\n  \"metadata\": {\n    \"external_id\": \"order-123\"\n  },\n  \"currency\": \"btc\",\n  \"type\": \"onchain\",\n  \"data\": {\n    \"address\": \"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh\",\n    \"amount\": {\n      \"currency\": \"btc\",\n      \"amount\": 150000000\n    },\n    \"max_fee\": {\n      \"currency\": \"btc\",\n      \"amount\": 1000000\n    },\n    \"description\": \"Order 123\"\n  }\n}\n```\n\n### Send BIP21\n\nPut the full BIP21 URI in `data.address`. URI parameters take precedence over\nduplicate explicit fields: `amount` supplies the amount, `lightning` supplies\nthe invoice, and `label` or `message` supplies the description.\n\n```json\n{\n  \"id\": \"68d00852-8dd8-4c71-94d2-91c84695da78\",\n  \"wallet_id\": \"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2\",\n  \"metadata\": {\n    \"external_id\": \"order-123\"\n  },\n  \"currency\": \"btc\",\n  \"type\": \"bip21\",\n  \"data\": {\n    \"address\": \"bitcoin:bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh?amount=0.0015&label=Order%20123\",\n    \"max_fee\": {\n      \"currency\": \"btc\",\n      \"amount\": 1000000\n    }\n  }\n}\n```\n\n### Receive a fixed amount\n\nPut the amount at the top level. The following creates a Lightning invoice for\n150 sats:\n\n```bash\nexport PAYMENT_ID=\"$(uuidgen)\"\n\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$PAYMENT_ID\",\n  \"wallet_id\": \"$WALLET_ID\",\n  \"metadata\": {\n    \"external_id\": \"order-123\"\n  },\n  \"amount\": {\n    \"currency\": \"btc\",\n    \"amount\": 150000\n  },\n  \"payment_kind\": \"bolt11\",\n  \"description\": \"Order 123\",\n  \"expiration\": 3600\n}\nJSON\n```\n\nUse `payment_kind: onchain` for a fixed on-chain receive or `payment_kind:\nbip21` for a unified request.\n\n### Receive any amount\n\nAny-amount receives are BTC-only and support Lightning and BIP21. They require\nan effective receive processing fee rate of zero or no configured rate. Omit\n`amount`, `amount_msats`, and `amount_sats`:\n\n```json\n{\n  \"id\": \"11ca843c-bdaa-44b6-965a-39ac550fcef7\",\n  \"wallet_id\": \"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"currency\": \"btc\",\n  \"payment_kind\": \"bolt11\",\n  \"description\": \"Customer-selected amount\",\n  \"expiration\": 3600\n}\n```\n\nPayment creation is asynchronous. If the effective `receive_basis_points` rate\nis greater than zero, the payment moves to `failed` with `error.type:\n\"receive_failed\"` and `error.code: \"invalid_payment_amount\"`. This failure occurs\nbefore the server generates an invoice or URI. Submit a fixed amount so that\nthe server can include the processing fee in the payer-facing request.\n\nUSD receives cannot be any-amount. On-chain and Taproot Asset receives require a\nfixed amount.\n\n### Metadata\n\nOptional `metadata` belongs at the top level of both send and receive payment\nrequests, next to `id` and `wallet_id`; do not put it inside `data`. It is\nreturned with the payment and can be used as a list filter. It accepts at most\n50 string-to-string entries; each key and value can be up to 256 characters.\n\n```json\n{\n  \"metadata\": {\n    \"external_id\": \"payment-123\",\n    \"tenant_id\": \"tenant-a\"\n  }\n}\n```\n\n## Swap-backed sends\n\nA swap-backed send lets an eligible node-backed wallet pay on one rail while\nfunding the payment on the other. It is an explicitly selected, non-custodial\nroute, not automatic fallback logic.\n\n### What must be in place\n\nConfirm all of the following before setting `flow_preference`:\n\n- The wallet is **node-backed**, and Voltage has enabled swap fulfillment for\n  its line of credit. Credit-backed wallets without a customer node cannot\n  request a swap.\n- The payment is a **Bolt11 or Bitcoin on-chain send**. BIP21, Taproot Asset,\n  and receive payments do not use this swap path.\n- An **active private channel connects the customer node and the swap node**.\n  The API does not open or fund this channel; it must be provisioned separately.\n- For an on-chain destination funded over Lightning, that channel has customer\n  outbound and swap-node inbound liquidity, and the swap node has spendable\n  on-chain funds.\n- For a Bolt11 destination funded on-chain, the customer node has spendable\n  on-chain funds, and the swap node has outbound Lightning liquidity plus a\n  usable route to the destination invoice. The private customer-to-swap channel\n  remains a provisioning requirement, although it is not the funding leg in\n  this direction.\n- The customer node and a configured swap node are available on the payment's\n  Bitcoin network.\n\nThe API rejects unsupported wallet and rail combinations. Channel, liquidity,\nand provider problems are discovered asynchronously; the payment may fail or\nremain processing while a retryable dependency is unavailable. Poll the\npayment status and error. A swap failure\ndoes not fall back to direct execution.\n\n### Request a swap route\n\nMost integrations should omit `flow_preference` unless Voltage has provisioned\nthe wallet for swaps. Add it at the top level of a normal send request. The\nshorthand selects the opposite funding rail:\n\n```json\n{\n  \"flow_preference\": \"swap\"\n}\n```\n\nThe object form selects the funding rail explicitly:\n\n```json\n{\n  \"flow_preference\": {\n    \"type\": \"swap\",\n    \"rail\": \"lightning\"\n  }\n}\n```\n\nIn the object form, `rail` is the funding rail, not the customer-facing payment\nrail. It must differ from the payment rail.\n\n| Customer payment | Swap funding rail | Customer funding used |\n|---|---|---|\n| On-chain send | Lightning | Customer-node Lightning liquidity |\n| Bolt11 send | Bitcoin on-chain | Customer-node on-chain funds |\n\nFulfillment checks for an internal short-circuit match before creating a swap.\nConsequently, a request can retain top-level `route: \"swap\"` while returning a\n`shortcircuit` outflow and no swap outflows. Otherwise, swap progress appears in\n`data.outflows`.\n\n### Why the swap is non-custodial\n\nBoth payment legs use the same payment hash. The on-chain funds are locked in a\nTaproot contract instead of being deposited into an unconditionally spendable\nswap-service balance:\n\n- The success path requires a signature from the claimant's node-held key and\n  the preimage for the shared payment hash.\n- The refund path requires a signature from a key derived by the original\n  on-chain funder's node and becomes consensus-valid after the contract's\n  persisted relative timelock. New contracts default to 144 blocks on standard\n  Bitcoin networks and 2,880 blocks on Mutinynet.\n- Taproot claim and refund signing keys remain in the respective customer or\n  swap LND node.\n\nThe contract has these two Miniscript leaves:\n\n```text\nsuccess: and_v(v:pk(<claim_pubkey>),sha256(<payment_hash>))\nrefund:  and_v(v:older(<refund_after_blocks>),pk(<refund_pubkey>))\n```\n\n`pk` requires the named key's signature, `sha256` requires the matching\npreimage, and `older(<refund_after_blocks>)` enforces the persisted refund\ndelay. The Taproot internal key is\na fresh blinded NUMS point with no known private key, so it does not provide a\nseparate key-path spend.\n\nNon-custodial here describes the cryptographic spend conditions and ownership\nof the signing keys. The refund branch exists on-chain, but the current API does\nnot construct, sign, or broadcast refund transactions. It is not an automatic\ncustomer recovery workflow; post-lock recovery can require Voltage support.\n\n### Lightning-funded on-chain send\n\nThis direction uses customer-node Lightning liquidity to deliver the requested\non-chain payment:\n\n```text\ncustomer Lightning -> private hold invoice -> hashlocked on-chain output\n                   -> customer claim -> destination address\n```\n\n1. The customer node creates the payment hash and derives its claim key.\n2. The swap node creates a private hold invoice using that hash. After the\n   customer node pays and the invoice is accepted, the swap node funds the\n   hashlocked Taproot output.\n3. The customer node signs a claim that spends the output to the requested\n   address. The claim reveals the preimage.\n4. The revealed preimage lets the swap node settle its hold invoice.\n\nThe public outflows can progress through:\n\n| Step | Rail | Meaning |\n|---|---|---|\n| `source_payment_submitted` | `lightning` | The customer node submitted the private Lightning payment. |\n| `target_submitted` | `onchain` | The swap node funded the hashlocked output; this is not yet the final destination spend. |\n| `target_claimed` | `onchain` | The customer node broadcast the spend to the requested address. A later receipt with this same step can mark the claim confirmed. |\n| `target_confirmed` | `onchain` | The swap-node hashlocked funding transaction reached the required confirmations. |\n\nThe payment can complete while the final claim receipt is still pending; later\nreads can include its confirmation update.\n\n### On-chain-funded Lightning send\n\nThis direction uses customer-node on-chain funds to pay the requested Bolt11\ninvoice:\n\n```text\ncustomer on-chain -> hashlocked source output -> swap-node Lightning payment\n                  -> swap-node source claim\n```\n\n1. The customer node derives the refund key, and the swap node derives its claim\n   key and returns the hashlocked Taproot address.\n2. The customer node funds that address. Before making the irreversible\n   Lightning payment, the swap waits for at least one source-funding\n   confirmation, even when the configured on-chain confirmation requirement is\n   zero; higher configured requirements are respected.\n3. The swap node pays the original Bolt11 invoice. The settled payment reveals\n   the preimage.\n4. The swap node uses the preimage and its claim key to spend the hashlocked\n   source output.\n\nThe recipient's Bolt11 invoice settles at `target_paid`, but the customer\npayment does not become `completed` or capture wallet funds at that point. The\nswap node first persists the selected source-claim fee and unsigned transaction\nID, then successfully broadcasts the claim or recovers that exact transaction\nwith LND. A retry does not obtain a new estimate or change the transaction ID.\nThe service then\nemits `SwapCompleted` so finalization can use the full cumulative set of\nrecorded network fees. This boundary does not wait for a block confirmation.\nLater confirmations enrich the payment receipts:\n\n| Step | Rail | Meaning |\n|---|---|---|\n| `source_submitted` | `onchain` | The customer node funded the hashlocked source output. |\n| `target_paid` | `lightning` | The swap node paid the requested Bolt11 invoice. |\n| `source_claimed` | `onchain` | The source-claim broadcast succeeded, or its exact durably prepared transaction was recovered from LND; block confirmation can follow. |\n\n### Fees and failure handling\n\nFor an on-chain destination, the request's `max_fee` is the Bitcoin funding and\nclaim cap. The service derives a separate source-Lightning allowance of roughly\n10% of that value, with a 1-sat minimum for a nonzero cap and a 50-sat maximum.\nTotal network fees can therefore include that Lightning allowance in addition\nto the Bitcoin cap.\n\nFor a Bolt11 destination, `max_fee` is used as the aggregate, Lightning, and\nBitcoin policy limit. The target Lightning attempt can use its full Lightning\nlimit. Source mining and target routing fees then reduce the budget available\nfor the later source claim. If that budget is exhausted after the invoice has\nbeen paid, the recipient has been paid but the customer payment cannot finalize\nor capture until source-claim publication succeeds or a valid existing claim\nis recovered during reconciliation.\n\nWhen it must construct a new source claim, the service requests LND's live\ntwo-block fee estimate and minimum relay rate. It raises the estimate to the\nrelay floor and applies any optional Bitcoin fee-rate ceiling; a ceiling below\nminimum relay is rejected. The resulting conservative 180-vbyte fee is bounded\nby the remaining Bitcoin-mining and cumulative network-fee ceilings and by the\namount that leaves the destination script's output at or above its\nscript-specific dust threshold. If those constraints cannot still fund the\nminimum-relay fee, the service refuses to sign or broadcast the claim.\n\nThe source claim signals opt-in RBF with sequence `0xfffffffd`. Its non-dust\nP2TR destination is controlled by the swap-node wallet and can be spent by a\nCPFP child. The current runtime does not automatically construct or publish an\nRBF replacement or CPFP child; these properties support an operator-run fee\nbump, not an automatic API behavior. `WalletKit/BumpFee` is an optional\noperator permission for CPFP; the payment runtime does not call it, and parent\nRBF would require separate rebuild, signing, publication, and txid tracking.\n\nThese limits are execution ceilings, not fee quotes. At capture,\n`payment_breakdown.network_fee` contains the cumulative Lightning routing and\nBitcoin mining fees recorded by the swap. A published Bitcoin transaction\ncommits its recorded mining-fee amount, so the fee can appear before block\nconfirmation. `processing_fee` is reported separately.\n\nTemporary provider and service failures are retried on the same swap. A\ndefinitive failure before funds are locked fails the payment. After funds are\nlocked, reconciliation remains on the same rail and some failures can require\nVoltage support. Cancellation is best-effort before the source-lock boundary;\nit is not a fund-recovery guarantee. At no point does a swap failure switch the\npayment to direct execution.\n\n## Workflow: pay a known BTC invoice from a USD wallet\n\nThis is the complete quote -> payment workflow. Keep the invoice amount in BTC\nthroughout so the quote and payment can be checked for exact equality.\n\n### 1. Request a BTC-to-USD quote\n\nThe quote ID is client-generated, just like the payment ID. `POST /quotes`\nreturns an empty `202 Accepted`.\n\n```bash\nexport QUOTE_ID=\"$(uuidgen)\"\nexport PAYMENT_ID=\"$(uuidgen)\"\n\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/quotes\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$QUOTE_ID\",\n  \"line_of_credit_id\": \"$LINE_OF_CREDIT_ID\",\n  \"network\": \"$NETWORK\",\n  \"amount\": {\n    \"currency\": \"btc\",\n    \"amount\": 150000\n  },\n  \"to\": \"usd\"\n}\nJSON\n```\n\n### 2. Poll until the quote is usable\n\n```bash\ncurl --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/quotes/$QUOTE_ID\"\n```\n\nProceed only when `created_at` and `quote` are non-null, `consumed_at` and\n`error` are null, and `expires_at` is still in the future. Stop if `failed_at`\nor `error` is non-null. Quotes expire and can be consumed only once.\n\n### 3. Create the payment with the same BTC amount\n\nUse top-level `currency: usd` because this is a USD wallet. The rail amount is\nstill the exact BTC amount quoted in step 1.\n\n```bash\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$PAYMENT_ID\",\n  \"wallet_id\": \"$WALLET_ID\",\n  \"quote_id\": \"$QUOTE_ID\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"currency\": \"usd\",\n  \"type\": \"bolt11\",\n  \"data\": {\n    \"payment_request\": \"$BOLT11_INVOICE\",\n    \"amount\": {\n      \"currency\": \"btc\",\n      \"amount\": 150000\n    },\n    \"max_fee\": {\n      \"currency\": \"btc\",\n      \"amount\": 1000\n    }\n  }\n}\nJSON\n```\n\n### 4. Poll the payment\n\n```bash\ncurl --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments/$PAYMENT_ID\"\n```\n\nPoll until `status` is `completed` or `failed`. Cross-currency results include\nthe market quote and any completed exchanges.\n\nThe same quote sequence applies to an exact on-chain or BIP21 payment from a\nUSD wallet: quote the known BTC rail amount to USD, then use that exact BTC\namount and `quote_id` in the corresponding payment request.\n\n## Workflow: create a USD-denominated receive\n\nThis workflow creates a fixed $10.00 receive request for a USD wallet. Quote the\nknown USD amount to BTC, then use that same USD amount in the payment request.\n\n### 1. Request a USD-to-BTC quote\n\n```bash\nexport QUOTE_ID=\"$(uuidgen)\"\nexport PAYMENT_ID=\"$(uuidgen)\"\n\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/quotes\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$QUOTE_ID\",\n  \"line_of_credit_id\": \"$LINE_OF_CREDIT_ID\",\n  \"network\": \"$NETWORK\",\n  \"amount\": {\n    \"currency\": \"usd\",\n    \"amount\": 1000\n  },\n  \"to\": \"btc\"\n}\nJSON\n```\n\n### 2. Poll until the quote is usable\n\n```bash\ncurl --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/quotes/$QUOTE_ID\"\n```\n\nApply the same readiness checks as the send workflow: `quote` and `created_at`\nmust exist, the quote must be unconsumed and unexpired, and neither `failed_at`\nnor `error` can be set.\n\n### 3. Create the fixed receive\n\n```bash\ncurl --fail-with-body -X POST \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  -H \"content-type: application/json\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data @- <<JSON\n{\n  \"id\": \"$PAYMENT_ID\",\n  \"wallet_id\": \"$WALLET_ID\",\n  \"quote_id\": \"$QUOTE_ID\",\n  \"metadata\": {\n    \"external_id\": \"payment-123\"\n  },\n  \"amount\": {\n    \"currency\": \"usd\",\n    \"amount\": 1000\n  },\n  \"payment_kind\": \"bolt11\",\n  \"description\": \"Receive USD 10.00\",\n  \"expiration\": 3600\n}\nJSON\n```\n\nQuoted receive expiration is capped by the quote's remaining lifetime.\n\n### 4. Poll and share the generated request\n\nPoll the payment ID. When `status` becomes `receiving`, read\n`data.payment_request` and give that invoice to the payer. Continue polling\nuntil the receive is `completed`, `failed`, or `expired`.\n\n## Read a payment response\n\nBranch first on top-level `direction`, then on `type`:\n\n- A send has `direction: send`, a `route`, and `data.outflows`.\n- A receive has `direction: receive` and `data.receipts`.\n\nReceipts are still the receive-side settlement records. Receive receipt types\nare `onchain`, `lightning`, and `shortcircuit`. Send outflow types are\n`onchain`, `lightning`, `shortcircuit`, and `swap`.\n\nBoth arrays can be empty while a payment is processing and can contain more\nthan one entry. A swap send is represented in `data.outflows`; it does not turn\na receive receipt into a swap receipt.\n\nExample completed receive:\n\n```json\n{\n  \"direction\": \"receive\",\n  \"payment_category\": \"standard\",\n  \"id\": \"11ca843c-bdaa-44b6-965a-39ac550fcef7\",\n  \"wallet_id\": \"7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2\",\n  \"metadata\": {\n    \"external_id\": \"order-123\"\n  },\n  \"organization_id\": \"b0684ab8-1130-46af-8f70-71519442f108\",\n  \"environment_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"created_at\": \"2025-02-12T21:21:21.744713Z\",\n  \"updated_at\": \"2025-02-12T21:23:03.173159Z\",\n  \"currency\": \"btc\",\n  \"requested_amount\": {\n    \"currency\": \"btc\",\n    \"amount\": 150000,\n    \"unit\": \"msats\"\n  },\n  \"type\": \"bolt11\",\n  \"data\": {\n    \"payment_request\": \"lntbs...\",\n    \"amount\": {\n      \"currency\": \"btc\",\n      \"amount\": 150000,\n      \"unit\": \"msats\"\n    },\n    \"amount_msats\": 150000,\n    \"memo\": \"Order 123\",\n    \"expiration\": 3600,\n    \"market_quote\": null,\n    \"receipts\": [\n      {\n        \"type\": \"lightning\",\n        \"data\": {\n          \"preimage\": \"1111111111111111111111111111111111111111111111111111111111111111\",\n          \"payment_hash\": \"2222222222222222222222222222222222222222222222222222222222222222\",\n          \"ledger_id\": \"03d87c6d-2cf8-414b-929a-eceeb4c896ed\"\n        }\n      }\n    ]\n  },\n  \"status\": \"completed\",\n  \"error\": null,\n  \"frozen\": [],\n  \"exchanges\": [],\n  \"bip21_uri\": \"lightning:lntbs...\"\n}\n```\n\nFor a USD-backed payment, `data.market_quote` records the market rate and\n`exchanges` records the amounts actually exchanged. Rate values are serialized\nin the fixed-point form `<coefficient>e<scale>`, where the value in currency\nbase units is `coefficient / 10^scale`. The `e` separates the coefficient and\ndecimal scale; it is not scientific notation. For example, `6500000e0` is\n6,500,000 cents per BTC, or $65,000 per BTC. The modern `data.amount`,\n`data.max_fee`, and `data.fees` fields use the market-quote display currency on\ncross-currency responses; deprecated numeric msat/sat fields retain the Bitcoin\nrail values. For a quoted receive, `requested_amount` is the converted BTC rail\namount. The optional top-level `payment_breakdown` is the best available\ndisplay-currency aggregate for a fee-bearing payment; wallet-confirmed values\nreplace quote-converted rail values when settlement completes. Use `exchanges`\nto reconcile the original and converted amounts.\n\n## List and filter payments\n\nCursor pagination is the best default for a long-running integration.\n\nFirst page:\n\n```bash\ncurl --get --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data-urlencode \"pagination=cursor\" \\\n  --data-urlencode \"limit=100\" \\\n  --data-urlencode \"sort_key=created_at\" \\\n  --data-urlencode \"sort_order=DESC\"\n```\n\nNext page:\n\n```bash\nexport NEXT_CURSOR=\"the-next-cursor-from-the-previous-response\"\n\ncurl --get --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data-urlencode \"cursor=$NEXT_CURSOR\" \\\n  --data-urlencode \"limit=100\" \\\n  --data-urlencode \"sort_key=created_at\" \\\n  --data-urlencode \"sort_order=DESC\"\n```\n\nRepeat the same filters, `sort_key`, and `sort_order` on every page. The cursor\nis bound to them; changing one returns an invalid-cursor error. Cursor results\nomit `total` and return `has_more` plus `next_cursor`. Offset pagination remains\navailable and includes `total`.\n\nArray filters use brackets:\n\n```text\nstatuses[]=completed&statuses[]=failed\n```\n\nMetadata filters use deep-object encoding, and multiple fields are ANDed:\n\n```text\nmetadata[external_id]=payment-123&metadata[tenant_id]=tenant-a\n```\n\nUse `payment_category=treasury` to return only treasury movements. Use\n`payment_category=standard` to return only standard payments. This\nfilter composes with `wallet_id`, `direction`, and the other payment filters.\n\n## Errors, retries, and client-generated IDs\n\nHTTP errors use an `error` envelope. Branch on `error.type`, or on\n`error.type` plus `error.code` when a code is present. Do not parse the human\nreadable `detail` string. The generated error schemas document the stable\n`type`, `code`, `detail`, and `context` fields for each operation.\n\nA payment that was accepted asynchronously can later expose an embedded\ntop-level `error` on its payment resource. Always inspect both the HTTP status\nand the resource status/error.\n\nUse a globally unique UUIDv4 and persist it before submission. The ID lets you\nreconcile an ambiguous transport result: query the ID before deciding whether\nto submit again. Do not assume that replaying a POST is generally idempotent.\n\nThe treasury endpoint returns `409 Conflict` for every payment ID that is\nalready visible. It does not promote an approved `/payments/check` payment.\n\n`POST /payments/check` is an asynchronous, policy-check-only send, not a\nsynchronous quote or fee preview. Poll the submitted ID until it becomes\n`approved` or `failed`. Do not attach a quote: the check consumes that\nsingle-use quote, so it cannot then be reused by `POST /payments`. Do not use\nthe check endpoint as a quote-to-payment workflow step or as a preview for\nexplicit swap routing.\n"},{"name":"Lines of Credit","description":"Manage lines of credit in an organization"},{"name":"Webhooks","description":"# Webhooks\n\nWebhooks deliver payment events to your application for low-latency updates.\nEach webhook registration belongs to one organization and environment.\n\n## Registration identity and secret\n\nSupply a unique webhook UUID in the create request. The create response returns\nthe same `id` and a generated `shared_secret`.\n\n```json\n{\n  \"id\": \"b0fc9829-f139-4035-bb14-4a4b6cd58f0e\",\n  \"shared_secret\": \"<redacted-shared-secret>\"\n}\n```\n\nStore the webhook ID and shared secret together. The API returns the plain-text\nsecret only during webhook creation or secret rotation.\n\nSecret rotation can overlap in-flight deliveries. During the handoff, keep the\nold and new secrets as candidates for the same webhook ID.\n\nEach registration has its own URL, event subscriptions, and shared secret. Do\nnot use one registration's secret to verify another registration.\n\n## Delivery routing\n\nOne payment event can match multiple webhook registrations. Voltage creates and\nsigns a separate delivery for each matching registration.\n\n| Callback URL | `x-voltage-webhook-id` | Signing secret |\n|--------------|-------------------------|----------------|\n| `https://a-webhook.com` | Webhook A ID | Webhook A shared secret |\n| `https://b-webhook.com` | Webhook B ID | Webhook B shared secret |\n\nEvery delivery includes the registration ID in `x-voltage-webhook-id`. A shared\nreceiver can use this header to select the candidate secret.\n\nMultiple registrations can use the exact same callback URL. The receiver uses\n`x-voltage-webhook-id` to distinguish those registrations.\n\nTreat the webhook ID as untrusted input. Verify the signature before you trust\nthe ID or process the payment.\n\n## Reliability and reconciliation\n\nWARNING: Do not use webhook deliveries as the only source of payment state. A\nmissed or unprocessed delivery can leave your records incomplete.\n\nTreat the Payments API as the source of truth for current payment state. Use\nthe payments list endpoint for scheduled reconciliation and recovery.\nSee [Payment reconciliation](#payment-reconciliation) for the recovery\nworkflow.\n\n## Outbound request\n\nVoltage sends an HTTP POST request with a JSON body and these headers:\n\n| Header | Value | Receiver use |\n|--------|-------|--------------|\n| `x-voltage-webhook-id` | Webhook registration UUID | Select the candidate shared secret or secrets |\n| `x-voltage-signature` | Base64-encoded HMAC-SHA256 digest | Verify the body and timestamp |\n| `x-voltage-timestamp` | Unix timestamp in seconds | Build the signed message and reject stale requests |\n| `x-voltage-event` | Event value from the payload | Compare with the verified payload before routing |\n\nSend and receive callbacks use this payload envelope:\n\n```json\n{\n  \"type\": \"receive\",\n  \"detail\": {\n    \"event\": \"completed\",\n    \"data\": {\n      \"id\": \"11ca843c-bdaa-44b6-965a-39ac550fcef7\"\n    }\n  }\n}\n```\n\nThis example abbreviates the payment object inside `detail.data`.\n\nThe `detail.data` value contains the payment object. Voltage does not inject the\nwebhook registration ID into payment metadata; use the header.\n\n## Signature verification\n\nVoltage signs webhook bodies with Hash-based Message Authentication Code using\nSHA-256 (HMAC-SHA256). The webhook body is not encrypted by this signature.\n\nThe signed message has this exact format:\n\n```text\n<raw_request_body>.<x-voltage-timestamp>\n```\n\nUse the literal UTF-8 `shared_secret` as the HMAC key. Use the exact timestamp\nheader string when you build the signed message.\n\nEncode the digest with standard padded Base64. This format uses `+`, `/`, and\n`=` characters. Compare the result with `x-voltage-signature`.\n\n```text\ncandidates = secrets[x-voltage-webhook-id]\nmessage = raw_request_body + \".\" + x-voltage-timestamp\nexpected = [base64(hmac_sha256(candidate, message)) for candidate in candidates]\nvalid = any(constant_time_equal(value, x-voltage-signature) for value in expected)\n```\n\nThe current signed message includes only the body and timestamp. It does not\ninclude `x-voltage-webhook-id` or `x-voltage-event`.\n\nUse `x-voltage-webhook-id` only to select the candidate secrets. After\nverification, use `type` and `detail.event` from the body as authoritative.\n\nIf you use `x-voltage-event` for routing, require it to match the verified\npayload event.\n\nVerify each delivery in this order:\n\n1. Read `x-voltage-webhook-id`, `x-voltage-timestamp`, and `x-voltage-signature`.\n2. Read the raw request body.\n3. Find the candidate secrets with `x-voltage-webhook-id`.\n4. Reject a missing or unknown webhook ID.\n5. Reject a timestamp outside your allowed time window.\n6. Calculate each expected signature from the raw body and timestamp.\n7. Compare each signature with a constant-time comparison.\n8. Parse and process the JSON only after verification succeeds.\n\nCAUTION: Verify the exact request body. Parsing is safe, but do not reserialize\nthe JSON and verify the new representation.\n\nUse HTTPS for every callback URL. A valid HMAC authenticates the body and\ntimestamp, but it does not authenticate other headers or encrypt the request.\n\n## Payment reconciliation\n\n| Path | Purpose |\n|------|---------|\n| Webhook delivery | Notify your application quickly when payment state changes |\n| `GET /organizations/{organization_id}/environments/{environment_id}/payments` | Return current payment state for reconciliation |\n\nStart each reconciliation sweep with cursor pagination ordered by `created_at`:\n\n```bash\ncurl --get --fail-with-body \\\n  -H \"x-api-key: $VOLTAGE_API_KEY\" \\\n  \"$VOLTAGE_API_URL/organizations/$ORGANIZATION_ID/environments/$ENVIRONMENT_ID/payments\" \\\n  --data-urlencode \"pagination=cursor\" \\\n  --data-urlencode \"limit=100\" \\\n  --data-urlencode \"sort_key=created_at\" \\\n  --data-urlencode \"sort_order=DESC\"\n```\n\nReconcile payments in this order:\n\n1. Request the first unfiltered cursor page with the sort shown above.\n2. Upsert each payment by `id`.\n3. Follow `next_cursor` with the same request parameters.\n4. Continue until `has_more` is false.\n5. Repeat complete sweeps on a schedule.\n\nCursor pages are not a database snapshot. A payment can change during a sweep.\nUse idempotent upserts so the next complete sweep can reconcile that change.\n\nDo not add payment filters to a complete environment sweep. For example, a\n`statuses` filter can hide a payment after its status changes.\n\nThe `start_date` and `end_date` filters apply to payment creation time. Do not\nuse these filters when you need a complete reconciliation sweep.\n"},{"name":"Billing","description":"Manage bills in an organization"},{"name":"Assets","description":"View assets voltage platform supports"},{"name":"Quoting (USD managed line of credit only)","description":"Manage currency exchange quotes for an organization"},{"name":"Checkout Sessions","description":"Create checkout sessions and expose browser-safe session state"},{"name":"Checkout Event Streams","description":"Open browser event streams for live checkout payment updates"},{"name":"Checkout Settings","description":"Configure checkout browser access for an environment"}]}