> ## 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.

# Create on-chain quote

> Creates a new wallet-funded onchain quote.

The amount field must appear on exactly one side (from or to).
Whichever side carries the amount is the fixed side; the server
calculates the other. The source wallet is required because onchain quote
execution is submitted directly by the client on-chain.



## OpenAPI

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


    PWS exposes Swaps (institutional FX-style trading), Conversions (rule-driven
    and one-shot fiat ↔ crypto value movement), retail-style Quotes and Price
    Trigger Swaps, end-user Users / Verifications, 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: []
    ApiNonce: []
    ApiSign: []
tags:
  - name: Users
    description: >-
      Users and headless-user onboarding flows that the partner manages.


      - **Create User** provisions a user with full identity verification fields
      collected up front.

      - **Create Headless User** provisions a lightweight user when your
      licensing agreement allows you to manage KYC data outside Payward.

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

      - **Update User** updates user profile fields and may re-trigger
      verification.


      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: Conversions
    description: >-
      Rule-driven and one-shot fiat ↔ crypto value movement, including
      conversion rules, deposits, and whitelisted wallets.
  - 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: 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: 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}/onchain-quotes:
    post:
      tags:
        - On-chain Swaps
      summary: Create on-chain quote
      description: >-
        Creates a new wallet-funded onchain quote.


        The amount field must appear on exactly one side (from or to).

        Whichever side carries the amount is the fixed side; the server

        calculates the other. The source wallet is required because onchain
        quote

        execution is submitted directly by the client on-chain.
      operationId: createOnchainQuote
      parameters:
        - $ref: '#/components/parameters/AccountIdPath'
      requestBody:
        content:
          application/json:
            schema:
              description: |-
                Request to create a new wallet-funded onchain quote.

                Exactly one of `from.amount` or `to.amount` must be provided to
                indicate which side of the trade is fixed. The server calculates
                the other side. Requests that set both amounts or omit both are
                rejected with a 400 Bad Request.
              type: object
              properties:
                from:
                  description: Source side of a create-onchain-quote request.
                  type: object
                  properties:
                    symbol:
                      description: Asset ticker symbol (e.g. "USDC"). Required.
                      type: string
                      minLength: 1
                      maxLength: 10
                    type:
                      description: Classification of the asset. Required.
                      type: string
                      enum:
                        - fiat
                        - crypto
                        - xstock
                        - stablecoin
                    amount:
                      description: >-
                        Amount to spend, as a non-negative decimal string.


                        Mutually exclusive with `to.amount`. Exactly one of
                        `from.amount` or

                        `to.amount` must be provided; set this to fix the source
                        side of the

                        trade and let the server calculate `to.amount`. Sending
                        both or

                        neither is rejected with a 400 Bad Request. Negative
                        values are

                        rejected with a 400 Bad Request.
                      type: string
                      pattern: ^[0-9]+(\.[0-9]+)?$
                      maxLength: 32
                    wallet:
                      description: Wallet used for wallet-funded onchain quote execution.
                      type: object
                      properties:
                        address:
                          description: >-
                            Client-controlled EVM wallet that will submit the
                            on-chain proxy transaction.
                          type: string
                          minLength: 1
                          maxLength: 64
                        network:
                          description: EVM network for this onchain quote.
                          type: string
                          enum:
                            - ethereum
                  required:
                    - wallet
                to:
                  description: Destination side of a create-onchain-quote request.
                  type: object
                  properties:
                    symbol:
                      description: Asset ticker symbol (e.g. "TSLAx"). Required.
                      type: string
                      minLength: 1
                      maxLength: 10
                    type:
                      description: Classification of the asset. Required.
                      type: string
                      enum:
                        - fiat
                        - crypto
                        - xstock
                        - stablecoin
                    amount:
                      description: >-
                        Amount to receive, as a non-negative decimal string.


                        Mutually exclusive with `from.amount`. Exactly one of
                        `from.amount`

                        or `to.amount` must be provided; set this to fix the
                        destination

                        side of the trade and let the server calculate
                        `from.amount`.

                        Sending both or neither is rejected with a 400 Bad
                        Request.

                        Negative values are rejected with a 400 Bad Request.
                      type: string
                      pattern: ^[0-9]+(\.[0-9]+)?$
                      maxLength: 32
              required:
                - from
                - to
            examples:
              buy-xstock-with-fixed-usdc:
                summary: Spend a fixed amount of USDC to buy TSLAx
                value:
                  from:
                    symbol: USDC
                    type: stablecoin
                    amount: '1853.40'
                    wallet:
                      address: 0x8888...8888
                      network: ethereum
                  to:
                    symbol: TSLAx
                    type: xstock
              sell-xstock-for-fixed-usdc:
                summary: Sell TSLAx to receive a fixed amount of USDC
                value:
                  from:
                    symbol: TSLAx
                    type: xstock
                    wallet:
                      address: 0x8888...8888
                      network: ethereum
                  to:
                    symbol: USDC
                    type: stablecoin
                    amount: '1853.40'
        required: true
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    description: Full representation of an onchain quote.
                    type: object
                    properties:
                      id:
                        description: Unique identifier for this onchain quote.
                        type: string
                      status:
                        description: Current lifecycle status of the onchain quote.
                        type: string
                        enum:
                          - offered
                          - executing
                          - executed
                          - expired
                          - failed
                          - pending
                      expires_at:
                        $ref: '#/components/schemas/google.protobuf.Timestamp'
                      from:
                        description: Source asset and amount for the trade.
                        type: object
                        properties:
                          symbol:
                            description: Asset ticker symbol (e.g. "BTC", "USD", "TSLAx").
                            type: string
                          name:
                            description: >-
                              Human-readable name of the asset (e.g. "Bitcoin"
                              for BTC). Populated by the server in responses.
                            type:
                              - string
                              - 'null'
                          type:
                            description: Classification of the asset.
                            type: string
                            enum:
                              - fiat
                              - crypto
                              - xstock
                              - stablecoin
                          amount:
                            description: Decimal amount as a string to preserve precision.
                            type: string
                      to:
                        description: Destination asset and amount for the trade.
                        type: object
                        properties:
                          symbol:
                            description: Asset ticker symbol (e.g. "BTC", "USD", "TSLAx").
                            type: string
                          name:
                            description: >-
                              Human-readable name of the asset (e.g. "Bitcoin"
                              for BTC). Populated by the server in responses.
                            type:
                              - string
                              - 'null'
                          type:
                            description: Classification of the asset.
                            type: string
                            enum:
                              - fiat
                              - crypto
                              - xstock
                              - stablecoin
                          amount:
                            description: Decimal amount as a string to preserve precision.
                            type: string
                      execution_details:
                        description: >-
                          Execution details for onchain quotes submitted
                          directly by the client on-chain.
                        type: object
                        properties:
                          chain_id:
                            description: Chain ID as a base-10 string.
                            type: string
                          proxy_address:
                            description: KrakenAtomicSwapProxy address.
                            type: string
                          proxy_swap_message:
                            description: >-
                              ABI-shaped proxy message for
                              KrakenAtomicSwapProxy.
                            type: object
                            properties:
                              atomic_message:
                                description: Backed atomic execution message.
                                type: object
                                properties:
                                  quote_id:
                                    description: >-
                                      On-chain quote ID from Backed's atomic
                                      message.
                                    type: string
                                  expiration:
                                    description: Expiration as Unix seconds.
                                    type: integer
                                    format: int64
                                  incoming_transfer:
                                    description: ABI-shaped token transfer.
                                    type: object
                                    properties:
                                      from:
                                        description: Sender address.
                                        type: string
                                      to:
                                        description: Recipient address.
                                        type: string
                                      token:
                                        description: Token contract address.
                                        type: string
                                      amount:
                                        description: Token amount in base units.
                                        type: string
                                  outgoing_transfer:
                                    description: ABI-shaped token transfer.
                                    type: object
                                    properties:
                                      from:
                                        description: Sender address.
                                        type: string
                                      to:
                                        description: Recipient address.
                                        type: string
                                      token:
                                        description: Token contract address.
                                        type: string
                                      amount:
                                        description: Token amount in base units.
                                        type: string
                              atomic_signature:
                                description: Backed signature over the atomic message.
                                type: string
                              signature:
                                description: >-
                                  Kraken EIP-712 onchain quote authorization
                                  signature.
                                type: string
                              client_address:
                                description: >-
                                  Client-controlled EVM wallet authorized for
                                  this proxy execution.
                                type: string
              examples:
                buy-xstock-with-fixed-usdc:
                  summary: Quote for spending a fixed amount of USDC to buy TSLAx
                  value:
                    data:
                      id: XQAAAAAAAAAAA1
                      status: offered
                      expires_at: '2026-04-23T16:00:30Z'
                      from:
                        symbol: USDC
                        name: USD Coin
                        type: stablecoin
                        amount: '1853.40'
                      to:
                        symbol: TSLAx
                        name: Tesla xStock
                        type: xstock
                        amount: '10'
                      execution_details:
                        chain_id: '1'
                        proxy_address: 0x1111...1111
                        proxy_swap_message:
                          atomic_message:
                            quote_id: 0x3333...3333
                            expiration: 1777034103
                            incoming_transfer:
                              from: 0x1111...1111
                              to: 0x4444...4444
                              token: 0x5555...5555
                              amount: '1853400000'
                            outgoing_transfer:
                              from: 0x4444...4444
                              to: 0x1111...1111
                              token: 0x6666...6666
                              amount: '10000000000000000000'
                          atomic_signature: 0xaaaa...aaaa
                          signature: 0x40e9...221c
                          client_address: 0x8888...8888
                sell-xstock-for-fixed-usdc:
                  summary: Quote for selling TSLAx to receive a fixed amount of USDC
                  value:
                    data:
                      id: XQAAAAAAAAAAA2
                      status: offered
                      expires_at: '2026-04-23T16:05:30Z'
                      from:
                        symbol: TSLAx
                        name: Tesla xStock
                        type: xstock
                        amount: '10'
                      to:
                        symbol: USDC
                        name: USD Coin
                        type: stablecoin
                        amount: '1853.40'
                      execution_details:
                        chain_id: '1'
                        proxy_address: 0x1111...1111
                        proxy_swap_message:
                          atomic_message:
                            quote_id: 0x7777...7777
                            expiration: 1777034403
                            incoming_transfer:
                              from: 0x1111...1111
                              to: 0x4444...4444
                              token: 0x6666...6666
                              amount: '10000000000000000000'
                            outgoing_transfer:
                              from: 0x4444...4444
                              to: 0x1111...1111
                              token: 0x5555...5555
                              amount: '1853400000'
                          atomic_signature: 0xbbbb...bbbb
                          signature: 0x51fa...701c
                          client_address: 0x8888...8888
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemBadRequest'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemUnauthenticated'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemForbidden'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemNotFound'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemResourceExhausted'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemInternal'
        '501':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemUnimplemented'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                description: >-
                  Type for errors when using the Kraken2025 format.


                  This format follows `Problem Details for HTTP APIs`
                  ([rfc7807]).


                  [rfc7807]: https://datatracker.ietf.org/doc/html/rfc7807
                type: object
                properties:
                  type:
                    description: >-
                      URL uniquely identifying the error type relative to an
                      operation
                    type: string
                    enum:
                      - tag:kraken.com,2025:gateway/Connect
                      - tag:kraken.com,2025:Unavailable
                      - tag:kraken.com,2025:InsufficientLiquidity
                  status:
                    description: HTTP status (provided for convenience)
                    type: integer
                    format: uint16
                    minimum: 0
                  title:
                    description: Short human-readable summary
                    type: string
                  detail:
                    description: Help to solve the problem
                    type:
                      - string
                      - 'null'
                  instance:
                    description: Link to debug data for this particular error
                    type:
                      - string
                      - 'null'
                  data:
                    description: Custom data attached to this problem
                  source:
                    description: Whether the service or gateway threw the error.
                    type: string
                    enum:
                      - Gateway
                required:
                  - data
                  - source
                  - status
                  - title
                  - type
        '504':
          description: Deadline exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDeadlineExceeded'
      security:
        - ApiKey: []
          ApiNonce: []
          ApiSign: []
components:
  parameters:
    AccountIdPath:
      in: path
      name: account_id
      required: true
      description: >-
        ID of the account the request applies to. This refers to one of the
        accounts held by the user the request is acting on behalf of (typically
        the user's main account, but any of the user's accounts is accepted).
        Routes the request to that specific account container.
      schema:
        $ref: '#/components/schemas/AccountId'
      example: W4BE9868GY65TB6523
  schemas:
    google.protobuf.Timestamp:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    ProblemBadRequest:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:BadRequest
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemUnauthenticated:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:Unauthenticated
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemForbidden:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:Forbidden
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemNotFound:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:NotFound
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemResourceExhausted:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:ResourceExhausted
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemInternal:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:gateway/ReadUpstream
            - tag:kraken.com,2025:gateway/WriteResponse
            - tag:kraken.com,2025:gateway/Connect
            - tag:kraken.com,2025:gateway/Fatal
            - tag:kraken.com,2025:Internal
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemUnimplemented:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:Unimplemented
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    ProblemDeadlineExceeded:
      type: object
      properties:
        type:
          description: URL uniquely identifying the error type relative to an operation
          type: string
          enum:
            - tag:kraken.com,2025:DeadlineExceeded
        status:
          description: HTTP status (provided for convenience)
          type: integer
          format: uint16
          minimum: 0
        title:
          description: Short human-readable summary
          type: string
        detail:
          description: Help to solve the problem
          type:
            - string
            - 'null'
        instance:
          description: Link to debug data for this particular error
          type:
            - string
            - 'null'
        data: {}
        source:
          description: Whether the service or gateway threw the error.
          type: string
          enum:
            - Gateway
      required:
        - data
        - source
        - status
        - title
        - type
    AccountId:
      type: string
      description: Canonical identifier for an account in the Payward public API.
      minLength: 14
      maxLength: 42
  securitySchemes:
    ApiKey:
      type: apiKey
      name: API-Key
      in: header
      description: Your public API key. Identifies the partner making the request.
    ApiNonce:
      type: apiKey
      name: API-Nonce
      in: header
      description: Monotonically increasing nonce included in the request signature.
    ApiSign:
      type: apiKey
      name: API-Sign
      in: header
      description: HMAC signature over the request, computed with your private key.

````