openapi: 3.0.0

info:
  title: Ramp REST API
  version: "2025-04-25"
  description: Payward Ramp REST API

servers:
  - url: https://nexus.kraken.com
    description: Production Server

security:
  - API-Key: []
    API-Sign: []

tags:
  - name: Supported options
  - name: Quotes
  - name: Checkout
  - name: Webhooks
    description: Partner-implemented endpoints for receiving transaction updates

paths:
  # Ramp
  "/v1/ramp/buy/crypto":
    get:
      operationId: getRampBuyCryptoAssets
      summary: List buy crypto assets
      tags:
        - Supported options
      description: |
        List cryptocurrency assets available for Ramp buy transactions, including the
        networks, withdrawal methods, and provider-specific identifiers surfaced to Ramp partners.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      assets:
                        type: array
                        description: Supported crypto assets for Ramp buy operations.
                        items:
                          $ref: "#/components/schemas/RampCryptoAsset"
                    required:
                      - assets
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/fiat-currencies":
    get:
      operationId: getRampFiatCurrencies
      summary: List fiat currencies
      tags:
        - Supported options
      description: |
        List fiat currencies supported for funding Ramp transactions.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      currencies:
                        type: array
                        description: Fiat currencies that can be used for Ramp deposits.
                        items:
                          $ref: "#/components/schemas/RampFiatCurrency"
                    required:
                      - currencies
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/payment-methods":
    get:
      operationId: getRampPaymentMethods
      summary: List payment methods
      tags:
        - Supported options
      description: |
        List fiat payment methods supported for Ramp deposits, including optional mapping
        to provider-specific identifiers.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      methods:
                        type: array
                        description: Supported funding methods for Ramp operations.
                        items:
                          $ref: "#/components/schemas/RampPaymentMethod"
                    required:
                      - methods
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/countries":
    get:
      operationId: getRampCountries
      summary: List countries
      tags:
        - Supported options
      description: |
        List countries and regions where Ramp is available. Depending on regulatory
        rules, availability may be scoped to specific states, provinces, or regions.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      countries:
                        type: array
                        description: Countries and sub-regions that support Ramp transactions.
                        items:
                          $ref: "#/components/schemas/RampCountry"
                    required:
                      - countries
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/limits":
    get:
      operationId: getRampLimits
      summary: Get limits
      tags:
        - Quotes
      description: |
        Retrieve combined min/max limits for a Ramp transaction configuration.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: in_asset
          required: true
          description: Fiat asset code for the deposit side (input asset). Use `GET /v1/ramp/fiat-currencies` to discover supported fiat currencies.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: in_method
          required: true
          description: Funding type used for the fiat deposit side. Use `GET /v1/ramp/payment-methods` to discover supported payment methods.
          schema:
            type: string
        - in: query
          name: out_asset
          required: true
          description: Crypto asset code for the withdrawal side (output asset). Use `GET /v1/ramp/buy/crypto` to discover supported crypto assets.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: out_method
          required: true
          description: Payward withdrawal method name. Use `GET /v1/ramp/buy/crypto` to discover available withdrawal methods for each crypto asset.
          schema:
            type: string
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      limits:
                        type: object
                        description: Transaction limits for deposit and withdrawal sides.
                        properties:
                          deposit:
                            $ref: "#/components/schemas/RampWireTransactionRange"
                          withdrawal:
                            $ref: "#/components/schemas/RampWireTransactionRange"
                        required:
                          - deposit
                          - withdrawal
                      final_combined:
                        type: object
                        description: Combined limits converted to both input and output assets.
                        properties:
                          in_asset:
                            description: Limits denominated in the input asset.
                            $ref: "#/components/schemas/RampWireTransactionRange"
                          out_asset:
                            description: Limits denominated in the output asset.
                            $ref: "#/components/schemas/RampWireTransactionRange"
                        required:
                          - in_asset
                          - out_asset
                    required:
                      - limits
                      - final_combined
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/quotes/prospective":
    get:
      operationId: getRampProspectiveQuote
      summary: Get prospective quote
      tags:
        - Quotes
      description: |
        Retrieve a prospective quote for a Ramp transaction without reserving liquidity.
        Use this to preview spend/receive amounts before creating a checkout URL.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: in_asset
          required: true
          description: Asset being deposited (input asset / fiat side). Use `GET /v1/ramp/fiat-currencies` to discover supported fiat currencies.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: in_method
          required: true
          description: Funding method used for the deposit. Use `GET /v1/ramp/payment-methods` to discover supported payment methods.
          schema:
            type: string
        - in: query
          name: in_amount
          required: true
          description: Amount to deposit (input amount).
          schema:
            $ref: "#/components/schemas/BigDecimal"
        - in: query
          name: out_asset
          required: true
          description: Asset being received (output asset / crypto side). Use `GET /v1/ramp/buy/crypto` to discover supported crypto assets.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: out_method
          required: true
          description: Withdrawal method for the crypto asset. Use `GET /v1/ramp/buy/crypto` to discover available withdrawal methods for each crypto asset.
          schema:
            type: string
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
        - in: query
          name: affiliate_fee_bps
          required: false
          description: Affiliate fee in basis points to attribute to the partner (0-10000 where 100 = 1%). This fee is additive to the platform fee, increasing the total fee charged to the user. The resulting affiliate_fee in the response reflects the partner's portion of the total fee.
          schema:
            $ref: "#/components/schemas/BasisPoints"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      spend:
                        $ref: "#/components/schemas/RampAssetDetails"
                      receive:
                        $ref: "#/components/schemas/RampAssetDetails"
                      unit_price:
                        $ref: "#/components/schemas/RampUnitPrice"
                    required:
                      - spend
                      - receive
                      - unit_price
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  "/v1/ramp/checkout":
    get:
      operationId: getRampCheckout
      summary: Get checkout URL
      tags:
        - Checkout
      description: |
        Generate a hosted Ramp checkout URL for the provided transaction configuration.
        The response echoes the request parameters so the Ramp partner can confirm what
        was submitted.
      parameters:
        - $ref: "#/components/parameters/PaywardVersion"
        - in: query
          name: in_asset
          required: true
          description: Fiat asset code the user will deposit (input asset). Use `GET /v1/ramp/fiat-currencies` to discover supported fiat currencies.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: in_method
          required: true
          description: Funding method for the deposit. Use `GET /v1/ramp/payment-methods` to discover supported payment methods.
          schema:
            type: string
        - in: query
          name: in_amount
          required: true
          description: Amount to deposit (input amount).
          schema:
            $ref: "#/components/schemas/BigDecimal"
        - in: query
          name: out_asset
          required: true
          description: Crypto asset the user receives (output asset). Use `GET /v1/ramp/buy/crypto` to discover supported crypto assets.
          schema:
            type: string
            maxLength: 16
        - in: query
          name: out_method
          required: true
          description: Withdrawal method identifier. Use `GET /v1/ramp/buy/crypto` to discover available withdrawal methods for each crypto asset.
          schema:
            type: string
        - in: query
          name: network
          description: Optional withdrawal network identifier. Use `GET /v1/ramp/buy/crypto` to discover available networks for each crypto asset.
          schema:
            type: string
        - in: query
          name: wallet_address
          description: Optional destination wallet address for the crypto withdrawal.
          schema:
            type: string
        - in: query
          name: memo
          description: Optional memo/tag/note for the crypto withdrawal (used for certain assets).
          schema:
            type: string
        - in: query
          name: affiliate_fee_bps
          description: Affiliate fee in basis points to attribute to the partner (0-10000 where 100 = 1%). This fee is additive to the platform fee, increasing the total fee charged to the user. The affiliate_fee in webhook payloads reflects the partner's portion of the total fee for transactions originating from this checkout.
          schema:
            $ref: "#/components/schemas/BasisPoints"
        - in: query
          name: country
          required: true
          description: ISO 3166-1 alpha-2 country code. Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
            maxLength: 2
        - in: query
          name: subdivision
          required: false
          description: ISO 3166-2 subdivision code suffix (e.g., `CA` for California when country is `US`). Use `GET /v1/ramp/countries` to discover supported values.
          schema:
            type: string
        - in: query
          name: redirect_url
          description: URL to redirect the user after completing checkout successfully.
          schema:
            type: string
            format: uri
        - in: query
          name: failure_url
          description: URL to redirect the user after a failed checkout.
          schema:
            type: string
            format: uri
        - in: query
          name: external_user_id
          description: Optional partner-supplied user identifier.
          schema:
            type: string
            maxLength: 64
        - in: query
          name: external_partner_id
          description: Optional partner-supplied partner identifier.
          schema:
            type: string
            maxLength: 64
        - in: query
          name: external_transaction_id
          description: Optional partner transaction identifier.
          schema:
            type: string
            maxLength: 64
        - in: query
          name: external_metadata
          description: Optional metadata to store alongside the checkout.
          schema:
            type: string
            maxLength: 1000
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      checkout_url:
                        type: string
                        format: uri
                        description: Hosted checkout URL.
                      request_data:
                        type: object
                        description: Original request payload for client confirmation.
                        properties:
                          in_asset:
                            description: Input asset
                            type: string
                            maxLength: 16
                          in_method:
                            description: Type of funding for the transaction
                            type: string
                          in_amount:
                            description: Input amount
                            $ref: "#/components/schemas/BigDecimal"
                          out_asset:
                            description: Output asset
                            type: string
                            maxLength: 16
                          out_method:
                            description: Withdrawal method identifier
                            type: string
                          network:
                            description: Network identifier for the withdrawal asset
                            type: string
                            nullable: true
                          wallet_address:
                            description: Destination wallet address for the crypto withdrawal
                            type: string
                            nullable: true
                          memo:
                            description: Memo/tag/note for the crypto withdrawal
                            type: string
                            nullable: true
                          affiliate_fee_bps:
                            description: Affiliate fee in basis points (0-10000 where 100 = 1%).
                            type: string
                            nullable: true
                            format: bps
                            example: "250"
                            pattern: "^\\d{1,5}$"
                          country:
                            description: ISO 3166-1 alpha-2 country code
                            type: string
                            maxLength: 2
                            nullable: true
                          subdivision:
                            description: ISO 3166-2 subdivision code suffix (e.g., CA for California when country is US)
                            type: string
                            nullable: true
                          redirect_url:
                            description: URL where the ramp provider should redirect the user after successful checkout
                            type: string
                            format: uri
                            nullable: true
                          failure_url:
                            description: URL where the ramp provider should redirect the user after failed checkout
                            type: string
                            format: uri
                            nullable: true
                          external_user_id:
                            description: Partner-provided user identifier (max 64 characters)
                            type: string
                            maxLength: 64
                            nullable: true
                          external_partner_id:
                            description: Partner-provided partner identifier (max 64 characters)
                            type: string
                            maxLength: 64
                            nullable: true
                          external_transaction_id:
                            description: Partner-provided transaction identifier (max 64 characters)
                            type: string
                            maxLength: 64
                            nullable: true
                          external_metadata:
                            description: Additional partner-provided metadata (max 1000 characters)
                            type: string
                            maxLength: 1000
                            nullable: true
                        required:
                          - in_asset
                          - in_amount
                          - out_asset
                          - in_method
                          - out_method
                          - country
                    required:
                      - checkout_url
                      - request_data
                required:
                  - result
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalError"

  # Webhooks - Partner-implemented endpoints
  "/webhooks/payward/transaction-update":
    post:
      operationId: rampTransactionUpdateWebhook
      summary: Transaction update
      tags:
        - Webhooks
      servers:
        - url: https://your-webhook-endpoint.com
          description: Partner-provided webhook endpoint
      security: []
      description: |
        This endpoint can be implemented by the partner to receive real-time transaction status updates from Payward.

        When a Ramp transaction is created or changes state, Payward sends a POST request to the partner's configured webhook URL with transaction details and status information.

        #### Security

        All webhook requests include an `X-Signature` header containing an HMAC-SHA256 signature of the request body. Partners should verify this signature to ensure integrity of the request.

        <Note>Contact your Payward integration point of contact to securely exchange the HMAC secret key for signature verification.</Note>

        ##### Signature Verification

        1. Extract the `X-Signature` header value
        2. Compute HMAC-SHA256 of the raw request body using your webhook secret
        3. Compare the computed signature with the `X-Signature` header value (hex-encoded)

        ```typescript
        import crypto from 'crypto';

        // This function will return true/false if the signature matches
        const verifySignature = (signature: string, secret: string, body: string) => {
          const hash = crypto.createHmac('sha256', secret).update(body).digest('hex');
          return (signature === hash);
        };
        ```

        #### Retry Behavior

        Payward will automatically retry failed webhook deliveries using exponential backoff. Partners should respond with HTTP 2xx status to acknowledge receipt. Non-2xx responses will trigger retries.

        #### Status Types

        The `status` field provides a simplified transaction state:
        - `new` - Transaction has been initiated
        - `paid` - Payment has been received
        - `pending` - Transaction is being processed
        - `completed` - Transaction successfully completed
        - `failed` - Transaction failed
        - `canceled` - Transaction was canceled
      parameters:
        - in: header
          name: X-Signature
          required: true
          description: HMAC-SHA256 signature of the request body (hex-encoded). Use this to verify the webhook authenticity.
          schema:
            type: string
            example: "35d050c7eb06bf050fd676db4e6c79f5e90abef9b2ae8aa2dac23302998db5cf"
        - in: header
          name: Content-Type
          required: true
          schema:
            type: string
            enum:
              - application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Webhook request sent by Payward when a Ramp transaction status changes.
              properties:
                status:
                  type: string
                  description: |
                    Transaction status:
                    - `new` - Transaction has been initiated
                    - `paid` - Payment has been received
                    - `pending` - Transaction is being processed
                    - `completed` - Transaction successfully completed
                    - `failed` - Transaction failed
                    - `canceled` - Transaction was canceled
                  enum:
                    - new
                    - paid
                    - pending
                    - completed
                    - failed
                    - canceled
                  example: "completed"
                payload:
                  type: object
                  description: Transaction payload containing detailed information about the Ramp transaction.
                  properties:
                    transaction_id:
                      description: Payward's internal transaction identifier.
                      type: string
                    in_amount:
                      description: Amount of the source currency/asset sold by the user.
                      type: string
                      format: decimal128
                      example: "10.00"
                      pattern: "^-?[0-9]+(\\.[0-9]+)?$"
                    in_asset:
                      description: Source currency/asset that the user sold.
                      type: string
                      example: "USD"
                    out_asset:
                      description: Destination currency/asset that the user bought.
                      type: string
                      example: "BTC"
                    out_amount:
                      description: Amount of the destination currency/asset received by the user.
                      type: string
                      format: decimal128
                      example: "0.002813"
                      pattern: "^-?[0-9]+(\\.[0-9]+)?$"
                    in_method:
                      description: Method used for the input side of the transaction.
                      type: string
                      example: "creditCard"
                    out_method:
                      description: Method used for the output side of the transaction.
                      type: string
                      example: "Bitcoin"
                    timestamp:
                      description: Timestamp when the webhook event was generated (ISO-8601 format).
                      type: string
                      format: date-time
                      example: "2025-11-07T14:35:57.391208753Z"
                    wallet:
                      description: Cryptocurrency wallet address that received the funds (for buy transactions).
                      type: string
                      nullable: true
                    transaction_hash:
                      description: Blockchain transaction hash of the crypto transfer.
                      type: string
                      nullable: true
                      example: "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
                    external_transaction_id:
                      description: Partner-provided transaction identifier (if provided during checkout).
                      type: string
                      nullable: true
                    external_user_id:
                      description: Partner-provided user identifier (if provided during checkout).
                      type: string
                      nullable: true
                    external_partner_id:
                      description: Partner-provided partner identifier (if provided during checkout).
                      type: string
                      nullable: true
                    external_metadata:
                      description: Additional partner-provided metadata (if provided during checkout).
                      type: string
                      nullable: true
                    affiliate_fee:
                      description: Portion of the transaction fee attributed to the partner, based on the affiliate_fee_bps rate provided during checkout. This amount is already included in the total fee, not additional to it. Present when affiliate_fee_bps was configured during checkout.
                      type: string
                      format: decimal128
                      example: "0.50"
                      pattern: "^-?[0-9]+(\\.[0-9]+)?$"
                      nullable: true
                  required:
                    - transaction_id
                    - in_amount
                    - in_asset
                    - out_asset
                    - out_amount
                    - in_method
                    - out_method
                    - timestamp
                raw_status:
                  type: object
                  description: Object containing internal status information for more granular transaction tracking.
                timestamp:
                  description: Timestamp when this webhook request was created (ISO-8601 format). Use this for replay attack detection.
                  type: string
                  format: date-time
                  example: "2025-11-07T14:35:57.391209043Z"
              required:
                - status
                - payload
                - raw_status
                - timestamp
      responses:
        "200":
          description: |
            Webhook received and processed successfully. Return any 2xx status code to acknowledge receipt.
        "500":
          description: |
            Internal server error on partner side. Payward will retry delivery.

components:
  securitySchemes:
    API-Key:
      type: apiKey
      name: API-Key
      description: The "API-Key" header should contain your API key.
      in: header

    API-Sign:
      type: apiKey
      name: API-Sign
      description: Authenticated requests should be signed with the "API-Sign" header, using a signature generated with your private key, nonce, encoded payload, and URI path.
      in: header

  parameters:
    PaywardVersion:
      in: header
      name: Payward-Version
      description: The target version of the Payward Ramp API to use. The API
        version name is based on the date when the API version was released. For
        example, the API version `2025-04-15` was released on April 15, 2025.
      schema:
        default: "2025-04-15"
        type: string
        enum:
          - "2025-04-15"

  responses:
    GenericError:
      description: Generic Error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"

    RateLimitError:
      description: Rate Limit Error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"

    InternalError:
      description: Internal Error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"

  schemas:
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            description: |-
              Error objects provide additional information about problems encountered while performing an operation. Error objects MUST be returned as an array keyed by errors in the top level of a JSON:API document.

              An error object MAY have the following members, and MUST contain at least one of:
            type: object
            properties:
              id:
                nullable: true
                description: A unique identifier for this particular occurrence
                  of the problem.
                type: string
              links:
                nullable: true
                description: A links object that MAY contain `about` and
                  `type` members.
                type: object
                properties:
                  about:
                    description: A link that leads to further details about
                      this particular occurrence of the problem. When dereferenced,
                      this URI SHOULD return a human-readable description
                      of the error.
                    anyOf:
                      - description: An RFC 3986 URI
                        type: string
                      - description: |-
                          A "link object" is an object that represents a web link.

                          Note: the `type` and `hreflang` members are only hints; the target resource is not guaranteed to be available in the indicated media type or language when the link is actually followed.
                        type: object
                        properties:
                          href:
                            description: A string whose value is a URI-reference
                              [RFC3986 Section 4.1] pointing to the link's
                              target.
                            type: string
                          rel:
                            description: A string indicating the link's relation
                              type. The string MUST be a valid link relation
                              type.
                            type: string
                            nullable: true
                          describedby:
                            nullable: true
                            description: A link to a description document
                              (e.g. OpenAPI or JSON Schema) for the link target.
                            type: string
                          title:
                            nullable: true
                            description: A string which serves as a label
                              for the destination of a link such that it can
                              be used as a human-readable identifier (e.g.,
                              a menu entry).
                            type: string
                          type:
                            nullable: true
                            description: A string indicating the media type
                              of the link's target.
                            type: string
                          hreflang:
                            description: A string or an array of strings indicating
                              the language(s) of the link's target. An array
                              of strings indicates that the link's target
                              is available in multiple languages. Each string
                              MUST be a valid language tag [RFC5646].
                            type: string
                            nullable: true
                            example: az-Arab-x-AZE-derbend
                            pattern: "^([a-zA-Z]{1,8})(-[a-zA-Z\\d]{1,8})*$"
                          meta:
                            nullable: true
                            description: A meta object containing non-standard
                              meta-information about the link.
                            type: object
                        required:
                          - href
                      - {}
                  type:
                    description: A link that identifies the type of error
                      that this particular error is an instance of. This
                      URI SHOULD be dereferenceable to a human-readable
                      explanation of the general error.
                    anyOf:
                      - description: An RFC 3986 URI
                        type: string
                      - description: |-
                          A "link object" is an object that represents a web link.

                          Note: the `type` and `hreflang` members are only hints; the target resource is not guaranteed to be available in the indicated media type or language when the link is actually followed.
                        type: object
                        properties:
                          href:
                            description: A string whose value is a URI-reference
                              [RFC3986 Section 4.1] pointing to the link's
                              target.
                            type: string
                          rel:
                            description: A string indicating the link's relation
                              type. The string MUST be a valid link relation
                              type.
                            type: string
                            nullable: true
                          describedby:
                            nullable: true
                            description: A link to a description document
                              (e.g. OpenAPI or JSON Schema) for the link target.
                            type: string
                          title:
                            nullable: true
                            description: A string which serves as a label
                              for the destination of a link such that it can
                              be used as a human-readable identifier (e.g.,
                              a menu entry).
                            type: string
                          type:
                            nullable: true
                            description: A string indicating the media type
                              of the link's target.
                            type: string
                          hreflang:
                            description: A string or an array of strings indicating
                              the language(s) of the link's target. An array
                              of strings indicates that the link's target
                              is available in multiple languages. Each string
                              MUST be a valid language tag [RFC5646].
                            type: string
                            nullable: true
                            example: az-Arab-x-AZE-derbend
                            pattern: "^([a-zA-Z]{1,8})(-[a-zA-Z\\d]{1,8})*$"
                          meta:
                            nullable: true
                            description: A meta object containing non-standard
                              meta-information about the link.
                            type: object
                        required:
                          - href
                      - {}
              status:
                nullable: true
                description: The HTTP status code applicable to this problem,
                  expressed as a string value. This SHOULD be provided.
                type: string
              code:
                nullable: true
                description: An application-specific error code, expressed
                  as a string value.
                type: string
              title:
                nullable: true
                description: A short, human-readable summary of the problem
                  that SHOULD NOT change from occurrence to occurrence of
                  the problem, except for purposes of localization.
                type: string
              detail:
                nullable: true
                description: A human-readable explanation specific to this
                  occurrence of the problem. Like title, this field's value
                  can be localized.
                type: string
              source:
                description: An object containing references to the primary
                  source of the error.
                oneOf:
                  - description: A JSON Pointer [RFC6901] to the value in
                      the request document that caused the error [e.g. "/data"
                      for a primary data object, or "/data/attributes/title"
                      for a specific attribute]. This MUST point to a value
                      in the request document that exists; if it doesn't,
                      the client SHOULD simply ignore the pointer.
                    type: object
                    properties:
                      pointer:
                        type: string
                    required:
                      - pointer
                  - description: A string indicating which URI query parameter
                      caused the error.
                    type: object
                    properties:
                      parameter:
                        type: string
                    required:
                      - parameter
                  - description: A string indicating the name of a single
                      request header which caused the error.
                    type: object
                    properties:
                      header:
                        type: string
                    required:
                      - header
              meta:
                nullable: true
                description: A meta object containing non-standard meta-information
                  about the error.
                type: object

    AssetName:
      type: string
      description: Asset name (e.g., BTC, ETH, USD, EUR).
      minLength: 3
      maxLength: 16
      example: BTC

    BigDecimal:
      type: string
      description: Decimal number represented as a string to preserve precision.
      format: decimal128
      example: "1.23"
      pattern: "^-?[0-9]+(\\.[0-9]+)?$"
      minLength: 1
      maxLength: 64

    BasisPoints:
      type: string
      description: Basis points represented as a string. Range 0-10000 where 100 = 1%.
      format: bps
      example: "250"
      pattern: "^\\d{1,5}$"

    RampCryptoAsset:
      type: object
      description: Crypto asset metadata for Ramp buy operations.
      properties:
        asset:
          description: Cryptocurrency asset name (e.g., BTC, ETH, SOL).
          type: string
          minLength: 3
          maxLength: 16
          example: BTC
        wrapped_asset:
          description: Optional wrapped-asset code for the asset (e.g., WSOL for wrapped Solana).
          type: string
          maxLength: 16
          nullable: true
        market_cap_rank:
          description: Asset's ranking based on market capitalization (lower number = higher rank).
          type: integer
          format: int32
        network:
          description: Withdrawal network label for the asset (e.g., Lightning, Bitcoin, Ethereum).
          type: string
        method:
          description: Unique name for the withdrawal method.
          type: string
        disabled_against:
          description: List of fiat currency assets that cannot be paired with this crypto asset.
          type: array
          items:
            $ref: "#/components/schemas/AssetName"
      required:
        - asset
        - market_cap_rank
        - network
        - method

    RampFiatCurrency:
      type: object
      description: Fiat currency metadata for Ramp deposits.
      properties:
        asset:
          $ref: "#/components/schemas/AssetName"
        asset_class:
          description: Classification of the asset type.
          type: string
          enum:
            - currency
          default: currency
      required:
        - asset

    RampPaymentMethod:
      type: object
      description: Supported funding method for Ramp.
      properties:
        method:
          description: Unique name for the payment method.
          type: string
      required:
        - method

    RampCountry:
      type: object
      description: Country/region availability details for Ramp.
      oneOf:
        - type: object
          properties:
            type:
              description: Availability type indicator (entire country).
              type: string
              enum:
                - country
            country:
              description: ISO 3166-1 alpha-2 country code.
              type: string
          required:
            - type
            - country
        - type: object
          properties:
            type:
              description: Availability type indicator (specific US states).
              type: string
              enum:
                - us_state
            country:
              description: ISO 3166-1 alpha-2 country code (always `US` for this type).
              type: string
              enum:
                - US
            states:
              description: List of US state codes using ISO 3166-2 suffix format (e.g., CA for California, TX for Texas).
              type: array
              items:
                type: string
          required:
            - type
            - country
            - states
        - type: object
          properties:
            type:
              description: Availability type indicator (specific Canadian provinces).
              type: string
              enum:
                - ca_province
            country:
              description: ISO 3166-1 alpha-2 country code (always `CA` for this type).
              type: string
              enum:
                - CA
            provinces:
              description: List of Canadian province codes using ISO 3166-2 suffix format (e.g., AB for Alberta, BC for British Columbia).
              type: array
              items:
                type: string
          required:
            - type
            - country
            - provinces
        - type: object
          properties:
            type:
              description: Availability type indicator (specific Ukrainian regions).
              type: string
              enum:
                - ukraine_region
            country:
              description: ISO 3166-1 alpha-2 country code (always `UA` for this type).
              type: string
              enum:
                - UA
            regions:
              description: List of Ukrainian region codes using ISO 3166-2 suffix format (e.g., 43 for Crimea, 32 for Kyiv).
              type: array
              items:
                type: string
          required:
            - type
            - country
            - regions

    RampWireTransactionRange:
      type: object
      description: Min/max transaction range expressed in asset amount.
      properties:
        minimum:
          description: Minimum single-transaction amount allowed.
          type: object
          nullable: true
          properties:
            asset:
              $ref: "#/components/schemas/AssetName"
            asset_class:
              description: Classification of the asset type.
              type: string
              enum:
                - currency
              nullable: true
            amount:
              description: Amount value in the specified asset.
              type: string
              format: decimal128
              example: "1.23"
              pattern: "^-?[0-9]+(\\.[0-9]+)?$"
              minLength: 1
              maxLength: 64
          required:
            - asset
            - amount
        maximum:
          description: Maximum single-transaction amount allowed.
          type: object
          nullable: true
          properties:
            asset:
              $ref: "#/components/schemas/AssetName"
            asset_class:
              description: Classification of the asset type.
              type: string
              enum:
                - currency
              nullable: true
            amount:
              description: Amount value in the specified asset.
              type: string
              format: decimal128
              example: "1.23"
              pattern: "^-?[0-9]+(\\.[0-9]+)?$"
              minLength: 1
              maxLength: 64
          required:
            - asset
            - amount

    RampAssetDetailsDisplay:
      type: object
      description: Optional display currency projection for an asset breakdown.
      properties:
        asset:
          $ref: "#/components/schemas/AssetName"
        asset_class:
          description: Classification of the display asset type.
          type: string
          enum:
            - currency
          nullable: true
        total:
          description: "Total amount in display currency after all fees. On the spend side: subtotal + fee + deposit_fee. On the receive side: subtotal - withdrawal_fee."
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
        fee:
          description: Trading fee amount in display currency. This includes the affiliate fee portion when affiliate_fee_bps was provided.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        deposit_fee:
          description: Deposit or funding fee in display currency.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        affiliate_fee:
          description: Portion of fee attributed to the partner in display currency, based on the affiliate_fee_bps rate provided during checkout. This amount is already included in fee, not additional to it.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        withdrawal_fee:
          description: Crypto withdrawal or network fee in display currency (if applicable).
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        subtotal:
          description: Base trade amount in display currency before any fees are applied.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"

    RampAssetDetails:
      type: object
      description: Asset breakdown returned in Ramp quotes.
      properties:
        asset:
          $ref: "#/components/schemas/AssetName"
        asset_class:
          description: Classification of the asset type.
          type: string
          enum:
            - currency
          nullable: true
        total:
          description: "Total amount after all fees. On the spend side: subtotal + fee + deposit_fee. On the receive side: subtotal - withdrawal_fee."
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
        fee:
          description: Trading fee amount. This includes the affiliate fee portion when affiliate_fee_bps was provided.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        deposit_fee:
          description: Deposit or funding fee charged on the fiat payment method.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        affiliate_fee:
          description: Portion of fee attributed to the partner, based on the affiliate_fee_bps rate provided during checkout. This amount is already included in fee, not additional to it.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        withdrawal_fee:
          description: Crypto withdrawal or network fee (if applicable).
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
          nullable: true
        subtotal:
          description: Base trade amount before any fees are applied.
          type: string
          format: decimal128
          example: "1.23"
          pattern: "^-?[0-9]+(\\.[0-9]+)?$"
        in_display:
          $ref: "#/components/schemas/RampAssetDetailsDisplay"
      required:
        - asset
        - total
        - subtotal

    RampUnitPriceDisplay:
      type: object
      description: Optional unit price projection in a different display currency.
      properties:
        asset:
          $ref: "#/components/schemas/AssetName"
        asset_class:
          description: Classification of the display currency asset type.
          type: string
          enum:
            - currency
          nullable: true
        unit_price:
          $ref: "#/components/schemas/BigDecimal"

    RampUnitPrice:
      type: object
      description: Unit price information returned in Ramp quotes.
      properties:
        asset:
          $ref: "#/components/schemas/AssetName"
        asset_class:
          description: Classification of the priced asset type.
          type: string
          enum:
            - currency
          nullable: true
        unit_price:
          $ref: "#/components/schemas/BigDecimal"
        denomination_asset:
          $ref: "#/components/schemas/AssetName"
        denomination_asset_class:
          description: Classification of the denomination asset type.
          type: string
          enum:
            - currency
          nullable: true
        in_display:
          $ref: "#/components/schemas/RampUnitPriceDisplay"
      required:
        - asset
        - unit_price
        - denomination_asset
