> ## Documentation Index
> Fetch the complete documentation index at: https://docs.services.payward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update conversion rule

> Updates an existing conversion rule. Replaces the destination, name, and
status in a single full-state PUT (matching the autoramp rule update
contract). The source side is immutable — re-create the conversion rule
if you need to change input asset, rail, or wallet.



## OpenAPI

````yaml /api-reference/openapi_v3_pws.json put /v1/accounts/{account_id}/conversions/{conversion_rule_id}
openapi: 3.1.0
info:
  title: Payward Services API
  description: >-
    The Payward Services (PWS) public API.


    PWS exposes Swaps (institutional FX-style trading), Conversion rules
    (rule-driven fiat ↔ crypto value movement), retail-style Quotes and Price
    Trigger Swaps, end-user Users / Verifications, Travel Rule address ownership
    verification, Funds (deposits, withdrawals, addresses, transactions),
    Portfolio, Earn, Reports, Webhooks, and Ramp (hosted fiat-to-crypto on-ramp
    checkout).


    All requests must be authenticated. All monetary values are decimal strings;
    all timestamps are ISO 8601 UTC. List endpoints are cursor-paginated. Errors
    follow a uniform shape (see `*ErrorResponse` schemas).
  version: v1
  contact:
    name: Payward Services API Support
    url: https://docs.payward.com
    email: api-support@payward.com
servers:
  - url: https://api.services.payward.com
    description: Production
security:
  - ApiKey: []
    ApiSign: []
    ApiNonce: []
tags:
  - name: Users
    description: >-
      User onboarding and status flows that the partner manages.


      - **Create User** provisions a user with an email and external reference.

      - **Get User** retrieves the user's profile, verification status, and
      required actions.


      Use the returned user `id` for calls that require the user's identifier.
  - name: Assets
    description: >-
      Catalog of assets available on the platform with retail-display metadata
      (logos, market data, descriptions).
  - name: Conversion rules
    x-group: Users
    description: >-
      Rule-driven fiat ↔ crypto value movement, including conversion rules and
      deposits.
  - name: On-demand conversions
    x-group: Users
    description: One-off conversions from an account balance to a wallet destination.
  - name: Earn
    description: >-
      Manage auto-earn preferences and retrieve allocation and reward
      information.
  - name: Funds
    description: >-
      Deposits, withdrawals, addresses, methods, and the consolidated
      funding-transactions ledger.
  - name: Bank Links
    description: >-
      Link US bank accounts to an account through a Kraken-hosted widget, then
      reference them for money movement.


      Two resources model a connection:


      - A **Bank Link** is the connection between one account and one banking
      institution. Create it to get a hosted-widget URL, and send the user there
      to choose their institution and approve access. One account can hold many
      Bank Links.

      - An **Account Link** is one bank account — a checking account, for
      example — that the user shared through that connection. One Bank Link owns
      one or more Account Links. Use `account_link_id` to reference the bank
      account when you move money.


      Both ids are opaque handles. Provider identifiers, access tokens, owner
      names, and raw bank numbers are never exposed.


      Eligibility is evaluated on every read, and ownership must match: the bank
      account's holder must match the account's verified holder. An account that
      fails ownership validation reports `ineligible` with the reason
      `name_mismatch`.


      Unlinking is permanent. Linking the same bank account again creates a new
      Bank Link and a new `account_link_id`; old ids stay valid only for reading
      history.
  - name: Portfolio
    description: End-user portfolio summary, history, and transaction views.
  - name: Price Trigger Swaps
    description: Limit-style orders that execute when a configured price trigger is met.
  - name: On-chain Swaps
    description: >-
      Wallet-funded onchain quote trading for xStock and USDC pairs. On-chain
      quotes settle on-chain through the Payward on-chain proxy contract.
  - name: Ramp
    description: >-
      Hosted fiat-to-crypto on-ramp checkout: country / fiat / payment-method /
      cryptocurrency-asset discovery, transaction limits and prospective quotes,
      and the hosted checkout URL.
  - name: Reports
    description: Settlement and reconciliation reports for the partner.
  - name: Swaps
    description: >-
      Direct partner-to-Payward swap quotes and executions (institutional
      FX-style trading).
  - name: Travel Rule Verifications
    description: Travel Rule address ownership verification flows.
  - name: Verifications
    description: Identity verification (KYC) submission and status for end users.
  - name: Webhooks
    description: Manage webhook subscriptions for asynchronous event delivery.
paths:
  /v1/accounts/{account_id}/conversions/{conversion_rule_id}:
    put:
      tags:
        - Conversion rules
      summary: Update conversion rule
      description: |-
        Updates an existing conversion rule. Replaces the destination, name, and
        status in a single full-state PUT (matching the autoramp rule update
        contract). The source side is immutable — re-create the conversion rule
        if you need to change input asset, rail, or wallet.
      operationId: updateConversionRule
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            description: >-
              Internet International Bank Account Number identifying the PWS
              account

              the conversion rule belongs to.
            type: string
            minLength: 14
            maxLength: 42
          style: simple
          example: AA23N84GGQN4WE6I
        - in: path
          name: conversion_rule_id
          required: true
          schema:
            description: Conversion rule identifier.
            type: string
            format: uuid
          style: simple
          example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        content:
          application/json:
            schema:
              description: >-
                Request to update an existing conversion rule.


                Full-state replacement (matching the upstream contract): the
                supplied

                `to`, `name`, and `status` replace the conversion rule's current
                values.

                The source side (`from`) is immutable — re-create the conversion
                rule to

                change input asset, rail, or source type.
              type: object
              properties:
                name:
                  description: >-
                    New partner-facing label for the conversion rule. This is a
                    full replacement:

                    omit to clear the existing label, send the current label to
                    keep it.
                  type: string
                  minLength: 1
                  maxLength: 128
                to:
                  description: >-
                    Destination side. Wallet destinations require `wallet`. Bank
                    destinations require `bank_account`, carrying either routing
                    details or an `account_link_id`.
                  type: object
                  properties:
                    symbol:
                      description: Asset ticker symbol (e.g. "EUR", "USDC", "BTC").
                      type: string
                      minLength: 1
                      maxLength: 16
                    type:
                      description: >-
                        Kind of endpoint. `wallet` uses `wallet`; `bank` uses
                        `bank_account` — raw routing details, or
                        `account_link_id` for a linked payout destination.
                      type: string
                      enum:
                        - wallet
                        - bank
                      title: EndpointType
                    wallet:
                      description: >-
                        Crypto wallet routing. On `to`: partner-supplied
                        destination. On

                        `from`: service-populated when autoramp provisions a
                        crypto inbound.

                        Ignored on the `from` side of requests.
                      type: object
                      properties:
                        via:
                          description: >-
                            Network identifier ("polygon", "ethereum",
                            "bitcoin", ...).
                          type: string
                          minLength: 1
                          maxLength: 32
                        address:
                          description: >-
                            On-chain address. Required when `Wallet` is set on a
                            destination

                            endpoint; populated by the service when set on a
                            source endpoint

                            response.
                          type: string
                          minLength: 1
                          maxLength: 256
                        memo:
                          description: >-
                            Memo for chains that require one (e.g. XLM, EOS,
                            Cosmos). Passed through to

                            the destination on off-ramp; populated on source
                            responses when upstream

                            provisions a memo'd inbound.
                          type: string
                          minLength: 1
                          maxLength: 64
                        tag:
                          description: >-
                            Destination tag for chains that require one (e.g.
                            XRP). Passed through to

                            the destination on off-ramp; populated on source
                            responses.
                          type: string
                          minLength: 1
                          maxLength: 64
                      required:
                        - via
                      title: Wallet
                    bank_account:
                      description: >-
                        Bank account routing. On `to`: partner-supplied
                        destination. On

                        `from`: service-populated when autoramp provisions a
                        fiat inbound.

                        Ignored on the `from` side of requests.
                      type: object
                      properties:
                        via:
                          description: >-
                            Bank rail identifier. A destination named by routing
                            details supports `sepa` and `fps`; one naming a
                            linked account with `account_link_id` uses `ach` or
                            `rtp`. Unsupported rails are rejected.
                          type: string
                          minLength: 1
                          maxLength: 32
                        bank:
                          description: >-
                            Bank / financial institution name for the
                            beneficiary account. Optional; passed through to the
                            destination on off-ramp.
                          type: string
                          maxLength: 256
                        iban:
                          description: International Bank Account Number (SEPA, SWIFT).
                          type: string
                          minLength: 14
                          maxLength: 42
                        bic:
                          description: Bank Identifier Code (SEPA, SWIFT).
                          type: string
                          minLength: 8
                          maxLength: 11
                        sort_code:
                          description: UK sort code (FPS).
                          type: string
                          minLength: 6
                          maxLength: 8
                        account_number:
                          description: >-
                            Account number. Required for FPS destinations; may
                            also be populated on source bank accounts.
                          type: string
                          minLength: 1
                          maxLength: 34
                        routing_number:
                          description: >-
                            Routing number populated on source bank accounts
                            when supplied by the provider; not accepted on
                            conversion destinations.
                          type: string
                          minLength: 1
                          maxLength: 32
                        swift:
                          description: >-
                            SWIFT code populated on source bank accounts when
                            supplied by the provider; not accepted on conversion
                            destinations.
                          type: string
                          minLength: 8
                          maxLength: 11
                        account_link_id:
                          description: >-
                            Public Account Link identifier for a US Rails payout
                            destination. Send it in place of raw routing
                            details, with `via` naming the rail the payout uses
                            (`ach` or `rtp`) — one link can be eligible for more
                            than one rail.
                          type: string
                          minLength: 1
                          maxLength: 128
                      required:
                        - via
                      title: BankAccount
                  required:
                    - symbol
                    - type
                  title: ConversionEndpoint
                  oneOf:
                    - $ref: '#/components/schemas/ConversionWalletDestination'
                    - $ref: '#/components/schemas/ConversionBankDestination'
                    - $ref: '#/components/schemas/ConversionLinkedBankDestination'
                status:
                  description: >-
                    New lifecycle status. Must be `active` or `paused`;
                    soft-delete via

                    the delete endpoint when it lands.
                  type: string
                  enum:
                    - active
                    - paused
              required:
                - to
                - status
              example:
                name: USDC to linked US bank account
                status: active
                to:
                  symbol: USD
                  type: bank
                  bank_account:
                    via: ach
                    account_link_id: al_8d341ff8-004a-44f0-b56e-af627f98bd9b
            examples:
              id-update-conversion-rule-ok:
                summary: UpdateConversionRule returns the updated rule
                value:
                  name: Renamed EUR autoramp
                  to:
                    symbol: USDC
                    type: wallet
                    wallet:
                      via: polygon
                      address: '0xabcdef1234567890abcdef1234567890abcdef12'
                  status: paused
              id-update-conversion-rule-rejects-symbol-change:
                summary: UpdateConversionRule rejects an attempt to change to.symbol
                value:
                  to:
                    symbol: USDT
                    type: wallet
                    wallet:
                      via: polygon
                      address: '0xabcdef1234567890abcdef1234567890abcdef12'
                  status: active
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    description: The updated conversion rule.
                    type: object
                    properties:
                      id:
                        description: Unique identifier for this conversion rule.
                        type: string
                        format: uuid
                      name:
                        description: Optional partner-facing label for the conversion rule.
                        type: string
                      from:
                        description: >-
                          Source side. On reads, `address`/`bank_account` are
                          populated by the

                          service from the autoramp-provisioned inbound (where
                          partner deposits

                          funds). On writes, those fields are ignored — partners
                          only specify

                          symbol, type, and via on the source side.
                        type: object
                        properties:
                          symbol:
                            description: Asset ticker symbol (e.g. "EUR", "USDC", "BTC").
                            type: string
                            minLength: 1
                            maxLength: 16
                          type:
                            description: >-
                              Kind of endpoint. `wallet` uses `wallet`; `bank`
                              uses `bank_account` routing. The source endpoint
                              is provisioned for you — any `bank_account` or
                              `address` you supply here is ignored.
                            type: string
                            enum:
                              - wallet
                              - bank
                            title: EndpointType
                          wallet:
                            description: >-
                              Crypto wallet routing. On `to`: partner-supplied
                              destination. On

                              `from`: service-populated when autoramp provisions
                              a crypto inbound.

                              Ignored on the `from` side of requests.
                            type: object
                            properties:
                              via:
                                description: >-
                                  Network identifier ("polygon", "ethereum",
                                  "bitcoin", ...).
                                type: string
                                minLength: 1
                                maxLength: 32
                              address:
                                description: >-
                                  On-chain address. Required when `Wallet` is
                                  set on a destination

                                  endpoint; populated by the service when set on
                                  a source endpoint

                                  response.
                                type: string
                                minLength: 1
                                maxLength: 256
                              memo:
                                description: >-
                                  Memo for chains that require one (e.g. XLM,
                                  EOS, Cosmos). Passed through to

                                  the destination on off-ramp; populated on
                                  source responses when upstream

                                  provisions a memo'd inbound.
                                type: string
                                minLength: 1
                                maxLength: 64
                              tag:
                                description: >-
                                  Destination tag for chains that require one
                                  (e.g. XRP). Passed through to

                                  the destination on off-ramp; populated on
                                  source responses.
                                type: string
                                minLength: 1
                                maxLength: 64
                            required:
                              - via
                            title: Wallet
                          bank_account:
                            description: >-
                              Bank account routing. On `to`: partner-supplied
                              destination. On

                              `from`: service-populated when autoramp provisions
                              a fiat inbound.

                              Ignored on the `from` side of requests.
                            type: object
                            properties:
                              via:
                                description: >-
                                  Bank rail identifier. Conversion destinations
                                  currently support `sepa` and `fps`;
                                  unsupported rails are rejected.
                                type: string
                                minLength: 1
                                maxLength: 32
                              bank:
                                description: >-
                                  Bank / financial institution name for the
                                  beneficiary account. Optional; passed through
                                  to the destination on off-ramp.
                                type: string
                                maxLength: 256
                              iban:
                                description: >-
                                  International Bank Account Number (SEPA,
                                  SWIFT).
                                type: string
                                minLength: 14
                                maxLength: 42
                              bic:
                                description: Bank Identifier Code (SEPA, SWIFT).
                                type: string
                                minLength: 8
                                maxLength: 11
                              sort_code:
                                description: UK sort code (FPS).
                                type: string
                                minLength: 6
                                maxLength: 8
                              account_number:
                                description: >-
                                  Account number. Required for FPS destinations;
                                  may also be populated on source bank accounts.
                                type: string
                                minLength: 1
                                maxLength: 34
                              routing_number:
                                description: >-
                                  Routing number populated on source bank
                                  accounts when supplied by the provider; not
                                  accepted on conversion destinations.
                                type: string
                                minLength: 1
                                maxLength: 32
                              swift:
                                description: >-
                                  SWIFT code populated on source bank accounts
                                  when supplied by the provider; not accepted on
                                  conversion destinations.
                                type: string
                                minLength: 8
                                maxLength: 11
                              payee_name:
                                description: >-
                                  Payee / account-holder name on the provisioned
                                  inbound (named account).

                                  Populated once the virtual account is
                                  provisioned — on Get and List for SEPA (not
                                  currently returned for FPS); the create
                                  response carries it only when the account was
                                  already

                                  provisioned at creation time. Rejected on a
                                  destination.
                                type: string
                                minLength: 1
                                maxLength: 140
                              bank_address:
                                description: >-
                                  Bank / EMI address on the provisioned inbound.
                                  Populated once the virtual

                                  account is provisioned — on Get and List for
                                  SEPA (not currently returned for FPS); the
                                  create response

                                  carries it only when the account was already
                                  provisioned at creation

                                  time. Rejected on a destination.
                                type: string
                                minLength: 1
                                maxLength: 256
                              payee_address:
                                description: >-
                                  Payee's registered postal address on the
                                  provisioned inbound (on-ramp

                                  source only) — distinct from `bank_address`,
                                  which is the bank / EMI

                                  address. Populated once the virtual account is
                                  provisioned — on Get and List for SEPA (not
                                  currently returned for FPS); the create
                                  response carries it only when the account was

                                  already provisioned at creation time. Rejected
                                  on a destination.
                                type: string
                                minLength: 1
                                maxLength: 256
                            required:
                              - via
                            title: BankAccount
                        required:
                          - type
                        title: ConversionEndpoint
                      to:
                        description: >-
                          Destination side. Wallet destinations require
                          `wallet`. Bank destinations require `bank_account`,
                          carrying either routing details or an
                          `account_link_id`.
                        type: object
                        properties:
                          symbol:
                            description: Asset ticker symbol (e.g. "EUR", "USDC", "BTC").
                            type: string
                            minLength: 1
                            maxLength: 16
                          type:
                            description: >-
                              Kind of endpoint. `wallet` uses `wallet`; `bank`
                              uses `bank_account` — raw routing details, or
                              `account_link_id` for a linked payout destination.
                            type: string
                            enum:
                              - wallet
                              - bank
                            title: EndpointType
                          wallet:
                            description: >-
                              Crypto wallet routing. On `to`: partner-supplied
                              destination. On

                              `from`: service-populated when autoramp provisions
                              a crypto inbound.

                              Ignored on the `from` side of requests.
                            type: object
                            properties:
                              via:
                                description: >-
                                  Network identifier ("polygon", "ethereum",
                                  "bitcoin", ...).
                                type: string
                                minLength: 1
                                maxLength: 32
                              address:
                                description: >-
                                  On-chain address. Required when `Wallet` is
                                  set on a destination

                                  endpoint; populated by the service when set on
                                  a source endpoint

                                  response.
                                type: string
                                minLength: 1
                                maxLength: 256
                              memo:
                                description: >-
                                  Memo for chains that require one (e.g. XLM,
                                  EOS, Cosmos). Passed through to

                                  the destination on off-ramp; populated on
                                  source responses when upstream

                                  provisions a memo'd inbound.
                                type: string
                                minLength: 1
                                maxLength: 64
                              tag:
                                description: >-
                                  Destination tag for chains that require one
                                  (e.g. XRP). Passed through to

                                  the destination on off-ramp; populated on
                                  source responses.
                                type: string
                                minLength: 1
                                maxLength: 64
                            required:
                              - via
                            title: Wallet
                          bank_account:
                            description: >-
                              Bank account routing. On `to`: partner-supplied
                              destination. On

                              `from`: service-populated when autoramp provisions
                              a fiat inbound.

                              Ignored on the `from` side of requests.
                            type: object
                            properties:
                              via:
                                description: >-
                                  Bank rail identifier. A destination named by
                                  routing details supports `sepa` and `fps`; one
                                  naming a linked account with `account_link_id`
                                  uses `ach` or `rtp`. Unsupported rails are
                                  rejected.
                                type: string
                                minLength: 1
                                maxLength: 32
                              bank:
                                description: >-
                                  Bank / financial institution name for the
                                  beneficiary account. Optional; passed through
                                  to the destination on off-ramp.
                                type: string
                                maxLength: 256
                              iban:
                                description: >-
                                  International Bank Account Number (SEPA,
                                  SWIFT).
                                type: string
                                minLength: 14
                                maxLength: 42
                              bic:
                                description: Bank Identifier Code (SEPA, SWIFT).
                                type: string
                                minLength: 8
                                maxLength: 11
                              sort_code:
                                description: UK sort code (FPS).
                                type: string
                                minLength: 6
                                maxLength: 8
                              account_number:
                                description: >-
                                  Account number. Required for FPS destinations;
                                  may also be populated on source bank accounts.
                                type: string
                                minLength: 1
                                maxLength: 34
                              routing_number:
                                description: >-
                                  Routing number populated on source bank
                                  accounts when supplied by the provider; not
                                  accepted on conversion destinations.
                                type: string
                                minLength: 1
                                maxLength: 32
                              swift:
                                description: >-
                                  SWIFT code populated on source bank accounts
                                  when supplied by the provider; not accepted on
                                  conversion destinations.
                                type: string
                                minLength: 8
                                maxLength: 11
                            required:
                              - via
                            title: BankAccount
                        required:
                          - type
                        title: ConversionEndpoint
                        oneOf:
                          - $ref: '#/components/schemas/ConversionWalletDestination'
                          - $ref: '#/components/schemas/ConversionBankDestination'
                          - $ref: >-
                              #/components/schemas/ConversionLinkedBankDestination
                      status:
                        description: Lifecycle status (active | paused).
                        type: string
                        enum:
                          - active
                          - paused
                          - provisioning
                      created_at:
                        $ref: '#/components/schemas/google.protobuf.Timestamp'
                      updated_at:
                        $ref: '#/components/schemas/google.protobuf.Timestamp'
                    required:
                      - id
                      - from
                      - to
                      - status
                      - created_at
                      - updated_at
                    title: ConversionRule
                required:
                  - data
              examples:
                id-update-conversion-rule-ok:
                  summary: UpdateConversionRule returns the updated rule
                  value:
                    data:
                      id: 550e8400-e29b-41d4-a716-446655440000
                      name: Renamed EUR autoramp
                      from:
                        symbol: EUR
                        type: bank
                        bank_account:
                          via: sepa
                          payee_name: Delta Commerce B.V.
                          bank_address: Borschestraat 12, Amsterdam
                          payee_address: >-
                            71 Sir John Rogerson's Quay, Dublin, D02 R296,
                            Ireland
                      to:
                        symbol: USDC
                        type: wallet
                        wallet:
                          via: polygon
                          address: '0xabcdef1234567890abcdef1234567890abcdef12'
                      status: paused
                      created_at: '2026-05-25T10:30:00Z'
                      updated_at: '2026-05-25T11:00:00Z'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BadRequestError'
                  - $ref: >-
                      #/components/schemas/ConversionInvalidWithdrawalAddressErrorResponse
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionsNotFoundErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleAlreadyDeletedErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceExhaustedError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
        '501':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnimplementedError'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnavailableError'
        '504':
          description: Deadline exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeadlineExceededError'
      security:
        - ApiKey: []
          ApiSign: []
          ApiNonce: []
components:
  schemas:
    ConversionWalletDestination:
      title: Wallet destination
      type: object
      additionalProperties: false
      required:
        - symbol
        - type
        - wallet
      properties:
        symbol:
          $ref: '#/components/schemas/ConversionEndpointSymbol'
        type:
          type: string
          enum:
            - wallet
        wallet:
          $ref: '#/components/schemas/ConversionEndpointWallet'
    ConversionBankDestination:
      title: Bank destination with routing details
      type: object
      additionalProperties: false
      required:
        - symbol
        - type
        - bank_account
      properties:
        symbol:
          $ref: '#/components/schemas/ConversionEndpointSymbol'
        type:
          type: string
          enum:
            - bank
        bank_account:
          $ref: '#/components/schemas/ConversionEndpointBankAccount'
    ConversionLinkedBankDestination:
      title: Linked bank destination
      type: object
      additionalProperties: false
      required:
        - symbol
        - type
        - bank_account
      properties:
        symbol:
          type: string
          enum:
            - USD
        type:
          type: string
          enum:
            - bank
        bank_account:
          description: Names a linked bank account instead of carrying routing details.
          type: object
          additionalProperties: false
          required:
            - via
            - account_link_id
          properties:
            via:
              description: >-
                Rail the payout uses. Required — one link can be eligible for
                more than one rail.
              type: string
              enum:
                - ach
                - rtp
            account_link_id:
              $ref: '#/components/schemas/ConversionAccountLinkId'
    google.protobuf.Timestamp:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    BadRequestError:
      description: Request validation failed or the request could not be processed.
      allOf:
        - $ref: '#/components/schemas/PwsValidationErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsValidationError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 400
                    code:
                      type: string
                      enum:
                        - bad_request
    ConversionInvalidWithdrawalAddressErrorResponse:
      description: >-
        The off-ramp destination bank account is missing or has an invalid field
        for the chosen withdrawal rail (e.g. `bic` is required for SEPA but
        absent). `causes[]` names each offending field and is non-empty.
      type: object
      properties:
        error:
          description: Error details.
          type: object
          properties:
            type:
              type: string
              enum:
                - conversions_error
            status:
              type: integer
              format: uint16
              enum:
                - 400
            instance:
              type: string
            code:
              type: string
              enum:
                - conversion_invalid_withdrawal_address
            doc_url:
              type:
                - string
                - 'null'
              format: uri
            causes:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/ConversionInvalidWithdrawalAddressCause'
              description: One entry per missing or invalid beneficiary bank field.
          required:
            - type
            - status
            - instance
            - code
            - causes
      required:
        - error
    UnauthenticatedError:
      description: Authentication credentials are missing, invalid, or not accepted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 401
                    code:
                      type: string
                      enum:
                        - unauthenticated
    ForbiddenError:
      description: The caller is not allowed to perform this operation.
      oneOf:
        - title: Forbidden
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        status:
                          type: integer
                          format: int32
                          enum:
                            - 403
                        code:
                          type: string
                          enum:
                            - forbidden
        - $ref: '#/components/schemas/GatewayError'
    ConversionsNotFoundErrorResponse:
      description: The requested resource does not exist.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 404
                    code:
                      type: string
                      enum:
                        - not_found
    RuleAlreadyDeletedErrorResponse:
      description: The conversion rule was already deleted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 409
                    code:
                      type: string
                      enum:
                        - rule_already_deleted
    ResourceExhaustedError:
      description: The request was rate limited or a resource quota was exhausted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 429
                    code:
                      type: string
                      enum:
                        - resource_exhausted
    InternalError:
      description: An unexpected server-side error occurred.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 500
                    code:
                      type: string
                      enum:
                        - internal
    UnimplementedError:
      description: The operation is not implemented by the upstream service.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 501
                    code:
                      type: string
                      enum:
                        - unimplemented
    UnavailableError:
      description: The service is temporarily unavailable.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 503
                    code:
                      type: string
                      enum:
                        - unavailable
    DeadlineExceededError:
      description: The upstream service did not complete the request before the deadline.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 504
                    code:
                      type: string
                      enum:
                        - deadline_exceeded
    ConversionEndpointSymbol:
      description: Asset ticker symbol for a conversion endpoint.
      type: string
      minLength: 1
      maxLength: 16
    ConversionEndpointWallet:
      description: Crypto wallet routing for a conversion destination.
      type: object
      required:
        - via
      properties:
        via:
          description: >-
            Network identifier (for example `polygon`, `ethereum`, or
            `bitcoin`).
          type: string
          minLength: 1
          maxLength: 32
        address:
          description: On-chain destination address.
          type: string
          minLength: 1
          maxLength: 256
        memo:
          description: Memo for networks that require one.
          type: string
          minLength: 1
          maxLength: 64
        tag:
          description: Destination tag for networks that require one.
          type: string
          minLength: 1
          maxLength: 64
    ConversionEndpointBankAccount:
      description: Raw bank-account routing for a conversion destination.
      type: object
      additionalProperties: false
      required:
        - via
      properties:
        via:
          description: >-
            Bank rail identifier for a destination named by routing details:
            `sepa` or `fps`.
          type: string
          minLength: 1
          maxLength: 32
        bank:
          description: Beneficiary financial-institution name.
          type: string
          maxLength: 256
        iban:
          description: International Bank Account Number.
          type: string
          minLength: 14
          maxLength: 42
        bic:
          description: Bank Identifier Code.
          type: string
          minLength: 8
          maxLength: 11
        sort_code:
          description: UK sort code.
          type: string
          minLength: 6
          maxLength: 8
        account_number:
          description: Beneficiary account number.
          type: string
          minLength: 1
          maxLength: 34
        routing_number:
          description: >-
            ABA routing number returned on source bank accounts; not accepted on
            destinations.
          type: string
          minLength: 1
          maxLength: 32
        swift:
          description: >-
            SWIFT code returned on source bank accounts; not accepted on
            destinations.
          type: string
          minLength: 8
          maxLength: 11
    ConversionAccountLinkId:
      description: >-
        Public Account Link identifier for a US Rails payout destination, sent
        inside `bank_account` alongside the rail in `via`.
      type: string
      minLength: 1
      maxLength: 128
    PwsValidationErrorEnvelope:
      description: Error envelope for request validation failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsValidationError'
          description: Validation error details.
    PwsValidationError:
      description: Standard PWS API error object for request validation failures.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
        causes:
          description: Validation failures that contributed to the error.
          type: array
          items:
            $ref: '#/components/schemas/PwsErrorCause'
    ConversionInvalidWithdrawalAddressCause:
      description: >-
        A single contributor to an invalid withdrawal address error. Each cause
        names one missing or invalid beneficiary bank field.
      type: object
      properties:
        field:
          description: >-
            Dot-notation path to the offending request field (e.g.
            `to.bank_account.bic`).
          type: string
        message:
          description: >-
            Human-readable explanation of why the field is required or invalid
            for the chosen withdrawal rail.
          type: string
    PwsGeneralErrorEnvelope:
      description: Error envelope for operational or domain failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsGeneralError'
          description: General error details.
    PwsGeneralError:
      description: Standard PWS API error object for non-validation failures.
      allOf:
        - $ref: '#/components/schemas/PwsErrorBase'
        - type: object
          properties:
            causes:
              description: Additional error details, when present.
              type: array
              items:
                type: object
                additionalProperties: true
    GatewayError:
      title: Gateway
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - status
            - code
          properties:
            type:
              type: string
              const: service_error
            status:
              type: integer
              format: int32
              const: 403
            code:
              type: string
              const: gateway
    PwsErrorCause:
      description: A single request validation failure.
      type: object
      required:
        - field
        - message
      properties:
        field:
          description: Dot-notation path to the offending request field.
          type: string
        message:
          description: Human-readable explanation of the failed validation rule.
          type: string
    PwsErrorBase:
      description: Common fields present on every PWS API error object.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
  securitySchemes:
    ApiKey:
      type: apiKey
      name: API-Key
      in: header
      description: Your public API key. Identifies the partner making the request.
    ApiSign:
      type: apiKey
      name: API-Sign
      in: header
      description: HMAC signature over the request, computed with your private key.
    ApiNonce:
      type: apiKey
      name: API-Nonce
      in: header
      description: Monotonically increasing nonce included in the request signature.

````