{"components":{"parameters":{"IdempotencyKey":{"description":"A unique key for this request, 8 to 128 characters.","in":"header","name":"Idempotency-Key","required":true,"schema":{"pattern":"^[A-Za-z0-9._:-]{8,128}$","type":"string"}}},"schemas":{"Account":{"additionalProperties":false,"properties":{"created_at":{"description":"When the account was created.","format":"date-time","type":"string"},"credential":{"additionalProperties":false,"properties":{"created_at":{"description":"When the key was issued.","format":"date-time","type":"string"},"expires_at":{"description":"When the key stops working. Absent: it does not expire.","format":"date-time","type":"string"},"id":{"description":"The API key's id (key_…), or the member's (mem_…).","type":"string"},"label":{"description":"The name the key was issued with.","type":"string"},"prefix":{"description":"The public start of the key, as you hold it (psp_test_… or psp_live_…). It identifies the key; it is not the secret, which is never returned. For a member, the member's id.","type":"string"},"scopes":{"items":{"description":"What the key may do. read: every GET. write: creating and changing resources, and moving money.","enum":["read","write"],"type":"string"},"type":"array"},"type":{"description":"The kind of credential that made the request: an API key, or a member of the account signed in to the dashboard (see GET /v1/me).","enum":["api_key","member"],"type":"string"}},"required":["type","id","prefix","scopes","created_at"],"type":"object"},"environment":{"description":"The environment that answered. Sandbox and live are separate deployments with separate data and keys.","enum":["sandbox","live"],"type":"string"},"id":{"description":"The id of the account.","pattern":"^acct_[0-9a-z]+$","type":"string"},"name":{"description":"The account's name.","type":"string"},"primary_treasury_asset":{"description":"The asset the account's balances are held in and payouts fund from (USDT unless the deployment says otherwise). Money in other assets is the account's too; GET /v1/balances marks the balance in this asset as primary.","type":"string"},"status":{"description":"The account's status. Only an active account's credentials are accepted, so this is active whenever it can be read.","enum":["active","suspended","closed"],"type":"string"}},"required":["id","name","status","environment","primary_treasury_asset","created_at","credential"],"type":"object"},"Balance":{"additionalProperties":false,"properties":{"as_of":{"description":"When the last movement was applied to these balances. Absent until there was one.","format":"date-time","type":"string"},"available":{"description":"What can be spent now. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency.","type":"string"},"earnings":{"description":"Your own markup on your customers' payouts, accumulated. Shown apart; not part of total. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"in_settlement":{"description":"Committed to a settlement on its way out to your bank. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"pending":{"description":"Recognised but not yet spendable. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"primary":{"description":"Whether this is the balance in the account's primary_treasury_asset: the treasury payouts fund from. At most one balance is primary; none is while nothing was ever held in that asset.","type":"boolean"},"reserved":{"description":"Held for payouts in flight. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"total":{"description":"available + pending + reserved + in_settlement. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","primary","available","pending","reserved","in_settlement","earnings","total"],"type":"object"},"BalanceEntry":{"additionalProperties":false,"properties":{"account":{"description":"Which of your balances the entry moved.","enum":["available","pending","reserved","in_settlement","earnings"],"type":"string"},"amount":{"description":"The amount moved, always positive; the direction gives the sign. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency.","type":"string"},"direction":{"description":"credit raises the balance, debit lowers it.","enum":["credit","debit"],"type":"string"},"id":{"description":"The id of the entry. Pass it as after to continue the statement.","pattern":"^ent_[0-9a-z]+$","type":"string"},"journal_id":{"description":"The id of the journal: the balanced set of entries this one belongs to.","pattern":"^jrn_[0-9a-z]+$","type":"string"},"occurred_at":{"description":"When the journal was posted.","format":"date-time","type":"string"},"origin":{"additionalProperties":false,"properties":{"id":{"description":"The operation's public id: a pay-in (pin_…), a payout (pout_…), a refund (rfd_…), a withdrawal (wdr_…), a settlement (stl_…) or, for an adjustment, a reference to quote to support (adj_…).","type":"string"},"type":{"description":"The kind of operation the journal belongs to: payin, payout, adjustment.","type":"string"}},"required":["type","id"],"type":"object"},"purpose":{"description":"What the journal was for: funding_deposit, payout_reserve, payout_capture, reversal, adjustment_credit, …","type":"string"}},"required":["id","journal_id","purpose","account","direction","amount","currency","origin","occurred_at"],"type":"object"},"Beneficiary":{"additionalProperties":false,"properties":{"country":{"description":"ISO 3166-1 alpha-2 of the account.","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"currency":{"description":"The currency.","type":"string"},"customer_id":{"description":"The id of the customer the account belongs to.","pattern":"^cus_[0-9a-z]+$","type":"string"},"holder":{"description":"The account holder's name.","type":"string"},"id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"label":{"description":"Your own name for the beneficiary.","type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"method":{"description":"The method.","type":"string"},"status":{"description":"active: can be paid. archived: kept for the record and no longer paid.","enum":["active","archived"],"type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"},"verification_status":{"description":"What a verification of the account said. verified is final.","enum":["unverified","verified","failed"],"type":"string"},"verified_at":{"description":"When it was verified.","format":"date-time","type":"string"}},"required":["id","method","currency","status","verification_status","metadata","created_at","updated_at"],"type":"object"},"BeneficiaryCreate":{"additionalProperties":false,"properties":{"country":{"description":"ISO 3166-1 alpha-2 of the account. Fixed by the method when the method has a country; optional otherwise.","type":"string"},"currency":{"description":"The currency the beneficiary receives.","type":"string"},"customer_id":{"description":"The id of the customer the account belongs to. Optional.","pattern":"^cus_[0-9a-z]+$","type":"string"},"details":{"additionalProperties":true,"description":"The account details the method requires (see beneficiary_fields in GET /v1/capabilities: for example clabe for spei, routing_number and account_number for ach, a key for pix). Write-only: never returned.","type":"object"},"holder":{"description":"The account holder's name. Stored encrypted; descriptive, not part of what makes two registrations the same account.","maxLength":200,"type":"string"},"label":{"description":"Your own name for the beneficiary.","maxLength":100,"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"method":{"description":"The method the beneficiary is paid by.","type":"string"}},"required":["method","currency","details"],"type":"object"},"CallbackReceipt":{"additionalProperties":false,"properties":{"outcome":{"description":"Whether it was new.","enum":["stored","duplicate","conflict"],"type":"string"},"status":{"description":"The delivery is stored.","enum":["received"],"type":"string"}},"required":["status","outcome"],"type":"object"},"Capability":{"additionalProperties":false,"properties":{"available":{"description":"False when the capability exists but cannot be used by the account right now.","type":"boolean"},"beneficiary_fields":{"items":{"$ref":"#/components/schemas/FieldSpec"},"type":"array"},"collection":{"items":{"description":"Pay-in only: how it is collected. account: an account that receives any deposit (POST /v1/funding-accounts without amount). payment: one payment of an amount stated beforehand, which the payer pays exactly (POST /v1/funding-accounts with amount).","enum":["account","payment"],"type":"string"},"type":"array"},"country":{"description":"ISO 3166-1 alpha-2, when the method has a country. For a remittance, the destination's.","type":"string"},"currency":{"description":"What the beneficiary receives (payout, remittance) or the payer sends (payin).","type":"string"},"customer_fields":{"items":{"$ref":"#/components/schemas/FieldSpec"},"type":"array"},"features":{"items":{"description":"Something at least one provider of the capability can do with it.","enum":["refund","partial_refund"],"type":"string"},"type":"array"},"limits":{"items":{"$ref":"#/components/schemas/CapabilityLimit"},"type":"array"},"method":{"description":"The method (rail) code, e.g. spei, pix, ach. For a remittance, the payout method.","type":"string"},"operation":{"description":"The operation behind a payin or payout: the same word. Absent on a remittance.","enum":["payout","payin"],"type":"string"},"payment_currency":{"description":"Pay-in and remittance: what the payer really pays in (USD by bank_transfer). It is the pay-in's currency, stated explicitly.","type":"string"},"payment_method_fields":{"items":{"$ref":"#/components/schemas/FieldSpec"},"type":"array"},"product":{"description":"What can be done: money in, money out, or in from a payer and out to a beneficiary in another currency.","enum":["payin","payout","remittance"],"type":"string"},"reason":{"description":"Why it is not available. suspended: stopped by the platform, temporary. not_enabled: not enabled for this account. no_provider: no provider can serve the account for it.","enum":["suspended","not_enabled","no_provider"],"type":"string"},"settlement_asset":{"description":"Pay-in and remittance: what the balance is credited in (USDT). For a pay-in, the default among settlement_currencies (the account's primary_treasury_asset when it is one of them); for a remittance, the asset its price goes through between the payer's on-ramp and the payout. When it differs from payment_currency the payer's money is converted on the way.","type":"string"},"settlement_currencies":{"items":{"description":"A currency a pay-in can be credited in.","type":"string"},"type":"array"},"source_country":{"description":"Remittance only: the pay-in's country, when it has one.","type":"string"},"source_currency":{"description":"Remittance only: the currency the payer sends.","type":"string"},"source_method":{"description":"Remittance only: the pay-in method the payer uses.","type":"string"}},"required":["product","method","currency","available"],"type":"object"},"CapabilityLimit":{"additionalProperties":false,"properties":{"currency":{"description":"The currency the bound is in.","type":"string"},"daily":{"description":"The most the last 24 hours may total. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"per_operation":{"description":"The most one operation may move. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency"],"type":"object"},"Customer":{"additionalProperties":false,"properties":{"compliance_status":{"description":"What compliance said about the customer. It changes through the platform's checks, never through this API.","enum":["unverified","pending","verified","rejected","review"],"type":"string"},"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"display_name":{"description":"The name shown for the customer.","type":"string"},"external_id":{"description":"Your own id for this customer.","type":"string"},"id":{"description":"The id of the customer.","pattern":"^cus_[0-9a-z]+$","type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"profile":{"$ref":"#/components/schemas/CustomerProfile"},"status":{"description":"blocked: the platform stopped this customer; nothing is paid to its beneficiaries. closed: final.","enum":["active","blocked","closed"],"type":"string"},"type":{"description":"Person or business.","enum":["individual","business"],"type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","external_id","type","status","country","display_name","metadata","compliance_status","created_at","updated_at"],"type":"object"},"CustomerCreate":{"additionalProperties":false,"properties":{"country":{"description":"ISO 3166-1 alpha-2 of the customer.","type":"string"},"display_name":{"description":"The name shown for the customer. Stored encrypted.","maxLength":200,"type":"string"},"external_id":{"description":"Your own id for this customer. Unique per account; sending it again returns the same customer.","maxLength":128,"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"profile":{"$ref":"#/components/schemas/CustomerProfile"},"type":{"description":"Person or business.","enum":["individual","business"],"type":"string"}},"required":["external_id","type","country","display_name"],"type":"object"},"CustomerProfile":{"additionalProperties":false,"properties":{"address":{"additionalProperties":false,"properties":{"city":{"description":"The city.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"line1":{"description":"Street and number.","type":"string"},"line2":{"description":"Further address line.","type":"string"},"postal_code":{"description":"The postal code.","type":"string"},"state":{"description":"The state or province.","type":"string"}},"type":"object"},"date_of_birth":{"description":"YYYY-MM-DD. Individuals only.","type":"string"},"email":{"description":"An email address.","type":"string"},"first_name":{"description":"A natural person's given names, as their identity document writes them. Individuals only; sent with last_name.","type":"string"},"identity_document":{"description":"The number of the identity document. Sent with identity_document_type.","type":"string"},"identity_document_country":{"description":"The country that issued the identity document, ISO 3166-1 alpha-2. Only with identity_document.","type":"string"},"identity_document_type":{"description":"The kind of the identity document, as the corridor names it (DNI, CE, PAS, RUC, …). Sent with identity_document.","type":"string"},"last_name":{"description":"A natural person's family names, as their identity document writes them. Individuals only; sent with first_name.","type":"string"},"phone":{"description":"A phone number in international form, digits with an optional leading +.","type":"string"},"registration_number":{"description":"The company register number. Businesses only.","type":"string"},"tax_id":{"description":"A tax identifier.","type":"string"}},"type":"object"},"CustomerUpdate":{"additionalProperties":false,"properties":{"metadata":{"$ref":"#/components/schemas/Metadata"},"status":{"description":"closed is final. blocked is set by the platform and cannot be set or lifted here.","enum":["active","closed"],"type":"string"}},"type":"object"},"Error":{"additionalProperties":false,"properties":{"code":{"description":"A stable machine-readable code.","type":"string"},"message":{"description":"A description for a person. Not stable; do not parse it.","type":"string"},"param":{"description":"The request field at fault, when there is one.","type":"string"},"reasons":{"items":{"description":"A closed code saying why: present with risk_blocked (the rules' reasons) and with payout_not_cancellable (one reason: submitted, outcome_uncertain, already_completed, already_failed, already_returned, in_review, managed_by_batch or managed_by_remittance).","type":"string"},"type":"array"},"request_id":{"description":"Quote this to support.","type":"string"},"type":{"description":"The kind of error. Branch on this and on code.","enum":["invalid_request","authentication_error","permission_error","not_found","conflict","rate_limited","unavailable","internal_error"],"type":"string"}},"required":["type","code","message"],"type":"object"},"ErrorResponse":{"additionalProperties":false,"properties":{"error":{"$ref":"#/components/schemas/Error"}},"required":["error"],"type":"object"},"Event":{"additionalProperties":false,"properties":{"data":{"additionalProperties":true,"description":"The resource as it was when the event happened.","type":"object"},"id":{"description":"The id of the event.","pattern":"^evt_[0-9a-z]+$","type":"string"},"livemode":{"description":"False in sandbox.","type":"boolean"},"occurred_at":{"description":"When it happened.","format":"date-time","type":"string"},"schema_version":{"description":"The version of data's schema for this type.","type":"integer"},"type":{"description":"The event type: what happened, as <resource>.<what>.","enum":["beneficiary.created","beneficiary.verified","customer.created","customer.status_changed","customer.updated","funding_account.active","funding_account.failed","hosted_session.created","hosted_session.payment_reported","payin.completed","payin.failed","payout.cancelled","payout.completed","payout.created","payout.failed","payout.return_settled","payout.returned","payout_batch.cancellation_finished","payout_batch.cancellation_requested","payout_batch.completed","payout_batch.created","reconciliation.exception_created","reconciliation.exception_resolved","refund.approved","refund.completed","refund.created","refund.failed","refund.processing","remittance.completed","remittance.created","remittance.failed","remittance.processing","remittance.returned","remittance.review","risk.review_required","settlement.completed","settlement.created","settlement.failed","settlement.on_hold","settlement.processing","settlement_schedule.activated","settlement_schedule.blocked","webhook.ping","withdrawal.approved","withdrawal.cancelled","withdrawal.completed","withdrawal.created","withdrawal.failed","withdrawal.pending_approval","withdrawal.submitted"],"type":"string"}},"required":["id","type","schema_version","occurred_at","livemode","data"],"type":"object"},"EventRedeliver":{"additionalProperties":false,"properties":{"endpoint_id":{"description":"The id of the only endpoint to send to.","pattern":"^we_[0-9a-z]+$","type":"string"}},"type":"object"},"FieldSpec":{"additionalProperties":false,"properties":{"description":{"description":"What the field is.","type":"string"},"enum":{"items":{"description":"An accepted value of an enum field.","type":"string"},"type":"array"},"example":{"description":"A value of the right shape.","type":"string"},"name":{"description":"The field's name. A field of a nested object is written with a dot: address.country.","type":"string"},"note":{"description":"Why an optional field may still be needed: required by some providers of this method.","type":"string"},"pattern":{"description":"A regular expression the value must match, when the platform checks one. Absent: presence only.","type":"string"},"required":{"description":"True when the field must be sent.","type":"boolean"},"type":{"description":"The kind of value.","enum":["string","number","iban","phone","email","date","enum"],"type":"string"}},"required":["name","type","required","description"],"type":"object"},"FundingAccount":{"additionalProperties":false,"properties":{"amount":{"description":"One payment: what the payer pays, exactly, in currency. instructions.amount says the same once active. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"currency":{"description":"The currency the payer sends.","type":"string"},"failure_code":{"description":"Why it could not be opened.","type":"string"},"id":{"description":"The id of the funding account.","pattern":"^fa_[0-9a-z]+$","type":"string"},"instructions":{"additionalProperties":{"type":"string"},"description":"How to pay into the account. Present once active.","type":"object"},"method":{"description":"The method.","type":"string"},"settlement_currency":{"description":"The currency the balance is credited in.","type":"string"},"status":{"description":"pending until the account is open. active: it can be paid into. failed: it could not be opened (failure_code). closed: it takes no more deposits.","enum":["pending","active","failed","closed"],"type":"string"}},"required":["id","status","method","currency","settlement_currency","created_at"],"type":"object"},"FundingAccountCreate":{"additionalProperties":false,"properties":{"amount":{"description":"One payment of exactly this amount, in currency: what the payer pays, and nothing more; the provider's commission is the platform's. For a method whose collection is payment. Omit it for an account that receives any deposit. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency the payer sends.","type":"string"},"method":{"description":"How the account is paid into, e.g. bank_transfer.","type":"string"},"payer":{"additionalProperties":{"type":"string"},"description":"With amount: the method's payment_method_fields (GET /v1/capabilities), by name, e.g. payer.name for pix.","type":"object"},"settlement_currency":{"description":"The currency the balance is credited in. Defaults to the first available for the method.","type":"string"}},"required":["method","currency"],"type":"object"},"HostedColors":{"additionalProperties":false,"properties":{"background":{"description":"The page's background. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"},"border":{"description":"The colour of borders. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"},"primary":{"description":"The colour of the main action. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"},"secondary":{"description":"The colour of secondary elements. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"},"surface":{"description":"The background of cards and fields. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"},"text":{"description":"The colour of text. As #rrggbb.","pattern":"^#[0-9a-f]{6}$","type":"string"}},"type":"object"},"HostedDomain":{"additionalProperties":false,"properties":{"certificate_status":{"description":"Where the certificate for the name stands. none until the domain is verified.","enum":["none","pending","active","failed"],"type":"string"},"created_at":{"description":"When it was claimed.","format":"date-time","type":"string"},"hostname":{"description":"The hostname.","type":"string"},"id":{"description":"The id of the hosted domain.","pattern":"^hd_[0-9a-z]+$","type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"},"verification_status":{"description":"pending: claimed, not yet verified. verified: your control of the name is established; the hostname serves the page. failed: the claim could not be verified; the name is released.","enum":["pending","verified","failed"],"type":"string"},"verification_token":{"description":"What you publish to prove control of the name. Not a secret.","type":"string"},"verified_at":{"description":"When it was verified.","format":"date-time","type":"string"}},"required":["id","hostname","verification_status","verification_token","certificate_status","created_at","updated_at"],"type":"object"},"HostedDomainCreate":{"additionalProperties":false,"properties":{"hostname":{"description":"A DNS name: no scheme, no port, no path. Stored in lower case.","maxLength":253,"type":"string"}},"required":["hostname"],"type":"object"},"HostedPage":{"additionalProperties":false,"properties":{"brand_name":{"description":"The name shown on the page.","type":"string"},"branding_mode":{"description":"caibo: the page is the platform's. co_branded: your brand, powered by the platform. white_label: your brand alone; needs the entitlement.","enum":["caibo","co_branded","white_label"],"type":"string"},"colors":{"$ref":"#/components/schemas/HostedColors"},"created_at":{"description":"When it was first configured.","format":"date-time","type":"string"},"enabled":{"description":"Whether the page serves customers.","type":"boolean"},"favicon_url":{"description":"The favicon. https only.","format":"uri","maxLength":2048,"type":"string"},"font":{"description":"The key of a font the page ships. It is a key, not a font family.","enum":["system","inter","roboto","open_sans","lato","montserrat","poppins","nunito","dm_sans","source_serif"],"type":"string"},"id":{"description":"The public id of the page, safe in a URL. Absent until the page was configured once.","pattern":"^hp_[0-9a-z]+$","type":"string"},"logo_url":{"description":"The logo. https only.","format":"uri","maxLength":2048,"type":"string"},"public_start":{"description":"Whether a visitor may start a remittance alone.","type":"boolean"},"radius":{"description":"The corner radius, from a fixed scale.","enum":["none","sm","md","lg","full"],"type":"string"},"support":{"$ref":"#/components/schemas/HostedSupport"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"},"white_label_entitled":{"description":"Whether the account may use branding_mode white_label. Granted by the platform; read-only here.","type":"boolean"}},"required":["enabled","branding_mode","white_label_entitled","brand_name","colors","radius","font","support","public_start"],"type":"object"},"HostedPageUpdate":{"additionalProperties":false,"properties":{"brand_name":{"description":"The name shown on the page. Required unless branding_mode is caibo.","maxLength":80,"type":"string"},"branding_mode":{"description":"caibo: the page is the platform's. co_branded: your brand, powered by the platform. white_label: your brand alone; needs the entitlement.","enum":["caibo","co_branded","white_label"],"type":"string"},"colors":{"$ref":"#/components/schemas/HostedColors"},"enabled":{"description":"Whether the page serves customers. Off: no session can be started.","type":"boolean"},"favicon_url":{"description":"The favicon. https only.","format":"uri","maxLength":2048,"type":"string"},"font":{"description":"The key of a font the page ships. It is a key, not a font family.","enum":["system","inter","roboto","open_sans","lato","montserrat","poppins","nunito","dm_sans","source_serif"],"type":"string"},"logo_url":{"description":"The logo. https only.","format":"uri","maxLength":2048,"type":"string"},"public_start":{"description":"Whether a visitor may start a remittance from the page without a session you created.","type":"boolean"},"radius":{"description":"The corner radius, from a fixed scale.","enum":["none","sm","md","lg","full"],"type":"string"},"support":{"$ref":"#/components/schemas/HostedSupport"}},"type":"object"},"HostedSession":{"additionalProperties":false,"properties":{"beneficiary_id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"customer_id":{"description":"The id of the customer who sends the money.","pattern":"^cus_[0-9a-z]+$","type":"string"},"expires_at":{"description":"Until when the session takes changes.","format":"date-time","type":"string"},"funding_account_id":{"description":"The id of the funding account the customer pays into.","pattern":"^fa_[0-9a-z]+$","type":"string"},"id":{"description":"The id of the hosted session.","pattern":"^hs_[0-9a-z]+$","type":"string"},"origin":{"description":"tenant: you created it. public: a visitor started it from the page.","enum":["tenant","public"],"type":"string"},"page_id":{"description":"The public id of the page.","pattern":"^hp_[0-9a-z]+$","type":"string"},"path":{"description":"The path, on the page's host, the session is served at: /s/<token>. Present only in the response that creates the session.","type":"string"},"payment_reported_at":{"description":"When the customer said they paid. A statement, not a confirmation.","format":"date-time","type":"string"},"prefill":{"$ref":"#/components/schemas/HostedSessionPrefill"},"quote_id":{"description":"The id of the quote in use.","pattern":"^quo_[0-9a-z]+$","type":"string"},"remittance_id":{"description":"The id of the session's remittance.","pattern":"^rem_[0-9a-z]+$","type":"string"},"status":{"description":"open: it takes changes. submitted: its remittance exists. expired: it ran out without one.","enum":["open","submitted","expired"],"type":"string"},"token":{"description":"The session token. Present only in the response that creates the session.","pattern":"^hps_(test|live)_[a-z0-9]{12}_[0-9a-f]{64}$","type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","status","origin","page_id","expires_at","created_at","updated_at"],"type":"object"},"HostedSessionCreate":{"additionalProperties":false,"properties":{"customer_id":{"description":"The id of the existing customer who sends the money. The session then cannot change its sender.","pattern":"^cus_[0-9a-z]+$","type":"string"},"expires_in":{"description":"For how many seconds the session takes changes. Default 86400. It stays readable afterwards.","maximum":604800,"minimum":300,"type":"integer"},"prefill":{"$ref":"#/components/schemas/HostedSessionPrefill"}},"type":"object"},"HostedSessionPrefill":{"additionalProperties":false,"description":"What the page starts from. Hints: the customer may change them.","properties":{"amount":{"description":"The amount the page starts from. With amount_side. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"amount_side":{"description":"Which amount it is.","enum":["source","destination"],"type":"string"},"destination_country":{"description":"ISO 3166-1 alpha-2 of the destination.","type":"string"},"destination_currency":{"description":"The currency the beneficiary receives.","type":"string"},"method":{"description":"The payout method.","type":"string"},"source_currency":{"description":"The currency the customer pays in.","type":"string"}},"type":"object"},"HostedSupport":{"additionalProperties":false,"properties":{"email":{"description":"An address customers can write to.","type":"string"},"phone":{"description":"A phone number in international form, digits with an optional leading +.","type":"string"},"url":{"description":"An https page where customers get help.","format":"uri","type":"string"}},"type":"object"},"Me":{"additionalProperties":false,"properties":{"account":{"additionalProperties":false,"properties":{"id":{"description":"The id of the account the request acts for.","pattern":"^acct_[0-9a-z]+$","type":"string"},"name":{"description":"The account's name.","type":"string"},"status":{"description":"The account's status: always active when it answers.","enum":["active","suspended","closed"],"type":"string"}},"required":["id","name","status"],"type":"object"},"api_key":{"additionalProperties":false,"properties":{"id":{"description":"The id of the API key.","pattern":"^key_[0-9a-z]+$","type":"string"},"label":{"description":"The name the key was issued with.","type":"string"},"prefix":{"description":"The public start of the key. Never the secret.","type":"string"}},"required":["id","prefix"],"type":"object"},"environment":{"description":"The environment that answered.","enum":["sandbox","live"],"type":"string"},"kind":{"description":"Who is calling: an API key, or a member of the account (a person signed in to the dashboard).","enum":["api_key","member"],"type":"string"},"member":{"additionalProperties":false,"properties":{"bound_at":{"description":"When the person first signed in and the invitation was bound.","format":"date-time","type":"string"},"email":{"description":"The member's address: the verified primary address the invitation was bound to.","type":"string"},"id":{"description":"The id of the member.","pattern":"^mem_[0-9a-z]+$","type":"string"},"role":{"description":"The member's role. owner, admin and developer hold read and write; viewer read. owner and admin manage members.","enum":["owner","admin","developer","viewer"],"type":"string"}},"required":["id","email","role","bound_at"],"type":"object"},"memberships":{"items":{"additionalProperties":false,"properties":{"account_id":{"description":"The id of the account.","pattern":"^acct_[0-9a-z]+$","type":"string"},"account_name":{"description":"The account's name.","type":"string"},"member_id":{"description":"The id of the membership.","pattern":"^mem_[0-9a-z]+$","type":"string"},"role":{"description":"The person's role in that account.","enum":["owner","admin","developer","viewer"],"type":"string"}},"required":["account_id","account_name","member_id","role"],"type":"object"},"type":"array"},"scopes":{"items":{"description":"What the caller may do: the key's scopes, or the member's role's.","enum":["read","write"],"type":"string"},"type":"array"}},"required":["kind","account","environment","scopes"],"type":"object"},"Member":{"additionalProperties":false,"properties":{"bound_at":{"description":"When the person first signed in. Absent: never.","format":"date-time","type":"string"},"created_at":{"description":"When the address was first invited.","format":"date-time","type":"string"},"email":{"description":"The address invited.","type":"string"},"id":{"description":"The id of the member.","pattern":"^mem_[0-9a-z]+$","type":"string"},"invitation_expires_at":{"description":"While invited: when the invitation stops being accepted.","format":"date-time","type":"string"},"role":{"description":"The member's role.","enum":["owner","admin","developer","viewer"],"type":"string"},"status":{"description":"invited: waiting for the person's first sign-in; active; disabled: refused at once.","enum":["invited","active","disabled"],"type":"string"},"updated_at":{"description":"When the member last changed.","format":"date-time","type":"string"}},"required":["id","email","role","status","created_at","updated_at"],"type":"object"},"MemberCreate":{"additionalProperties":false,"properties":{"email":{"description":"The address to invite. The person signs in with it, verified.","type":"string"},"role":{"description":"The role the member will have.","enum":["owner","admin","developer","viewer"],"type":"string"}},"required":["email","role"],"type":"object"},"MemberUpdate":{"additionalProperties":false,"properties":{"role":{"description":"A new role.","enum":["owner","admin","developer","viewer"],"type":"string"},"status":{"description":"active or disabled.","enum":["active","disabled"],"type":"string"}},"type":"object"},"Metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Your own references: at most 20 keys of the form [a-z][a-z0-9_]{0,39}, string values of at most 500 characters. Never personal data.","maxProperties":20,"propertyNames":{"pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":"object"},"PayIn":{"additionalProperties":false,"properties":{"amount":{"description":"What was credited, or will be. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"completed_at":{"description":"When it was credited.","format":"date-time","type":"string"},"created_at":{"description":"When it was first seen.","format":"date-time","type":"string"},"currency":{"description":"The currency credited.","type":"string"},"failure_code":{"description":"Why it failed.","type":"string"},"funding_account_id":{"description":"The id of the funding account.","pattern":"^fa_[0-9a-z]+$","type":"string"},"id":{"description":"The id of the pay-in.","pattern":"^pin_[0-9a-z]+$","type":"string"},"paid":{"additionalProperties":false,"description":"What the payer paid, when the provider reports it apart from what was credited: a payer paying USD by bank transfer into an account credited in USDT. Evidence beside the credit; the balance is credited amount in currency.","properties":{"amount":{"description":"What the payer paid. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"What the payer paid in.","type":"string"}},"required":["amount","currency"],"type":"object"},"refundable":{"description":"What can still be refunded: the credited amount minus refunded. Present once the amount is known. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"refunded":{"description":"What has been sent back to the payer so far, refunds in flight included. Present once the amount is known. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"status":{"description":"processing until the deposit is verified and credited. completed: credited to the balance. failed: it will not arrive.","enum":["processing","completed","failed"],"type":"string"}},"required":["id","status","funding_account_id","created_at"],"type":"object"},"Payout":{"additionalProperties":false,"properties":{"beneficiary":{"additionalProperties":false,"description":"Whom the payout pays, as you recognise it. In a list and when one payout is retrieved; not in the response that creates it, nor in an event.","properties":{"account_hint":{"description":"The last four digits of the account, never more. Absent when the account has fewer than eight digits or none (an e-mail key).","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 of the account, when it has one.","type":"string"},"display_name":{"description":"Your own name for the beneficiary (its label) or, when you gave none, the account holder's name. Absent when it has neither.","type":"string"},"id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"method":{"description":"The payout method of the account.","type":"string"}},"required":["id","method"],"type":"object"},"beneficiary_id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"cancellation":{"additionalProperties":false,"description":"The latest cancellation asked for, if any. Only when one payout is retrieved and in the answer to POST /v1/payouts/{id}/cancel.","properties":{"decided_at":{"description":"When it was decided. Absent while it is requested.","format":"date-time","type":"string"},"not_cancelled_reason":{"description":"Why it was refused, when it was.","enum":["in_review","submitted","outcome_uncertain","already_completed","already_failed","already_returned","managed_by_batch","managed_by_remittance"],"type":"string"},"requested_at":{"description":"When it was asked for.","format":"date-time","type":"string"},"requested_via":{"description":"Who asked. api: you, through POST /v1/payouts/{id}/cancel. batch: the cancellation of the payout's batch. operator: the platform's operations team.","enum":["api","batch","operator"],"type":"string"},"status":{"description":"requested: asked for, waiting for the platform's decision (the payout is not sent meanwhile). cancelled: the payout was cancelled. refused: the payout could not be cancelled; not_cancelled_reason says why, and the payout goes on.","enum":["requested","cancelled","refused"],"type":"string"}},"required":["status","requested_via","requested_at"],"type":"object"},"cancelled_at":{"description":"When it was cancelled. Only when one payout is retrieved.","format":"date-time","type":"string"},"completed_at":{"description":"When the beneficiary was paid. Only when one payout is retrieved.","format":"date-time","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 of the beneficiary's account, when it has one. Only when one payout is retrieved.","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"description":{"description":"The note given at creation. Only when one payout is retrieved (GET /v1/payouts/{id}): never in the response that creates it, in a list or in an event.","type":"string"},"destination":{"additionalProperties":false,"properties":{"amount":{"description":"The amount. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency code.","type":"string"}},"required":["amount","currency"],"type":"object"},"failed_at":{"description":"When it failed. Only when one payout is retrieved.","format":"date-time","type":"string"},"failure_code":{"description":"Why it failed, when it did: insufficient_funds, no_route, risk_rejected, or a provider's reason. A cancelled payout has cancelled_before_submission; so has a payout cancelled through its batch before cancelled existed, which is failed.","type":"string"},"id":{"description":"The id of the payout.","pattern":"^pout_[0-9a-z]+$","type":"string"},"method":{"description":"The method.","type":"string"},"quote_id":{"description":"The id of the quote used.","pattern":"^quo_[0-9a-z]+$","type":"string"},"rate":{"description":"Destination units per source unit.","type":"string"},"refund":{"additionalProperties":false,"properties":{"amount":{"description":"What went back to the available balance so far, in the source currency. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The source currency.","type":"string"},"status":{"description":"settled: the amount is final. in_review: what the return did not recover is being attributed under your contract; the amount can still change, and payout.return_settled follows.","enum":["settled","in_review"],"type":"string"}},"required":["amount","currency","status"],"type":"object"},"returned_at":{"description":"When it was returned after completion. Only when one payout is retrieved.","format":"date-time","type":"string"},"risk_decision_id":{"description":"The platform's risk decision about the payout, when one was taken. Quote it to support.","pattern":"^rsk_[0-9a-z]+$","type":"string"},"risk_status":{"description":"What the risk controls decided. allowed: nothing to do. in_review: funds reserved, a person reviews the payout before it is sent; risk.review_required was published. approved: reviewed and released for execution. rejected: reviewed and refused; the payout failed with risk_rejected and its funds were returned.","enum":["allowed","in_review","approved","rejected"],"type":"string"},"source":{"additionalProperties":false,"properties":{"currency":{"description":"The currency debited.","type":"string"},"platform_fee":{"description":"The platform's fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"principal":{"description":"What is converted or sent. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"tenant_markup":{"description":"The account's own markup, credited to its earnings. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"total":{"description":"What is debited from the balance: principal + platform_fee + tenant_markup. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","principal","platform_fee","tenant_markup","total"],"type":"object"},"status":{"description":"processing: accepted, funds reserved, outcome not final yet. verification_pending: it was submitted and its outcome is uncertain; funds stay reserved while it is verified with the provider, and nothing sends it again or in its place (no request retries or cancels it); it ends completed or failed on the provider's evidence. completed: the beneficiary was paid. failed: not executed, funds returned. returned: paid, then sent back by the beneficiary's bank; see refund for what came back to the balance. cancelled: cancelled before anything of it reached a provider (POST /v1/payouts/{id}/cancel, an operator, or its batch's cancellation); funds returned.","enum":["processing","verification_pending","completed","failed","returned","cancelled"],"type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","status","method","beneficiary_id","source","destination","rate","created_at","updated_at"],"type":"object"},"PayoutBatch":{"additionalProperties":false,"properties":{"cancellation":{"additionalProperties":false,"properties":{"cancelled":{"description":"Items cancelled.","type":"integer"},"finished_at":{"description":"When every item had its decision.","format":"date-time","type":"string"},"not_cancelled":{"items":{"additionalProperties":false,"properties":{"count":{"description":"How many.","type":"integer"},"reason":{"description":"Why these items were left as they were.","enum":["already_refused","in_review","submitted","outcome_uncertain","already_completed","already_failed","already_returned"],"type":"string"}},"required":["reason","count"],"type":"object"},"type":"array"},"requested_at":{"description":"When the cancellation was requested.","format":"date-time","type":"string"},"status":{"description":"in_progress: items are still being decided. finished: every item has its decision.","enum":["in_progress","finished"],"type":"string"},"undecided":{"description":"Items not decided yet.","type":"integer"}},"required":["status","requested_at","cancelled","undecided","not_cancelled"],"type":"object"},"completed_at":{"description":"When the batch reached its final status.","format":"date-time","type":"string"},"created_at":{"description":"When it was accepted.","format":"date-time","type":"string"},"id":{"description":"The id of the payout batch.","pattern":"^pbat_[0-9a-z]+$","type":"string"},"item_count":{"description":"How many items the batch has.","type":"integer"},"label":{"description":"Your own name for the batch.","type":"string"},"status":{"description":"accepted: its items are being turned into payouts. processing: every item is a payout, refused or cancelled; payouts are in flight. completed: every payout completed. completed_with_failures: every payout is final and at least one item was refused, failed or returned. cancelled: a cancellation cancelled at least one item and no payout of the batch was executed. partially_cancelled: a cancellation cancelled at least one item and at least one payout was executed.","enum":["accepted","processing","completed","completed_with_failures","cancelled","partially_cancelled"],"type":"string"},"summary":{"additionalProperties":false,"properties":{"cancelled":{"description":"Items cancelled by the batch's cancellation: before they were issued, or with their payout before it reached a provider.","type":"integer"},"failed":{"description":"Payouts that failed on their own, insufficient_funds included.","type":"integer"},"pending":{"description":"Payouts accepted and waiting for their outcome, a risk review included.","type":"integer"},"queued":{"description":"Items not yet issued.","type":"integer"},"refused":{"description":"Items that never became a payout (see their error_code).","type":"integer"},"returned":{"description":"Payouts returned after completion.","type":"integer"},"succeeded":{"description":"Payouts completed.","type":"integer"},"uncertain":{"description":"Payouts whose outcome is being established (a single payout shows these as processing). Never sent again and never cancelled; the batch stays processing until they are resolved.","type":"integer"}},"required":["queued","refused","pending","uncertain","succeeded","failed","returned","cancelled"],"type":"object"},"totals":{"items":{"additionalProperties":false,"properties":{"cancelled_total":{"description":"The part of total of the payouts the cancellation cancelled: what their holds gave back to the available balance. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"completed_total":{"description":"The part of total of the completed payouts. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"count":{"description":"The batch's payouts in this currency, whatever their status.","type":"integer"},"currency":{"description":"The source currency.","type":"string"},"platform_fee":{"description":"The sum of their platform fees. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"principal":{"description":"The sum of their principals. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"tenant_markup":{"description":"The sum of their markups. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"total":{"description":"The sum of their totals. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","count","principal","platform_fee","tenant_markup","total","completed_total","cancelled_total"],"type":"object"},"type":"array"}},"required":["id","status","item_count","summary","totals","created_at"],"type":"object"},"PayoutBatchCreate":{"additionalProperties":false,"properties":{"items":{"description":"The payouts, in the order they are issued.","items":{"additionalProperties":false,"properties":{"amount":{"description":"The fixed amount, when no quote is given. Priced when the item is issued. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"amount_side":{"description":"Which amount is fixed, when no quote is given.","enum":["source","destination"],"type":"string"},"beneficiary_id":{"description":"The id of the beneficiary to pay.","pattern":"^ben_[0-9a-z]+$","type":"string"},"description":{"description":"A note for your own records, given to the payout.","maxLength":500,"type":"string"},"quote_id":{"description":"The id of the quote whose terms apply. Send this or source_currency, amount and amount_side.","pattern":"^quo_[0-9a-z]+$","type":"string"},"reference":{"description":"Your own identifier for the item, returned with it.","pattern":"^[A-Za-z0-9._:/#-]{1,64}$","type":"string"},"source_currency":{"description":"The currency debited, when no quote is given.","type":"string"}},"required":["beneficiary_id"],"type":"object"},"maxItems":1000,"minItems":1,"type":"array"},"label":{"description":"Your own name for the batch. Not for personal data.","maxLength":100,"type":"string"}},"required":["items"],"type":"object"},"PayoutBatchItem":{"additionalProperties":false,"properties":{"amount":{"description":"The fixed amount, when priced. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"amount_side":{"description":"Which amount was fixed, when priced.","enum":["source","destination"],"type":"string"},"beneficiary_id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"cancelled_at":{"description":"When the batch's cancellation cancelled the item.","format":"date-time","type":"string"},"error_code":{"description":"Why the item was refused.","enum":["beneficiary_not_found","unsupported_method","method_unavailable","quote_not_found","quote_expired","quote_already_used","quote_mismatch","invalid_amount","amount_too_small","pricing_unavailable","limit_exceeded","customer_not_active","invalid_request","idempotency_conflict"],"type":"string"},"failure_code":{"description":"The payout's failure_code, when it failed.","type":"string"},"index":{"description":"The item's position in the request, from 0.","type":"integer"},"not_cancelled_reason":{"description":"Why the batch's cancellation left the item as it was.","enum":["already_refused","in_review","submitted","outcome_uncertain","already_completed","already_failed","already_returned"],"type":"string"},"payout_id":{"description":"The id of the payout the item became.","pattern":"^pout_[0-9a-z]+$","type":"string"},"quote_id":{"description":"The id of the quote named.","pattern":"^quo_[0-9a-z]+$","type":"string"},"reference":{"description":"Your own identifier for the item.","type":"string"},"source_currency":{"description":"The currency debited, when priced.","type":"string"},"status":{"description":"queued: not issued yet. refused: never became a payout (error_code). cancelled: cancelled by the batch's cancellation. Otherwise its payout's status.","enum":["queued","refused","cancelled","processing","verification_pending","completed","failed","returned"],"type":"string"}},"required":["index","status","beneficiary_id"],"type":"object"},"PayoutCreate":{"additionalProperties":false,"properties":{"amount":{"description":"The fixed amount, when no quote is given. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"amount_side":{"description":"Which amount is fixed, when no quote is given.","enum":["source","destination"],"type":"string"},"beneficiary_id":{"description":"The id of the beneficiary to pay.","pattern":"^ben_[0-9a-z]+$","type":"string"},"description":{"description":"A note for your own records.","maxLength":500,"type":"string"},"quote_id":{"description":"The id of the quote whose terms apply. Send this or source_currency, amount and amount_side.","pattern":"^quo_[0-9a-z]+$","type":"string"},"source_currency":{"description":"The currency debited, when no quote is given.","type":"string"}},"required":["beneficiary_id"],"type":"object"},"Quote":{"additionalProperties":false,"properties":{"created_at":{"description":"When it was priced.","format":"date-time","type":"string"},"destination":{"additionalProperties":false,"properties":{"amount":{"description":"The amount. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency code.","type":"string"}},"required":["amount","currency"],"type":"object"},"expires_at":{"description":"Until when it can be used.","format":"date-time","type":"string"},"id":{"description":"The id of the quote.","pattern":"^quo_[0-9a-z]+$","type":"string"},"method":{"description":"The payout method the quote is for.","type":"string"},"payer":{"additionalProperties":false,"description":"What the payer pays, in their own currency, when the quote was priced from a payer's side.","properties":{"amount":{"description":"What the payer pays: principal + fee. Rounded up: never less than what funds the payout. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"What the payer pays in.","type":"string"},"effective_rate":{"description":"Destination units per payer unit: the conversion of the payer's currency into source.currency times the payout's rate.","type":"string"},"fee":{"description":"Every fee, in the payer's currency, derived exactly: amount - principal. It holds the payout's fee and your markup, the pay-in method's fee and the rounding of the conversion. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"method":{"description":"The pay-in method the payer pays by.","type":"string"},"principal":{"description":"What of amount buys what the beneficiary receives, before any fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","amount","principal","fee","effective_rate"],"type":"object"},"rate":{"description":"Destination units per source unit, all margins included.","type":"string"},"source":{"additionalProperties":false,"properties":{"currency":{"description":"The currency debited.","type":"string"},"platform_fee":{"description":"The platform's fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"principal":{"description":"What is converted or sent. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"tenant_markup":{"description":"The account's own markup, credited to its earnings. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"total":{"description":"What is debited from the balance: principal + platform_fee + tenant_markup. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","principal","platform_fee","tenant_markup","total"],"type":"object"},"status":{"description":"open: can still be used. used: an operation took it. expired: its time passed unused.","enum":["open","used","expired"],"type":"string"}},"required":["id","status","source","destination","rate","created_at","expires_at"],"type":"object"},"QuoteCreate":{"additionalProperties":false,"properties":{"amount":{"description":"The fixed amount. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"amount_side":{"description":"Which amount is fixed: what is paid (source) or what is received (destination).","enum":["source","destination"],"type":"string"},"destination_currency":{"description":"The currency delivered.","type":"string"},"method":{"description":"The payout method the quote is for. Omit for a conversion with no payout rail.","type":"string"},"payer":{"additionalProperties":false,"description":"Price the quote from a payer's side: the payer pays in currency by method, converted into source_currency (an on-ramp priced with the platform's rates, margins and the method's pay_in fee), and source_currency pays the beneficiary. With amount_side source, amount is in the payer's currency: what the payer sends to be converted, fees on top. The answer says what the payer pays (payer).","properties":{"currency":{"description":"What the payer pays in (USD).","type":"string"},"method":{"description":"The pay-in method the payer pays by (bank_transfer). Only optional when currency is source_currency.","type":"string"}},"required":["currency","method"],"type":"object"},"source_currency":{"description":"The currency debited from the balance.","type":"string"}},"required":["source_currency","destination_currency","amount","amount_side"],"type":"object"},"ReconciliationException":{"additionalProperties":false,"properties":{"closed_at":{"description":"When it was resolved or dismissed.","format":"date-time","type":"string"},"id":{"description":"The id of the reconciliation exception.","pattern":"^rex_[0-9a-z]+$","type":"string"},"kind":{"description":"What is inconsistent. missing_at_provider: the provider has no record of something we booked. missing_internally: the provider moved money we have no record of. duplicate: two operations answer for one movement. amount_mismatch, currency_mismatch: the operation and its evidence disagree. wrong_state: the operation's status contradicts the evidence. unknown_outcome: nobody can tell yet whether it was executed. late_settlement: a settlement is overdue. unexpected_return: money came back that no return accounts for. unexplained_credit: a credit to the balance that no operation explains. balance_mismatch, hold_mismatch: a balance or the funds held do not add up to the operations behind them.","enum":["missing_at_provider","missing_internally","duplicate","amount_mismatch","currency_mismatch","wrong_state","unknown_outcome","late_settlement","unexpected_return","unexplained_credit","balance_mismatch","hold_mismatch"],"type":"string"},"opened_at":{"description":"When it was opened.","format":"date-time","type":"string"},"operation_id":{"description":"The id of the operation it is about.","type":"string"},"operation_type":{"description":"The kind of operation it is about.","enum":["payin","payout","withdrawal","refund","settlement","remittance"],"type":"string"},"status":{"description":"open: found, not yet taken. assigned: an operator owns it. investigating: being looked into. resolved: explained and dealt with. dismissed: found not to be a problem.","enum":["open","assigned","investigating","resolved","dismissed"],"type":"string"}},"required":["id","kind","status","operation_type","operation_id","opened_at"],"type":"object"},"Refund":{"additionalProperties":false,"properties":{"amount":{"description":"What is sent back. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"completed_at":{"description":"When the payer got the money.","format":"date-time","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"currency":{"description":"The pay-in's currency.","type":"string"},"failure_code":{"description":"Why it failed, when it did: risk_rejected, not_submitted, provider_unavailable, invalid_instruction, resolved_not_executed, or a provider's reason.","type":"string"},"id":{"description":"The id of the refund.","pattern":"^rfd_[0-9a-z]+$","type":"string"},"note":{"description":"The note given at creation.","type":"string"},"payin_id":{"description":"The id of the pay-in refunded.","pattern":"^pin_[0-9a-z]+$","type":"string"},"reason_code":{"description":"Why.","enum":["requested_by_customer","duplicate","fraud","other"],"type":"string"},"risk_decision_id":{"description":"The platform's risk decision about the refund, when one was taken. Quote it to support.","pattern":"^rsk_[0-9a-z]+$","type":"string"},"risk_status":{"description":"What the risk controls decided. allowed: nothing to do. in_review: the refund is pending_review; risk.review_required was published. approved: reviewed and released for execution; refund.approved was published. rejected: reviewed and refused; the refund failed with risk_rejected and its funds were returned.","enum":["allowed","in_review","approved","rejected"],"type":"string"},"status":{"description":"pending_review: accepted and held for a review by the platform's risk controls; the funds are reserved and nothing is sent to the payer until a person approves it (then processing) or rejects it (then failed with risk_rejected, funds returned to the balance). processing: accepted, funds reserved, outcome not final yet. completed: the payer got the money. failed: not executed, funds returned to the balance.","enum":["pending_review","processing","completed","failed"],"type":"string"}},"required":["id","status","payin_id","amount","currency","reason_code","created_at"],"type":"object"},"RefundCreate":{"additionalProperties":false,"properties":{"amount":{"description":"What to send back, in the pay-in's currency. Omit to refund everything that is left. A partial amount needs the method to support partial refunds. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"note":{"description":"A note for your own records. Stored as written: do not put personal data in it.","maxLength":500,"type":"string"},"payin_id":{"description":"The id of the credited pay-in to refund.","pattern":"^pin_[0-9a-z]+$","type":"string"},"reason_code":{"description":"Why.","enum":["requested_by_customer","duplicate","fraud","other"],"type":"string"}},"required":["payin_id","reason_code"],"type":"object"},"Remittance":{"additionalProperties":false,"properties":{"beneficiary":{"additionalProperties":false,"description":"Whom the remittance pays, as you recognise it. In a list and when one remittance is retrieved; not in the response that creates it, nor in an event.","properties":{"account_hint":{"description":"The last four digits of the account, never more. Absent when the account has fewer than eight digits or none (an e-mail key).","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 of the account, when it has one.","type":"string"},"display_name":{"description":"Your own name for the beneficiary (its label) or, when you gave none, the account holder's name. Absent when it has neither.","type":"string"},"id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"method":{"description":"The payout method of the account.","type":"string"}},"required":["id","method"],"type":"object"},"beneficiary_id":{"description":"The id of the beneficiary.","pattern":"^ben_[0-9a-z]+$","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"customer_id":{"description":"The id of the customer who sends the money.","pattern":"^cus_[0-9a-z]+$","type":"string"},"destination":{"additionalProperties":false,"properties":{"amount":{"description":"The amount. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency code.","type":"string"}},"required":["amount","currency"],"type":"object"},"failure_code":{"description":"Why it failed: quote_expired, risk_blocked, risk_rejected (held for review and rejected by a reviewer), limit_exceeded, customer_not_active, insufficient_funds, or the payout's own failure_code.","type":"string"},"funding_account_id":{"description":"The id of the funding account the deposit is expected into.","pattern":"^fa_[0-9a-z]+$","type":"string"},"id":{"description":"The id of the remittance.","pattern":"^rem_[0-9a-z]+$","type":"string"},"method":{"description":"The payout method.","type":"string"},"payer":{"additionalProperties":false,"description":"What the payer pays, in their own currency, when its quote was priced from a payer's side (a hosted remittance always is). source is what the balance must be credited with; the deposit is credited by the provider in source.currency.","properties":{"amount":{"description":"What the payer pays: principal + fee. Rounded up: never less than what funds the payout. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"What the payer pays in.","type":"string"},"effective_rate":{"description":"Destination units per payer unit: the conversion of the payer's currency into source.currency times the payout's rate.","type":"string"},"fee":{"description":"Every fee, in the payer's currency, derived exactly: amount - principal. It holds the payout's fee and your markup, the pay-in method's fee and the rounding of the conversion. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"method":{"description":"The pay-in method the payer pays by.","type":"string"},"principal":{"description":"What of amount buys what the beneficiary receives, before any fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","amount","principal","fee","effective_rate"],"type":"object"},"payin_id":{"description":"The id of the pay-in that funded it.","pattern":"^pin_[0-9a-z]+$","type":"string"},"payout_id":{"description":"The id of the payout that pays the beneficiary.","pattern":"^pout_[0-9a-z]+$","type":"string"},"quote_id":{"description":"The id of the quote.","pattern":"^quo_[0-9a-z]+$","type":"string"},"rate":{"description":"Destination units per source unit, as quoted.","type":"string"},"review_reason":{"description":"Why it is in review. underfunded: the deposit credited less than the quote's total. screening: the platform's risk controls hold it; a reviewer approves it (it is paid) or rejects it (it fails with risk_rejected). payout_unknown: the payout's outcome has been uncertain for too long; it is still followed and nothing else is sent.","enum":["underfunded","screening","payout_unknown"],"type":"string"},"sender":{"additionalProperties":false,"description":"Who sends the money, as you registered them. In a list and when one remittance is retrieved; not in the response that creates it, nor in an event. Absent without a customer.","properties":{"display_name":{"description":"The customer's display_name, as you registered it.","type":"string"},"id":{"description":"The id of the customer who sends the money.","pattern":"^cus_[0-9a-z]+$","type":"string"}},"required":["id","display_name"],"type":"object"},"source":{"additionalProperties":false,"properties":{"currency":{"description":"The currency debited.","type":"string"},"platform_fee":{"description":"The platform's fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"principal":{"description":"What is converted or sent. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"tenant_markup":{"description":"The account's own markup, credited to its earnings. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"total":{"description":"What is debited from the balance: principal + platform_fee + tenant_markup. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"}},"required":["currency","principal","platform_fee","tenant_markup","total"],"type":"object"},"status":{"description":"awaiting_funds: waiting for the deposit. processing: funded and being paid. verification_pending: its payout was submitted and its outcome is uncertain; funds stay reserved while it is verified, and nothing is sent again (after a while the remittance goes to review with review_reason payout_unknown). review: a person must look (review_reason). completed: the beneficiary was paid. failed: nothing was paid; what the deposit credited stays in the balance. returned: paid, then sent back; see the payout.","enum":["awaiting_funds","processing","verification_pending","review","completed","failed","returned"],"type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","status","beneficiary_id","quote_id","method","source","destination","rate","created_at","updated_at"],"type":"object"},"RemittanceCreate":{"additionalProperties":false,"properties":{"beneficiary_id":{"description":"The id of the beneficiary to pay.","pattern":"^ben_[0-9a-z]+$","type":"string"},"customer_id":{"description":"The id of the customer who sends the money. Optional.","pattern":"^cus_[0-9a-z]+$","type":"string"},"quote_id":{"description":"The id of the quote whose terms apply. Its method and destination currency must be the beneficiary's; its source currency is what the deposit is credited in.","pattern":"^quo_[0-9a-z]+$","type":"string"},"source":{"additionalProperties":false,"properties":{"funding_account_id":{"description":"The id of the funding account whose next deposit funds the remittance. Send this or payin_id.","pattern":"^fa_[0-9a-z]+$","type":"string"},"payin_id":{"description":"The id of the pay-in that already credited the balance. Send this or funding_account_id.","pattern":"^pin_[0-9a-z]+$","type":"string"}},"type":"object"}},"required":["quote_id","beneficiary_id","source"],"type":"object"},"ReportRow":{"additionalProperties":{"type":["string","null"]},"description":"One row of a report: its columns, in the report's order. Amounts are decimal strings in the currency's precision, with a leading minus when negative; timestamps are RFC 3339 in UTC; ids are public ids; null when the row has no value.","type":"object"},"SandboxDeposit":{"additionalProperties":false,"properties":{"amount":{"description":"The amount that arrives, in currency. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"What amount is in. The account's settlement_currency (the default): that amount is credited. Or the account's currency, what the payer pays in: the simulated provider converts it into the settlement currency at its indicative rate, rounded down, and the pay-in records both (amount credited, paid).","type":"string"},"funding_account_id":{"description":"The id of the active funding account.","pattern":"^fa_[0-9a-z]+$","type":"string"}},"required":["funding_account_id","amount"],"type":"object"},"SandboxDepositAccepted":{"additionalProperties":false,"properties":{"amount":{"description":"The amount, as stated. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The currency it was stated in.","type":"string"},"funding_account_id":{"description":"The funding account.","type":"string"},"status":{"description":"The deposit was reported; it is credited asynchronously.","enum":["accepted"],"type":"string"}},"required":["status","funding_account_id","amount","currency"],"type":"object"},"Settlement":{"additionalProperties":false,"properties":{"adjustments":{"description":"The adjustments applied to the balance in the period. Signed. A decimal string in the currency's precision, with a leading minus when negative.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":"string"},"created_at":{"description":"When the period was opened.","format":"date-time","type":"string"},"currency":{"description":"The currency.","type":"string"},"failure_code":{"description":"Why it failed.","type":"string"},"fees":{"description":"The platform's settlement fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"gross":{"description":"What the balance gained through operations in the period, less what it spent: pay-ins, returns, payouts' holds and their releases, conversions. Signed. A decimal string in the currency's precision, with a leading minus when negative.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":"string"},"hold_reason":{"description":"Why it is on hold: insufficient_available, no_route, no_destination, operator. On a pending settlement: why a settlement that was due could not be generated (no_destination: the schedule cannot be executed).","enum":["insufficient_available","no_route","no_destination","operator"],"type":"string"},"id":{"description":"The id of the settlement.","pattern":"^stl_[0-9a-z]+$","type":"string"},"items":{"items":{"additionalProperties":false,"properties":{"amount":{"description":"The journal's signed contribution. A decimal string in the currency's precision, with a leading minus when negative.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":"string"},"class":{"description":"Which figure the journal contributes to.","enum":["gross","fee","adjustment"],"type":"string"},"journal_id":{"description":"The id of the ledger journal.","pattern":"^jrn_[0-9a-z]+$","type":"string"},"purpose":{"description":"What the journal was: funding_deposit, payout_reserve, reversal, adjustment_credit, ...","type":"string"}},"required":["journal_id","class","purpose","amount"],"type":"object"},"type":"array"},"net":{"description":"gross - fees + adjustments: what is transferred. A decimal string in the currency's precision, with a leading minus when negative.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":"string"},"period_end":{"description":"When the period ends or ended. Absent while the period is pending under a manual or threshold schedule: it ends when the settlement is generated.","format":"date-time","type":"string"},"period_start":{"description":"When the period started.","format":"date-time","type":"string"},"reference":{"description":"The reference of the transfer, once known.","type":"string"},"schedule_id":{"description":"The id of the schedule the settlement was closed under.","pattern":"^stls_[0-9a-z]+$","type":"string"},"settled_at":{"description":"When it was settled.","format":"date-time","type":"string"},"status":{"description":"pending: the period is open and the figures still accrue. ready: the period closed; the figures are final. processing: the net left the balance and is being transferred. settled: the transfer is evidenced. on_hold: stopped before any money moved. failed: the transfer did not happen and the net is back in the balance. disputed: the transfer's evidence does not match the figures; being resolved.","enum":["pending","ready","processing","settled","on_hold","failed","disputed"],"type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","status","currency","period_start","gross","fees","adjustments","net","schedule_id","created_at","updated_at"],"type":"object"},"SettlementConfiguration":{"additionalProperties":false,"properties":{"currencies":{"items":{"additionalProperties":false,"properties":{"automatic":{"description":"Whether settlements are generated without anyone asking: the state is active and the schedule is not manual.","type":"boolean"},"currency":{"description":"The currency.","type":"string"},"reason":{"description":"Why the schedule cannot be executed. no_destination: its destination is not an active account of yours in the currency. invalid_cutoff: its cutoff cannot be computed.","enum":["no_destination","invalid_cutoff"],"type":"string"},"schedule":{"$ref":"#/components/schemas/SettlementSchedule"},"state":{"description":"unconfigured: no schedule is in force; nothing is settled automatically. active: a schedule is in force and can be executed. unexecutable: a schedule is in force and cannot be executed now.","enum":["unconfigured","active","unexecutable"],"type":"string"}},"required":["currency","state","automatic"],"type":"object"},"type":"array"},"state":{"description":"unconfigured: no settlement schedule is in force for the account in any currency; nothing is settled automatically. configured: at least one is; see currencies.","enum":["unconfigured","configured"],"type":"string"}},"required":["state","currencies"],"type":"object"},"SettlementDestination":{"additionalProperties":false,"properties":{"country":{"description":"ISO 3166-1 alpha-2, when the method has a country.","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"currency":{"description":"The currency.","type":"string"},"id":{"description":"The id of the settlement destination.","pattern":"^dest_[0-9a-z]+$","type":"string"},"method":{"description":"The method.","type":"string"},"status":{"description":"active: withdrawals can be sent to it. archived: kept for the record and no longer used.","enum":["active","archived"],"type":"string"},"verified":{"description":"Whether the platform verified that the account is yours.","type":"boolean"}},"required":["id","method","currency","status","verified","created_at"],"type":"object"},"SettlementDestinationCreate":{"additionalProperties":false,"properties":{"currency":{"description":"The currency of the account. A withdrawal to it is in this currency.","type":"string"},"details":{"additionalProperties":true,"description":"The account details the method requires, as for a beneficiary. Write-only: never returned.","type":"object"},"method":{"description":"The method the account is reached by, e.g. spei.","type":"string"}},"required":["method","currency","details"],"type":"object"},"SettlementSchedule":{"additionalProperties":false,"properties":{"closed_at":{"description":"When it was replaced.","format":"date-time","type":"string"},"created_at":{"description":"When it came into force.","format":"date-time","type":"string"},"currency":{"description":"The currency settled.","type":"string"},"cutoff_time":{"description":"The time of day (HH:MM, in time_zone) at which the period closes. Present on daily, weekly and monthly schedules.","type":"string"},"day_of_month":{"description":"The day of the month a monthly schedule closes on.","maximum":28,"minimum":1,"type":"integer"},"fee_bps":{"description":"The settlement fee in basis points of the gross.","type":"integer"},"fee_fixed":{"description":"The fixed part of the settlement fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"frequency":{"description":"How settlements are generated. manual: only on request to the platform, never by itself. daily, weekly, monthly: when the period reaches its cutoff. threshold: when what the period would pay reaches threshold_amount.","enum":["manual","daily","weekly","monthly","threshold"],"type":"string"},"id":{"description":"The id of the schedule.","pattern":"^stls_[0-9a-z]+$","type":"string"},"minimum_amount":{"description":"At a cutoff, a period whose net is below this keeps accruing. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"status":{"description":"active: in force. closed: replaced by a newer schedule.","enum":["active","closed"],"type":"string"},"threshold_amount":{"description":"A threshold schedule generates a settlement when what it would pay (net of the fee) reaches this. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"time_zone":{"description":"The IANA time zone cutoff_time is stated in, e.g. America/Mexico_City. Present with cutoff_time.","type":"string"},"weekday":{"description":"The day of the week a weekly schedule closes on.","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"type":"string"}},"required":["id","currency","frequency","minimum_amount","fee_bps","fee_fixed","status","created_at"],"type":"object"},"WebhookDelivery":{"additionalProperties":false,"properties":{"attempts":{"type":"integer"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"delivered_at":{"description":"When it was delivered.","format":"date-time","type":"string"},"endpoint_id":{"description":"The id of the endpoint.","pattern":"^we_[0-9a-z]+$","type":"string"},"event_id":{"description":"The id of the event.","pattern":"^evt_[0-9a-z]+$","type":"string"},"event_type":{"description":"The event type.","enum":["beneficiary.created","beneficiary.verified","customer.created","customer.status_changed","customer.updated","funding_account.active","funding_account.failed","hosted_session.created","hosted_session.payment_reported","payin.completed","payin.failed","payout.cancelled","payout.completed","payout.created","payout.failed","payout.return_settled","payout.returned","payout_batch.cancellation_finished","payout_batch.cancellation_requested","payout_batch.completed","payout_batch.created","reconciliation.exception_created","reconciliation.exception_resolved","refund.approved","refund.completed","refund.created","refund.failed","refund.processing","remittance.completed","remittance.created","remittance.failed","remittance.processing","remittance.returned","remittance.review","risk.review_required","settlement.completed","settlement.created","settlement.failed","settlement.on_hold","settlement.processing","settlement_schedule.activated","settlement_schedule.blocked","webhook.ping","withdrawal.approved","withdrawal.cancelled","withdrawal.completed","withdrawal.created","withdrawal.failed","withdrawal.pending_approval","withdrawal.submitted"],"type":"string"},"history":{"items":{"additionalProperties":false,"properties":{"duration_ms":{"type":"integer"},"error":{"description":"A closed code: http_5xx, transport_timeout, …","type":"string"},"http_status":{"type":"integer"},"number":{"type":"integer"},"occurred_at":{"description":"When the attempt was made.","format":"date-time","type":"string"}},"required":["number","duration_ms","occurred_at"],"type":"object"},"type":"array"},"id":{"description":"The id of the delivery.","pattern":"^whd_[0-9a-z]+$","type":"string"},"next_attempt_at":{"description":"When it is tried next.","format":"date-time","type":"string"},"redelivery_of":{"description":"The id of the delivery this one repeats.","pattern":"^whd_[0-9a-z]+$","type":"string"},"status":{"description":"pending: not yet attempted, or waiting for its next attempt. delivered: the receiver answered 2xx. exhausted: every attempt failed; redeliver to try again. cancelled: the endpoint was deleted first.","enum":["pending","delivered","exhausted","cancelled"],"type":"string"}},"required":["id","endpoint_id","event_id","event_type","status","attempts","created_at","history"],"type":"object"},"WebhookEndpoint":{"additionalProperties":false,"properties":{"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"description":{"description":"A note.","type":"string"},"event_types":{"items":{"description":"An event type.","enum":["beneficiary.created","beneficiary.verified","customer.created","customer.status_changed","customer.updated","funding_account.active","funding_account.failed","hosted_session.created","hosted_session.payment_reported","payin.completed","payin.failed","payout.cancelled","payout.completed","payout.created","payout.failed","payout.return_settled","payout.returned","payout_batch.cancellation_finished","payout_batch.cancellation_requested","payout_batch.completed","payout_batch.created","reconciliation.exception_created","reconciliation.exception_resolved","refund.approved","refund.completed","refund.created","refund.failed","refund.processing","remittance.completed","remittance.created","remittance.failed","remittance.processing","remittance.returned","remittance.review","risk.review_required","settlement.completed","settlement.created","settlement.failed","settlement.on_hold","settlement.processing","settlement_schedule.activated","settlement_schedule.blocked","webhook.ping","withdrawal.approved","withdrawal.cancelled","withdrawal.completed","withdrawal.created","withdrawal.failed","withdrawal.pending_approval","withdrawal.submitted"],"type":"string"},"type":"array"},"id":{"description":"The id of the webhook endpoint.","pattern":"^we_[0-9a-z]+$","type":"string"},"previous_secret_expires_at":{"description":"Until when the previous secret also signs.","format":"date-time","type":"string"},"secret":{"description":"The signing secret. Present only when the endpoint is created or its secret rotated.","type":"string"},"status":{"description":"active: deliveries are sent. paused: you paused it. failing: deliveries keep failing and the endpoint is only probed.","enum":["active","paused","failing"],"type":"string"},"url":{"description":"The URL.","type":"string"}},"required":["id","url","event_types","status","created_at"],"type":"object"},"WebhookEndpointCreate":{"additionalProperties":false,"properties":{"description":{"description":"A note.","type":"string"},"event_types":{"items":{"description":"An event type to receive. Empty or omitted: all.","enum":["beneficiary.created","beneficiary.verified","customer.created","customer.status_changed","customer.updated","funding_account.active","funding_account.failed","hosted_session.created","hosted_session.payment_reported","payin.completed","payin.failed","payout.cancelled","payout.completed","payout.created","payout.failed","payout.return_settled","payout.returned","payout_batch.cancellation_finished","payout_batch.cancellation_requested","payout_batch.completed","payout_batch.created","reconciliation.exception_created","reconciliation.exception_resolved","refund.approved","refund.completed","refund.created","refund.failed","refund.processing","remittance.completed","remittance.created","remittance.failed","remittance.processing","remittance.returned","remittance.review","risk.review_required","settlement.completed","settlement.created","settlement.failed","settlement.on_hold","settlement.processing","settlement_schedule.activated","settlement_schedule.blocked","webhook.ping","withdrawal.approved","withdrawal.cancelled","withdrawal.completed","withdrawal.created","withdrawal.failed","withdrawal.pending_approval","withdrawal.submitted"],"type":"string"},"type":"array"},"url":{"description":"An https URL on port 443 with a public address.","format":"uri","type":"string"}},"required":["url"],"type":"object"},"WebhookEndpointUpdate":{"additionalProperties":false,"properties":{"active":{"description":"False pauses the endpoint; true resumes it.","type":"boolean"},"description":{"description":"A note.","type":"string"},"event_types":{"items":{"description":"An event type.","enum":["beneficiary.created","beneficiary.verified","customer.created","customer.status_changed","customer.updated","funding_account.active","funding_account.failed","hosted_session.created","hosted_session.payment_reported","payin.completed","payin.failed","payout.cancelled","payout.completed","payout.created","payout.failed","payout.return_settled","payout.returned","payout_batch.cancellation_finished","payout_batch.cancellation_requested","payout_batch.completed","payout_batch.created","reconciliation.exception_created","reconciliation.exception_resolved","refund.approved","refund.completed","refund.created","refund.failed","refund.processing","remittance.completed","remittance.created","remittance.failed","remittance.processing","remittance.returned","remittance.review","risk.review_required","settlement.completed","settlement.created","settlement.failed","settlement.on_hold","settlement.processing","settlement_schedule.activated","settlement_schedule.blocked","webhook.ping","withdrawal.approved","withdrawal.cancelled","withdrawal.completed","withdrawal.created","withdrawal.failed","withdrawal.pending_approval","withdrawal.submitted"],"type":"string"},"type":"array"},"url":{"format":"uri","type":"string"}},"type":"object"},"Withdrawal":{"additionalProperties":false,"properties":{"amount":{"description":"What the destination receives. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"created_at":{"description":"When it was created.","format":"date-time","type":"string"},"currency":{"description":"The currency of the withdrawal.","type":"string"},"destination_id":{"description":"The id of the settlement destination.","pattern":"^dest_[0-9a-z]+$","type":"string"},"failure_code":{"description":"Why it failed or was cancelled, when it was: insufficient_funds, no_route, rejected_by_operator, or a provider's reason.","type":"string"},"fee":{"description":"The platform's fee, in the withdrawal's currency. It is set when the withdrawal is created, by the pricing in force for the account at that moment, and never changes afterwards. It may be zero. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"id":{"description":"The id of the withdrawal.","pattern":"^wdr_[0-9a-z]+$","type":"string"},"method":{"description":"The method.","type":"string"},"status":{"description":"pending_approval: above the account's threshold, waiting for the platform's operators; funds held. processing: accepted, funds held, outcome not final yet. completed: the funds left to the destination. failed: not executed, funds returned. cancelled: refused before anything was sent, funds returned.","enum":["pending_approval","processing","completed","failed","cancelled"],"type":"string"},"total":{"description":"What is debited from the balance: amount + fee. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"updated_at":{"description":"When it last changed.","format":"date-time","type":"string"}},"required":["id","status","method","destination_id","currency","amount","fee","total","created_at","updated_at"],"type":"object"},"WithdrawalCreate":{"additionalProperties":false,"properties":{"amount":{"description":"What the destination receives, in its currency. The fee, if any, is held on top of it. A decimal string in the currency's precision.","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"currency":{"description":"The destination's currency. Optional; when given it must match.","type":"string"},"destination_id":{"description":"The id of the settlement destination to send to.","pattern":"^dest_[0-9a-z]+$","type":"string"}},"required":["destination_id","amount"],"type":"object"}},"securitySchemes":{"apiKey":{"description":"Your secret API key, sent as `Authorization: Bearer <key>`. A key names its environment: `psp_test_…` works only against sandbox (`https://api-sandbox.caibopay.app`), `psp_live_…` only against live (`https://api.caibopay.app`). Keys are issued by Caibo when your account is opened; the dashboard (Developers) shows the key in use.","scheme":"bearer","type":"http"}}},"info":{"description":"B2B payment infrastructure: customers, beneficiaries, quotes, payouts, withdrawals, funding, refunds and events.\n\n**One API for every country.** There are no per-country or per-provider endpoints. `GET /v1/capabilities` says which methods and currencies are available; the same resources serve all of them.\n\n**Environments.** Sandbox and live are separate deployments with separate data and separate keys. A key names its environment (`psp_test_…`, `psp_live_…`) and works only there.\n\n**Money.** Amounts are decimal strings with exactly the precision of their currency. They are never numbers.\n\n**Idempotency.** Requests that move money or create priced resources require an `Idempotency-Key`. Repeating a request with the same key returns the original result (`Idempotent-Replayed: true`) and has no second effect; the same key with a different request is a 409.\n\n**Lists.** Every collection is returned newest first, in pages: `limit` (1 to 100), and `starting_after` with the `next_cursor` of the previous page while `has_more` is true. A walk returns every item that existed when it started exactly once, whatever is created meanwhile. Lists are narrowed by `status` (the public status of the resource), by `created_after` (inclusive) and `created_before` (exclusive), RFC 3339, and by the resources an item relates to (`customer_id`, `beneficiary_id`, `payin_id`, ...). Filters combine with AND; a value a filter cannot take is a 400 naming the parameter, and an id that is not one of yours matches nothing.\n\n**Closed vocabularies.** Statuses, reasons, kinds and event types are declared as `enum`. New values can be added in a later version of the contract; treat a value you do not know as you would an unknown status, not as an error.\n\n**Asynchrony.** A payout or a withdrawal is accepted, then executed. Follow it with webhooks or `GET /v1/events`. While its outcome is not yet certain its status is `processing`: do not create a new one for the same purpose, the original is still being resolved. The story of one resource is `GET /v1/events?resource_id={id}`.","title":"Caibo PSP API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/account":{"get":{"description":"Who the credential is: the account it belongs to, the environment that answered (sandbox or live) and the credential itself, without its secret. Use it to check a key and to show which account and environment a client is working in. The credential is an API key: there are no user identities (people, roles, single sign-on) yet, so nothing here describes a person.","operationId":"getAccount","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve the account of the credential","tags":["Account"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.account.retrieve();"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.account.retrieve()"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Account.Retrieve(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/balances":{"get":{"description":"The account's money per currency, by how usable it is. Every figure is read from the ledger; total = available + pending + reserved + in_settlement. Earnings are shown apart and not added.","operationId":"listBalances","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Balance"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List balances","tags":["Balances"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.balances.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.balances.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Balances.List(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/balances/{currency}/entries":{"get":{"description":"Every movement on the account's balances in a currency, newest first: one entry per ledger posting on one of the account's own balances, with the operation it belongs to. Pass next_cursor as after to continue; the statement is walked without gaps or repeats.","operationId":"listBalanceEntries","parameters":[{"in":"path","name":"currency","required":true,"schema":{"type":"string"}},{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"The id of the last entry received (the next_cursor of the previous page).","in":"query","name":"after","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BalanceEntry"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List the statement of a currency","tags":["Balances"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.balances.listEntries(\"USDT\")) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.balances.list_entries(\"USDT\"):\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Balances.ListEntriesAll(ctx, \"USDT\", nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/beneficiaries":{"get":{"description":"Newest first.","operationId":"listBeneficiaries","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["active","archived"],"type":"string"}},{"description":"Only the beneficiaries of this customer.","in":"query","name":"customer_id","required":false,"schema":{"pattern":"^cus_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Beneficiary"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List beneficiaries","tags":["Beneficiaries"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.beneficiaries.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.beneficiaries.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Beneficiaries.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Registers who is paid. The same account registered twice for the same customer is the same beneficiary (200 with the existing one). Account details are write-only. The country is the method's when the method has one.","operationId":"createBeneficiary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BeneficiaryCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Beneficiary"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Beneficiary"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a beneficiary","tags":["Beneficiaries"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.beneficiaries.create({\n  currency: \"PEN\",\n  details: {},\n  method: \"bank_transfer\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.beneficiaries.create(currency=\"PEN\", details={}, method=\"bank_transfer\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Beneficiaries.Create(ctx, &caibopay.BeneficiaryCreate{\n\tCurrency: \"PEN\",\n\tMethod: \"bank_transfer\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/beneficiaries/{id}":{"get":{"operationId":"getBeneficiary","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Beneficiary"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a beneficiary","tags":["Beneficiaries"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.beneficiaries.retrieve(\"ben_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.beneficiaries.retrieve(\"ben_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Beneficiaries.Retrieve(ctx, \"ben_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/capabilities":{"get":{"description":"The products (payin, payout, remittance), methods, currencies and countries available to the account, with the fields each one requires and whether it can be used right now. Countries and rails are discovered here; they never have endpoints of their own.","operationId":"listCapabilities","parameters":[{"description":"Only this product: payin, payout or remittance.","in":"query","name":"product","required":false,"schema":{"enum":["payin","payout","remittance"],"type":"string"}},{"description":"Only this country (ISO 3166-1 alpha-2). For a remittance, the destination's.","in":"query","name":"country","required":false,"schema":{"type":"string"}},{"description":"Only this currency. For a remittance, the destination's.","in":"query","name":"currency","required":false,"schema":{"type":"string"}},{"description":"Only this method. For a remittance, the payout method.","in":"query","name":"method","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Capability"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List what the account can do","tags":["Capabilities"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.capabilities.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.capabilities.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Capabilities.List(ctx, nil)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/customers":{"get":{"description":"Newest first. The profile is not in a list; retrieve a customer for it.","operationId":"listCustomers","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["active","blocked","closed"],"type":"string"}},{"description":"Only the customer with this external_id: your own id for it.","in":"query","name":"external_id","required":false,"schema":{"type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Customer"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List customers","tags":["Customers"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.customers.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.customers.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Customers.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Registers a person or business you act for, under your own external_id. The same external_id sent again with the same identity (type, country, display_name, profile) returns the existing customer (200); with a different identity it is a 409 conflict. metadata is yours and is not compared.","operationId":"createCustomer","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a customer","tags":["Customers"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.customers.create({\n  country: \"...\",\n  display_name: \"...\",\n  external_id: \"id_...\",\n  type: \"individual\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.customers.create(country=\"...\", display_name=\"...\", external_id=\"id_...\", type=\"individual\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Customers.Create(ctx, &caibopay.CustomerCreate{\n\tCountry: \"...\",\n\tDisplayName: \"...\",\n\tExternalID: \"id_...\",\n\tType: \"individual\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/customers/{id}":{"get":{"operationId":"getCustomer","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a customer","tags":["Customers"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.customers.retrieve(\"cus_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.customers.retrieve(\"cus_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Customers.Retrieve(ctx, \"cus_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"patch":{"description":"metadata replaces the whole object. status takes active or closed; closed is final. A blocked customer is blocked by the platform and cannot be reactivated here.","operationId":"updateCustomer","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Update a customer's metadata or close it","tags":["Customers"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.customers.update(\"cus_...\", {});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.customers.update(\"cus_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Customers.Update(ctx, \"cus_...\", &caibopay.CustomerUpdate{})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/events":{"get":{"description":"Events in the order they became visible. Store next_cursor and pass it as after to poll; no event is ever skipped. With resource_id the list is the story of one resource, oldest first: every status it went through, from its creation to its outcome. Filters combine, and the cursor works the same with them.","operationId":"listEvents","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"The next_cursor of the previous page.","in":"query","name":"after","required":false,"schema":{"type":"string"}},{"description":"Only events of this type (payout.completed), or of this family of types when it ends in a dot (payout.). A type the platform does not publish is a 400.","in":"query","name":"type","required":false,"schema":{"type":"string"}},{"description":"Only events about this resource, by its id: a payout, a pay-in, a funding account, a refund, a withdrawal, a remittance, a settlement, a customer, a beneficiary, a payout batch, a reconciliation exception, a risk decision or a webhook endpoint.","in":"query","name":"resource_id","required":false,"schema":{"pattern":"^[a-z]+_[0-9a-z]+$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List events","tags":["Events"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.events.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.events.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Events.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/events/{id}":{"get":{"operationId":"getEvent","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve an event","tags":["Events"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.events.retrieve(\"evt_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.events.retrieve(\"evt_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Events.Retrieve(ctx, \"evt_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/events/{id}/redeliver":{"post":{"operationId":"redeliverEvent","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventRedeliver"}}},"required":false},"responses":{"202":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"Accepted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Send an event to webhook endpoints again","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.events.redeliver(\"evt_...\", {})) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.events.redeliver(\"evt_...\"):\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Events.Redeliver(ctx, \"evt_...\", &caibopay.EventRedeliver{})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/funding-accounts":{"post":{"description":"An account the balance is funded through. It is created pending; its payment instructions are available once it is active (event funding_account.active). With amount it is one payment of exactly that amount (collection payment in GET /v1/capabilities): the payer pays the amount and nothing more, and the account closes once it is paid; the pay-in that credits it is payin.completed.","operationId":"createFundingAccount","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingAccountCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingAccount"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingAccount"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a funding account","tags":["Funding"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.fundingAccounts.create({\n  currency: \"PEN\",\n  method: \"bank_transfer\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.funding_accounts.create(currency=\"PEN\", method=\"bank_transfer\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.FundingAccounts.Create(ctx, &caibopay.FundingAccountCreate{\n\tCurrency: \"PEN\",\n\tMethod: \"bank_transfer\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/funding-accounts/{id}":{"get":{"operationId":"getFundingAccount","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingAccount"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a funding account","tags":["Funding"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.fundingAccounts.retrieve(\"fa_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.funding_accounts.retrieve(\"fa_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.FundingAccounts.Retrieve(ctx, \"fa_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/hosted-domains":{"get":{"operationId":"listHostedDomains","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/HostedDomain"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List hosted domains","tags":["Hosted pages"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.hostedDomains.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.hosted_domains.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedDomains.List(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"post":{"description":"Claims a hostname the page should be served at. The claim starts pending, with a verification_token to publish; the hostname serves the page only once the platform has verified it. A hostname with a live claim, yours or anybody's, is refused with hostname_taken.","operationId":"createHostedDomain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedDomainCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedDomain"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedDomain"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Claim a hostname for the hosted page","tags":["Hosted pages"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedDomains.create({\n  hostname: \"...\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_domains.create(hostname=\"...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedDomains.Create(ctx, &caibopay.HostedDomainCreate{\n\tHostname: \"...\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/hosted-domains/{id}":{"delete":{"description":"The hostname stops serving the page at once and can be claimed again.","operationId":"deleteHostedDomain","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Remove a hosted domain","tags":["Hosted pages"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nawait caibo.hostedDomains.delete(\"hd_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nclient.hosted_domains.delete(\"hd_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nif err := client.HostedDomains.Delete(ctx, \"hd_...\"); err != nil {\n\treturn err\n}"}]},"get":{"operationId":"getHostedDomain","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedDomain"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a hosted domain","tags":["Hosted pages"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedDomains.retrieve(\"hd_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_domains.retrieve(\"hd_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedDomains.Retrieve(ctx, \"hd_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/hosted-page":{"get":{"description":"How the account's hosted remittance page is configured. An account that never configured it gets the defaults, with no id.","operationId":"getHostedPage","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedPage"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve the hosted page configuration","tags":["Hosted pages"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedPage.retrieve();"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_page.retrieve()"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedPage.Retrieve(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"put":{"description":"Replaces the whole configuration; a field left out is reset to its default. The theme is data, validated here: colours are #rrggbb, the radius is one of a fixed scale, the font is the key of a font the page ships, and URLs are https. branding_mode white_label needs the entitlement (white_label_entitled), which the platform grants; it is refused with white_label_not_entitled otherwise.","operationId":"putHostedPage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedPageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedPage"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Replace the hosted page configuration","tags":["Hosted pages"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedPage.update({});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_page.update()"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedPage.Update(ctx, &caibopay.HostedPageUpdate{})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/hosted-sessions":{"get":{"description":"Newest first, those your customers started from the page included. Never with a token. A session's status is read off its remittance and its expiry when you ask, so the list is not filtered by it.","operationId":"listHostedSessions","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only the sessions of this customer.","in":"query","name":"customer_id","required":false,"schema":{"pattern":"^cus_[0-9a-z]+$","type":"string"}},{"description":"Only the session this remittance was created from.","in":"query","name":"remittance_id","required":false,"schema":{"pattern":"^rem_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/HostedSession"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List hosted sessions","tags":["Hosted pages"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.hostedSessions.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.hosted_sessions.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.HostedSessions.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Starts a session of the hosted remittance flow for one of your customers. The response carries the session token and the path the hosted page serves it at (/s/<token>); they are shown only here. Send the customer to that path on your page's host: the same link is where they follow the remittance afterwards. A session creates at most one remittance, ever. Repeating the request with the same Idempotency-Key returns the same session, without the token. The hosted page must be enabled.","operationId":"createHostedSession","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedSessionCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedSession"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedSession"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a hosted session","tags":["Hosted pages"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedSessions.create({}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_sessions.create(idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedSessions.Create(ctx, &caibopay.HostedSessionCreate{}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/hosted-sessions/{id}":{"get":{"description":"With the ids of what the session holds: its customer, beneficiary, quote, funding account and remittance. payment_reported_at is when the customer said they paid; it is a statement, not a confirmation: follow the remittance and its pay-in for that.","operationId":"getHostedSession","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedSession"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a hosted session","tags":["Hosted pages"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.hostedSessions.retrieve(\"hs_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.hosted_sessions.retrieve(\"hs_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.HostedSessions.Retrieve(ctx, \"hs_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/me":{"get":{"description":"Who the credential of the request is: an API key (kind api_key) or a member of the account, a person signed in to the dashboard through its identity provider (kind member), with the account it acts for and its scopes. A member's role and scopes are the platform's: a client reads them here, never from the identity provider. For a member it also lists every account the person may act for; send the Caibo-Account header (acct_…) to act for another one. A person signed in to the dashboard who is no active member of an active account is answered 403 no_membership, one answer whatever the reason; this route binds the person's open invitations first. A dashboard session token is accepted only by this API, an operator console's never.","operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Who is calling","tags":["Account"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.account.me();"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.account.me()"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Account.Me(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/members":{"get":{"description":"The people who act for the account through the dashboard, and the open invitations, newest first. A member's role maps to scopes: owner, admin and developer hold read and write, viewer read.","operationId":"listMembers","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Member"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List the account's members","tags":["Members"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.members.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.members.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Members.List(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"post":{"description":"Invites an e-mail address with a role. The invitation expires after 7 days; it is bound at the person's first signed-in call to the person whose verified primary address it is, and the member becomes active. Inviting an address that was invited and never signed in renews its invitation (200). Only a signed-in owner or admin invites, and only an owner invites an owner: an API key does not manage people (403 insufficient_role). An address that is already a member is 409 member_exists.","operationId":"createMember","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Invite a person","tags":["Members"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.members.create({\n  email: \"...\",\n  role: \"owner\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.members.create(email=\"...\", role=\"owner\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Members.Create(ctx, &caibopay.MemberCreate{\n\tEmail: \"...\",\n\tRole: \"owner\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/members/{id}":{"patch":{"description":"status disabled refuses the member's next request at once, whatever its session; active enables it again (only a member that signed in once). Only a signed-in owner or admin changes members, not their own; only an owner touches an owner; the account keeps at least one active owner (409 last_owner). Withdraw an invitation by disabling it.","operationId":"updateMember","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Change a member's role or disable it","tags":["Members"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.members.update(\"mem_...\", {});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.members.update(\"mem_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Members.Update(ctx, \"mem_...\", &caibopay.MemberUpdate{})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payins":{"get":{"description":"Newest first. refunded and refundable are not in a list; retrieve a pay-in for them.","operationId":"listPayIns","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["processing","completed","failed"],"type":"string"}},{"description":"Only the pay-ins into this funding account.","in":"query","name":"funding_account_id","required":false,"schema":{"pattern":"^fa_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PayIn"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List pay-ins","tags":["Funding"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.payins.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.payins.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Payins.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/payins/{id}":{"get":{"description":"A credited pay-in also says what it has given back (refunded) and what can still be refunded (refundable).","operationId":"getPayIn","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayIn"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a pay-in","tags":["Funding"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payins.retrieve(\"pin_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payins.retrieve(\"pin_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Payins.Retrieve(ctx, \"pin_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payout-batches":{"get":{"description":"Newest first, each with its summary, totals and cancellation as they are now. A batch accepted while you page never shifts or repeats the pages that follow.","operationId":"listPayoutBatches","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["accepted","processing","completed","completed_with_failures","cancelled","partially_cancelled"],"type":"string"}},{"description":"Only batches with exactly this label.","in":"query","name":"label","required":false,"schema":{"type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PayoutBatch"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List payout batches","tags":["Payouts"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.payoutBatches.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.payout_batches.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.PayoutBatches.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Accepts up to 1000 payouts in one request. Every item is checked for form first: one malformed item refuses the whole batch (400, param items[i].field) and nothing is created. The batch is then accepted and each item becomes, asynchronously and at most once, an ordinary payout with its own status and events, in index order. An item that cannot be paid does not stop the others: it is refused (status refused, error_code) when it never became a payout, or its payout fails (insufficient_funds) as a single payout would. A quote named by an item is used by that item from the moment the batch is accepted. A payout kill switch for the account refuses the whole batch (503). Repeating the request with the same Idempotency-Key returns the same batch and creates nothing.","operationId":"createPayoutBatch","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutBatchCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutBatch"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutBatch"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a payout batch","tags":["Payouts"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payoutBatches.create({\n  items: [],\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payout_batches.create(items=[], idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.PayoutBatches.Create(ctx, &caibopay.PayoutBatchCreate{}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payout-batches/{id}":{"get":{"description":"With its summary and totals, computed from its payouts as they are now. A payout whose outcome is not yet certain is counted as uncertain (its item is verification_pending) and keeps the batch processing; it is never sent again.","operationId":"getPayoutBatch","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutBatch"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a payout batch","tags":["Payouts"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payoutBatches.retrieve(\"pbat_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payout_batches.retrieve(\"pbat_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.PayoutBatches.Retrieve(ctx, \"pbat_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payout-batches/{id}/cancel":{"post":{"description":"Asks for the batch to be cancelled. Nothing that was sent is reversed. The request is recorded at once and carried out asynchronously, item by item: an item not yet issued is cancelled; an item whose payout has provably not reached a provider is cancelled with its payout (the payout fails with failure_code cancelled_before_submission and its funds are available again); every other item keeps its state, with not_cancelled_reason saying why (in_review, submitted, outcome_uncertain, already_completed, already_failed, already_returned, already_refused). A payout whose outcome is uncertain is never cancelled and never sent again. The answer is the batch as it is now: cancellation.status is in_progress until every item has its decision (event payout_batch.cancellation_finished); the batch then ends cancelled (no payout was executed), partially_cancelled (some were) or, when nothing could be cancelled, completed or completed_with_failures. Asking again, or for a batch that is already finished, changes nothing and returns the batch as it is.","operationId":"cancelPayoutBatch","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutBatch"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Cancel a payout batch","tags":["Payouts"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payoutBatches.cancel(\"pbat_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payout_batches.cancel(\"pbat_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.PayoutBatches.Cancel(ctx, \"pbat_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payout-batches/{id}/items":{"get":{"description":"In index order, each with its payout's status now, why it was refused, or what the batch's cancellation decided about it.","operationId":"listPayoutBatchItems","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"The index of the last item received (the next_cursor of the previous page).","in":"query","name":"after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status: queued, refused, cancelled, processing, verification_pending, completed, failed or returned.","in":"query","name":"status","required":false,"schema":{"enum":["queued","refused","cancelled","processing","verification_pending","completed","failed","returned"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PayoutBatchItem"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List the items of a payout batch","tags":["Payouts"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.payoutBatches.listItems(\"pbat_...\")) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.payout_batches.list_items(\"pbat_...\"):\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.PayoutBatches.ListItemsAll(ctx, \"pbat_...\", nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/payouts":{"get":{"description":"Newest first. A list carries the payout without its detail (description, country, completed_at, failed_at, returned_at); retrieve a payout for it.","operationId":"listPayouts","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["processing","verification_pending","completed","failed","returned","cancelled"],"type":"string"}},{"description":"Only the payouts to this beneficiary.","in":"query","name":"beneficiary_id","required":false,"schema":{"pattern":"^ben_[0-9a-z]+$","type":"string"}},{"description":"Only the payouts whose risk_status is this: allowed, in_review (funds held, waiting for a person), approved or rejected. A payout without a risk decision has no risk_status and matches none.","in":"query","name":"risk_status","required":false,"schema":{"enum":["allowed","in_review","approved","rejected"],"type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Payout"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List payouts","tags":["Payouts"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.payouts.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.payouts.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Payouts.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Reserves the funds and accepts the payout; it is executed asynchronously. A payout the balance cannot fund is created with status failed and failure_code insufficient_funds. Repeating the request with the same Idempotency-Key returns the same payout and never pays twice.","operationId":"createPayout","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a payout","tags":["Payouts"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payouts.create({\n  beneficiary_id: \"ben_...\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payouts.create(beneficiary_id=\"ben_...\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Payouts.Create(ctx, &caibopay.PayoutCreate{\n\tBeneficiaryID: \"ben_...\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payouts/{id}":{"get":{"description":"With its detail: your own description, the country of the beneficiary's account, when it completed, failed, was returned or was cancelled, and its latest cancellation if one was asked for. Its story, step by step, is GET /v1/events?resource_id={id}. A payout whose submission's outcome is uncertain is verification_pending: its funds stay reserved, it is being verified with the provider, and nothing sends it again or in its place; it ends completed or failed on the provider's evidence. No request retries or cancels it.","operationId":"getPayout","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a payout","tags":["Payouts"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payouts.retrieve(\"pout_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payouts.retrieve(\"pout_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Payouts.Retrieve(ctx, \"pout_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/payouts/{id}/cancel":{"post":{"description":"Asks for a payout to be cancelled. Only a payout nothing of which can have reached a provider is cancelled: it is processing, it was never sent (or every send is proven never to have left) and it is not waiting for a risk review. A payout that was sent, may have been sent (verification_pending), is final, waits for a risk review, or belongs to a payout batch or a remittance is refused with 409 payout_not_cancellable, reasons saying why (submitted, outcome_uncertain, already_completed, already_failed, already_returned, in_review, managed_by_batch, managed_by_remittance); nothing changes. The request is recorded at once and decided by the platform, under the payout's lock, before the payout would be sent: the answer is 202 with cancellation.status requested. Once cancelled, the payout's status is cancelled (failure_code cancelled_before_submission), its funds are available again and payout.cancelled is published; asking again, with any key, answers 200 with the cancelled payout. If the payout was sent in the meantime, cancellation.status becomes refused with not_cancelled_reason, and the payout goes on. Repeating the request with the same Idempotency-Key never cancels twice; the same key for another payout is 409 idempotency_key_reused.","operationId":"cancelPayout","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"The payout is cancelled: by this request's decision or an earlier one."},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"Accepted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Cancel a payout that was never sent","tags":["Payouts"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.payouts.cancel(\"pout_...\", { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.payouts.cancel(\"pout_...\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Payouts.Cancel(ctx, \"pout_...\", caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/quotes":{"post":{"description":"Freezes a price for a short time. A quote is used by at most one payout.","operationId":"createQuote","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a quote","tags":["Quotes"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.quotes.create({\n  amount: \"100.00\",\n  amount_side: \"source\",\n  destination_currency: \"PEN\",\n  source_currency: \"USDT\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.quotes.create(amount=\"100.00\", amount_side=\"source\", destination_currency=\"PEN\", source_currency=\"USDT\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Quotes.Create(ctx, &caibopay.QuoteCreate{\n\tAmount: \"100.00\",\n\tAmountSide: \"source\",\n\tDestinationCurrency: \"PEN\",\n\tSourceCurrency: \"USDT\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/quotes/{id}":{"get":{"operationId":"getQuote","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a quote","tags":["Quotes"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.quotes.retrieve(\"quo_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.quotes.retrieve(\"quo_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Quotes.Retrieve(ctx, \"quo_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/reconciliation-exceptions":{"get":{"description":"Inconsistencies the platform found about your own operations (a pay-in, a payout, a withdrawal, a refund, a settlement or a remittance) and is working on, newest first. Read-only: the platform's operators investigate and close them.","operationId":"listReconciliationExceptions","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ReconciliationException"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List reconciliation exceptions","tags":["Reconciliation"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.reconciliationExceptions.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.reconciliation_exceptions.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.ReconciliationExceptions.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/reconciliation-exceptions/{id}":{"get":{"operationId":"getReconciliationException","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationException"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a reconciliation exception","tags":["Reconciliation"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.reconciliationExceptions.retrieve(\"rex_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.reconciliation_exceptions.retrieve(\"rex_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.ReconciliationExceptions.Retrieve(ctx, \"rex_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/refunds":{"get":{"description":"Newest first.","operationId":"listRefunds","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["pending_review","processing","completed","failed"],"type":"string"}},{"description":"Only the refunds of this pay-in.","in":"query","name":"payin_id","required":false,"schema":{"pattern":"^pin_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Refund"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List refunds","tags":["Refunds"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.refunds.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.refunds.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Refunds.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Sends part or all of a credited pay-in back to its payer, from the available balance, through the provider that received it. Reserves the funds and accepts the refund; it is executed asynchronously. A refund the platform's risk controls hold for a review is created with status pending_review: its funds are reserved and it counts against what is left to refund, but nothing is sent until it is approved; a refund they refuse is a 422 risk_blocked. Omit amount to refund everything that is left. Repeating the request with the same Idempotency-Key returns the same refund and never refunds twice.","operationId":"createRefund","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Refund a pay-in","tags":["Refunds"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.refunds.create({\n  payin_id: \"pin_...\",\n  reason_code: \"requested_by_customer\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.refunds.create(payin_id=\"pin_...\", reason_code=\"requested_by_customer\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Refunds.Create(ctx, &caibopay.RefundCreate{\n\tPayinID: \"pin_...\",\n\tReasonCode: \"requested_by_customer\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/refunds/{id}":{"get":{"operationId":"getRefund","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a refund","tags":["Refunds"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.refunds.retrieve(\"rfd_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.refunds.retrieve(\"rfd_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Refunds.Retrieve(ctx, \"rfd_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/remittances":{"get":{"description":"Newest first. payin_id and payout_id find the remittance a pay-in funded or a payout pays: at most one.","operationId":"listRemittances","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["awaiting_funds","processing","verification_pending","review","completed","failed","returned"],"type":"string"}},{"description":"Only the remittances sent by this customer.","in":"query","name":"customer_id","required":false,"schema":{"pattern":"^cus_[0-9a-z]+$","type":"string"}},{"description":"Only the remittances to this beneficiary.","in":"query","name":"beneficiary_id","required":false,"schema":{"pattern":"^ben_[0-9a-z]+$","type":"string"}},{"description":"Only the remittance this pay-in funded.","in":"query","name":"payin_id","required":false,"schema":{"pattern":"^pin_[0-9a-z]+$","type":"string"}},{"description":"Only the remittance this payout pays.","in":"query","name":"payout_id","required":false,"schema":{"pattern":"^pout_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Remittance"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List remittances","tags":["Remittances"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.remittances.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.remittances.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Remittances.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Sends a quote's destination amount to a beneficiary, funded by a deposit: either the next deposit into a funding account (source.funding_account_id; the remittance awaits it and the deposit must be credited before the quote expires) or a pay-in that already credited the balance (source.payin_id; a pay-in funds at most one remittance). The quote is used by the remittance from the moment it is created. The remittance never spends more than its pay-in credited. It is executed asynchronously and makes exactly one payout; while that payout's outcome is uncertain the remittance stays processing or review, and no second payout is ever made.","operationId":"createRemittance","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemittanceCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Remittance"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Remittance"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a remittance","tags":["Remittances"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.remittances.create({\n  beneficiary_id: \"ben_...\",\n  quote_id: \"quo_...\",\n  source: {},\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.remittances.create(beneficiary_id=\"ben_...\", quote_id=\"quo_...\", source={}, idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Remittances.Create(ctx, &caibopay.RemittanceCreate{\n\tBeneficiaryID: \"ben_...\",\n\tQuoteID: \"quo_...\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/remittances/{id}":{"get":{"operationId":"getRemittance","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Remittance"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a remittance","tags":["Remittances"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.remittances.retrieve(\"rem_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.remittances.retrieve(\"rem_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Remittances.Retrieve(ctx, \"rem_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/reports/{name}":{"get":{"description":"A read-only view of a period, never the authority for money (the ledger is). The answer says what it was computed from (source) and the instant it is complete up to (as_of). name is one of transactions, payins, payouts, remittances, refunds, withdrawals, settlements, fees, fx, balances. Row reports list what was created in [from, to), oldest first, in pages (pass next_cursor as after); balances is returned whole: per currency and balance, the opening at from, the credits and debits of the period and the closing at to, with opening + credits - debits = closing exactly. Every value is a string (amounts as decimal strings in the currency's precision, timestamps in UTC) or null. With format=csv the whole report is streamed as RFC 4180 CSV with a header row, as an attachment.","operationId":"getReport","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}},{"description":"Required. The start of the period, inclusive (RFC 3339).","in":"query","name":"from","required":false,"schema":{"type":"string"}},{"description":"Required. The end of the period, exclusive (RFC 3339). At most 366 days after from.","in":"query","name":"to","required":false,"schema":{"type":"string"}},{"description":"Only this currency.","in":"query","name":"currency","required":false,"schema":{"type":"string"}},{"description":"json (the default) or csv.","in":"query","name":"format","required":false,"schema":{"enum":["json","csv"],"type":"string"}},{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"The next_cursor of the previous page (JSON only; not for balances).","in":"query","name":"after","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"as_of":{"description":"The instant the rows are complete up to: everything recorded before it is in them. Each page is computed on its own and has its own as_of; a CSV export is one snapshot.","format":"date-time","type":"string"},"data":{"items":{"$ref":"#/components/schemas/ReportRow"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"},"source":{"description":"What the rows were read from. live: the operations and the ledger themselves, in the snapshot of this request. view: a view over them, in the snapshot of this request. materialized: a stored copy, as fresh as as_of.","enum":["live","view","materialized"],"type":"string"}},"required":["data","has_more"],"type":"object"}},"text/csv":{"schema":{"description":"RFC 4180 CSV: a header row with the column names, then one record per row; CRLF line endings.","type":"string"}}},"description":"OK","headers":{"Content-Disposition":{"description":"With format=csv: attachment; filename=\"<name>_<from>_<to>.csv\".","schema":{"type":"string"}},"Report-As-Of":{"description":"With format=csv: the instant the export is complete up to (the as_of of a JSON page).","schema":{"format":"date-time","type":"string"}},"Report-Source":{"description":"With format=csv: what the export was read from (the source of a JSON page).","schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Run a report","tags":["Reports"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.reports.retrieve(\"payouts\")) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.reports.retrieve(\"payouts\"):\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Reports.RetrieveAll(ctx, \"payouts\", nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/sandbox/deposits":{"post":{"description":"Sandbox only. The simulated provider reports a deposit; it is verified and credited through the same path as a real one. Not served in live.","operationId":"simulateDeposit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxDeposit"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxDepositAccepted"}}},"description":"Accepted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Simulate a deposit into a funding account","tags":["Sandbox"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.sandbox.simulateDeposit({\n  amount: \"100.00\",\n  funding_account_id: \"fa_...\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.sandbox.simulate_deposit(amount=\"100.00\", funding_account_id=\"fa_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Sandbox.SimulateDeposit(ctx, &caibopay.SandboxDeposit{\n\tAmount: \"100.00\",\n\tFundingAccountID: \"fa_...\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/settlement-configuration":{"get":{"description":"Whether and how settlements are generated, for the account and per currency. The account's state is unconfigured when no schedule is in force in any currency: nothing is settled automatically and the balance stays available until you withdraw it or the platform puts a schedule in force. Per currency, state is unconfigured (no schedule in force), active (the schedule in force generates settlements as its frequency says; automatic is false for a manual schedule, whose settlements are generated only on request to the platform) or unexecutable (a schedule is in force but cannot be executed now; reason says why, e.g. no_destination; settlements that fall due wait and are generated once it can). currencies lists every currency the account holds a balance in or has a schedule for; with the currency parameter, that currency alone, whatever the account holds.","operationId":"getSettlementConfiguration","parameters":[{"description":"Only this currency. A currency without a schedule is answered as unconfigured.","in":"query","name":"currency","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementConfiguration"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Read how the account is settled","tags":["Settlements"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.settlements.configuration();"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.settlements.configuration()"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Settlements.Configuration(ctx, nil)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/settlement-destinations":{"get":{"operationId":"listSettlementDestinations","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SettlementDestination"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List settlement destinations","tags":["Withdrawals"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.settlementDestinations.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.settlement_destinations.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.SettlementDestinations.List(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"post":{"description":"Registers an account of your own that withdrawals go to. The same account registered twice is the same destination (200 with the existing one). Account details are write-only.","operationId":"createSettlementDestination","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementDestinationCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementDestination"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementDestination"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a settlement destination","tags":["Withdrawals"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.settlementDestinations.create({\n  currency: \"PEN\",\n  details: {},\n  method: \"bank_transfer\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.settlement_destinations.create(currency=\"PEN\", details={}, method=\"bank_transfer\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.SettlementDestinations.Create(ctx, &caibopay.SettlementDestinationCreate{\n\tCurrency: \"PEN\",\n\tMethod: \"bank_transfer\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/settlement-destinations/{id}":{"get":{"operationId":"getSettlementDestination","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementDestination"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a settlement destination","tags":["Withdrawals"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.settlementDestinations.retrieve(\"dest_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.settlement_destinations.retrieve(\"dest_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.SettlementDestinations.Retrieve(ctx, \"dest_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/settlement-schedules":{"get":{"description":"The account's settlement terms per currency, as agreed in its contract: the one in force (status active) and those it replaced (closed), newest first. Read-only: a schedule carries the fee and the destination and is set by the platform; a change is a new schedule and applies from the period that is open: settlements that exist do not change. An empty list means no schedule was ever in force; GET /v1/settlement-configuration says so explicitly (unconfigured).","operationId":"listSettlementSchedules","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SettlementSchedule"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List settlement schedules","tags":["Settlements"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.settlements.listSchedules()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.settlements.list_schedules():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Settlements.ListSchedules(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/settlements":{"get":{"description":"The periodic statements of what the account is owed, newest first. Each one is a closed (or still open) period of one currency: what accrued to the balance, the fee, the adjustments, and the net that is or was transferred to the account's settlement destination.","operationId":"listSettlements","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only settlements in this currency.","in":"query","name":"currency","required":false,"schema":{"type":"string"}},{"description":"Only periods ending after this RFC 3339 timestamp.","in":"query","name":"period_from","required":false,"schema":{"type":"string"}},{"description":"Only periods starting before this RFC 3339 timestamp.","in":"query","name":"period_to","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["pending","ready","processing","settled","on_hold","failed","disputed"],"type":"string"}},{"description":"Only settlements generated under this schedule.","in":"query","name":"schedule_id","required":false,"schema":{"pattern":"^stls_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Settlement"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List settlements","tags":["Settlements"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.settlements.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.settlements.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Settlements.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]}},"/v1/settlements/{id}":{"get":{"description":"With its items: the ledger journals its figures are made of.","operationId":"getSettlement","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settlement"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a settlement","tags":["Settlements"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.settlements.retrieve(\"stl_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.settlements.retrieve(\"stl_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Settlements.Retrieve(ctx, \"stl_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEndpoint"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List webhook endpoints","tags":["Webhooks"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.webhookEndpoints.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.webhook_endpoints.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.List(ctx)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"post":{"description":"The response carries the signing secret. It is shown only here and after a rotation.","operationId":"createWebhookEndpoint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a webhook endpoint","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.webhookEndpoints.create({\n  url: \"https://example.com/webhooks/caibo\",\n});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.webhook_endpoints.create(url=\"https://example.com/webhooks/caibo\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.Create(ctx, &caibopay.WebhookEndpointCreate{\n\tURL: \"https://example.com/webhooks/caibo\",\n})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/webhook-endpoints/{id}":{"delete":{"operationId":"deleteWebhookEndpoint","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Delete a webhook endpoint","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nawait caibo.webhookEndpoints.delete(\"we_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nclient.webhook_endpoints.delete(\"we_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nif err := client.WebhookEndpoints.Delete(ctx, \"we_...\"); err != nil {\n\treturn err\n}"}]},"get":{"operationId":"getWebhookEndpoint","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a webhook endpoint","tags":["Webhooks"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.webhookEndpoints.retrieve(\"we_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.webhook_endpoints.retrieve(\"we_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.Retrieve(ctx, \"we_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]},"patch":{"operationId":"updateWebhookEndpoint","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Update, pause or resume a webhook endpoint","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.webhookEndpoints.update(\"we_...\", {});"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.webhook_endpoints.update(\"we_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.Update(ctx, \"we_...\", &caibopay.WebhookEndpointUpdate{})\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/webhook-endpoints/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List recent deliveries to an endpoint","tags":["Webhooks"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.webhookEndpoints.listDeliveries(\"we_...\")) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.webhook_endpoints.list_deliveries(\"we_...\"):\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.ListDeliveries(ctx, \"we_...\", nil)\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/webhook-endpoints/{id}/ping":{"post":{"operationId":"pingWebhookEndpoint","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}},"description":"Accepted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Send a test event","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.webhookEndpoints.ping(\"we_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.webhook_endpoints.ping(\"we_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.Ping(ctx, \"we_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/webhook-endpoints/{id}/rotate-secret":{"post":{"description":"Returns the new secret. For a grace period deliveries are signed with both the new and the previous secret.","operationId":"rotateWebhookSecret","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Rotate the signing secret","tags":["Webhooks"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.webhookEndpoints.rotateSecret(\"we_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.webhook_endpoints.rotate_secret(\"we_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.WebhookEndpoints.RotateSecret(ctx, \"we_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/withdrawals":{"get":{"description":"Newest first.","operationId":"listWithdrawals","parameters":[{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Return items after this id (the next_cursor of the previous page).","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only items with this status.","in":"query","name":"status","required":false,"schema":{"enum":["pending_approval","processing","completed","failed","cancelled"],"type":"string"}},{"description":"Only the withdrawals to this settlement destination.","in":"query","name":"destination_id","required":false,"schema":{"pattern":"^dest_[0-9a-z]+$","type":"string"}},{"description":"Only items created at or after this RFC 3339 timestamp.","in":"query","name":"created_after","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only items created before this RFC 3339 timestamp.","in":"query","name":"created_before","required":false,"schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Withdrawal"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["data","has_more"],"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"List withdrawals","tags":["Withdrawals"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nfor await (const item of caibo.withdrawals.list()) {\n  console.log(item);\n}"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nfor item in client.withdrawals.list():\n    print(item)"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nfor item, err := range client.Withdrawals.ListAll(ctx, nil) {\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(item)\n}"}]},"post":{"description":"Holds the amount plus the fee from the available balance and sends it to one of your settlement destinations, in the destination's currency, asynchronously. The fee is fixed when the withdrawal is created and stated in the response (fee, total); the balance must cover both. A withdrawal the balance cannot fund is created with status failed and failure_code insufficient_funds. Above the account's approval threshold it is created pending_approval and waits for the platform's operators. Repeating the request with the same Idempotency-Key returns the same withdrawal and never sends twice.","operationId":"createWithdrawal","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}},"description":"The request was already made: the existing resource is returned.","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The Idempotency-Key was used with a different request, or the resource is in conflict."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is well formed but cannot be carried out."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Create a withdrawal","tags":["Withdrawals"],"x-required-scope":"write","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.withdrawals.create({\n  amount: \"100.00\",\n  destination_id: \"dest_...\",\n}, { idempotencyKey: \"your-operation-id\" });"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.withdrawals.create(amount=\"100.00\", destination_id=\"dest_...\", idempotency_key=\"your-operation-id\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Withdrawals.Create(ctx, &caibopay.WithdrawalCreate{\n\tAmount: \"100.00\",\n\tDestinationID: \"dest_...\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}},"/v1/withdrawals/{id}":{"get":{"operationId":"getWithdrawal","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is not valid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key is missing or not valid."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks the required scope."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such resource."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"An error on our side. Safe to retry with the same Idempotency-Key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."}},"summary":"Retrieve a withdrawal","tags":["Withdrawals"],"x-required-scope":"read","x-codeSamples":[{"lang":"js","label":"Node.js","source":"import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.withdrawals.retrieve(\"wdr_...\");"},{"lang":"python","label":"Python","source":"import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.withdrawals.retrieve(\"wdr_...\")"},{"lang":"go","label":"Go","source":"client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Withdrawals.Retrieve(ctx, \"wdr_...\")\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"}]}}},"security":[{"apiKey":[]}],"servers":[{"url":"https://api-sandbox.caibopay.app","description":"Sandbox"},{"url":"https://api.caibopay.app","description":"Live"}],"tags":[{"description":"Who the credential is: the account, its environment and the key in use.","name":"Account"},{"description":"The people who act for the account through the dashboard, and their invitations.","name":"Members"},{"description":"What the account can do.","name":"Capabilities"},{"description":"Funds per currency, by how usable they are, and the statement behind them.","name":"Balances"},{"description":"The people and businesses you act for.","name":"Customers"},{"description":"Who is paid.","name":"Beneficiaries"},{"description":"Frozen prices.","name":"Quotes"},{"description":"Money out.","name":"Payouts"},{"description":"Your own funds to your own bank account: settlement destinations and withdrawals.","name":"Withdrawals"},{"description":"Money in from a payer, out to a beneficiary, at a quoted price.","name":"Remittances"},{"description":"Money in: funding accounts and the pay-ins that arrive through them.","name":"Funding"},{"description":"Money given back: part or all of a credited pay-in sent back to its payer.","name":"Refunds"},{"description":"What the account is owed per period, and its transfer to the account's settlement destination.","name":"Settlements"},{"description":"Read-only reports of a period: operations, fees, conversions and balances, as JSON or CSV.","name":"Reports"},{"description":"Inconsistencies found about your operations, and where their investigation stands.","name":"Reconciliation"},{"description":"What happened, in order.","name":"Events"},{"description":"Events pushed to your servers, signed.","name":"Webhooks"},{"description":"Sandbox-only helpers.","name":"Sandbox"},{"description":"The hosted remittance page: its configuration and branding, the hostnames it is served at, and the sessions your customers go through.","name":"Hosted pages"}]}