{"openapi":"3.1.0","info":{"title":"Acclaim API","version":"1.0.0","description":"Payments infrastructure built for the insurance industry. This specification describes\nthe core resources and operations for treasury accounts, payouts, funding, and more.\n\nAuthentication uses a secret API key passed as a Bearer token. The API is JSON-only\nand available via HTTPS only.\n"},"servers":[{"url":"https:\/\/api.withacclaim.com\/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Treasury \/ Treasury Accounts","description":"Manage treasury accounts and balances."},{"name":"Payees","description":"Manage recipients of payouts."},{"name":"Payout Methods","description":"Manage payout methods (e.g. bank accounts) for a payee."},{"name":"Payouts","description":"Create and track individual payouts."},{"name":"Payout Batches","description":"Create and track groups of payouts."},{"name":"Treasury \/ Funding","description":"Move funds between settlement accounts and treasury accounts."},{"name":"Payment Requests","description":"Create and manage payment requests for collecting payments."},{"name":"Setup Requests","description":"Create and manage setup requests for securely storing payment methods."},{"name":"Refunds","description":"Create and manage refunds for payments."},{"name":"Payers","description":"Create and manage payers for payment collection."},{"name":"Payment Methods","description":"Manage payment methods (e.g. cards, bank accounts) for a payer."}],"paths":{"\/treasury_accounts":{"get":{"tags":["Treasury \/ Treasury Accounts"],"summary":"List treasury accounts","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Number of items to return."},{"in":"query","name":"cursor","schema":{"type":"string"},"description":"Cursor for pagination."}],"responses":{"200":{"description":"A list of treasury accounts.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListTreasuryAccountsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Treasury \/ Treasury Accounts"],"summary":"Create a treasury account","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateTreasuryAccountRequest"}}}},"responses":{"201":{"description":"Treasury account created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TreasuryAccount"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}":{"get":{"tags":["Treasury \/ Treasury Accounts"],"summary":"Retrieve a treasury account","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"}],"responses":{"200":{"description":"The treasury account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TreasuryAccount"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}\/fundings":{"post":{"tags":["Treasury \/ Funding"],"summary":"Deposit from a settlement account","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateFundingRequest"}}}},"responses":{"201":{"description":"Deposit created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FundingTransfer"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}\/withdrawals":{"post":{"tags":["Treasury \/ Funding"],"summary":"Withdraw to a settlement account","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateWithdrawalRequest"}}}},"responses":{"201":{"description":"Withdrawal created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WithdrawalTransfer"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payees":{"get":{"tags":["Treasury \/ Payees"],"summary":"List payees","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of payees.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListPayeesResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Treasury \/ Payees"],"summary":"Create a payee","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePayeeRequest"}}}},"responses":{"201":{"description":"Payee created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payee"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payees\/{payee_id}":{"get":{"tags":["Payees"],"summary":"Retrieve a payee","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"}],"responses":{"200":{"description":"The payee.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payee"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payees"],"summary":"Update a payee","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePayeeRequest"}}}},"responses":{"200":{"description":"Updated payee.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payee"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"delete":{"tags":["Payees"],"summary":"Delete a payee","description":"Payees that have been used in a transaction or have related records cannot be deleted; returns 400 in that case. Deactivate instead.\n","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"}],"responses":{"204":{"description":"Payee deleted successfully."},"400":{"description":"Payee cannot be deleted because it has related records; deactivate instead.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payees\/{identifier}":{"put":{"tags":["Payees"],"summary":"Create or update a payee by identifier","description":"Idempotent endpoint to create or update a payee using a custom identifier.\nIf a payee with the given identifier exists, it will be updated.\nIf not, a new payee will be created with that identifier.\nReturns 201 for creation, 200 for update.\n","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string"},"description":"Custom identifier for the payee (e.g., external vendor ID)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePayeeRequest"}}}},"responses":{"200":{"description":"Payee updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payee"}}}},"201":{"description":"Payee created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payee"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payees\/{payee_id}\/payout_methods":{"get":{"tags":["Payout Methods"],"summary":"List payout methods for a payee","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"}],"responses":{"200":{"description":"List of payout methods for the payee.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/PayoutMethod"}}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Payout Methods"],"summary":"Create a payout method for a payee","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePayoutMethodRequest"}}}},"responses":{"201":{"description":"Payout method created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutMethod"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payees\/{payee_id}\/payout_methods\/{payout_method_id}":{"get":{"tags":["Payout Methods"],"summary":"Retrieve a payout method","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"},{"$ref":"#\/components\/parameters\/PayoutMethodId"}],"responses":{"200":{"description":"The payout method.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutMethod"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payout Methods"],"summary":"Update a payout method","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"},{"$ref":"#\/components\/parameters\/PayoutMethodId"}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePayoutMethodRequest"}}}},"responses":{"200":{"description":"Updated payout method.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutMethod"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"delete":{"tags":["Payout Methods"],"summary":"Delete a payout method","description":"Payout methods that have been used in a transaction cannot be deleted; return 403 in that case. Deactivate instead.\n","parameters":[{"$ref":"#\/components\/parameters\/PayeeId"},{"$ref":"#\/components\/parameters\/PayoutMethodId"}],"responses":{"204":{"description":"Payout method deleted."},"403":{"description":"Payout method cannot be deleted because it has been used; deactivate instead.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_method_schemas":{"get":{"tags":["Payout Methods"],"summary":"Generate payout method schemas","description":"Returns available payout method types and their field schemas (required fields, types, validation)\nfor the given country. Use this to build dynamic create forms for payout methods.\n","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":2},"description":"ISO 3166-1 alpha-2 country code (e.g. US)"},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","enum":["Individual","Company"],"default":"Individual"},"description":"Entity type of payee"}],"responses":{"200":{"description":"List of payout method schemas.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutMethodSchemaListResponse"}}}},"400":{"description":"Missing or invalid query parameters (e.g. country required)."},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payouts":{"get":{"tags":["Payouts"],"summary":"List payouts","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string","enum":["ReadyToProcess","Processing","Succeeded","Failed","Canceled","RequiresPayeeInfo","RequiresAction","RequiresPayoutMethod","NeedsApproval"]}}],"responses":{"200":{"description":"A list of payouts.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListPayoutsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Payouts"],"summary":"Create a payout","description":"Create a payout from a treasury account to a payee. Also creates a payout link for recipient choice.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePayoutRequest"}}}},"responses":{"201":{"description":"Payout created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payout"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payouts\/{payout_id}":{"get":{"tags":["Payouts"],"summary":"Retrieve a payout","parameters":[{"$ref":"#\/components\/parameters\/PayoutId"}],"responses":{"200":{"description":"The payout.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payout"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payouts"],"summary":"Update a payout","parameters":[{"$ref":"#\/components\/parameters\/PayoutId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePayoutRequest"}}}},"responses":{"200":{"description":"The updated payout.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payout"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payouts\/{payout_id}\/cancel":{"post":{"tags":["Payouts"],"summary":"Cancel a payout","parameters":[{"$ref":"#\/components\/parameters\/PayoutId"}],"responses":{"200":{"description":"The canceled payout.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payout"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches":{"get":{"tags":["Payout Batches"],"summary":"List payout batches","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string","enum":["Draft","ReadyToProcess","Processing","Completed","PartialCompleted","Failed","Canceled"]}}],"responses":{"200":{"description":"A list of payout batches.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListBatchesResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Payout Batches"],"summary":"Create a payout batch","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateBatchRequest"}}}},"responses":{"201":{"description":"Payout batch created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}":{"get":{"tags":["Payout Batches"],"summary":"Retrieve a payout batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"}],"responses":{"200":{"description":"The payout batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}\/items":{"get":{"tags":["Payout Batches"],"summary":"List payouts in a batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string","enum":["ReadyToProcess","Processing","Succeeded","Failed","Canceled","RequiresPayeeInfo","RequiresAction","RequiresPayoutMethod","NeedsApproval"]}}],"responses":{"200":{"description":"A page of payouts in the batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListPayoutsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}\/add_items":{"post":{"tags":["Payout Batches"],"summary":"Add payouts to a batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModifyPayoutBatchItemsRequest"}}}},"responses":{"200":{"description":"The updated payout batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}\/remove_items":{"post":{"tags":["Payout Batches"],"summary":"Remove payouts from a batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModifyPayoutBatchItemsRequest"}}}},"responses":{"200":{"description":"The updated payout batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}\/cancel":{"post":{"tags":["Payout Batches"],"summary":"Cancel a payout batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"}],"responses":{"200":{"description":"The canceled payout batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payout_batches\/{batch_id}\/process":{"post":{"tags":["Payout Batches"],"summary":"Process a payout batch","parameters":[{"$ref":"#\/components\/parameters\/BatchId"}],"responses":{"200":{"description":"The payout batch after processing (status may be processing, completed, failed, etc.).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}},"422":{"description":"Strong Customer Authentication is required; use the web application to complete verification and submit the batch.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PayoutBatchScaRequiredError"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/settlement_accounts":{"get":{"tags":["Treasury \/ Funding"],"summary":"List settlement accounts","description":"Settlement accounts are linked and verified in the Console. Creation via API is not available.","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of settlement accounts.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListSettlementAccountsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/settlement_accounts\/{settlement_account_id}":{"get":{"tags":["Treasury \/ Funding"],"summary":"Retrieve a settlement account","parameters":[{"$ref":"#\/components\/parameters\/SettlementAccountId"}],"responses":{"200":{"description":"The settlement account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SettlementAccount"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/virtual_accounts":{"get":{"tags":["Treasury \/ Funding"],"summary":"List virtual accounts","description":"Virtual Accounts are virtual bank account numbers for funding treasury accounts in a specific country and currency.","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"treasury_account_id","schema":{"type":"string"},"description":"Filter virtual accounts by the owning treasury account."},{"in":"query","name":"currency","schema":{"type":"string"},"description":"ISO 4217 currency code to filter by."}],"responses":{"200":{"description":"A list of virtual accounts.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListVirtualAccountsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/virtual_accounts\/{virtual_account_id}":{"get":{"tags":["Treasury \/ Funding"],"summary":"Retrieve a virtual account","parameters":[{"$ref":"#\/components\/parameters\/VirtualAccountId"}],"responses":{"200":{"description":"The virtual account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VirtualAccount"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}\/transactions":{"get":{"tags":["Treasury \/ Treasury Accounts"],"summary":"List treasury transactions","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"type","schema":{"type":"string","enum":["Withdrawal","Deposit","Transfer","Fee","Adjustment","Refund","Payout","PayoutReversal","Payment"]},"description":"Filter by transaction type."}],"responses":{"200":{"description":"A list of treasury transactions.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListTreasuryTransactionsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}\/transactions\/{transaction_id}":{"get":{"tags":["Treasury \/ Treasury Accounts"],"summary":"Retrieve a treasury transaction","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"},{"$ref":"#\/components\/parameters\/TransactionId"}],"responses":{"200":{"description":"The treasury transaction.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TreasuryTransaction"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/treasury_accounts\/{treasury_account_id}\/transfers":{"post":{"tags":["Treasury \/ Treasury Accounts"],"summary":"Transfer between treasury accounts","description":"Create an internal transfer that moves funds from the source treasury account (path param) to a destination treasury account in the same account.","parameters":[{"$ref":"#\/components\/parameters\/TreasuryAccountId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateTransferRequest"}}}},"responses":{"201":{"description":"Transfer created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TreasuryTransaction"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payment_requests":{"get":{"tags":["Payment Requests"],"summary":"List payment requests","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of payment requests.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListPaymentRequestsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Payment Requests"],"summary":"Create a payment request","description":"Create a payment request for collecting a payment. The request will be in RequiresPaymentMethod status until a payment method is provided.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePaymentRequestRequest"}}}},"responses":{"201":{"description":"Payment request created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentRequest"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payment_requests\/{payment_request_id}":{"get":{"tags":["Payment Requests"],"summary":"Retrieve a payment request","parameters":[{"$ref":"#\/components\/parameters\/PaymentRequestId"}],"responses":{"200":{"description":"The payment request.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentRequest"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payment Requests"],"summary":"Update a payment request","description":"Update a payment request. Only provided fields will be updated. Can update description, reference, amount, currency, tokenization flags, expiration date, payer, payment method, IP address, and user agent.","parameters":[{"$ref":"#\/components\/parameters\/PaymentRequestId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePaymentRequestRequest"}}}},"responses":{"200":{"description":"Payment request updated successfully.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentRequest"}}}},"400":{"description":"Bad request - invalid data or business rule violation (e.g., payer not found, invalid date format).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Payment request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payment_requests\/{payment_request_id}\/cancel":{"post":{"tags":["Payment Requests"],"summary":"Cancel a payment request","description":"Cancel a payment request that is in RequiresPaymentMethod or RequiresAction status. Once canceled, the payment request can no longer be confirmed and funds collected.","parameters":[{"$ref":"#\/components\/parameters\/PaymentRequestId"}],"responses":{"200":{"description":"Payment request canceled successfully.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentRequest"}}}},"400":{"description":"Bad request - payment request cannot be canceled (e.g., already confirmed, succeeded, or failed).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Payment request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payment_requests\/{payment_request_id}\/confirm":{"post":{"tags":["Payment Requests"],"summary":"Confirm a payment request","description":"Confirm a payment request to complete the payment lifecycle. The payment request must be in RequiresPaymentMethod or RequiresAction status. This can be used when collecting a payment method to create and process a payment. The payment request status updates based on the result.","parameters":[{"$ref":"#\/components\/parameters\/PaymentRequestId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePaymentRequestRequest"}}}},"responses":{"201":{"description":"Payment attempt created (includes nested payment when the charge succeeded).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentAttempt"}}}},"400":{"description":"Bad request - payment request cannot be confirmed (e.g., missing payer or payment method, wrong status, or processing error).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Payment request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/setup_requests":{"get":{"tags":["Setup Requests"],"summary":"List setup requests","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of setup requests.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListSetupRequestsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Setup Requests"],"summary":"Create a setup request","description":"Create a setup request for securely storing a payment method. The request will be in RequiresPaymentMethod status until a payment method is provided.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateSetupRequestRequest"}}}},"responses":{"201":{"description":"Setup request created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetupRequest"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/setup_requests\/{setup_request_id}":{"get":{"tags":["Setup Requests"],"summary":"Retrieve a setup request","parameters":[{"$ref":"#\/components\/parameters\/SetupRequestId"}],"responses":{"200":{"description":"The setup request.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetupRequest"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Setup Requests"],"summary":"Update a setup request","description":"Update a setup request. Only provided fields will be updated. Can update description, payer, payment method, and expiration date.","parameters":[{"$ref":"#\/components\/parameters\/SetupRequestId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateSetupRequestRequest"}}}},"responses":{"200":{"description":"Setup request updated successfully.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetupRequest"}}}},"400":{"description":"Bad request - invalid data or business rule violation (e.g., payer not found, invalid date format, wrong status).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Setup request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/setup_requests\/{setup_request_id}\/cancel":{"post":{"tags":["Setup Requests"],"summary":"Cancel a setup request","description":"Cancel a setup request that is in RequiresPaymentMethod or RequiresAction status. Once canceled, the setup request cannot be used.","parameters":[{"$ref":"#\/components\/parameters\/SetupRequestId"}],"responses":{"200":{"description":"Setup request canceled successfully.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetupRequest"}}}},"400":{"description":"Bad request - setup request cannot be canceled (e.g., already confirmed, succeeded, or failed).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Setup request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/setup_requests\/{setup_request_id}\/confirm":{"post":{"tags":["Setup Requests"],"summary":"Confirm a setup request","description":"Confirm a setup request to complete the setup lifecycle. The setup request must be in RequiresPaymentMethod or RequiresAction status. This will validate the payment method and tokenize it. The setup request status updates based on the result.","parameters":[{"$ref":"#\/components\/parameters\/SetupRequestId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateSetupRequestRequest"}}}},"responses":{"201":{"description":"Setup request completed successfully.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetupAttempt"}}}},"400":{"description":"Bad request - setup request cannot be confirmed (e.g., missing payer or payment method, wrong status, or processing error).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Setup request not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payments\/{payment_id}\/refunds":{"post":{"tags":["Refunds"],"summary":"Create a refund for a payment","description":"Create and process a refund for a specific payment. The refund amount must not exceed the remaining refundable amount.","parameters":[{"$ref":"#\/components\/parameters\/PaymentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateRefundRequest"}}}},"responses":{"201":{"description":"Refund created and processed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Refund"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/refunds":{"get":{"tags":["Refunds"],"summary":"List refunds","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of refunds.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListRefundsResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/refunds\/{refund_id}":{"get":{"tags":["Refunds"],"summary":"Retrieve a refund","parameters":[{"$ref":"#\/components\/parameters\/RefundId"}],"responses":{"200":{"description":"The refund.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Refund"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payers":{"get":{"tags":["Payers"],"summary":"List payers","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of payers.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ListPayersResponse"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"post":{"tags":["Payers"],"summary":"Create a payer","description":"Create a payer for payment collection. A unique identifier will be generated if not provided.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePayerRequest"}}}},"responses":{"201":{"description":"Payer created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payer"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payers\/{payer_id}":{"get":{"tags":["Payers"],"summary":"Retrieve a payer","parameters":[{"$ref":"#\/components\/parameters\/PayerId"}],"responses":{"200":{"description":"The payer.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payer"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payers"],"summary":"Update a payer","parameters":[{"$ref":"#\/components\/parameters\/PayerId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePayerRequest"}}}},"responses":{"200":{"description":"Updated payer.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Payer"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"delete":{"tags":["Payers"],"summary":"Delete a payer","description":"Payers that have been used in a transaction or have related records cannot be deleted; returns 400 in that case. Deactivate instead.\n","parameters":[{"$ref":"#\/components\/parameters\/PayerId"}],"responses":{"204":{"description":"Payer deleted successfully."},"400":{"description":"Payer cannot be deleted because it has related records; deactivate instead."},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payers\/{payer_id}\/payment_methods":{"get":{"tags":["Payment Methods"],"summary":"List payment methods for a payer","parameters":[{"$ref":"#\/components\/parameters\/PayerId"}],"responses":{"200":{"description":"List of payment methods for the payer.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/PaymentMethod"}}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}},"\/payers\/{payer_id}\/payment_methods\/{payment_method_id}":{"get":{"tags":["Payment Methods"],"summary":"Retrieve a payment method","parameters":[{"$ref":"#\/components\/parameters\/PayerId"},{"$ref":"#\/components\/parameters\/PaymentMethodId"}],"responses":{"200":{"description":"The payment method.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentMethod"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"patch":{"tags":["Payment Methods"],"summary":"Update a payment method","parameters":[{"$ref":"#\/components\/parameters\/PayerId"},{"$ref":"#\/components\/parameters\/PaymentMethodId"}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePaymentMethodRequest"}}}},"responses":{"200":{"description":"Updated payment method.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PaymentMethod"}}}},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}},"delete":{"tags":["Payment Methods"],"summary":"Delete a payment method","description":"Payment methods that have been used in a transaction cannot be deleted; returns 403 in that case. Deactivate instead.\n","parameters":[{"$ref":"#\/components\/parameters\/PayerId"},{"$ref":"#\/components\/parameters\/PaymentMethodId"}],"responses":{"204":{"description":"Payment method deleted."},"403":{"description":"Payment method cannot be deleted because it has been used; deactivate instead."},"default":{"$ref":"#\/components\/responses\/ErrorResponse"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key"}},"parameters":{"TreasuryAccountId":{"name":"treasury_account_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the treasury account."},"PayeeId":{"name":"payee_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payee."},"PayoutMethodId":{"name":"payout_method_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payout method."},"PayoutId":{"name":"payout_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payout."},"BatchId":{"name":"batch_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payout batch."},"SettlementAccountId":{"name":"settlement_account_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the settlement account."},"VirtualAccountId":{"name":"virtual_account_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the virtual account."},"TransactionId":{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the treasury transaction."},"PaymentRequestId":{"name":"payment_request_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payment request."},"SetupRequestId":{"name":"setup_request_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the setup request."},"PaymentId":{"name":"payment_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payment."},"RefundId":{"name":"refund_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the refund."},"PayerId":{"name":"payer_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payer."},"PaymentMethodId":{"name":"payment_method_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID of the payment method."}},"responses":{"ErrorResponse":{"description":"Error payload.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"schemas":{"CursorPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}}},"TreasuryAccount":{"type":"object","properties":{"id":{"type":"string","example":"tac_b0TrsSg91h"},"name":{"type":"string","example":"Collected Premium","description":"Display name for the treasury account"},"description":{"type":"string","nullable":true,"example":"Treasury account for premium collections","description":"Optional description of the treasury account"},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"account_holder_id":{"type":"string","nullable":true,"example":"pyee_abc123","description":"ID of the entity that holds\/owns this treasury account"},"balance":{"type":"integer","description":"Amount in smallest currency unit","example":125000},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"ListTreasuryAccountsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TreasuryAccount"}}}}]},"CreateTreasuryAccountRequest":{"type":"object","properties":{"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"name":{"type":"string","description":"Display name for the treasury account","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"description":"Optional description of the treasury account","maxLength":255},"treasury_pool_id":{"type":"string","description":"Public ID of the treasury pool to use. Required when the organization has more than one active treasury pool; omit when only one pool exists (that pool is used automatically).","example":"tp_abc123"}},"required":["currency","name"]},"SettlementAccount":{"type":"object","properties":{"id":{"type":"string","example":"sa_M9q4eR20Kx"},"currency":{"type":"string","example":"USD"},"status":{"type":"string","enum":["Inactive","Pending","Active"]},"created_at":{"type":"string","format":"date-time"}}},"ListSettlementAccountsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SettlementAccount"}}}}]},"CreateFundingRequest":{"type":"object","properties":{"settlement_account_id":{"type":"string","description":"Settlement account ID"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":500000},"reference":{"type":"string","description":"Optional idempotency or client reference for reconciliation"},"description":{"type":"string"}},"required":["settlement_account_id","amount"]},"FundingTransfer":{"type":"object","properties":{"id":{"type":"string","example":"fu_0A1b2C3d4E"},"treasury_account_id":{"type":"string","example":"tac_b0TrsSg91h","description":"ID of the treasury account"},"settlement_account_id":{"type":"string","example":"sa_M9q4eR20Kx"},"amount":{"type":"integer"},"currency":{"type":"string","example":"USD"},"status":{"type":"string","enum":["Pending","Completed","Voided"]},"created_at":{"type":"string","format":"date-time"}}},"CreateWithdrawalRequest":{"type":"object","properties":{"settlement_account_id":{"type":"string","description":"Destination settlement account ID"},"amount":{"type":"integer","description":"Amount in smallest currency unit"},"reference":{"type":"string"},"description":{"type":"string"}},"required":["settlement_account_id","amount"]},"WithdrawalTransfer":{"type":"object","properties":{"id":{"type":"string","example":"wd_P8LmNo23Qr"},"treasury_account_id":{"type":"string","example":"tac_b0TrsSg91h","description":"ID of the treasury account"},"settlement_account_id":{"type":"string","example":"sa_M9q4eR20Kx"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["Pending","Completed","Failed","Reversed","Canceled","Voided"]},"created_at":{"type":"string","format":"date-time"}}},"Payee":{"type":"object","properties":{"id":{"type":"string","example":"pyee_KfIuLz83Ya"},"given_name":{"type":"string","nullable":true,"example":"John"},"family_name":{"type":"string","nullable":true,"example":"Doe"},"middle_name":{"type":"string","nullable":true},"name":{"type":"string"},"identifier":{"type":"string","example":"PYEE-2025-001"},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number"},"company":{"type":"string","nullable":true},"entity_type":{"type":"string","enum":["Individual","Company"],"example":"Individual"},"address":{"allOf":[{"$ref":"#\/components\/schemas\/Address"}],"nullable":true},"active":{"type":"boolean","example":true},"status":{"type":"string","enum":["Active","MissingInfo","Inactive"],"example":"Active","description":"Current status of the payee based on information completeness and active state"},"preferred_language":{"type":"string","nullable":true,"maxLength":20,"description":"BCP 47 language tag (e.g. en, en-US)"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PayoutMethod":{"type":"object","properties":{"id":{"type":"string","example":"pmet_abc123","description":"Public ID of the payout method"},"payout_method_type":{"type":"string","example":"UnitedStatesAch","description":"Type of payout method"},"active":{"type":"boolean","example":true},"currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code"},"country":{"type":"string","nullable":true,"description":"ISO 3166-1 alpha-2 country code"},"account_number":{"type":"string","nullable":true},"routing_type1":{"type":"string","nullable":true},"routing_value1":{"type":"string","nullable":true},"routing_type2":{"type":"string","nullable":true},"routing_value2":{"type":"string","nullable":true},"bank_name":{"type":"string","nullable":true},"account_holder_name":{"type":"string","nullable":true},"account_type":{"type":"string","nullable":true},"swift_code":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"tax_id_type":{"type":"string","nullable":true},"tax_id":{"type":"string","nullable":true},"payout_speed":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreatePayoutMethodRequest":{"type":"object","properties":{"payout_method_type":{"type":"string","nullable":true,"description":"Payout method type. When omitted, we infer the payout method type from the given data.","example":"UnitedStatesAch"},"country":{"type":"string","nullable":true,"description":"ISO 3166-1 alpha-2 country code","minLength":2,"maxLength":2},"account_number":{"type":"string","nullable":true,"maxLength":255,"description":"Bank account number"},"routing_type1":{"type":"string","nullable":true,"description":"Primary routing type (e.g. aba, swift)"},"routing_value1":{"type":"string","nullable":true,"maxLength":255,"description":"Primary routing value"},"routing_type2":{"type":"string","nullable":true,"description":"Secondary routing type"},"routing_value2":{"type":"string","nullable":true,"maxLength":255,"description":"Secondary routing value"},"account_holder_name":{"type":"string","nullable":true,"maxLength":255},"account_type":{"type":"string","nullable":true,"maxLength":50,"description":"e.g. checking, savings"},"swift_code":{"type":"string","nullable":true,"maxLength":50},"iban":{"type":"string","nullable":true,"maxLength":34},"currency":{"type":"string","nullable":true,"maxLength":3,"description":"ISO 4217 currency code"},"tax_id_type":{"type":"string","nullable":true,"maxLength":50},"tax_id":{"type":"string","nullable":true,"maxLength":100},"payout_speed":{"type":"string","nullable":true,"enum":["normal","priority"],"description":"Payout speed preference"}}},"UpdatePayoutMethodRequest":{"type":"object","properties":{"active":{"type":"boolean","nullable":true,"description":"Set payout method active or inactive"},"default":{"type":"boolean","nullable":true,"description":"Set as the payee default payout method"}}},"PayoutMethodSchemaListResponse":{"type":"object","properties":{"schemas":{"type":"array","items":{"$ref":"#\/components\/schemas\/PayoutMethodSchema"}}}},"PayoutMethodSchema":{"type":"object","properties":{"payout_method_type":{"type":"string","example":"UnitedStatesAch","description":"Schema key; use when creating a payout method"},"description":{"type":"string","description":"Human-readable description of the payout method"},"currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code"},"country":{"type":"string","nullable":true,"description":"Supported country code or JSON array of codes"},"fields":{"type":"array","items":{"$ref":"#\/components\/schemas\/PayoutMethodSchemaField"}}}},"PayoutMethodSchemaField":{"type":"object","properties":{"name":{"type":"string","description":"Field name; use as key when creating a payout method"},"label":{"type":"string"},"type":{"type":"string","example":"text","description":"Field type (text, select, hidden, etc.)"},"required":{"type":"boolean"},"placeholder":{"type":"string","nullable":true},"maxLength":{"type":"integer","nullable":true},"minLength":{"type":"integer","nullable":true},"pattern":{"type":"string","nullable":true,"description":"Regex for client-side validation"},"options":{"type":"array","nullable":true,"description":"For select\/radio; array of { value, label }"},"helpText":{"type":"string","nullable":true},"entityTypeConstraint":{"type":"string","nullable":true,"description":"Individual or Company when field is entity-specific"}}},"Address":{"type":"object","required":["country"],"properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","example":"US","minLength":2,"maxLength":2},"address1":{"type":"string","nullable":true,"example":"123 Main St","maxLength":255},"address2":{"type":"string","nullable":true,"example":"Suite 100","maxLength":255},"city":{"type":"string","nullable":true,"example":"New York","maxLength":255},"state":{"type":"string","nullable":true,"example":"NY","maxLength":255},"postal_code":{"type":"string","nullable":true,"example":"10001","maxLength":255}}},"CreatePayeeRequest":{"type":"object","properties":{"given_name":{"type":"string","example":"John","description":"First name","minLength":1,"maxLength":255},"family_name":{"type":"string","example":"Doe","description":"Last name","minLength":1,"maxLength":255},"middle_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"company":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number"},"entity_type":{"type":"string","enum":["Individual","Company"],"default":"Individual","description":"Type of legal entity"},"address":{"$ref":"#\/components\/schemas\/Address"},"active":{"type":"boolean","default":true},"identifier":{"type":"string","nullable":true,"minLength":1,"maxLength":50,"description":"Custom identifier for the payee"},"preferred_language":{"type":"string","nullable":true,"maxLength":20},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":["given_name","family_name"]},"UpdatePayeeRequest":{"type":"object","properties":{"given_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"family_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"middle_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"company":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number"},"entity_type":{"type":"string","enum":["Individual","Company"],"nullable":true},"address":{"$ref":"#\/components\/schemas\/Address"},"active":{"type":"boolean","nullable":true},"identifier":{"type":"string","nullable":true,"minLength":1,"maxLength":50},"preferred_language":{"type":"string","nullable":true,"maxLength":20},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}}},"ListPayeesResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Payee"}}}}]},"Payout":{"type":"object","properties":{"id":{"type":"string","example":"po_dlZwQyd0Sn"},"treasury_account_id":{"type":"string","example":"tac_b0TrsSg91h","nullable":true,"description":"ID of the treasury account funding the payout"},"payee_id":{"type":"string","example":"pyee_KfIuLz83Ya","description":"ID of the payee"},"batch_id":{"type":"string","nullable":true,"example":"pob_r8PxTnQ5Dv","description":"ID of the payout batch if this payout belongs to one"},"funded_amount":{"type":"integer","nullable":true,"description":"The amount funded from the treasury account in smallest currency unit","example":125000},"funding_currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code for the funded amount","example":"USD"},"payment_amount":{"type":"integer","nullable":true,"description":"Amount sent to payee in smallest currency unit (after currency conversion)","example":125000},"payment_currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code for the payment amount","example":"USD"},"exchange_rate":{"type":"string","nullable":true,"description":"Exchange rate used for currency conversion (if applicable)","example":"1.00000000"},"status":{"type":"string","enum":["ReadyToProcess","Processing","Succeeded","Failed","Canceled","RequiresPayeeInfo","RequiresAction","RequiresPayoutMethod","NeedsApproval"]},"payout_link_url":{"type":"string","format":"uri","nullable":true,"description":"URL for the payout link if generated for recipient choice"},"payout_method":{"allOf":[{"$ref":"#\/components\/schemas\/PayoutMethod"}],"nullable":true,"description":"The payout method used for this payout"},"reference":{"type":"string","nullable":true,"maxLength":100,"example":"REF-2025-001","description":"Optional message that appears on beneficiary\u0027s bank statement (e.g. invoice number, claim ID, further credit)."},"idempotency_key":{"type":"string","nullable":true,"maxLength":255,"example":"idem_payout_2025_001","description":"Unique identifier that you generate to track and deduplicate payouts"},"description":{"type":"string","nullable":true,"example":"Payment for services rendered"},"purpose_of_payment":{"type":"string","nullable":true,"enum":["ProviderBillPayment","Commission","Refund","ClaimReimbursement"],"description":"Purpose of the payment"},"processed_at":{"type":"string","format":"date-time","nullable":true,"example":"2025-10-08T18:25:00Z","description":"When the payout was processed"},"payment_date":{"type":"string","format":"date","nullable":true,"example":"2025-10-08","description":"Expected or actual payment date"},"swift_charge_option":{"type":"string","nullable":true,"enum":["Our","Shared","Beneficiary"],"description":"SWIFT charge option (for international wire transfers)"},"lock_side":{"type":"string","enum":["Funding","Payment"],"description":"Which side of the FX quote has a locked rate. Funding means the funded amount is fixed; Payment means the payment amount is fixed."},"failure_code":{"type":"string","nullable":true,"example":"insufficient_funds","description":"Error code if the payout failed"},"failure_message":{"type":"string","nullable":true,"example":"Insufficient funds in treasury account","description":"Human-readable error message if the payout failed"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"PayoutLineItemRequest":{"type":"object","required":["amount"],"properties":{"amount":{"type":"integer","minimum":1,"description":"Amount in the smallest unit of `currency` (or of the implied payout line currency)","example":10000},"currency":{"type":"string","description":"ISO 4217 code for this line. If omitted, defaults to the payout payment or funding amount currency as appropriate.","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"example":"USD"},"description":{"type":"string","maxLength":2000,"nullable":true},"reference":{"type":"string","maxLength":100,"nullable":true},"metadata":{"type":"object","nullable":true,"description":"Optional key-value metadata for the line. Values must be strings.","additionalProperties":{"type":"string"}}}},"CreatePayoutRequest":{"type":"object","properties":{"treasury_account_id":{"type":"string","description":"ID of the treasury account to payout from"},"payee_id":{"type":"string","description":"ID of the payee to receive the payout"},"funded_amount":{"type":"integer","minimum":1,"description":"Amount in smallest currency unit from the treasury account","example":125000},"payment_amount":{"type":"integer","minimum":1,"description":"Amount in smallest currency unit to send to the payee (after currency conversion)","example":125000},"payment_currency":{"type":"string","description":"ISO 4217 currency code for the payment amount (3 uppercase letters)","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"example":"USD"},"reference":{"type":"string","maxLength":100,"example":"REF-2025-001","description":"Optional message that appears on beneficiary\u0027s bank statement (e.g. invoice number, claim ID, further credit)."},"idempotency_key":{"type":"string","nullable":true,"maxLength":255,"example":"idem_payout_2025_001","description":"Unique identifier that you generate to track and deduplicate payouts"},"description":{"type":"string","maxLength":255,"description":"Optional description for the payout"},"purpose_of_payment":{"type":"string","enum":["ProviderBillPayment","Commission","Refund","ClaimReimbursement"],"description":"Purpose of the payment","example":"ClaimReimbursement"},"payout_method_id":{"type":"string","description":"ID of the payout method to use for this payout","example":"pom_1a2b3c4d5e"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"process_now":{"type":"boolean","default":false,"description":"Process the payout immediately after it is created. If false, a payout that is ready stays in `ReadyToProcess`."},"line_items":{"type":"array","maxItems":500,"items":{"$ref":"#\/components\/schemas\/PayoutLineItemRequest"},"description":"Optional line-item breakdown. If omitted or empty, the payout will have no line items."}},"required":["treasury_account_id","payee_id","payment_currency"]},"UpdatePayoutRequest":{"type":"object","description":"All fields are optional; only supplied fields are updated. If `line_items` is omitted, existing line items are left unchanged. If `line_items` is present, it replaces the full set (use an empty array to remove all line items).","properties":{"treasury_account_id":{"type":"string","description":"ID of the treasury account to fund the payout from (must belong to the account)."},"funded_amount":{"type":"integer","minimum":1,"description":"Amount in smallest currency unit in the treasury account currency.","example":125000},"payment_amount":{"type":"integer","minimum":1,"description":"Amount in smallest currency unit in `payment_currency` (or existing payment currency).","example":125000},"payment_currency":{"type":"string","description":"ISO 4217 currency code for the payment amount (3 uppercase letters).","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"example":"USD"},"description":{"type":"string","maxLength":255,"description":"Optional description for the payout."},"reference":{"type":"string","maxLength":100,"nullable":true,"example":"REF-2025-001","description":"Optional message that appears on beneficiary\u0027s bank statement (e.g. invoice number, claim ID, further credit)."},"purpose_of_payment":{"type":"string","enum":["ProviderBillPayment","Commission","Refund","ClaimReimbursement"],"description":"Purpose of the payment.","example":"ClaimReimbursement"},"payout_method_id":{"type":"string","description":"ID of the payout method to use (must belong to the payee).","example":"pom_1a2b3c4d5e"},"line_items":{"type":"array","maxItems":500,"items":{"$ref":"#\/components\/schemas\/PayoutLineItemRequest"},"description":"If provided, replaces all line items. An empty array removes every line item."}}},"ListPayoutsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Payout"}}}}]},"PayoutBatch":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the payout batch.","example":"pob_r8PxTnQ5Dv"},"reference":{"type":"string","nullable":true,"maxLength":100,"description":"Optional client reference for reconciliation."},"description":{"type":"string","nullable":true,"maxLength":255,"description":"Optional human-readable description."},"processed_at":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the batch was processed, if applicable."},"status":{"type":"string","description":"Current lifecycle status of the batch.","enum":["Draft","ReadyToProcess","Processing","Completed","PartialCompleted","Failed","Canceled"],"example":"ReadyToProcess"},"total_items":{"type":"integer","description":"Total number of payouts in the batch.","minimum":0,"example":100},"valid_items":{"type":"integer","description":"Number of payouts in the batch that are valid for processing.","minimum":0,"example":100},"metadata":{"type":"object","nullable":true,"description":"Optional key-value metadata attached to the batch. Values must be strings.","additionalProperties":{"type":"string"}},"created_at":{"type":"string","format":"date-time","description":"When the batch was created.","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","description":"When the batch was last updated.","example":"2025-10-08T18:25:00Z"}}},"CreateBatchRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Optional display name; if omitted, a default name is generated."},"reference":{"type":"string","maxLength":100,"description":"Optional client reference for the batch (must be unique among non-canceled\/non-failed batches for the account)."},"description":{"type":"string","maxLength":255}}},"ModifyPayoutBatchItemsRequest":{"type":"object","required":["payout_ids"],"properties":{"payout_ids":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"},"description":"Public IDs of payouts to add or remove from the batch."}}},"PayoutBatchScaRequiredError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SCA_REQUIRED"},"message":{"type":"string"},"details":{"type":"object","properties":{"request_id":{"type":"string"},"sca_session_code":{"type":"string","nullable":true},"batch_id":{"type":"string"}},"additionalProperties":true}}}}},"ListBatchesResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/PayoutBatch"}}}}]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_request"},"message":{"type":"string","example":"Missing required field: amount"},"details":{"type":"object","additionalProperties":true},"request_id":{"type":"string","example":"req_7lYt4o2x"}}}}},"VirtualAccount":{"type":"object","properties":{"id":{"type":"string","example":"va_2mQh9T4XyZ"},"deposit_to_id":{"type":"string","example":"tac_b0TrsSg91h","description":"ID of the treasury account that receives deposits to this virtual account"},"country":{"type":"string","nullable":true,"description":"ISO 3166-1 alpha-2 country code","example":"US"},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"bank_name":{"type":"string","nullable":true,"example":"Acme Bank N.A."},"status":{"type":"string","enum":["Active","Inactive","Pending"]},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"}}},"ListVirtualAccountsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/VirtualAccount"}}}}]},"TreasuryTransaction":{"type":"object","properties":{"id":{"type":"string","example":"tx_7n0QWb9vLa"},"treasury_account_id":{"type":"string","example":"tac_b0TrsSg91h","description":"ID of the treasury account"},"type":{"type":"string","enum":["Withdrawal","Deposit","Transfer","Fee","Adjustment","Refund","Payout","PayoutReversal","Payment"]},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":50000},"currency":{"type":"string","example":"USD"},"source_id":{"type":"string","example":"va_zb9C6lW9oE","nullable":true,"description":"The originating account for this transaction, if applicable."},"destination_id":{"type":"string","example":"set_Tv0RGtQAWA","nullable":true,"description":"The destination account for this transaction, if applicable."},"payout_id":{"type":"string","example":"po_Tv0RGtQAWA","nullable":true,"description":"The payout that originated this transaction, if applicable."},"payment_id":{"type":"string","example":"pay_Tv0RGtQAWA","nullable":true,"description":"The payment that originated this transaction, if applicable."},"refund_id":{"type":"string","example":"re_Tv0RGtQAWA","nullable":true,"description":"The refund that originated this transaction, if applicable."},"deposit_id":{"type":"string","example":"dep_Tv0RGtQAWA","nullable":true,"description":"The deposit that originated this transaction, if applicable."},"withdrawal_id":{"type":"string","example":"wth_Tv0RGtQAWA","nullable":true,"description":"The withdrawal that originated this transaction, if applicable."},"reference":{"type":"string","nullable":true,"description":"Client-supplied reference used for reconciliation."},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"}}},"ListTreasuryTransactionsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TreasuryTransaction"}}}}]},"CreateTransferRequest":{"type":"object","properties":{"destination_treasury_account_id":{"type":"string","description":"Treasury account to receive funds","example":"tac_9TzQ1sLm2P"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":250000},"reference":{"type":"string","description":"Optional client reference for reconciliation"},"description":{"type":"string"}},"required":["destination_treasury_account_id","amount"]},"PaymentRequest":{"type":"object","properties":{"id":{"type":"string","example":"prq_AbC123XyZ"},"status":{"type":"string","enum":["RequiresPaymentMethod","RequiresAction","Processing","Authorized","Succeeded","Failed","Canceled"],"example":"RequiresPaymentMethod","description":"Current status of the payment request"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":125000},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"payer_id":{"type":"string","nullable":true,"example":"pyr_AbC123XyZ","description":"ID of the payer associated with this payment request"},"description":{"type":"string","example":"Premium payment for policy #POL-2025-001"},"reference":{"type":"string","example":"ORD-2025-001","description":"Client-supplied identifier"},"idempotency_key":{"type":"string","nullable":true,"maxLength":255,"example":"idem_ord_2025_001","description":"Unique identifier that you generate to track and deduplicate payments"},"requires_tokenization":{"type":"boolean","example":false,"description":"Whether this payment request requires tokenization of the payment method"},"allows_tokenization":{"type":"boolean","example":false,"description":"Whether this payment request allows tokenization of the payment method"},"payment_method":{"type":"object","nullable":true,"description":"Payment method associated with this payment request","additionalProperties":true},"session_identifier":{"type":"string","example":"prq_AbC123XyZ_abc123...","description":"External session identifier for this payment request"},"shipping_address":{"allOf":[{"$ref":"#\/components\/schemas\/Address"}],"nullable":true,"description":"Shipping address for this payment request"},"failure_code":{"type":"string","nullable":true,"example":"card_declined","description":"Error code if the payment request failed"},"failure_message":{"type":"string","nullable":true,"example":"Card was declined","description":"Human-readable error message if the payment request failed"},"expires_at":{"type":"string","format":"date-time","nullable":true,"example":"2025-12-31T23:59:59Z","description":"When the payment request expires"},"completed_at":{"type":"string","format":"date-time","nullable":true,"example":"2025-10-08T18:25:00Z","description":"When the payment request was completed"},"ip_address":{"type":"string","nullable":true,"example":"192.168.1.1","description":"IP address of the client making the payment"},"user_agent":{"type":"string","nullable":true,"example":"Mozilla\/5.0...","description":"User agent string of the client making the payment"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"CreatePaymentRequestRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":255,"example":"Premium payment for policy #POL-2025-001","description":"Description of the payment request"},"reference":{"type":"string","maxLength":255,"example":"ORD-2025-001","description":"Client-supplied identifier for reconciliation"},"amount":{"type":"integer","minimum":1,"example":125000,"description":"Amount in smallest currency unit"},"currency":{"type":"string","description":"ISO 4217 currency code (3 uppercase letters)","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"example":"USD"},"requires_tokenization":{"type":"boolean","default":false,"description":"Whether this payment request requires tokenization of the payment method"},"allows_tokenization":{"type":"boolean","default":false,"description":"Whether this payment request allows tokenization of the payment method"},"payer_id":{"type":"string","nullable":true,"maxLength":255,"example":"pyr_AbC123XyZ","description":"ID of the payer to associate with this payment request"},"payment_method_id":{"type":"string","nullable":true,"maxLength":255,"example":"pm_AbC123XyZ","description":"ID of an existing payment method to use (must belong to the payer if payer_id is provided)"},"idempotency_key":{"type":"string","nullable":true,"maxLength":255,"example":"idem_ord_2025_001","description":"Unique identifier that you generate to track and deduplicate payments"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":["description","reference","amount","currency"]},"UpdatePaymentRequestRequest":{"type":"object","properties":{"description":{"type":"string","nullable":true,"maxLength":255,"example":"Updated premium payment for policy #POL-2025-001","description":"Description of the payment request"},"reference":{"type":"string","nullable":true,"maxLength":255,"example":"ORD-2025-002","description":"Client-supplied identifier for reconciliation"},"amount":{"type":"integer","nullable":true,"minimum":1,"example":20000,"description":"Amount in smallest currency unit (must provide both amount and currency)"},"currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code (3 uppercase letters, must provide both amount and currency)","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"example":"USD"},"requires_tokenization":{"type":"boolean","nullable":false,"description":"Whether this payment request requires tokenization of the payment method"},"allows_tokenization":{"type":"boolean","nullable":false,"description":"Whether this payment request allows tokenization of the payment method"},"expires_at":{"type":"string","nullable":true,"format":"date-time","example":"2025-12-31T23:59:59Z","description":"When the payment request expires (ISO 8601 date-time string)"},"payer_id":{"type":"string","nullable":true,"example":"pyr_AbC123XyZ","description":"ID of the payer to associate with this payment request"},"payment_method_id":{"type":"string","nullable":true,"maxLength":255,"example":"pm_AbC123XyZ","description":"ID of an existing payment method to use (must belong to the payer if payer_id is provided)"},"payment_method":{"type":"object","nullable":true,"description":"Payment method data (e.g., payment_token, payment_method type)","additionalProperties":true},"ip_address":{"type":"string","nullable":true,"example":"192.168.1.1","description":"IP address of the client making the payment"},"user_agent":{"type":"string","nullable":true,"example":"Mozilla\/5.0...","description":"User agent string of the client making the payment"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":[]},"ListPaymentRequestsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/PaymentRequest"}}}}]},"SetupRequest":{"type":"object","properties":{"id":{"type":"string","example":"trq_XyZ789AbC"},"status":{"type":"string","enum":["RequiresPaymentMethod","RequiresAction","Processing","Succeeded","Failed","Canceled"],"example":"RequiresPaymentMethod","description":"Current status of the setup request"},"payer_id":{"type":"string","nullable":true,"example":"pyr_AbC123XyZ","description":"ID of the payer associated with this setup request"},"payment_method":{"type":"object","nullable":true,"description":"Payment method associated with this setup request","additionalProperties":true},"session_identifier":{"type":"string","example":"trq_XyZ789AbC_abc123...","description":"External session identifier for this setup request"},"description":{"type":"string","nullable":true,"example":"Tokenize payment method for customer","description":"Optional description of the setup request"},"failure_code":{"type":"string","nullable":true,"example":"validation_failed","description":"Error code if the setup request failed"},"failure_message":{"type":"string","nullable":true,"example":"Payment method validation failed","description":"Human-readable error message if the setup request failed"},"expires_at":{"type":"string","format":"date-time","nullable":true,"example":"2025-12-31T23:59:59Z","description":"When the setup request expires"},"completed_at":{"type":"string","format":"date-time","nullable":true,"example":"2025-10-08T18:25:00Z","description":"When the setup request was completed"},"ip_address":{"type":"string","nullable":true,"example":"192.168.1.1","description":"IP address of the client making the setup request"},"user_agent":{"type":"string","nullable":true,"example":"Mozilla\/5.0...","description":"User agent string of the client making the setup request"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"CreateSetupRequestRequest":{"type":"object","properties":{"payer_id":{"type":"string","nullable":true,"example":"pyr_AbC123XyZ","description":"ID of the payer to associate with this setup request"},"description":{"type":"string","maxLength":255,"nullable":true,"example":"Tokenize payment method for customer","description":"Optional description of the setup request"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":[]},"ListSetupRequestsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SetupRequest"}}}}]},"UpdateSetupRequestRequest":{"type":"object","properties":{"description":{"type":"string","nullable":true,"maxLength":255,"example":"Updated setup request for customer","description":"Optional description of the setup request"},"payer_id":{"type":"string","nullable":true,"example":"pyr_AbC123XyZ","description":"ID of the payer to associate with this setup request"},"payment_method":{"type":"object","nullable":true,"description":"Payment method data (e.g., payment_token, payment_method type)","additionalProperties":true},"expires_at":{"type":"string","nullable":true,"format":"date-time","example":"2025-12-31T23:59:59Z","description":"When the setup request expires (ISO 8601 date-time string)"},"ip_address":{"type":"string","nullable":true,"example":"192.168.1.1","description":"IP address of the client making the request"},"user_agent":{"type":"string","nullable":true,"example":"Mozilla\/5.0...","description":"User agent of the client making the request"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":[]},"SetupAttempt":{"type":"object","properties":{"id":{"type":"string","example":"ta_AbC123XyZ"},"setup_request_id":{"type":"string","nullable":true,"example":"trq_Def456UvW","description":"ID of the setup request this attempt belongs to"},"payer_id":{"type":"string","nullable":true,"example":"pyr_GhI789JkL","description":"ID of the payer for this setup attempt"},"status":{"type":"string","enum":["Pending","Processing","Succeeded","Failed"],"example":"Succeeded","description":"Current status of the setup attempt"},"processor_transaction_id":{"type":"string","nullable":true,"example":"txn_processor_123","description":"Processor transaction ID from the payment processor"},"failure_code":{"type":"string","nullable":true,"example":"validation_failed","description":"Error code if the setup attempt failed"},"failure_message":{"type":"string","nullable":true,"example":"Payment method validation failed","description":"Human-readable error message if the setup attempt failed"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"Refund":{"type":"object","properties":{"id":{"type":"string","example":"rf_AbC123XyZ"},"payment_id":{"type":"string","nullable":true,"example":"pay_Def456UvW","description":"ID of the payment being refunded"},"status":{"type":"string","enum":["Processing","Succeeded","Failed"],"example":"Processing","description":"Current status of the refund"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":50000},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"reason":{"type":"string","nullable":true,"example":"Customer request","description":"Reason for the refund"},"processor_transaction_id":{"type":"string","nullable":true,"example":"ref_processor_123","description":"Processor transaction ID from the payment processor"},"failure_code":{"type":"string","nullable":true,"example":"unknown_failure","description":"Error code if the refund failed"},"failure_message":{"type":"string","nullable":true,"example":"The refund could not be completed","description":"Human-readable error message if the refund failed"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"CreateRefundRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"example":50000,"description":"Refund amount in smallest currency unit"},"reason":{"type":"string","maxLength":255,"nullable":true,"example":"Customer request","description":"Optional reason for the refund"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}}},"required":["amount"]},"ListRefundsResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Refund"}}}}]},"Payer":{"type":"object","properties":{"id":{"type":"string","example":"pyr_AbC123XyZ"},"identifier":{"type":"string","example":"PAYER-2025-001"},"name":{"type":"string","example":"John Doe","description":"Full name for individual or business name"},"given_name":{"type":"string","nullable":true,"example":"John"},"family_name":{"type":"string","nullable":true,"example":"Doe"},"middle_name":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true,"example":"Acme Corp"},"email":{"type":"string","format":"email","nullable":true,"example":"john.doe@example.com"},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number","example":"+15551234567"},"tax_id":{"type":"string","nullable":true,"example":"12-3456789","description":"Tax identification number"},"address":{"allOf":[{"$ref":"#\/components\/schemas\/Address"}],"nullable":true},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"active":{"type":"boolean","example":true},"preferred_language":{"type":"string","nullable":true,"maxLength":20,"description":"Payer language for payment links and invite messages. One of en, de, es, fr, pt.","example":"es"},"status":{"type":"string","enum":["Active","Inactive"],"example":"Active","description":"Current status of the payer based on the active flag"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"CreatePayerRequest":{"type":"object","properties":{"given_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"example":"John","description":"First name"},"family_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"example":"Doe","description":"Last name"},"middle_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"example":"John Doe","description":"Full name (overrides given_name\/family_name if provided)"},"company_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"example":"Acme Corp","description":"Company name for business payers"},"email":{"type":"string","format":"email","nullable":true,"example":"john.doe@example.com"},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number","example":"+15551234567"},"tax_id":{"type":"string","nullable":true,"minLength":1,"maxLength":50,"example":"12-3456789","description":"Tax identification number"},"identifier":{"type":"string","nullable":true,"minLength":1,"maxLength":100,"example":"PAYER-2025-001","description":"Custom identifier for the payer (auto-generated if not provided)"},"address":{"$ref":"#\/components\/schemas\/Address"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"preferred_language":{"type":"string","nullable":true,"maxLength":20,"enum":["en","de","es","fr","pt"],"description":"Language for this payer\u0027s payment links and invite messages. Omit or send null for English.","example":"es"}},"required":[]},"UpdatePayerRequest":{"type":"object","properties":{"given_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"family_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"middle_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"Full name (overrides given_name\/family_name if provided)"},"company_name":{"type":"string","nullable":true,"minLength":1,"maxLength":255},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true,"description":"E.164 formatted phone number"},"tax_id":{"type":"string","nullable":true,"minLength":1,"maxLength":50},"identifier":{"type":"string","nullable":true,"minLength":1,"maxLength":100},"address":{"$ref":"#\/components\/schemas\/Address"},"metadata":{"type":"object","nullable":true,"description":"Optional metadata as key-value pairs. Values must be strings.","additionalProperties":{"type":"string"},"example":{"custom_field":"value","source":"api"}},"active":{"type":"boolean","nullable":true},"preferred_language":{"type":"string","nullable":true,"maxLength":20,"enum":["en","de","es","fr","pt"],"description":"Language for this payer\u0027s payment links and invite messages. Send null to clear it."}},"required":[]},"ListPayersResponse":{"allOf":[{"$ref":"#\/components\/schemas\/CursorPage"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Payer"}}}}]},"PaymentAttempt":{"type":"object","properties":{"id":{"type":"string","example":"pat_AbC123XyZ"},"payment_request_id":{"type":"string","example":"prq_Def456UvW","description":"ID of the payment request this attempt belongs to"},"payment_id":{"type":"string","nullable":true,"example":"pay_GhI789JkL","description":"ID of the received payment when the attempt succeeded"},"payment":{"allOf":[{"$ref":"#\/components\/schemas\/Payment"}],"nullable":true,"description":"Received payment when the attempt succeeded"},"payer_id":{"type":"string","example":"pyr_GhI789JkL","description":"ID of the payer for this payment attempt"},"status":{"type":"string","enum":["Pending","Processing","Succeeded","Failed"],"example":"Succeeded","description":"Current status of the payment attempt"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":125000},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"reference":{"type":"string","example":"ORD-2025-001","description":"Client-supplied identifier"},"description":{"type":"string","nullable":true,"example":"Premium payment for policy #POL-2025-001"},"processor_transaction_id":{"type":"string","nullable":true,"example":"txn_processor_123","description":"Processor transaction ID from the payment processor"},"failure_code":{"type":"string","nullable":true,"example":"card_declined","description":"Error code if the attempt failed"},"failure_message":{"type":"string","nullable":true,"example":"Card was declined","description":"Human-readable error message if the attempt failed"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"Payment":{"type":"object","properties":{"id":{"type":"string","example":"pay_AbC123XyZ"},"payment_request_id":{"type":"string","nullable":true,"example":"prq_Def456UvW","description":"ID of the payment request this payment belongs to"},"payer_id":{"type":"string","nullable":true,"example":"pyr_GhI789JkL","description":"ID of the payer making the payment"},"status":{"type":"string","enum":["Succeeded","PartiallyRefunded","Refunded","Reversed"],"example":"Succeeded","description":"Lifecycle status of received funds"},"amount":{"type":"integer","description":"Amount in smallest currency unit","example":125000},"currency":{"type":"string","description":"ISO 4217 currency code","example":"USD"},"reference":{"type":"string","example":"ORD-2025-001","description":"Client-supplied identifier"},"description":{"type":"string","nullable":true,"example":"Premium payment for policy #POL-2025-001","description":"Description of the payment"},"processor_transaction_id":{"type":"string","nullable":true,"example":"txn_processor_123","description":"Processor transaction ID from the payment processor"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string","example":"pm_AbC123XyZ"},"type":{"type":"string","enum":["Card","AchDebit","SepaDebit","WireTransfer","PaperCheck","Cash","Paypal","ApplePay","GooglePay","Venmo","Zelle"],"example":"Card","description":"Type of payment method"},"active":{"type":"boolean","example":true,"description":"Whether the payment method is active"},"default":{"type":"boolean","example":false,"description":"Whether this is the default payment method for the payer"},"card":{"allOf":[{"$ref":"#\/components\/schemas\/CardPaymentMethodDetails"}],"nullable":true,"description":"Card details (present when type is Card)"},"ach_debit":{"allOf":[{"$ref":"#\/components\/schemas\/AchPaymentMethodDetails"}],"nullable":true,"description":"ACH bank account details (present when type is AchDebit)"},"sepa_debit":{"allOf":[{"$ref":"#\/components\/schemas\/SepaPaymentMethodDetails"}],"nullable":true,"description":"SEPA bank account details (present when type is SepaDebit)"},"paypal":{"allOf":[{"$ref":"#\/components\/schemas\/PayPalPaymentMethodDetails"}],"nullable":true,"description":"PayPal account details (present when type is Paypal)"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"CardPaymentMethodDetails":{"type":"object","properties":{"brand":{"type":"string","nullable":true,"enum":["Visa","Mastercard","Amex","Discover","DinersClub","Jcb","UnionPay","Maestro","Unknown"],"example":"Visa","description":"Card brand"},"last4":{"type":"string","nullable":true,"example":"4242","description":"Last four digits of the card number"},"expiry_month":{"type":"string","nullable":true,"example":"09","description":"Card expiry month (MM)"},"expiry_year":{"type":"string","nullable":true,"example":"2026","description":"Card expiry year (YYYY)"},"funding":{"type":"string","nullable":true,"enum":["Credit","Debit","Prepaid","DeferredDebit","Charge","Unknown"],"example":"Credit","description":"Card funding type"},"cardholder_name":{"type":"string","nullable":true,"example":"John Doe","description":"Cardholder name"},"country":{"type":"string","nullable":true,"example":"US","description":"Card issuing country (ISO 3166-1 alpha-2)"},"currency":{"type":"string","nullable":true,"example":"USD","description":"Card currency (ISO 4217)"},"fingerprint":{"type":"string","nullable":true,"description":"Unique fingerprint for the card"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"AchPaymentMethodDetails":{"type":"object","properties":{"account_number":{"type":"string","nullable":true,"description":"Bank account number (may be masked)"},"routing_number":{"type":"string","nullable":true,"description":"Bank routing number"},"country":{"type":"string","nullable":true,"example":"US","description":"Country (ISO 3166-1 alpha-2)"},"currency":{"type":"string","nullable":true,"example":"USD","description":"Currency (ISO 4217)"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"SepaPaymentMethodDetails":{"type":"object","properties":{"iban":{"type":"string","nullable":true,"description":"International Bank Account Number"},"country":{"type":"string","nullable":true,"example":"DE","description":"Country (ISO 3166-1 alpha-2)"},"currency":{"type":"string","nullable":true,"example":"EUR","description":"Currency (ISO 4217)"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"PayPalPaymentMethodDetails":{"type":"object","properties":{"email":{"type":"string","format":"email","nullable":true,"description":"PayPal account email address"},"payer_id":{"type":"string","nullable":true,"description":"PayPal payer ID"},"created_at":{"type":"string","format":"date-time","example":"2025-10-08T18:20:31Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-10-08T18:25:00Z"}}},"UpdatePaymentMethodRequest":{"type":"object","properties":{"active":{"type":"boolean","nullable":true,"description":"Set payment method active or inactive"},"default":{"type":"boolean","nullable":true,"description":"Set as the payer\u0027s default payment method"}}}}}}