> ## Documentation Index
> Fetch the complete documentation index at: https://distributedcrafts.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a tx for a request (V2 body includes token-swap route).



## OpenAPI

````yaml /api-reference/openapi.json patch /v2/register-tx
openapi: 3.1.0
info:
  title: BOB Gateway API
  description: BOB Gateway API for Bitcoin swaps
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://gateway-api-mainnet.gobob.xyz
    description: Production
  - url: https://gateway-api-staging.gobob.xyz
    description: Staging
security: []
tags:
  - name: v1
    description: BOB Gateway Core API (v1)
  - name: v2
    description: BOB Gateway Core API (v2)
  - name: v3
    description: BOB Gateway Core API (v3)
paths:
  /v2/register-tx:
    patch:
      tags:
        - v2
      summary: Register a tx for a request (V2 body includes token-swap route).
      operationId: register_tx_v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTxV2'
        required: true
      responses:
        '200':
          description: Register successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterTxSuccess'
        '400':
          description: Register error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
      security:
        - api_key: []
components:
  schemas:
    RegisterTxV2:
      oneOf:
        - type: object
          required:
            - onramp
          properties:
            onramp:
              type: object
              required:
                - order_id
              properties:
                bitcoin_tx_hex:
                  type:
                    - string
                    - 'null'
                  description: Hex-encoded full Bitcoin transaction
                bitcoin_txid:
                  type:
                    - string
                    - 'null'
                  description: Bitcoin transaction ID (txid)
                order_id:
                  type: string
                  description: Unique order id
                  example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
        - type: object
          required:
            - offramp
          properties:
            offramp:
              type: object
              required:
                - order_id
                - evm_txhash
              properties:
                evm_txhash:
                  type: string
                  description: EVM txhash
                order_id:
                  type: string
                  description: Unique order id
                  example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
        - type: object
          required:
            - tokenSwap
          properties:
            tokenSwap:
              type: object
              required:
                - order_id
                - evm_txhash
              properties:
                evm_txhash:
                  type: string
                  description: EVM txhash
                order_id:
                  type: string
                  description: Unique order id
                  example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
      description: V2 register-tx body (onramp, offramp, and token swap).
    RegisterTxSuccess:
      oneOf:
        - type: object
          required:
            - onramp
          properties:
            onramp:
              type: object
              required:
                - txid
              properties:
                txid:
                  type: string
        - type: string
          enum:
            - ok
    GatewayError:
      type: object
      description: >-
        Structured error response for V1 API.

        Contains an error code, human-readable message, and optional structured
        details.
      required:
        - code
        - error
      properties:
        code:
          $ref: '#/components/schemas/GatewayErrorCode'
          description: Stable error code for frontend parsing
        details:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GatewayErrorDetails'
              description: Optional structured details specific to the error type
        error:
          type: string
          description: Human-readable error message
    GatewayErrorCode:
      type: string
      description: >-
        Error codes for structured error responses that the frontend can parse.

        These codes are stable and should not be changed without coordinating
        with the frontend.
      enum:
        - INSUFFICIENT_AMOUNT
        - QUOTE_AMOUNT_TOO_LOW
        - INSUFFICIENT_SWAP_AMOUNT
        - INSUFFICIENT_SOLVER_BALANCE
        - INSUFFICIENT_PAYMENT_AMOUNT
        - UNABLE_TO_COVER_FEES
        - INSUFFICIENT_CONFIRMED_FUNDS
        - SIMULATION_FAILED
        - GAS_ESTIMATE_FAILED
        - PER_ACCOUNT_LIMIT_EXCEEDED
        - GLOBAL_LIMIT_EXCEEDED
        - EXCEEDED_LIMIT
        - INVALID_REQUEST
        - INVALID_ORDER_ARGS
        - INVALID_AFFILIATE_FEE
        - SLIPPAGE_TOO_LOW
        - SLIPPAGE_TOO_HIGH
        - NO_ROUTE
        - DISABLED_CHAIN
        - INVALID_DESTINATION_CHAIN_ID
        - ORDER_NOT_FOUND
        - ORDER_EXPIRED
        - DUPLICATE_ORDER
        - INTERNAL_ERROR
    GatewayErrorDetails:
      oneOf:
        - type: object
          required:
            - expected
            - actual
          properties:
            actual:
              type: string
            expected:
              type: string
        - type: object
          required:
            - required
            - available
          properties:
            available:
              type: string
            required:
              type: string
        - type: object
          required:
            - total_fees
            - available_amount
          properties:
            available_amount:
              type: string
            total_fees:
              type: string
        - type: object
          properties:
            tenderly_url:
              type:
                - string
                - 'null'
        - type: object
          required:
            - src_chain
            - src_token
            - dst_chain
            - dst_token
          properties:
            dst_chain:
              type: string
            dst_token:
              type: string
            src_chain:
              type: string
            src_token:
              type: string
        - type: object
          required:
            - limit
          properties:
            limit:
              type: string
        - type: 'null'
          default: null
        - type: object
          required:
            - minimum
            - actual
          properties:
            actual:
              type: string
            minimum:
              type: string
      description: Structured details for V1 error types.
  securitySchemes:
    api_key:
      type: http
      scheme: bearer

````