Zero Hash Payments API

Payment Services

Documentation

Specifications

Other Resources

OpenAPI Specification

zero-hash-payments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: zerohash Payments API
  description: '

    ### Authentication


    zerohash Uses HMAC SHA-256 verification to ensure the authenticity of API requests, follow instructions by link [https://docs.zerohash.com/reference/api-authentication](https://docs.zerohash.com/reference/api-authentication)


    <a href="/zh-swagger.json">Download zerohash OpenAPI Schema as JSON</a>

    '
  version: 1.7.0
servers:
- url: https://api.cert.zerohash.com
  description: Certification API server
security:
- apiKey: []
  apiPassphrase: []
tags:
- name: Payments
  description: Payment Services
paths:
  /payments/external_accounts:
    post:
      tags:
      - Payments
      summary: Create external account
      description: Links an external fiat or crypto account to a participant. Fiat accounts are linked via a Plaid processor token. Crypto account support requires the feature to be enabled on the calling platform.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      requestBody:
        description: Link request. Use the Fiat Account variant for Plaid-backed fiat accounts and the Crypto Account variant for on-chain destinations.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCreateExternalAccountRequest'
      responses:
        '201':
          description: Successfully created external account. Returns the created resource with generated IDs and timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostCreateExternalAccountResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
    get:
      tags:
      - Payments
      summary: List external accounts
      description: Retrieves a paginated list of external accounts linked to the calling platform, optionally filtered by participants, account type, or account status.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: participants
        in: query
        description: Comma-separated list of participant codes to filter on (e.g. `ABCDEF,DEMO01`).
        required: false
        schema:
          type: string
          example: ABCDEF
      - name: account_type
        in: query
        description: Filter for a specific account_type
        required: false
        schema:
          type: string
          enum:
          - checking
          - savings
      - name: account_status
        in: query
        description: Filter for a specific account_status
        required: false
        schema:
          type: string
          enum:
          - pending
          - submitted
          - approved
          - closed
          - deleted
          - rejected
          - locked
          - disabled
          - revoked
          - failed
      - name: page
        in: query
        description: Filter for a specific page (pagination)
        required: false
        schema:
          default: 1
          type: number
      - name: size
        in: query
        description: Filter for the amount of external account objects returned
        required: false
        schema:
          default: 200
          type: number
      responses:
        '200':
          description: 'Successfully retrieved paginated list of external accounts with optional filters: participants, account_type, account_status.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetExternalAccountsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/external_accounts/{external_account_id}/close:
    post:
      tags:
      - Payments
      summary: Close external account
      description: Closes an external account previously linked to a participant. After closure the account can no longer be used for new payments.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: external_account_id
        in: path
        description: Identifier of the external account to close.
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Close request. `participant_code` identifies the account owner.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCloseExternalAccountRequest'
      responses:
        '200':
          description: External account closed. Response contains the final snapshot of the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostCloseExternalAccountResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments:
    post:
      tags:
      - Payments
      summary: Create payment
      description: Creates a fiat pre-fund/settlement or a crypto payout. The request body must match one of the four documented shapes; submitting both `total` and `quantity` on a payout is rejected.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/SimulatorScenario'
      requestBody:
        description: Payload describing either a fiat transaction or a crypto payout.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostPaymentsRequest'
      responses:
        '201':
          description: Successfully created payment. Returns the created resource with generated IDs and timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPaymentsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
    get:
      tags:
      - Payments
      summary: List payments
      description: Retrieves a paginated list of payouts for the platform, optionally filtered by `participant_code` and a `start_date` / `end_date` window.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: participant_code
        in: query
        description: Filter for participant code
        required: false
        schema:
          type: string
      - name: page
        in: query
        description: Filter for a specific page (pagination)
        required: false
        schema:
          default: 1
          type: number
      - name: size
        in: query
        description: Filter for the amount of payments returned
        required: false
        schema:
          default: 50
          type: number
      - name: start_date
        in: query
        description: Unix timestamp in seconds. Returns payments created on or after this date.
        required: false
        schema:
          type: integer
          format: int64
          example: 1704067200
      - name: end_date
        in: query
        description: Unix timestamp in seconds. Returns payments created on or before this date.
        required: false
        schema:
          type: integer
          format: int64
          example: 1704153600
      responses:
        '200':
          description: 'Successfully retrieved paginated list of payouts with optional filters: participant_code, start_date, end_date.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPaymentsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/{payment_id}:
    get:
      tags:
      - Payments
      summary: Get payment by id
      description: Fetches a single payout by its identifier, returning the current lifecycle status and on-chain details.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: payment_id
        in: path
        description: Identifier of the payout to fetch.
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Successfully retrieved payout.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPaymentByIDResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/settlements:
    get:
      tags:
      - Payments
      summary: List pending ACH settlements
      description: Retrieves pending ACH settlements for a specific platform. Used by the platform to reconcile the daily ACH settlement window.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: start_date
        in: query
        description: Inclusive start of the query window as a Unix timestamp in seconds. Defaults to 2 days ago.
        required: false
        schema:
          type: integer
          format: int64
          example: 1777722086
      - name: end_date
        in: query
        description: Inclusive end of the query window as a Unix timestamp in seconds. Defaults to now.
        required: false
        schema:
          type: integer
          format: int64
          example: 1777895286
      - name: platform_code
        in: query
        description: Platform code to fetch pending settlements for.
        required: true
        schema:
          type: string
          example: DEMO01
      - name: page
        in: query
        description: Filter for a specific page (pagination)
        required: false
        schema:
          type: number
          default: 1
      - name: size
        in: query
        description: Filter for the amount of pending ACH transaction objects returned
        required: false
        schema:
          type: number
          default: 200
      responses:
        '200':
          description: 'Successfully retrieved paginated list of pending ACH settlements with optional filters: platform_code, start_date, end_date.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPendingACHTransactionsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/{transaction_id}/retry:
    post:
      tags:
      - Payments
      summary: Retry a fiat payment
      description: Retries a failed, cancelled, or returned fiat transaction whose linked trade has already terminated.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: transaction_id
        in: path
        description: Identifier of the fiat transaction to retry.
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Retry submitted. The returned `transaction_id` identifies the new transfer attempt and should be polled via `/payments/status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPaymentsRetryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/history:
    get:
      tags:
      - Payments
      summary: List fiat transaction history
      description: Retrieves the historical fiat transactions (ACH / same-day ACH / wire / RTP) for the calling platform, with optional filters by participant, transfer type, or a set of transaction identifiers.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: participant
        in: query
        description: Filter to a single participant code.
        required: false
        schema:
          type: string
          example: ABCDEF
      - name: transaction_ids
        in: query
        description: Optional list of transaction identifiers to fetch. Repeat the query parameter for multiple ids (e.g. `?transaction_ids=id1&transaction_ids=id2`).
        required: false
        schema:
          type: array
          items:
            type: string
            format: uuid
      - name: transfer_type
        in: query
        description: Filter for the given `transfer_type`
        required: false
        schema:
          type: string
          enum:
          - credit
          - debit
      - name: page
        in: query
        description: Filter for a specific page (pagination)
        required: false
        schema:
          type: number
          default: 1
      - name: size
        in: query
        description: Filter for the amount of transaction objects will be returned per request
        required: false
        schema:
          type: number
          default: 200
      responses:
        '200':
          description: 'Successfully retrieved paginated list of fiat transactions with optional filters: participant, transfer_type.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetACHTransactionHistoryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/status:
    get:
      tags:
      - Payments
      summary: List fiat transaction statuses
      description: 'Retrieves fiat transaction status objects for the calling platform. Defaults: when `start_date`/`end_date` are omitted, the last day of transactions is returned; when `page`/`size` are omitted, the first 200 transactions are returned; omitting `participant` or `status` removes the respective filter.'
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      - name: start_date
        in: query
        description: Inclusive start of the query window as a Unix timestamp in seconds.
        required: false
        schema:
          type: integer
          format: int64
          example: 1777895286
      - name: end_date
        in: query
        description: Inclusive end of the query window as a Unix timestamp in seconds.
        required: false
        schema:
          type: integer
          format: int64
          example: 1777895700
      - name: participant
        in: query
        description: Filter for the given `participant` code
        required: false
        schema:
          type: string
      - name: transaction_id
        in: query
        description: Filter for the given `transaction_id`
        required: false
        schema:
          type: string
      - name: trade_id
        in: query
        description: Filter for the given `trade_id`
        required: false
        schema:
          type: string
      - name: status
        in: query
        description: Filter for the given `status` of the transaction
        required: false
        schema:
          type: string
          enum:
          - posted
          - cancelled
          - failed
          - returned
          - submitted
          - pending
          - settled
          - rejected
          - pending_trade
          - returned_settled
          - retried
          - unspecified
      - name: page
        in: query
        description: Filter for a specific page (pagination)
        required: false
        schema:
          type: number
          default: 1
      - name: size
        in: query
        description: Filter for the amount of transaction status objects returned
        required: false
        schema:
          type: number
          default: 200
      responses:
        '200':
          description: 'Successfully retrieved paginated list of fiat transaction statuses with optional filters: start_date, end_date, participant, transaction_id, trade_id, status.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetACHTransactionStatusResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/rfq:
    post:
      tags:
      - Payments
      summary: Request payment quote
      description: Retrieves a quote for a payout. Exactly one of `quantity` or `total` must be supplied. The returned `quote_id` can be passed to `POST /payments/execute` before `expire_ts`.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      requestBody:
        description: Quote parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostPaymentsRequestForQuoteRequest'
      responses:
        '200':
          description: Quote generated. Execute the quote via `POST /payments/execute` before `expire_ts` elapses.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPaymentsRequestForQuoteResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
  /payments/execute:
    post:
      tags:
      - Payments
      summary: Execute payment quote
      description: Executes the quote identified by `quote_id` and creates the underlying fiat transaction. The quote must not have expired.
      parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/Timestamp'
      requestBody:
        description: Execution payload.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostPaymentsExecutePaymentRequest'
      responses:
        '200':
          description: Quote executed. Poll `/payments/status` with the returned `transaction_id` to observe lifecycle transitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPaymentsExecutePaymentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code400'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code500'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Code503'
components:
  schemas:
    GetACHTransactionHistoryResponse:
      type: object
      properties:
        request_id:
          type: string
          format: uuid
          description: Request identifier echoed back from the request.
          example: 0f68333e-2114-469d-b505-c850d776e063
        message:
          type: array
          items:
            $ref: '#/components/schemas/ACHTransactionHistory'
        page:
          type: number
          example: 1
        page_size:
          type: number
          example: 200
        count:
          type: number
          example: 10
    Code503:
      type: object
      description: 'A downstream dependency was unavailable, timed out, or returned a retryable error. Safe to retry; the response carries a `zh-allow-retry: true` header.'
      required:
      - error
      properties:
        error:
          type: string
          example: Service Unavailable
    PostCreateExternalAccountRequest:
      type: object
      oneOf:
      - title: Fiat Account
        type: object
        properties:
          participant_code:
            type: string
            description: Participant code
            example: ALI123
          account_nickname:
            type: string
            description: Account nickname
            example: test1
          plaid_processor_token:
            type: string
            minLength: 1
            description: Plaid processor token
            example: 0f68333e-2114-469d-b505-c850d776e063
        required:
        - participant_code
        - plaid_processor_token
      - title: Crypto Account
        type: object
        properties:
          participant_code:
            type: string
            description: Participant code
            example: ALI123
          account_nickname:
            type: string
            description: Account nickname
            example: test1
          type:
            type: string
            description: Account asset type
            enum:
            - crypto
            example: crypto
          details:
            type: object
            oneOf:
            - title: With Supported Symbols
              type: object
              properties:
                network:
                  type: string
                  description: Blockchain network
                  enum:
                  - ETH
                  - ALGO
                  - ARBITRUM
                  - AVAX
                  - BASE
                  - HBAR
                  - POLYGON
                  - SOL
                  - OP
                  - SUI
                  - XLM
                  - ZK
                  example: SOL
                supported_symbols:
                  description: Symbol uses dot notation to refer to asset and network
                  type: array
                  items:
                    type: string
                  example:
                  - USDC.SOL
                address:
                  type: string
                  description: Destination address
                destination_tag:
                  type: string
                  description: Destination tag (for XRP, XLM, etc.)
                no_destination_tag:
                  type: boolean
                  description: Set to true to acknowledge that the destination address does not require a destination tag. Required for tag-based assets when destination_tag is not provided.
              required:
              - network
              - supported_symbols
              - address
            - title: With Supported Assets
              type: object
              properties:
                network:
                  type: string
                  description: Blockchain network
                  enum:
                  - ETH
                  - ALGO
                  - ARBITRUM
                  - AVAX
                  - BASE
                  - HBAR
                  - POLYGON
                  - SOL
                  - OP
                  - SUI
                  - XLM
                  - ZK
                  example: ETH
                supported_assets:
                  description: Tokens or currencies in the provided network
                  type: array
                  items:
                    type: string
                  example:
                  - USDC
                address:
                  type: string
                  description: Destination address
                destination_tag:
                  type: string
                  description: Destination tag (for XRP, XLM, etc.)
                no_destination_tag:
                  type: boolean
                  description: Set to true to acknowledge that the destination address does not require a destination tag. Required for tag-based assets when destination_tag is not provided.
              required:
              - network
              - su

# --- truncated at 32 KB (79 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zero-hash/refs/heads/main/openapi/zero-hash-payments-api-openapi.yml