---
openapi: 3.1.0
info:
  title: Coinhako Public API
  version: v1
  description: |
    ### How to get an API key
    Our API is currently in beta. If you would like to get an API key, please contact us at [hello@coinhako.com](mailto:hello@coinhako.com)

    ### Authentication
    All endpoints require the following additional parameters to be sent in the request header: `X-API-KEY` hexadecimal public key, `X-API-Signature` hexadecimal signature, and `X-API-Timestamp` in unix time.

    #### Signature
    Generate a pair of public and private key pair using the ECDSA algorithm, with the secp256k1 elliptic curve.
    Sign the request body with the private key generated. The signature is then encoded as a uppercase hexadecimal string and is returned in the request header under `X-API-Signature`.

    #### Signature Input Scheme
    *signature='method=@method&target-uri=@target-uri&content-digest=@content-digest&created=@created&alg=@alg'*

    `@method` refers to the HTTP verb used for this request (GET, POST, PUT, PATCH, DELETE)

    `@target-uri` refers to the full absolute URL of the request, including the authority, request target and parameters if any (eg. `https://www.example.com/path?param=value`)

    `@content-digest` refers request body that has been hashed with sha256 and in hexadecimal encoding, uppercase string

    `@created` has the same value as `X-API-Timestamp`

    `@alg` is the algorithm used, which is `ecdsa-secp256k1-sha256`

    #### Example in Ruby:
    ```ruby
    require 'openssl'

    ec = OpenSSL::PKey::EC.new(File.read('/path/to/private_key.pem')) # Load your ECDSA secp256k1 private key

    payload = { "foo": "bar" }

    timestamp = 1684149207947
    algorithm = 'ecdsa-secp256k1-sha256'
    content_digest = OpenSSL::Digest.digest('SHA256', payload.to_json).unpack1('H*').upcase
    method = 'POST'
    target_uri = 'http://www.example.com/path?param=value'
    signature_input = "method=#{method}&target-uri=#{target_uri}&content-digest=#{content_digest}&created=#{timestamp}&alg=#{algorithm}"

    message_hash = OpenSSL::Digest::SHA256.digest(signature_input)

    signature = ec.dsa_sign_asn1(message_hash).unpack1('H*').upcase
    ```

    ### Errors
    Errors are returned in the following format:
    ```json
    {
      "errors": [
        {
          "message":  "a short, human-readable summary of the problem"
        }
      ]
    }
    ```
  x-logo:
    url: https://www.coinhako.com/assets/images/coinhako_logo.svg
paths:
  "/public_api/v1/transactions/{transaction_id}/counterparty_info":
    post:
      summary: Submit counterparty info
      tags:
      - Transactions
      description: 'Submit counterparty info for a given transaction. Presently only
        transactions with transaction_type RECEIVE are supported.

        '
      parameters:
      - name: transaction_id
        in: path
        schema:
          type: string
          format: uuid
        required: true
        description: transaction ID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Transaction not found
          content:
            application/json:
              examples:
                Transaction not found:
                  value:
                    errors:
                    - message: Transaction not found
              schema:
                "$ref": "#/components/schemas/errors"
        '422':
          description: Invalid submission
          content:
            application/json:
              examples:
                Counterparty info already exists:
                  value:
                    errors:
                    - message: Counterparty info already exists
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet_identity_attributes:
                  type: object
                  description: Counterparty's info attributes
                  properties:
                    entity_type:
                      type: string
                      enum:
                      - individual
                      - entity
                      description: Counterparty's legal status as an individual or
                        an entity
                    entity_name:
                      type: string
                      description: Counterparty's legal name
                    ownership:
                      type: string
                      enum:
                      - first_party
                      - third_party
                      description: |-
                        Specifies if the counterparty is the same entity as transaction originator \
                        or someone else
                    entity_identity_document_number:
                      type: string
                      description: Counterparty's identity document number
                    address_attributes:
                      type: object
                      properties:
                        country_code:
                          type: string
                        address1:
                          type: string
                        address2:
                          type: string
                        postcode:
                          type: string
                        district:
                          type: string
                        region:
                          type: string
                      required:
                      - country_code
                  required:
                  - entity_type
                  - entity_name
                  - ownership
                crypto_wallet_attributes:
                  type: object
                  description: Wallet/Exchange attributes, either id or name is required
                  properties:
                    id:
                      type: string
                      description: ID of a counterparty's Wallet entity as returned
                        from /v1/crypto_wallets. Leave it empty if the wallet is not
                        in the list
                    name:
                      type: string
                      description: |-
                        Name of the wallet/exchange if ID is not available. \
                        This will lead to creating a new unverified Wallet and trigger further compliance review
              required:
              - wallet_identity_attributes
              additionalProperties: false
            examples:
              known_wallet_example:
                summary: Request example for known wallet
                value:
                  wallet_identity_attributes:
                    entity_type: individual
                    entity_name: John Doe
                    ownership: third_party
                    address_attributes:
                      country_code: SG
                      address1: 8517 Griselda Falls
                      address2: Purdy Port
                      postcode: '871748'
                  crypto_wallet_attributes:
                    id: 431631e3-7fd7-4068-a23d-c6519e22569b
              unknown_wallet_example:
                summary: Request example for Wallet not in the list
                value:
                  wallet_identity_attributes:
                    entity_type: individual
                    entity_name: John Doe
                    ownership: third_party
                  crypto_wallet_attributes:
                    id: 431631e3-7fd7-4068-a23d-c6519e22569b
  "/public_api/v1/accounts/balances":
    get:
      summary: List current user account balances
      tags:
      - Account
      description: |
        List all account balances aggregated by asset symbol for the current user.

        Returns regular and locked balances for each asset.
        Only assets with non-zero total balances are returned.

        **Balance Fields:**
        - `regular`: Available balance for trading and withdrawals
        - `locked`: Total locked balance (DEPRECATED - use locked_balance instead)
        - `locked_balance`: Detailed breakdown of locked balances
          - `orders`: Amount locked by open orders
          - `alternative_products`: Amount locked by Alternative Products
      parameters:
      - name: currency
        in: query
        description: Filter by specific asset symbol (e.g., BTC, ETH)
        required: false
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: success response with asset filter
          content:
            application/json:
              examples:
                success:
                  value:
                  - currency: BTC
                    regular: '2.5'
                    locked: '1.0'
                    locked_balance:
                      orders: '1.0'
                      alternative_products: '0'
                  - currency: ETH
                    regular: '10.0'
                    locked: '0'
                    locked_balance:
                      orders: '0'
                      alternative_products: '0'
              schema:
                type: array
                items:
                  type: object
                  properties:
                    currency:
                      type: string
                    regular:
                      type: string
                      format: decimal
                    locked:
                      type: string
                      format: decimal
                      deprecated: true
                      description: 'DEPRECATED: Use locked_balance instead. Sum locked_balance
                        fields to get total.'
                    locked_balance:
                      type: object
                      description: Detailed breakdown of locked balances by source.
                        Sum all fields to get total locked balance.
                      properties:
                        orders:
                          type: string
                          format: decimal
                          description: Amount locked by open orders
                        alternative_products:
                          type: string
                          format: decimal
                          description: Amount locked by alternative products (e.g.,
                            covered options, structured products)
                      required:
                      - orders
                      - alternative_products
                      additionalProperties: false
                  required:
                  - currency
                  - regular
                  - locked
                  - locked_balance
                  additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/bank_accounts":
    get:
      summary: List bank accounts
      tags:
      - Bank Accounts
      description: Lists all bank accounts belonging to a user
      parameters:
      - name: currency
        in: query
        schema:
          type: string
          enum:
          - USD
          - SGD
        description: Filter accounts by currency
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Page to fetch when using offset pagination. Has no effect unless
          page[enable_offset]=true is also sent; otherwise the response uses cursor
          pagination and this parameter is ignored.
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 2
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to pagination from
        schema:
          type: string
      - name: page[enable_offset]
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Set to true to switch this endpoint from cursor pagination to
          offset pagination, enabling page[number] to select a specific page.
      security:
      - api_key: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Identifier of the bank account
                    currency:
                      type:
                      - string
                      - 'null'
                      description: Bank account currency
                    account_number:
                      type: string
                      description: Account number
                    beneficiary_name:
                      type: string
                      description: Name of the beneficiary
                    last_used_at:
                      type:
                      - integer
                      - 'null'
                      description: Timestamp of when the account was last used for
                        withdrawal (epoch milliseconds)
                    verified:
                      type: boolean
                      description: Whether the bank account was added by Coinhako
                        staff (true) or self-added by the user (false)
                    bank:
                      type:
                      - object
                      - 'null'
                      description: Bank institution details
                      properties:
                        name:
                          type:
                          - string
                          - 'null'
                        swift_code:
                          type:
                          - string
                          - 'null'
                        bic_code:
                          type:
                          - string
                          - 'null'
                        branch_name:
                          type:
                          - string
                          - 'null'
                        branch_code:
                          type:
                          - string
                          - 'null'
                        address:
                          type:
                          - string
                          - 'null'
                  required:
                  - id
                  - account_number
                  - beneficiary_name
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/bank_accounts/{id}":
    delete:
      summary: Remove a bank account
      tags:
      - Bank Accounts
      description: Removes a bank account.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/crypto/deposits":
    get:
      summary: List Crypto Deposits
      tags:
      - Crypto Deposits
      description: Returns a paginated list of crypto deposits for the authenticated
        user
      parameters:
      - name: created_at_after
        in: query
        required: false
        schema:
          type: integer
        description: Filter deposits created after this time (milliseconds since epoch)
      - name: created_at_before
        in: query
        required: false
        schema:
          type: integer
        description: Filter deposits created before this time (milliseconds since
          epoch)
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Page to fetch when using offset pagination. Has no effect unless
          page[enable_offset]=true is also sent; otherwise the response uses cursor
          pagination and this parameter is ignored.
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 2
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to pagination from
        schema:
          type: string
      - name: page[enable_offset]
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Set to true to switch this endpoint from cursor pagination to
          offset pagination, enabling page[number] to select a specific page.
      security:
      - api_key: []
      responses:
        '200':
          description: Returns a paginated list of crypto deposits
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    to_address:
                      type: string
                    amount:
                      type: string
                    created_at:
                      type: integer
                    transaction_hash:
                      type: string
                    status:
                      type: string
                    travel_rule_status:
                      type: string
                    link_explorer:
                      type: string
                    invoice_downloadable:
                      type: boolean
                    transaction:
                      type: object
                      properties:
                        uuid:
                          type: string
                          format: uuid
                      required:
                      - uuid
                    crypto_currency:
                      type: object
                      additionalProperties: true
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                        code:
                          type: string
                      required:
                      - id
                      - name
                      - code
                  required:
                  - id
                  - created_at
                  - status
                  - invoice_downloadable
                  - transaction
        '422':
          description: Invalid Time Parameters
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/crypto/withdrawals":
    post:
      summary: Create Crypto Withdrawal
      tags:
      - Crypto Withdrawals
      description: Creates a crypto withdrawal for the authenticated user
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - transfer
      responses:
        '201':
          description: Withdrawal Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  address:
                    type: string
                  amount:
                    type: string
                  total_amount:
                    type: string
                  created_at:
                    type: integer
                  fee:
                    type:
                    - string
                    - 'null'
                  memo:
                    type:
                    - string
                    - 'null'
                  status:
                    type: string
                  travel_rule_status:
                    type:
                    - string
                    - 'null'
                  pending_reason:
                    type:
                    - string
                    - 'null'
                  recipient_fullname:
                    type:
                    - string
                    - 'null'
                  transaction_hash:
                    type:
                    - string
                    - 'null'
                  link_explorer:
                    type:
                    - string
                    - 'null'
                  crypto_currency:
                    type: object
                    additionalProperties: true
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                      code:
                        type: string
                      minimum_sell:
                        type: string
                      precision:
                        type: integer
                      allow_multiple_user_addresses:
                        type: boolean
                      icon:
                        type: string
                      network_id:
                        type: string
                      has_address_tag:
                        type: boolean
                      network:
                        type: object
                        additionalProperties: true
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          name:
                            type: string
                          network_code:
                            type: string
                      asset:
                        type: object
                        additionalProperties: true
                        properties:
                          id:
                            type: integer
                          name:
                            type: string
                          symbol:
                            type: string
                          icon_url:
                            type:
                            - string
                            - 'null'
                          asset_type:
                            type: string
                    required:
                    - id
                    - name
                    - code
                    - network
                    - asset
                  address_book_address:
                    type:
                    - object
                    - 'null'
                    additionalProperties: true
                    properties:
                      id:
                        type: string
                        format: uuid
                      label:
                        type: string
                      created_at:
                        type: integer
                      address:
                        type: string
                      address_tag:
                        type:
                        - string
                        - 'null'
                      status:
                        type: string
                      display_status:
                        type:
                        - string
                        - 'null'
                      crypto_wallet:
                        type:
                        - object
                        - 'null'
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                          type:
                            type: string
                      wallet_identity:
                        type:
                        - object
                        - 'null'
                        properties:
                          id:
                            type: string
                            format: uuid
                          entity_name:
                            type: string
                          entity_type:
                            type: string
                          ownership:
                            type: string
                          additional_info_provided:
                            type: boolean
                      crypto_currency_networks:
                        type: array
                        items:
                          type: object
                          properties:
                            uuid:
                              type: string
                              format: uuid
                            name:
                              type: string
                            network_code:
                              type: string
                  note:
                    type:
                    - string
                    - 'null'
                  invoice_downloadable:
                    type: boolean
                  transaction:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                    required:
                    - uuid
                required:
                - id
                - address
                - amount
                - created_at
                - status
                - total_amount
                - fee
                - transaction_hash
                - crypto_currency
                - address_book_address
                - invoice_downloadable
                - transaction
        '422':
          description: VASP Info Missing
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: Address Not Found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                crypto_currency_id:
                  type: integer
                  description: Crypto currency ID
                amount:
                  type: string
                  description: Amount to withdraw
                address_book_address_id:
                  type: string
                  format: uuid
                  description: Address book address ID
                request_id:
                  type: string
                  description: Request ID for idempotency
                transaction_purpose:
                  type: string
                  description: Transaction purpose
                note:
                  type: string
                  description: Optional note
              required:
              - crypto_currency_id
              - amount
              - address_book_address_id
    get:
      summary: List Crypto Withdrawals
      tags:
      - Crypto Withdrawals
      description: Returns a paginated list of crypto withdrawals for the authenticated
        user
      parameters:
      - name: from_time
        in: query
        required: false
        schema:
          type: integer
        description: Filter withdrawals created_at by starting time (e.g. ?from_time=1672531199000)
      - name: to_time
        in: query
        required: false
        schema:
          type: integer
        description: Filter withdrawals created_at by ending time (e.g. ?to_time=1672531199000)
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Page to fetch when using offset pagination. Has no effect unless
          page[enable_offset]=true is also sent; otherwise the response uses cursor
          pagination and this parameter is ignored.
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 2
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to pagination from
        schema:
          type: string
      - name: page[enable_offset]
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Set to true to switch this endpoint from cursor pagination to
          offset pagination, enabling page[number] to select a specific page.
      security:
      - api_key: []
      responses:
        '200':
          description: Filters withdrawals by created_at range
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    address:
                      type: string
                    amount:
                      type: string
                    total_amount:
                      type: string
                    created_at:
                      type: integer
                    fee:
                      type:
                      - string
                      - 'null'
                    memo:
                      type:
                      - string
                      - 'null'
                    status:
                      type: string
                    travel_rule_status:
                      type:
                      - string
                      - 'null'
                    pending_reason:
                      type:
                      - string
                      - 'null'
                    recipient_fullname:
                      type:
                      - string
                      - 'null'
                    transaction_hash:
                      type:
                      - string
                      - 'null'
                    link_explorer:
                      type:
                      - string
                      - 'null'
                    crypto_currency:
                      type: object
                      additionalProperties: true
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                        code:
                          type: string
                        minimum_sell:
                          type: string
                        precision:
                          type: integer
                        allow_multiple_user_addresses:
                          type: boolean
                        icon:
                          type: string
                        network_id:
                          type: string
                        has_address_tag:
                          type: boolean
                        network:
                          type: object
                          additionalProperties: true
                          properties:
                            uuid:
                              type: string
                              format: uuid
                            name:
                              type: string
                            network_code:
                              type: string
                        asset:
                          type: object
                          additionalProperties: true
                          properties:
                            id:
                              type: integer
                            name:
                              type: string
                            symbol:
                              type: string
                            icon_url:
                              type:
                              - string
                              - 'null'
                            asset_type:
                              type: string
                      required:
                      - id
                      - name
                      - code
                      - network
                      - asset
                    address_book_address:
                      type: object
                      additionalProperties: true
                      properties:
                        id:
                          type: string
                          format: uuid
                        label:
                          type: string
                        created_at:
                          type: integer
                        address:
                          type: string
                        address_tag:
                          type:
                          - string
                          - 'null'
                        status:
                          type: string
                        display_status:
                          type:
                          - string
                          - 'null'
                        crypto_wallet:
                          type:
                          - object
                          - 'null'
                          properties:
                            id:
                              type: string
                              format: uuid
                            name:
                              type: string
                            type:
                              type: string
                        wallet_identity:
                          type:
                          - object
                          - 'null'
                          properties:
                            id:
                              type: string
                              format: uuid
                            entity_name:
                              type: string
                            entity_type:
                              type: string
                            ownership:
                              type: string
                            additional_info_provided:
                              type: boolean
                        crypto_currency_networks:
                          type: array
                          items:
                            type: object
                            properties:
                              uuid:
                                type: string
                                format: uuid
                              name:
                                type: string
                              network_code:
                                type: string
                    note:
                      type:
                      - string
                      - 'null'
                    invoice_downloadable:
                      type: boolean
                    transaction:
                      type: object
                      properties:
                        uuid:
                          type: string
                          format: uuid
                      required:
                      - uuid
                  required:
                  - id
                  - amount
                  - created_at
                  - status
                  - crypto_currency
                  - address_book_address
                  - invoice_downloadable
                  - transaction
        '422':
          description: Invalid Time Parameters
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/crypto/withdrawals/{id}":
    get:
      summary: Get Crypto Withdrawal
      tags:
      - Crypto Withdrawals
      description: Returns a single crypto withdrawal by ID
      parameters:
      - name: id
        in: path
        format: uuid
        description: Withdrawal ID (UUID)
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: Returns the withdrawal
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  address:
                    type: string
                  amount:
                    type: string
                  total_amount:
                    type: string
                  created_at:
                    type: integer
                  fee:
                    type:
                    - string
                    - 'null'
                  memo:
                    type:
                    - string
                    - 'null'
                  status:
                    type: string
                  travel_rule_status:
                    type:
                    - string
                    - 'null'
                  pending_reason:
                    type:
                    - string
                    - 'null'
                  recipient_fullname:
                    type:
                    - string
                    - 'null'
                  transaction_hash:
                    type:
                    - string
                    - 'null'
                  link_explorer:
                    type:
                    - string
                    - 'null'
                  crypto_currency:
                    type: object
                    additionalProperties: true
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                      code:
                        type: string
                      minimum_sell:
                        type: string
                      precision:
                        type: integer
                      allow_multiple_user_addresses:
                        type: boolean
                      icon:
                        type: string
                      network_id:
                        type: string
                      has_address_tag:
                        type: boolean
                      network:
                        type: object
                        additionalProperties: true
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          name:
                            type: string
                          network_code:
                            type: string
                      asset:
                        type: object
                        additionalProperties: true
                        properties:
                          id:
                            type: integer
                          name:
                            type: string
                          symbol:
                            type: string
                          icon_url:
                            type:
                            - string
                            - 'null'
                          asset_type:
                            type: string
                    required:
                    - id
                    - name
                    - code
                    - network
                    - asset
                  address_book_address:
                    type:
                    - object
                    - 'null'
                    additionalProperties: true
                    properties:
                      id:
                        type: string
                        format: uuid
                      label:
                        type: string
                      created_at:
                        type: integer
                      address:
                        type: string
                      address_tag:
                        type:
                        - string
                        - 'null'
                      status:
                        type: string
                      display_status:
                        type:
                        - string
                        - 'null'
                      crypto_wallet:
                        type:
                        - object
                        - 'null'
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                          type:
                            type: string
                      wallet_identity:
                        type:
                        - object
                        - 'null'
                        properties:
                          id:
                            type: string
                            format: uuid
                          entity_name:
                            type: string
                          entity_type:
                            type: string
                          ownership:
                            type: string
                          additional_info_provided:
                            type: boolean
                      crypto_currency_networks:
                        type: array
                        items:
                          type: object
                          properties:
                            uuid:
                              type: string
                              format: uuid
                            name:
                              type: string
                            network_code:
                              type: string
                  note:
                    type:
                    - string
                    - 'null'
                  invoice_downloadable:
                    type: boolean
                  transaction:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                    required:
                    - uuid
                required:
                - id
                - address
                - amount
                - created_at
                - status
                - total_amount
                - fee
                - transaction_hash
                - crypto_currency
                - address_book_address
                - invoice_downloadable
                - transaction
        '404':
          description: Cannot access other users withdrawal
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/crypto_wallets":
    get:
      summary: List of known wallets/exchanges
      tags:
      - Crypto Wallets
      description: |
        Lists available wallets for specifying transaction counterparty information.

        This API is used in conjunction with the counterparty declaration APIs.
      parameters:
      - name: name
        in: query
        required: false
        schema:
          type: string
        description: Name or partial name to search for. Performs a fuzzy search and
          may return in-exact matches
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              examples:
                success:
                  value:
                  - id: b7d2dc66-782f-4a53-87e5-7dcc8ba7ed9e
                    name: Coinbase
                    type: hosted
                    risk_level: high
                  - id: 7a09a012-da4c-4efb-8cde-6d27fcee3fc9
                    name: Metamask
                    type: private
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      pattern: "^([a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8})$"
                    type:
                      type: string
                      enum:
                      - private
                      - hosted
                    name:
                      type: string
                    risk_level:
                      type: string
                      enum:
                      - low
                      - medium
                      - high
                  required:
                  - id
                  - type
                  - name
                  additionalProperties: false
  "/public_api/v1/fiat/deposits":
    get:
      summary: List fiat deposits
      tags:
      - Fiat Deposits
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: paginated response with page params
          content:
            application/vnd.api+json:
              schema:
                type: array
                items:
                  "$ref": "#/components/schemas/fiat_deposit"
        '401':
          description: unauthorized response
          content:
            application/vnd.api+json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/fiat/withdrawal_fees":
    get:
      summary: List fiat withdrawal fees
      tags:
      - Fiat Withdrawals
      description: |
        Returns withdrawal fee per FeatureFlag-enabled fiat currency for the authenticated user.

        Currencies are intersected: FeatureFlag-fiat-visible for the user x WithdrawalFee row exists
        for the user's legal entity. Currencies missing either are omitted.
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: success response - ignores fee rows for other legal entities
          content:
            application/json:
              examples:
                success:
                  value:
                  - currency: SGD
                    fee: '5.0'
                    asset:
                      id: 1
                      name: Singapore Dollar
                      symbol: SGD
                      icon_url:
                      asset_type: fiat
              schema:
                type: array
                items:
                  type: object
                  properties:
                    currency:
                      type: string
                    fee:
                      type: string
                    asset:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                        symbol:
                          type: string
                        icon_url:
                          type: string
                        asset_type:
                          type: string
                      required:
                      - id
                      - name
                      - symbol
                      - asset_type
                  required:
                  - currency
                  - fee
                  - asset
                  additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/fiat/withdrawal_limits":
    get:
      summary: List fiat withdrawal limits
      tags:
      - Fiat Withdrawals
      description: |
        Returns the minimum and maximum withdrawal amount per FeatureFlag-enabled fiat currency
        for the authenticated user.
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: returns empty array when no fiats are enabled
          content:
            application/json:
              examples:
                success:
                  value:
                  - currency: SGD
                    minimum_withdrawal_amount: '10.0'
                    maximum_withdrawal_amount: '50000.0'
                  - currency: USD
                    minimum_withdrawal_amount: '100.0'
                    maximum_withdrawal_amount: '100000.0'
                  - currency: IDR
                    minimum_withdrawal_amount: '1000000.0'
                    maximum_withdrawal_amount: '70000.0'
              schema:
                type: array
                items:
                  type: object
                  properties:
                    currency:
                      type: string
                      description: Fiat currency symbol
                    minimum_withdrawal_amount:
                      type: string
                      description: Fiat withdrawal minimum amount
                    maximum_withdrawal_amount:
                      type: string
                      description: Fiat withdrawal maximum amount
                  required:
                  - currency
                  - minimum_withdrawal_amount
                  - maximum_withdrawal_amount
                  additionalProperties: false
  "/public_api/v1/fiat/withdrawals":
    get:
      summary: List fiat withdrawals
      tags:
      - Fiat Withdrawals
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: paginated response with page params
          content:
            application/vnd.api+json:
              schema:
                type: array
                items:
                  type: object
    post:
      summary: Create Fiat Withdrawal
      tags:
      - Fiat Withdrawals
      description: Creates a fiat withdrawal for the authenticated user
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - transfer
      responses:
        '201':
          description: Withdrawal Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  currency:
                    type: string
                  amount:
                    type: string
                  status:
                    type: string
                  bank_reference:
                    type:
                    - string
                    - 'null'
                  withdrawal_fee:
                    type:
                    - string
                    - 'null'
                  created_at:
                    type:
                    - string
                    - integer
                  invoice_downloadable:
                    type: boolean
                  transaction:
                    type:
                    - object
                    - 'null'
                    properties:
                      uuid:
                        type: string
                        format: uuid
                    required:
                    - uuid
                  bank_account:
                    type:
                    - object
                    - 'null'
                    properties:
                      id:
                        type: integer
                      account_number:
                        type: string
                      beneficiary_name:
                        type: string
                      currency:
                        type: string
                      last_used_at:
                        type:
                        - integer
                        - 'null'
                      verified:
                        type: boolean
                      bank:
                        type:
                        - object
                        - 'null'
                        properties:
                          name:
                            type:
                            - string
                            - 'null'
                          swift_code:
                            type:
                            - string
                            - 'null'
                          bic_code:
                            type:
                            - string
                            - 'null'
                          branch_name:
                            type:
                            - string
                            - 'null'
                          branch_code:
                            type:
                            - string
                            - 'null'
                          address:
                            type:
                            - string
                            - 'null'
                    required:
                    - id
                required:
                - id
                - currency
                - amount
                - status
                - created_at
                - invoice_downloadable
                - transaction
        '422':
          description: Bank Account Does Not Belong to User
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: Withdrawal Fee Not Found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: Currency code (e.g., SGD)
                amount:
                  type: string
                  description: Amount to withdraw
                bank_account_id:
                  type: integer
                  description: Bank account ID
              required:
              - currency
              - amount
              - bank_account_id
  "/public_api/v1/merchant/crypto_deposits":
    get:
      summary: List merchant crypto deposits
      tags:
      - Merchants
      description: Returns a paginated list of crypto deposits for the authenticated
        merchant user
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Page to fetch when using offset pagination. Has no effect unless
          page[enable_offset]=true is also sent; otherwise the response uses cursor
          pagination and this parameter is ignored.
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 2
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to pagination from
        schema:
          type: string
      - name: page[enable_offset]
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Set to true to switch this endpoint from cursor pagination to
          offset pagination, enabling page[number] to select a specific page.
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Returns list of merchant crypto deposits
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    status:
                      type: string
                    transaction_hash:
                      type:
                      - string
                      - 'null'
                    amount:
                      type:
                      - string
                      - 'null'
                    merchant_customer_id:
                      type:
                      - string
                      - 'null'
                    source_addresses:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                    destination_address:
                      type:
                      - string
                      - 'null'
                    crypto_currency:
                      type:
                      - string
                      - 'null'
                    network:
                      type:
                      - string
                      - 'null'
                    created_at:
                      type: integer
                    updated_at:
                      type: integer
                  required:
                  - id
                  - merchant_customer_id
                  - source_addresses
                  - destination_address
                  - transaction_hash
                  - amount
                  - status
                  - crypto_currency
                  - network
                  additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/crypto_deposits/{id}":
    get:
      summary: Get merchant crypto deposit
      tags:
      - Merchants
      description: Returns a single crypto deposit by id for the authenticated merchant
        user
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Crypto deposit id
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Returns the merchant crypto deposit
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  status:
                    type: string
                  transaction_hash:
                    type:
                    - string
                    - 'null'
                  amount:
                    type:
                    - string
                    - 'null'
                  merchant_customer_id:
                    type:
                    - string
                    - 'null'
                  source_addresses:
                    type:
                    - array
                    - 'null'
                    items:
                      type: string
                  destination_address:
                    type:
                    - string
                    - 'null'
                  crypto_currency:
                    type:
                    - string
                    - 'null'
                  network:
                    type:
                    - string
                    - 'null'
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                required:
                - id
                - merchant_customer_id
                - source_addresses
                - destination_address
                - transaction_hash
                - amount
                - status
                - crypto_currency
                - network
                additionalProperties: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/customers/{customer_id}/address":
    post:
      summary: Create merchant customer address
      tags:
      - Merchants
      description: |
        Creates a deposit address for the specified merchant customer.

        The address is assigned to the authenticated merchant user through the
        standard wallet address issuance flow, then stored as the merchant
        customer's associated deposit address.
      parameters:
      - name: customer_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Merchant customer UUID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                - merchant_customer_id
                - address
                - currency
                - network_code
                properties:
                  merchant_customer_id:
                    type: string
                    format: uuid
                  address:
                    type: string
                  currency:
                    type: string
                  network_code:
                    type: string
                additionalProperties: false
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - merchant_customer_id
                - address
                - currency
                - network_code
                properties:
                  merchant_customer_id:
                    type: string
                    format: uuid
                  address:
                    type: string
                  currency:
                    type: string
                  network_code:
                    type: string
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: The currency code for the deposit address.
                network_code:
                  type: string
                  description: The blockchain network code for the deposit address.
              required:
              - currency
              - network_code
              additionalProperties: false
    get:
      summary: Get merchant customer address
      tags:
      - Merchants
      description: Returns the deposit address associated with the specified merchant
        customer.
      parameters:
      - name: customer_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Merchant customer UUID
      - name: currency
        in: query
        required: true
        schema:
          type: string
        description: Currency code for the merchant customer address
      - name: network_code
        in: query
        required: true
        schema:
          type: string
        description: Network code for the merchant customer address
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - merchant_customer_id
                - address
                - currency
                - network_code
                properties:
                  merchant_customer_id:
                    type: string
                    format: uuid
                  address:
                    type: string
                  currency:
                    type: string
                  network_code:
                    type: string
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/customers":
    get:
      summary: List merchant customers
      tags:
      - Merchants
      description: Lists merchant customers for the authenticated merchant user.
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    external_customer_id:
                      type: string
                    first_name:
                      type: string
                    last_name:
                      type: string
                  required:
                  - id
                  - external_customer_id
                  - first_name
                  - last_name
                  additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
    post:
      summary: Create merchant customer
      tags:
      - Merchants
      description: Creates a merchant customer for the authenticated merchant user.
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  external_customer_id:
                    type: string
                  first_name:
                    type: string
                  last_name:
                    type: string
                required:
                - id
                - external_customer_id
                - first_name
                - last_name
                additionalProperties: false
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                external_customer_id:
                  type: string
                first_name:
                  type: string
                last_name:
                  type: string
              required:
              - external_customer_id
              - first_name
              - last_name
              additionalProperties: false
  "/public_api/v1/merchant/customers/{customer_id}/refund_addresses":
    get:
      summary: List merchant customer refund addresses
      tags:
      - Merchants
      description: Lists refund addresses scoped to a merchant customer.
      parameters:
      - name: customer_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Merchant customer UUID
      - name: network_code
        in: query
        required: false
        schema:
          type: string
        description: Filter by blockchain network code
      - name: status
        in: query
        required: false
        schema:
          type: string
          enum:
          - unverified
          - verified
        description: Filter by refund address status
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    merchant_customer_id:
                      type: string
                    destination_address:
                      type: string
                    network_code:
                      type: string
                    status:
                      type: string
                      enum:
                      - unverified
                      - verified
                    created_at:
                      type: integer
                    updated_at:
                      type: integer
                  required:
                  - id
                  - merchant_customer_id
                  - destination_address
                  - network_code
                  - status
                  - created_at
                  - updated_at
                  additionalProperties: false
    post:
      summary: Create merchant customer refund address
      tags:
      - Merchants
      description: Creates or returns a refund address scoped to a merchant customer
        and returns a verification URL when the address is unverified.
      parameters:
      - name: customer_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Merchant customer UUID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  merchant_customer_id:
                    type: string
                  destination_address:
                    type: string
                  network_code:
                    type: string
                  status:
                    type: string
                    enum:
                    - unverified
                    - verified
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                  verification_url:
                    type: string
                    format: uri
                required:
                - id
                - merchant_customer_id
                - destination_address
                - network_code
                - status
                - created_at
                - updated_at
                additionalProperties: false
        '200':
          description: Existing refund address
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  merchant_customer_id:
                    type: string
                  destination_address:
                    type: string
                  network_code:
                    type: string
                  status:
                    type: string
                    enum:
                    - unverified
                    - verified
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                  verification_url:
                    type: string
                    format: uri
                required:
                - id
                - merchant_customer_id
                - destination_address
                - network_code
                - status
                - created_at
                - updated_at
                additionalProperties: false
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                destination_address:
                  type: string
                network_code:
                  type: string
                redirect_url:
                  type: string
                  format: uri
              required:
              - destination_address
              - network_code
              additionalProperties: false
  "/public_api/v1/merchant/customers/{customer_id}/refund_addresses/{id}":
    get:
      summary: Show merchant customer refund address
      tags:
      - Merchants
      description: Shows one refund address scoped to a merchant customer.
      parameters:
      - name: customer_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Merchant customer UUID
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Refund address UUID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  merchant_customer_id:
                    type: string
                  destination_address:
                    type: string
                  network_code:
                    type: string
                  status:
                    type: string
                    enum:
                    - unverified
                    - verified
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                  verification_url:
                    type: string
                    format: uri
                required:
                - id
                - merchant_customer_id
                - destination_address
                - network_code
                - status
                - created_at
                - updated_at
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/webhook_events":
    get:
      summary: List merchant webhook events
      tags:
      - Merchants
      description: Returns a paginated list of webhook events for the authenticated
        merchant.
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to paginate from
        schema:
          type: string
      - name: webhook_id
        in: query
        required: false
        description: Filter by webhook ID
        schema:
          type: string
      - name: event_type
        in: query
        required: false
        description: Filter by event type
        schema:
          type: string
      - name: status
        in: query
        required: false
        schema:
          type: string
          enum:
          - success
          - pending
          - failed
        description: Filter by delivery status
      - name: from_time
        in: query
        required: false
        schema:
          type: integer
          format: int64
        description: Filter events created at or after this time (e.g. ?from_time=1672531199000)
      - name: to_time
        in: query
        required: false
        schema:
          type: integer
          format: int64
        description: Filter events created at or before this time (e.g. ?to_time=1672531199000)
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    webhook_id:
                      type: string
                      format: uuid
                    event_type:
                      type: string
                    status:
                      type: string
                      enum:
                      - success
                      - pending
                      - failed
                    retry_count:
                      type: integer
                    delivered_at:
                      type:
                      - integer
                      - 'null'
                    created_at:
                      type: integer
                    updated_at:
                      type: integer
                  required:
                  - id
                  - webhook_id
                  - event_type
                  - status
                  - retry_count
                  - delivered_at
                  - created_at
                  - updated_at
                  additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/webhook_events/{id}":
    get:
      summary: Get merchant webhook event
      tags:
      - Merchants
      description: Returns a single webhook event by id for the authenticated merchant.
      parameters:
      - name: id
        in: path
        description: Webhook event ID
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  webhook_id:
                    type: string
                    format: uuid
                  event_type:
                    type: string
                  status:
                    type: string
                    enum:
                    - success
                    - pending
                    - failed
                  retry_count:
                    type: integer
                  delivered_at:
                    type:
                    - integer
                    - 'null'
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                required:
                - id
                - webhook_id
                - event_type
                - status
                - retry_count
                - delivered_at
                - created_at
                - updated_at
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/webhook_events/{webhook_event_id}/redeliver":
    post:
      summary: Redeliver a webhook event
      tags:
      - Merchants
      description: Enqueues a webhook event for redelivery.
      parameters:
      - name: webhook_event_id
        in: path
        description: Webhook event ID
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  webhook_id:
                    type: string
                    format: uuid
                  event_type:
                    type: string
                  status:
                    type: string
                    enum:
                    - success
                    - pending
                    - failed
                  retry_count:
                    type: integer
                  delivered_at:
                    type:
                    - integer
                    - 'null'
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                required:
                - id
                - webhook_id
                - event_type
                - status
                - retry_count
                - delivered_at
                - created_at
                - updated_at
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/merchant/webhooks":
    get:
      summary: List active webhooks
      tags:
      - Merchants
      description: Lists all active webhooks for the authenticated merchant.
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    url:
                      type: string
                    created_at:
                      type: integer
                  required:
                  - id
                  - url
                  - created_at
                  additionalProperties: false
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
    post:
      summary: Register a webhook
      tags:
      - Merchants
      description: Registers a new webhook for the authenticated merchant. Returns
        the generated secret once.
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                  created_at:
                    type: integer
                  secret:
                    type: string
                required:
                - id
                - url
                - created_at
                - secret
                additionalProperties: false
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
              required:
              - url
              additionalProperties: false
  "/public_api/v1/merchant/webhooks/{id}":
    put:
      summary: Update a webhook URL
      tags:
      - Merchants
      description: Updates the URL of an existing active webhook.
      parameters:
      - name: id
        in: path
        description: Webhook ID
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                  created_at:
                    type: integer
                required:
                - id
                - url
                - created_at
                additionalProperties: false
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: Not found
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
              required:
              - url
              additionalProperties: false
    delete:
      summary: Deactivate a webhook
      tags:
      - Merchants
      description: Deactivates an existing active webhook.
      parameters:
      - name: id
        in: path
        description: Webhook ID
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - merchant
      responses:
        '204':
          description: No Content
        '404':
          description: Not found
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/order_quotes":
    post:
      summary: Create Order Quote
      tags:
      - Order Quotes
      description: Send a request to price a quote for a buy or sell order
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - trade
      responses:
        '201':
          description: order quote created
          content:
            application/json:
              examples:
                success:
                  value:
                    symbol: BTC-USD
                    side: buy
                    quantity: '100.0'
                    payment_method: user_balance
                    quote_id: 9adbdcdc-ac0b-40d1-b59d-7fa55ab1688a
                    locked_price: '34567.89'
                    expires_at: 1700123456789
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                    description: Symbol of the order quote. eg. BTC-USD
                  side:
                    type: string
                    enum:
                    - buy
                    - sell
                    description: Side of the order, either buy or sell.
                  quantity:
                    type: string
                    format: decimal
                  payment_method:
                    type: string
                    enum:
                    - user_balance
                    - grab_pay
                    - checkout_dot_com
                    description: Payment method to use.
                  quote_id:
                    type: string
                    description: Unique identifier for the order quote.
                  locked_price:
                    type: string
                    description: Price at which order can be executed before quote
                      expires.
                  expires_at:
                    type: integer
                    description: Unix timestamp for expiration of quote in milliseconds.
                  credit_card:
                    type: object
                    nullable: true
                    description: Credit card information for the order.
                    properties:
                      bank_name:
                        type: string
                        description: Issuing bank name.
                      bin:
                        type: string
                        description: Bank identification number.
                      blocked:
                        type: boolean
                        description: Whether the card is currently blocked.
                      blocked_expired:
                        type: boolean
                        description: Whether the block has expired.
                      blocked_until:
                        type: integer
                        description: Timestamp in milliseconds until the block lifts.
                      card_type:
                        type: string
                        description: Type of the card (credit, debit, etc.).
                      cardholder_name:
                        type: string
                        description: Name on the card.
                      icon_url:
                        type: string
                        description: URL to card brand icon.
                      last_4_digits:
                        type: string
                        description: Last four digits of the card number.
                      masked_card_number:
                        type: string
                        description: Masked representation of the card number.
                      primary:
                        type: boolean
                        description: Whether this card is primary.
                      scheme:
                        type: string
                        description: Card scheme (e.g., Visa, Mastercard).
                      uuid:
                        type: string
                        description: Unique identifier for the stored card.
                    additionalProperties: false
                required:
                - symbol
                - side
                - quantity
                - payment_method
                - quote_id
                - locked_price
                - expires_at
                additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '422':
          description: invalid request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '503':
          description: Service Unavailable
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait before retrying the request
          content:
            application/json:
              examples:
                service_unavailable:
                  value:
                    errors:
                    - message: We are unable to process your request at the moment.
                        Please try again later.
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                symbol:
                  type: string
                  description: Symbol of the order quote. eg. BTC-USD
                side:
                  type: string
                  enum:
                  - buy
                  - sell
                  description: Side of the order, either buy or sell.
                currency:
                  type: string
                  description: "'Currency of quantity. If not provided, defaults to
                    counter currency for buy order and base currency for sell order.'"
                quantity:
                  type: string
                  format: decimal
                  description: Requested quantity of the order (counter quantity for
                    buy order, base quantity for sell order)
                payment_method:
                  type: string
                  enum:
                  - user_balance
                  - grab_pay
                  - checkout_dot_com
                  description: Payment method to use
                card_uuid:
                  type: string
                  description: UUID of the credit card to use for the order.
                promo_code:
                  type: string
                  description: Promo code to apply to the order.
              required:
              - symbol
              - side
              - quantity
              - payment_method
            examples:
              Example - BTC-USD:
                summary: Example - Buy BTC with USD using user balance
                value:
                  symbol: BTC-USD
                  side: buy
                  quantity: '100.0'
                  currency: USD
                  payment_method: user_balance
  "/public_api/v1/orders/{order_id}/invoice":
    parameters:
    - name: order_id
      in: path
      required: true
      description: Order ID
      schema:
        type: string
    post:
      summary: List order tax invoices
      tags:
      - Orders
      description: Returns the order's billing documents as expiring, presigned download
        links
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: Presigned download links for the order's billing documents
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: false
                  required:
                  - document_number
                  - document_type
                  - url
                  - expires_at
                  properties:
                    document_number:
                      type: string
                      example: INV-2606000201
                    document_type:
                      type: string
                      enum:
                      - invoice
                      - credit_note
                    url:
                      type: string
                      format: uri
                      description: Short-lived presigned S3 URL to the PDF
                    expires_at:
                      type: integer
                      description: Link expiry, Unix milliseconds
        '422':
          description: Order not eligible for a tax invoice
          content:
            application/json:
              examples:
                not_eligible:
                  value:
                    errors:
                    - message: This order is not eligible for a tax invoice
              schema:
                "$ref": "#/components/schemas/errors"
        '503':
          description: Invoice generation temporarily unavailable
          content:
            application/json:
              examples:
                generation_failed:
                  value:
                    errors:
                    - message: The tax invoice could not be generated. Please try
                        again later.
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: Order not found
          content:
            application/json:
              examples:
                not_found:
                  value:
                    errors:
                    - message: Record not found
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/orders":
    get:
      summary: Get orders
      tags:
      - Orders
      parameters:
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Current page
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 50
        description: Number of items per page
      - name: from_time
        in: query
        required: false
        schema:
          type: integer
          format: int64
        description: Filter order created_at by starting time (e.g. ?from_time=1672531199000)
      - name: to_time
        in: query
        required: false
        schema:
          type: integer
          format: int64
        description: Filter order created_at by ending time (e.g. ?to_time=1672531199000)
      - name: base_currency
        in: query
        required: false
        schema:
          type: string
        description: Filter by base_currency (e.g. base_currency=BTC)
      - name: counter_currency
        in: query
        required: false
        schema:
          type: string
        description: Filter by counter_currency (e.g. counter_currency=USD)
      - name: status[]
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - completed
            - cancelled
            - pending
            - cancelling
            - open
        description: Filter by multiple statuses (e.g. ?status[]=completed&status[]=cancelled)
      - name: execution_type[]
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - limit
            - rfq
        description: Filter by multiple execution types (e.g. ?execution_type[]=limit&execution_type[]=rfq)
      - name: type[]
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - buy
            - sell
            - swap
        description: Filter by multiple types (e.g. ?type[]=buy&type[]=sell&type[]=swap)
      - name: recurring_plan_id
        in: query
        required: false
        schema:
          type: string
          format: uuid
        description: Filter by recurring plan ID. Returns orders executed for a specific
          recurring plan.
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              examples:
                success:
                  value:
                  - id: 12345
                    order_receipt_id: 459919c5-414f-45bf-a021-c4a1388349f5
                    symbol: BTC-SGD
                    side: buy
                    type: Buy
                    quantity: '100.0'
                    currency: SGD
                    base_currency: BTC
                    counter_currency: SGD
                    payment_method: user_balance
                    status: Completed
                    received_currency: BTC
                    price: '62993.7'
                    order_quote_id: b8ba35e7-86e9-4171-82be-08a397721d81
                    client_order_id: 91209400-8fda-499d-89e8-1653252e31bd
                    created_at: 1704222249247
                    fee: '0.5'
                    fee_currency: SGD
                    net_amount: '99.5'
                    execution_type: rfq
                    expires_at:
                    fee_percentage: '0.5'
                    point_earned: 1
                    cancel_reason: over_slippage
                  - id: 23456
                    order_receipt_id: 459919c5-414f-45bf-a021-c4a1388349f6
                    symbol: BTC-SGD
                    side: sell
                    type: Sell
                    quantity: '0.0001'
                    currency: BTC
                    base_currency: BTC
                    counter_currency: SGD
                    payment_method: user_balance
                    status: Completed
                    received_currency: SGD
                    price: '62993.7'
                    order_quote_id: b8ba35e7-86e9-4171-82be-08a397721d82
                    client_order_id: 91209400-8fda-499d-89e8-1653252e31be
                    created_at: 1704222249248
                    fee: '0.5'
                    fee_currency: SGD
                    net_amount: '99.5'
                    execution_type: rfq
                    expires_at:
                    fee_percentage: '0.5'
                    point_earned: 1
                    cancel_reason: cancelled by aggregator
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Unique identifier for the order
                    order_receipt_id:
                      type: string
                      description: Internal id for the order
                    symbol:
                      type: string
                      description: Trading pair symbol (e.g. BTC-USD)
                    side:
                      type: string
                      description: Order side (e.g. Buy or Sell)
                      enum:
                      - buy
                      - sell
                    quantity:
                      type: string
                      format: decimal
                      description: Quantity of the order in counter currency for 'buy'
                        orders and in base currency for 'sell' orders
                    order_qty:
                      type: string
                      format: decimal
                      deprecated: true
                      description: Quantity of the order in counter currency for 'buy'
                        orders and in base currency for 'sell' orders
                    payment_method:
                      type: string
                      description: Payment method used for the order.
                    created_at:
                      type: integer
                      description: Timestamp when the order was created
                    status:
                      type: string
                      description: Current status of the order
                      enum:
                      - Open
                      - Cancelling
                      - Completed
                      - Cancelled
                      - Pending
                    currency:
                      type: string
                      deprecated: true
                    fee:
                      type:
                      - string
                      - 'null'
                      description: Fee charged for the order
                    fee_currency:
                      type:
                      - string
                      - 'null'
                      description: Currency of the fee charged
                    net_amount:
                      type:
                      - string
                      - 'null'
                      description: Net amount after fees. In base currency for 'buy'
                        order and counter currency for 'sell' order
                    received_currency:
                      type: string
                      deprecated: true
                    price:
                      type: string
                      description: Limit price for limit order. Quote price for rfq
                        order
                    order_quote_id:
                      type:
                      - string
                      - 'null'
                      description: Id of quote for rfq order
                    client_order_id:
                      type:
                      - string
                      - 'null'
                      description: Client generated unique id for order
                    execution_type:
                      type: string
                      enum:
                      - rfq
                      - limit
                      description: Type of the order, rfq or limit
                    expires_at:
                      type:
                      - string
                      - 'null'
                      description: Expiry timestamp for GTD limit order.
                    fee_percentage:
                      type:
                      - string
                      - 'null'
                    type:
                      type: string
                      enum:
                      - Buy
                      - Sell
                      - Swap
                    point_earned:
                      type:
                      - integer
                      - 'null'
                    cancel_reason:
                      type:
                      - string
                      - 'null'
                      description: Reason for order cancellation
                    base_currency:
                      type: string
                      description: Base currency for the order, eg. BTC in a BTC-USD
                        order
                    counter_currency:
                      type: string
                      description: Counter currency for the order, eg. USD in a BTC-USD
                        order
                    redirect_link:
                      type:
                      - string
                      - 'null'
                      description: Redirect link for payment
                    recurring_plan_id:
                      type:
                      - string
                      - 'null'
                      format: uuid
                      description: ID of the recurring plan (DCA) that this order
                        belongs to
                  required:
                  - order_receipt_id
                  - symbol
                  - side
                  - quantity
                  - payment_method
                  - created_at
                  - status
                  - currency
                  - fee
                  - expires_at
                  - fee_currency
                  - net_amount
                  - received_currency
                  - price
                  - order_quote_id
                  - client_order_id
                  - execution_type
                  - fee_percentage
                  - type
                  - point_earned
                  - base_currency
                  - counter_currency
                  additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
    post:
      summary: Create Order
      tags:
      - Orders
      description: Send a request to create an order
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - trade
      responses:
        '201':
          description: order created
          content:
            application/json:
              examples:
                success:
                  value:
                    id: 12345
                    order_receipt_id: 459919c5-414f-45bf-a021-c4a1388349f5
                    symbol: BTC-SGD
                    side: buy
                    quantity: '100.0'
                    currency: SGD
                    base_currency: BTC
                    counter_currency: SGD
                    payment_method: user_balance
                    status: Pending
                    received_currency: BTC
                    price: '62993.7'
                    order_quote_id:
                    client_order_id: 91209400-8fda-499d-89e8-1653252e31bd
                    created_at: 1704222249247
                    execution_type: limit
                    expires_at: 1704222249248
                    fee: '0.5'
                    fee_currency: SGD
                    net_amount: '0.0001587'
                    fee_percentage: '0.5'
                    type: Buy
                    point_earned: 1
                    cancel_reason: over_slippage
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique identifier for the order
                  order_receipt_id:
                    type: string
                    description: Internal id for the order
                  symbol:
                    type: string
                    description: Trading pair symbol (e.g. BTC-USD)
                  side:
                    type: string
                    description: Order side (e.g. Buy or Sell)
                    enum:
                    - buy
                    - sell
                  quantity:
                    type: string
                    format: decimal
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  order_qty:
                    type: string
                    format: decimal
                    deprecated: true
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  payment_method:
                    type: string
                    description: Payment method used for the order.
                  created_at:
                    type: integer
                    description: Timestamp when the order was created
                  status:
                    type: string
                    description: Current status of the order
                    enum:
                    - Open
                    - Cancelling
                    - Completed
                    - Cancelled
                    - Pending
                  currency:
                    type: string
                    deprecated: true
                  fee:
                    type:
                    - string
                    - 'null'
                    description: Fee charged for the order
                  fee_currency:
                    type:
                    - string
                    - 'null'
                    description: Currency of the fee charged
                  net_amount:
                    type:
                    - string
                    - 'null'
                    description: Net amount after fees. In base currency for 'buy'
                      order and counter currency for 'sell' order
                  received_currency:
                    type: string
                    deprecated: true
                  price:
                    type: string
                    description: Limit price for limit order. Quote price for rfq
                      order
                  order_quote_id:
                    type:
                    - string
                    - 'null'
                    description: Id of quote for rfq order
                  client_order_id:
                    type:
                    - string
                    - 'null'
                    description: Client generated unique id for order
                  execution_type:
                    type: string
                    description: Type of the order, rfq or limit
                    enum:
                    - rfq
                    - limit
                  expires_at:
                    type:
                    - integer
                    - 'null'
                    description: Expiry timestamp for GTD limit order.
                  fee_percentage:
                    type:
                    - string
                    - 'null'
                  type:
                    type: string
                    enum:
                    - Buy
                    - Sell
                    - Swap
                  point_earned:
                    type:
                    - integer
                    - 'null'
                  credit_card:
                    type:
                    - object
                    - 'null'
                    properties:
                      masked_card_number:
                        type: string
                      icon_url:
                        type: string
                  cancel_reason:
                    type:
                    - string
                    - 'null'
                    description: Reason for order cancellation
                  original_fee:
                    type:
                    - string
                    - 'null'
                    description: Original fee charged for the order before reduced
                      fee code is applied
                  invoice_downloadable:
                    type: boolean
                    description: Whether a tax invoice can be downloaded for this
                      order
                  fee_reduction:
                    type:
                    - object
                    - 'null'
                    properties:
                      type:
                        type: string
                        enum:
                        - override
                        - deduct
                      amount:
                        type: string
                      amount_scheme:
                        type: string
                        enum:
                        - rate
                        - value
                      code:
                        type: string
                      percent:
                        type: string
                  base_currency:
                    type: string
                    description: Base currency for the order, eg. BTC in a BTC-USD
                      order
                  counter_currency:
                    type: string
                    description: Counter currency for the order, eg. USD in a BTC-USD
                      order
                  redirect_link:
                    type:
                    - string
                    - 'null'
                    description: Redirect link for payment
                  recurring_plan_id:
                    type:
                    - string
                    - 'null'
                    format: uuid
                    description: ID of the recurring plan (DCA) that this order belongs
                      to
                required:
                - order_receipt_id
                - symbol
                - side
                - quantity
                - payment_method
                - created_at
                - status
                - currency
                - fee
                - fee_currency
                - net_amount
                - received_currency
                - price
                - order_quote_id
                - client_order_id
                - execution_type
                - fee_percentage
                - type
                - point_earned
                - expires_at
                - base_currency
                - counter_currency
                additionalProperties: false
        '503':
          description: Service Unavailable
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait before retrying the request
          content:
            application/json:
              examples:
                service_unavailable:
                  value:
                    errors:
                    - message: We are unable to process your request at the moment.
                        Please try again later.
              schema:
                "$ref": "#/components/schemas/errors"
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                symbol:
                  type: string
                  description: Symbol of the order. Required for limit order.
                side:
                  type: string
                  enum:
                  - buy
                  - sell
                  description: Side of the order, either buy or sell. Required for
                    limit order.
                counter_qty:
                  type: string
                  format: decimal
                  deprecated: true
                  description: Requested quantity of the limit buy order. Required
                    for limit order.
                base_qty:
                  type: string
                  format: decimal
                  deprecated: true
                  description: Requested quantity of the limit sell order. Required
                    for limit order.
                quantity:
                  type: string
                  format: decimal
                  description: Requested quantity of the limit buy/sell order. Required
                    for limit order. Replaces use of counter_qty/base_qty
                currency:
                  type: string
                  description: Currency of the quantity Defaults to counter currency
                    in symbol for buy order and base currency in symbol for sell order
                client_order_id:
                  type: string
                  description: Unique Client Order ID for this request, usually a
                    UUID.
                order_quote_id:
                  type: string
                  description: Order Quote ID to trade on. Required for rfq order.
                execution_type:
                  type: string
                  enum:
                  - rfq
                  - limit
                  description: Execution type of the order, either rfq or limit for
                    buy/sell order. Rfq for swap orders.
                reduced_fee_code:
                  type: string
                price:
                  type: string
                  format: decimal
                  description: Limit price of the order. Required for limit order.
                expires_at:
                  type: integer
                  format: int64
                  description: Unix timestamp in milliseconds when the order expires.
                    Only applicable for limit orders. Leave empty for GTC (Good Till
                    Cancel)
              required:
              - execution_type
            examples:
              Example - Buy BTC-SGD:
                summary: Example - Buy BTC with SGD using user balance
                value:
                  symbol: BTC-SGD
                  side: buy
                  counter_qty: '100.0'
                  client_order_id: 91209400-8fda-499d-89e8-1653252e31b9
                  order_quote_id: 61bcc003-3fdc-44fd-8edd-d484b76b1c8d
                  execution_type: rfq
              Example - Buy BTC-SGD Limit Order:
                summary: Example - Sell BTC Limit Order with SGD using user balance
                value:
                  symbol: BTC-SGD
                  side: sell
                  base_qty: '1.0'
                  client_order_id: 91209400-8fda-499d-89e8-1653252e31b9
                  execution_type: limit
                  price: '100.0'
                  expires_at: 1704222249248
  "/public_api/v1/orders/{id}":
    get:
      summary: Get order details
      tags:
      - Orders
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Order ID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              examples:
                success:
                  value:
                    id: 12345
                    order_receipt_id: 459919c5-414f-45bf-a021-c4a1388349f5
                    symbol: BTC-SGD
                    side: buy
                    quantity: '100.0'
                    currency: SGD
                    base_currency: BTC
                    counter_currency: SGD
                    payment_method: user_balance
                    status: Completed
                    received_currency: BTC
                    price: '62993.7'
                    order_quote_id: b8ba35e7-86e9-4171-82be-08a397721d81
                    client_order_id: 91209400-8fda-499d-89e8-1653252e31bd
                    created_at: 1704222249247
                    fee: '0.5'
                    fee_currency: SGD
                    net_amount: '99.5'
                    execution_type: rfq
                    expires_at:
                    fee_percentage: '0.5'
                    type: Buy
                    point_earned: 1
                    credit_card:
                      masked_card_number: "************1234"
                      icon_url: https://example.com/icon.png
                    cancel_reason: over_slippage
                    fee_reduction:
                      amount: '0.1'
                      scheme: rate
                      type: override
                      code: PROMO10
                    invoice_downloadable: true
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique identifier for the order
                  order_receipt_id:
                    type: string
                    description: Internal id for the order
                  symbol:
                    type: string
                    description: Trading pair symbol (e.g. BTC-USD)
                  side:
                    type: string
                    description: Order side (e.g. Buy or Sell)
                    enum:
                    - buy
                    - sell
                  quantity:
                    type: string
                    format: decimal
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  order_qty:
                    type: string
                    format: decimal
                    deprecated: true
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  payment_method:
                    type: string
                    description: Payment method used for the order.
                  created_at:
                    type: integer
                    description: Timestamp when the order was created
                  status:
                    type: string
                    description: Current status of the order
                    enum:
                    - Open
                    - Cancelling
                    - Completed
                    - Cancelled
                    - Pending
                  currency:
                    type: string
                    deprecated: true
                  fee:
                    type:
                    - string
                    - 'null'
                    description: Fee charged for the order
                  fee_currency:
                    type:
                    - string
                    - 'null'
                    description: Currency of the fee charged
                  net_amount:
                    type:
                    - string
                    - 'null'
                    description: Net amount after fees. In base currency for 'buy'
                      order and counter currency for 'sell' order
                  received_currency:
                    type: string
                    deprecated: true
                  price:
                    type: string
                    description: Limit price for limit order. Quote price for rfq
                      order
                  order_quote_id:
                    type:
                    - string
                    - 'null'
                    description: Id of quote for rfq order
                  client_order_id:
                    type:
                    - string
                    - 'null'
                    description: Client generated unique id for order
                  execution_type:
                    type: string
                    description: Type of the order, rfq or limit
                    enum:
                    - rfq
                    - limit
                  expires_at:
                    type:
                    - integer
                    - 'null'
                    description: Expiry timestamp for GTD limit order.
                  fee_percentage:
                    type:
                    - string
                    - 'null'
                  type:
                    type: string
                    enum:
                    - Buy
                    - Sell
                    - Swap
                  point_earned:
                    type:
                    - integer
                    - 'null'
                  credit_card:
                    type:
                    - object
                    - 'null'
                    properties:
                      masked_card_number:
                        type: string
                      icon_url:
                        type: string
                  cancel_reason:
                    type:
                    - string
                    - 'null'
                    description: Reason for order cancellation
                  original_fee:
                    type:
                    - string
                    - 'null'
                    description: Original fee charged for the order before reduced
                      fee code is applied
                  invoice_downloadable:
                    type: boolean
                    description: Whether a tax invoice can be downloaded for this
                      order
                  fee_reduction:
                    type:
                    - object
                    - 'null'
                    properties:
                      type:
                        type: string
                        enum:
                        - override
                        - deduct
                      amount:
                        type: string
                      amount_scheme:
                        type: string
                        enum:
                        - rate
                        - value
                      code:
                        type: string
                      percent:
                        type: string
                  base_currency:
                    type: string
                    description: Base currency for the order, eg. BTC in a BTC-USD
                      order
                  counter_currency:
                    type: string
                    description: Counter currency for the order, eg. USD in a BTC-USD
                      order
                  redirect_link:
                    type:
                    - string
                    - 'null'
                    description: Redirect link for payment
                  recurring_plan_id:
                    type:
                    - string
                    - 'null'
                    format: uuid
                    description: ID of the recurring plan (DCA) that this order belongs
                      to
                required:
                - order_receipt_id
                - symbol
                - side
                - quantity
                - payment_method
                - created_at
                - status
                - currency
                - fee
                - fee_currency
                - net_amount
                - received_currency
                - price
                - order_quote_id
                - client_order_id
                - execution_type
                - fee_percentage
                - type
                - point_earned
                - expires_at
                - base_currency
                - counter_currency
                additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
    delete:
      summary: Request to cancel order
      tags:
      - Orders
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Order ID
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: REMOTE_ADDR
        in: header
        schema:
          type: string
      security:
      - api_key:
        - trade
      responses:
        '200':
          description: success response
          content:
            application/json:
              examples:
                success:
                  value:
                    id: 1234
                    order_receipt_id: 459919c5-414f-45bf-a021-c4a1388349f5
                    symbol: BTC-SGD
                    side: buy
                    quantity: '100.0'
                    currency: SGD
                    base_currency: BTC
                    counter_currency: SGD
                    payment_method: user_balance
                    status: Cancelling
                    received_currency: BTC
                    price: '62993.7'
                    order_quote_id:
                    client_order_id: 91209400-8fda-499d-89e8-1653252e31bd
                    created_at: 1704222249247
                    fee: '0.5'
                    fee_currency: SGD
                    net_amount: '99.5'
                    execution_type: limit
                    expires_at: 1704222249248
                    fee_percentage: '0.5'
                    type: Buy
                    point_earned: 1
                    credit_card:
                      masked_card_number: "************1234"
                      icon_url: https://example.com/icon.png
                    cancel_reason: Requested by user
                    fee_reduction:
                      percent: '10.0'
                      type: override
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique identifier for the order
                  order_receipt_id:
                    type: string
                    description: Internal id for the order
                  symbol:
                    type: string
                    description: Trading pair symbol (e.g. BTC-USD)
                  side:
                    type: string
                    description: Order side (e.g. Buy or Sell)
                    enum:
                    - buy
                    - sell
                  quantity:
                    type: string
                    format: decimal
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  order_qty:
                    type: string
                    format: decimal
                    deprecated: true
                    description: Quantity of the order in counter currency for 'buy'
                      orders and in base currency for 'sell' orders
                  payment_method:
                    type: string
                    description: Payment method used for the order.
                  created_at:
                    type: integer
                    description: Timestamp when the order was created
                  status:
                    type: string
                    description: Current status of the order
                    enum:
                    - Open
                    - Cancelling
                    - Completed
                    - Cancelled
                    - Pending
                  currency:
                    type: string
                    deprecated: true
                  fee:
                    type:
                    - string
                    - 'null'
                    description: Fee charged for the order
                  fee_currency:
                    type:
                    - string
                    - 'null'
                    description: Currency of the fee charged
                  net_amount:
                    type:
                    - string
                    - 'null'
                    description: Net amount after fees. In base currency for 'buy'
                      order and counter currency for 'sell' order
                  received_currency:
                    type: string
                    deprecated: true
                  price:
                    type: string
                    description: Limit price for limit order. Quote price for rfq
                      order
                  order_quote_id:
                    type:
                    - string
                    - 'null'
                    description: Id of quote for rfq order
                  client_order_id:
                    type:
                    - string
                    - 'null'
                    description: Client generated unique id for order
                  execution_type:
                    type: string
                    description: Type of the order, rfq or limit
                    enum:
                    - rfq
                    - limit
                  expires_at:
                    type:
                    - integer
                    - 'null'
                    description: Expiry timestamp for GTD limit order.
                  fee_percentage:
                    type:
                    - string
                    - 'null'
                  type:
                    type: string
                    enum:
                    - Buy
                    - Sell
                    - Swap
                  point_earned:
                    type:
                    - integer
                    - 'null'
                  credit_card:
                    type:
                    - object
                    - 'null'
                    properties:
                      masked_card_number:
                        type: string
                      icon_url:
                        type: string
                  cancel_reason:
                    type:
                    - string
                    - 'null'
                    description: Reason for order cancellation
                  original_fee:
                    type:
                    - string
                    - 'null'
                    description: Original fee charged for the order before reduced
                      fee code is applied
                  invoice_downloadable:
                    type: boolean
                    description: Whether a tax invoice can be downloaded for this
                      order
                  fee_reduction:
                    type:
                    - object
                    - 'null'
                    properties:
                      type:
                        type: string
                        enum:
                        - override
                        - deduct
                      amount:
                        type: string
                      amount_scheme:
                        type: string
                        enum:
                        - rate
                        - value
                      code:
                        type: string
                      percent:
                        type: string
                  base_currency:
                    type: string
                    description: Base currency for the order, eg. BTC in a BTC-USD
                      order
                  counter_currency:
                    type: string
                    description: Counter currency for the order, eg. USD in a BTC-USD
                      order
                  redirect_link:
                    type:
                    - string
                    - 'null'
                    description: Redirect link for payment
                  recurring_plan_id:
                    type:
                    - string
                    - 'null'
                    format: uuid
                    description: ID of the recurring plan (DCA) that this order belongs
                      to
                required:
                - order_receipt_id
                - symbol
                - side
                - quantity
                - payment_method
                - created_at
                - status
                - currency
                - fee
                - fee_currency
                - net_amount
                - received_currency
                - price
                - order_quote_id
                - client_order_id
                - execution_type
                - fee_percentage
                - type
                - point_earned
                - expires_at
                - base_currency
                - counter_currency
                additionalProperties: false
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: not found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/price/depth":
    get:
      summary: Get depth price
      tags:
      - Price
      description: Get depth price for a symbol
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
          examples:
          - BTC-SGD
        description: Symbol of the currency pair to get depth price
      - name: side
        in: query
        required: true
        schema:
          type: string
          examples:
          - buy
        description: Side of the currency pair, either buy or sell
      - name: order_qty
        in: query
        required: false
        schema:
          type: string
          format: decimal
          examples:
          - '100.12'
          deprecated: true
        description: Requested quantity of the currency pair. Currency of the quantity
          is counter currency for buy order and base currency for sell order
      - name: quantity
        in: query
        required: true
        schema:
          type: string
          format: decimal
          examples:
          - '100.12'
        description: Requested quantity of the currency pair. Currency of the quantity
          is counter currency for buy order and base currency for sell order. This
          replaces the deprecated order_qty parameter.
      - name: currency
        in: query
        required: false
        schema:
          type: string
          examples:
          - SGD
        description: Currency of the order quantity. If not provided, it will be set
          to counter currency for buy order and base currency for sell order
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: successful response
          content:
            application/json:
              examples:
                success:
                  value:
                    price: '12345.67'
              schema:
                type: object
                properties:
                  price:
                    type: string
                required:
                - price
                additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '422':
          description: invalid request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
        '503':
          description: Service Unavailable
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait before retrying the request
          content:
            application/json:
              examples:
                service_unavailable:
                  value:
                    errors:
                    - message: We are unable to process your request at the moment.
                        Please try again later.
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/price/spots":
    get:
      summary: Get spot prices
      tags:
      - Price
      description: Get spot prices
      parameters:
      - name: base_currency
        in: query
        required: false
        schema:
          type: string
          examples:
          - BTC
          - USD
        description: The symbol of the base asset. Cryptos, fiats, and stables supported,
          e.g. BTC, USD
      - name: counter_currency
        in: query
        required: false
        schema:
          type: string
          examples:
          - SGD
        description: The symbol of the quote asset. Fiats and stables supported, e.g.
          USD. Default is SGD.
      responses:
        '200':
          description: successful response
          content:
            application/json:
              examples:
                success:
                  value:
                  - buy_price: '12345.67'
                    sell_price: '12345.67'
                    symbol: BTC-USD
              schema:
                type: array
                items:
                  type: object
                  properties:
                    buy_price:
                      type: string
                      description: Indicative buy price for the symbol
                    sell_price:
                      type: string
                      description: Indicative sell price for the symbol
                    symbol:
                      type: string
                      description: The trading pair symbol
                  required:
                  - buy_price
                  - sell_price
                  - symbol
                  additionalProperties: false
  "/public_api/v1/transactions/{id}/invoice":
    parameters:
    - name: id
      in: path
      required: true
      description: Transaction integer ID or UUID
      schema:
        type: string
    post:
      summary: List transaction tax invoices
      tags:
      - Transactions
      description: Returns the transaction's billing documents as expiring, presigned
        download links
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: Presigned download links for the transaction's billing documents
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: false
                  required:
                  - document_number
                  - document_type
                  - url
                  - expires_at
                  properties:
                    document_number:
                      type: string
                      example: INV-2606000201
                    document_type:
                      type: string
                      enum:
                      - invoice
                      - credit_note
                    url:
                      type: string
                      format: uri
                      description: Short-lived presigned S3 URL to the PDF
                    expires_at:
                      type: integer
                      description: Link expiry, Unix milliseconds
        '422':
          description: Transaction not eligible for a tax invoice
          content:
            application/json:
              examples:
                not_eligible:
                  value:
                    errors:
                    - message: This transaction is not eligible for a tax invoice
              schema:
                "$ref": "#/components/schemas/errors"
        '503':
          description: Invoice generation temporarily unavailable
          content:
            application/json:
              examples:
                generation_failed:
                  value:
                    errors:
                    - message: The tax invoice could not be generated. Please try
                        again later.
              schema:
                "$ref": "#/components/schemas/errors"
        '404':
          description: Transaction not found
          content:
            application/json:
              examples:
                not_found:
                  value:
                    errors:
                    - message: Record not found
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/transactions":
    get:
      summary: Get all transactions
      tags:
      - Transactions
      description: Returns all account transactions
      parameters:
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
          default: 1
        description: Page to fetch when using offset pagination. Has no effect unless
          page[enable_offset]=true is also sent; otherwise the response uses cursor
          pagination and this parameter is ignored.
      - name: page[size]
        in: query
        required: false
        schema:
          type: integer
          default: 2
        description: Number of items per page
      - name: page[cursor]
        in: query
        required: false
        description: Cursor value to pagination from
        schema:
          type: string
      - name: page[enable_offset]
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Set to true to switch this endpoint from cursor pagination to
          offset pagination, enabling page[number] to select a specific page.
      security:
      - api_key: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    currency:
                      type: string
                    created_at:
                      type: integer
                    account_updated_at:
                      type: integer
                    status:
                      type: string
                    amount:
                      type: string
                    transaction_type:
                      type: string
                    tx_id:
                      type: string
                  required:
                  - id
                  - currency
                  - created_at
                  - status
                  - amount
                  - transaction_type
                  additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
  "/public_api/v1/transactions/{id}":
    get:
      summary: Get specific transactions
      tags:
      - Transactions
      description: Returns a single transactions
      parameters:
      - name: id
        in: path
        description: Transaction integer ID or UUID
        required: true
        schema:
          type: string
      - name: X-API-Signature
        in: header
        required: true
        description: Hexadecimal encoded ECDSA Signature
        schema:
          type: string
      - name: X-API-Timestamp
        in: header
        required: true
        description: Timestamp in milliseconds
        schema:
          type: integer
      - name: X-API-Algorithm
        in: header
        required: true
        description: Algorithm used to sign request. Must be an ENUM value
        schema:
          type: string
      security:
      - api_key: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  currency:
                    type: string
                  created_at:
                    type: integer
                  account_updated_at:
                    type: integer
                  status:
                    type: string
                  amount:
                    type: string
                  transaction_type:
                    type: string
                  tx_id:
                    type: string
                  invoice_downloadable:
                    type: boolean
                    description: Whether a tax invoice can be downloaded for this
                      transaction
                required:
                - id
                - currency
                - created_at
                - status
                - amount
                - transaction_type
                - invoice_downloadable
                additionalProperties: false
        '401':
          description: unauthorized response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors"
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-KEY
      in: header
  schemas:
    errors:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
            - message
      required:
      - errors
    fiat_deposit:
      type: object
      properties:
        id:
          type: integer
        currency:
          type: string
        amount:
          type: string
        created_at:
          type: integer
        status:
          type: string
        invoice_downloadable:
          type: boolean
        transaction:
          type:
          - object
          - 'null'
          properties:
            uuid:
              type: string
              format: uuid
          required:
          - uuid
      required:
      - id
      - currency
      - amount
      - created_at
      - status
      - invoice_downloadable
      - transaction
      additionalProperties: false
servers:
- url: https://{defaultHost}
  variables:
    defaultHost:
      default: www.coinhako.com
