openapi: 3.0.3
info:
  title: Rise
  description: Web3-enabled payroll and compliance for the modern workforce
  version: 2.0.0
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    v1Auth:
      type: apiKey
      name: X-Auth-Token
      in: header
      description: JWT token
  schemas: {}
paths:
  /v2/auth/siwe:
    get:
      summary: Get SIWE
      tags:
        - B2B Authentication
      description: Retrieves a SIWE (Sign-In with Ethereum) message that can be used
        for authentication. This message is signed by the user to prove their
        identity.
      parameters:
        - schema:
            type: string
          in: query
          name: wallet
          required: true
          description: Wallet address of the user.
        - schema:
            type: string
          in: query
          name: riseid
          required: true
          description: RiseID of the user.
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      siwe:
                        type: string
                        description: The SIWE message that the user needs to sign.
                    required:
                      - siwe
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/auth/verify:
    post:
      summary: Verify a SIWE message and return a JWT for API authentication
      tags:
        - B2B Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The original SIWE message that was signed by the user.
                sig:
                  type: string
                  description: The signature generated by the user when signing the SIWE message.
                nonce:
                  type: string
                  description: A unique nonce to prevent replay attacks.
              required:
                - message
                - sig
                - nonce
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      jwt:
                        type: string
                        description: The JSON Web Token (JWT) for authenticated API requests.
                    required:
                      - jwt
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/balance:
    get:
      summary: Get entity balance
      tags:
        - B2B Balance
      description: Retrieves balance and details of an entity using their nanoid (te-
        for team, co- for company, us- for user).
      parameters:
        - schema:
            type: string
            pattern: ^(te-|co-|us-)
          in: query
          name: nanoid
          required: true
          description: Nanoid of the entity to retrieve.
        - schema:
            type: array
            items:
              type: string
              enum:
                - BTC
                - CAD
                - EUR
                - GBP
                - USD
                - USDC
                - USDT
          in: query
          name: currencies
          required: false
          description: Optional array of currencies to retrieve balances for. If not
            provided, returns all supported currencies.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      rise_account_address:
                        type: string
                        pattern: ^0x[a-fA-F0-9]{40}$
                        description: Rise account address.
                      balances:
                        type: array
                        items:
                          type: object
                          properties:
                            currency:
                              type: string
                              enum:
                                - AED
                                - AUD
                                - CAD
                                - CHF
                                - DKK
                                - EUR
                                - GBP
                                - HKD
                                - JPY
                                - MXN
                                - NOK
                                - PHP
                                - PLN
                                - RON
                                - SEK
                                - SGD
                                - USD
                                - ZAR
                                - CZK
                                - NZD
                                - COP
                              description: Currency code.
                            balance_cents:
                              type: string
                              description: Balance in cents (as string).
                          required:
                            - currency
                            - balance_cents
                          additionalProperties: false
                        description: Array of balances for different currencies.
                    required:
                      - rise_account_address
                      - balances
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/invites:
    get:
      summary: Get Invites
      tags:
        - B2B Invites
      description: List all pending invites for a company or team. User must be
        team_admin for teams or org_admin for companies.
      parameters:
        - schema:
            anyOf:
              - type: string
                minLength: 15
                maxLength: 15
                pattern: ^te-.*
                description: Identifier of a Rise team (a workspace below a company).
                  15-character nanoid prefixed with `te-`.
              - type: string
                minLength: 15
                maxLength: 15
                pattern: ^co-.*
                description: Identifier of a Rise company. 15-character nanoid prefixed with
                  `co-` (e.g. `co-aBcD1234EfGh`).
          in: query
          name: nanoid
          required: true
          description: The nanoid of the company or team to get invites for
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        nanoid:
                          type: string
                        role:
                          type: string
                          enum:
                            - org_admin
                            - org_finance_admin
                            - org_viewer
                            - org_hr_admin
                            - org_delegate_admin
                            - org_non_delegate_admin
                            - team_admin
                            - team_viewer
                            - team_finance_admin
                            - team_delegate_admin
                            - team_non_delegate_admin
                            - team_payment_initiator
                            - team_invite_initiator
                            - contractor
                            - team_employee
                            - aor_contractor
                            - team_hr_admin
                          nullable: true
                        invitee_name:
                          type: string
                          minLength: 1
                        email:
                          type: string
                          format: email
                          pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        inviter_name:
                          type: string
                          minLength: 1
                        inviter_email:
                          type: string
                          format: email
                          pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        company:
                          type: object
                          properties:
                            name:
                              type: string
                              minLength: 1
                            avatar:
                              type: string
                          required:
                            - name
                            - avatar
                          additionalProperties: false
                        team:
                          type: object
                          properties:
                            name:
                              type: string
                              minLength: 1
                            avatar:
                              type: string
                          required:
                            - name
                            - avatar
                          additionalProperties: false
                      required:
                        - nanoid
                        - role
                        - invitee_name
                        - email
                        - inviter_name
                        - inviter_email
                      additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    post:
      summary: Create invites for employees and contractors
      tags:
        - B2B Invites
      description: Create invites/warm invites for employees and contractors. This is
        used to invite users to team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nanoid:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                  description: Identifier of a Rise team (a workspace below a company).
                    15-character nanoid prefixed with `te-`.
                invites:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        format: email
                        pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                      prefill:
                        type: object
                        properties:
                          first_name:
                            type: string
                          middle_name:
                            default: ""
                            type: string
                          last_name:
                            type: string
                          phone:
                            type: string
                          company_name:
                            type: string
                          job_title:
                            type: string
                          company_size:
                            type: string
                          company_website:
                            type: string
                          company_industry:
                            type: string
                          company_address:
                            type: string
                          company_city:
                            type: string
                          company_state:
                            type: string
                          company_zip:
                            type: string
                          company_country:
                            type: string
                        required:
                          - first_name
                          - last_name
                          - phone
                          - company_name
                          - job_title
                          - company_size
                          - company_website
                          - company_industry
                          - company_address
                          - company_city
                          - company_state
                          - company_zip
                          - company_country
                    required:
                      - email
                role:
                  type: string
                  enum:
                    - contractor
                    - team_employee
                    - aor_contractor
                anonymous:
                  type: boolean
              required:
                - nanoid
                - invites
                - role
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      nanoids:
                        type: array
                        items:
                          type: string
                    required:
                      - nanoids
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/invites/manager:
    post:
      summary: Create admin invites typed data
      tags:
        - B2B Invites
      description: Create admin invites for a company or team. This is used to invite
        users to the company or team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: string
                    format: email
                    pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                role:
                  anyOf:
                    - type: string
                      enum:
                        - team_admin
                        - team_finance_admin
                        - team_viewer
                        - team_payment_initiator
                        - team_invite_initiator
                    - type: string
                      enum:
                        - org_admin
                        - org_finance_admin
                        - org_viewer
                        - org_hr_admin
                nanoid:
                  anyOf:
                    - type: string
                      minLength: 15
                      maxLength: 15
                      pattern: ^te-.*
                      description: Identifier of a Rise team (a workspace below a company).
                        15-character nanoid prefixed with `te-`.
                    - type: string
                      minLength: 15
                      maxLength: 15
                      pattern: ^co-.*
                      description: Identifier of a Rise company. 15-character nanoid prefixed with
                        `co-` (e.g. `co-aBcD1234EfGh`).
              required:
                - emails
                - role
                - nanoid
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      invites:
                        type: array
                        items:
                          type: string
                          minLength: 15
                          maxLength: 15
                          pattern: ^in-.*
                          description: Identifier of an invite (e.g. team-member invitation). 15-character
                            nanoid prefixed with `in-`.
                      typed_data:
                        type: object
                        properties:
                          domain:
                            type: object
                            properties:
                              name:
                                type: string
                              version:
                                type: string
                              chainId:
                                type: number
                              verifyingContract:
                                type: string
                                pattern: ^0x[a-fA-F0-9]{40}$
                                description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                            required:
                              - name
                              - version
                              - chainId
                              - verifyingContract
                            additionalProperties: false
                          types:
                            type: object
                            properties:
                              SetRolesForwardRequest:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                    - name
                                    - type
                                  additionalProperties: false
                              SetRole:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                    - name
                                    - type
                                  additionalProperties: false
                            required:
                              - SetRolesForwardRequest
                              - SetRole
                            additionalProperties: false
                          typed_data:
                            type: object
                            properties:
                              from:
                                type: string
                                pattern: ^0x[a-fA-F0-9]{40}$
                                description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                              to:
                                type: string
                                pattern: ^0x[a-fA-F0-9]{40}$
                                description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                              salt:
                                type: string
                              expires:
                                type: string
                              data:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    role:
                                      type: string
                                    account:
                                      type: string
                                      pattern: ^0x[a-fA-F0-9]{40}$
                                      description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  required:
                                    - role
                                    - account
                                  additionalProperties: false
                            required:
                              - from
                              - to
                              - salt
                              - expires
                              - data
                            additionalProperties: false
                          primary_type:
                            type: string
                        required:
                          - domain
                          - types
                          - typed_data
                          - primary_type
                        additionalProperties: false
                    required:
                      - invites
                      - typed_data
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Execute admin invites
      tags:
        - B2B Invites
      description: Execute admin invites for a company or team. This is used to
        execute admin invites for a company or team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invites:
                  type: array
                  items:
                    type: string
                    minLength: 15
                    maxLength: 15
                    pattern: ^in-.*
                    description: Identifier of an invite (e.g. team-member invitation). 15-character
                      nanoid prefixed with `in-`.
                signer:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                typed_data:
                  type: object
                  properties:
                    from:
                      type: string
                      pattern: ^0x[a-fA-F0-9]{40}$
                      description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                    to:
                      type: string
                      pattern: ^0x[a-fA-F0-9]{40}$
                      description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                    salt:
                      type: string
                    expires:
                      type: string
                    data:
                      type: array
                      items:
                        type: object
                        properties:
                          role:
                            type: string
                          account:
                            type: string
                            pattern: ^0x[a-fA-F0-9]{40}$
                            description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        required:
                          - role
                          - account
                  required:
                    - from
                    - to
                    - salt
                    - expires
                    - data
                signature:
                  type: string
                  pattern: ^0x(?!0{130}$)[a-fA-F0-9]{130}$
                  description: ECDSA signature over an EVM message (0x + 130 hex chars covering r,
                    s, v).
              required:
                - invites
                - signer
                - typed_data
                - signature
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      invites:
                        type: array
                        items:
                          type: string
                          minLength: 15
                          maxLength: 15
                          pattern: ^in-.*
                          description: Identifier of an invite (e.g. team-member invitation). 15-character
                            nanoid prefixed with `in-`.
                      transaction:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^tx-.*
                        description: Identifier of a Rise transaction (the unit tracked end-to-end
                          across the payment-handler pipeline). 15-character
                          nanoid prefixed with `tx-`. Distinct from on-chain tx
                          hashes.
                    required:
                      - invites
                      - transaction
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/payments:
    get:
      summary: Query Payments
      tags:
        - B2B Payments
      description: Query payments for a team, optionally filtered by recipient and
        date range.
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: query
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
        - schema:
            type: string
            enum:
              - all
              - intent
              - scheduled
              - complete
          in: query
          name: state
          required: true
        - schema:
            anyOf:
              - type: number
              - type: string
              - {}
          in: query
          name: start_date
          required: true
          description: A date accepted as ISO-8601 string, epoch milliseconds (number), or
            `Date`. Legacy v1 format `YYYY-MM-DD HH:mm:ss` is normalized to
            `YYYY-MM-DDTHH:mm:ss` before parsing. Coerced to a `Date` after
            validation.
        - schema:
            anyOf:
              - type: number
              - type: string
              - {}
          in: query
          name: end_date
          required: true
          description: A date accepted as ISO-8601 string, epoch milliseconds (number), or
            `Date`. Legacy v1 format `YYYY-MM-DD HH:mm:ss` is normalized to
            `YYYY-MM-DDTHH:mm:ss` before parsing. Coerced to a `Date` after
            validation.
        - schema:
            type: string
            enum:
              - payable
              - receivable
          in: query
          name: query_type
          required: true
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^us-.*
          in: query
          name: recipient
          required: false
          description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            recipient:
                              type: object
                              properties:
                                nanoid:
                                  anyOf:
                                    - type: string
                                      minLength: 15
                                      maxLength: 15
                                      pattern: ^us-.*
                                      description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                                    - type: string
                                      minLength: 15
                                      maxLength: 15
                                      pattern: ^co-.*
                                      description: Identifier of a Rise company. 15-character nanoid prefixed with
                                        `co-` (e.g. `co-aBcD1234EfGh`).
                                riseid:
                                  anyOf:
                                    - type: string
                                      minLength: 42
                                      maxLength: 42
                                      description: On-chain identifier of a Rise user — the 42-character EVM address
                                        of the user's RiseAccount contract.
                                    - type: string
                                      minLength: 42
                                      maxLength: 42
                                      description: On-chain identifier of a Rise company — the 42-character EVM
                                        address of the company's RiseAccount
                                        contract.
                                avatar:
                                  type: string
                                first_name:
                                  type: string
                                  nullable: true
                                middle_name:
                                  type: string
                                  nullable: true
                                last_name:
                                  type: string
                                  nullable: true
                                company_name:
                                  type: string
                                  nullable: true
                                email:
                                  type: string
                                  nullable: true
                                address:
                                  type: object
                                  properties:
                                    country:
                                      type: string
                                      pattern: ^[A-Z]{2}$
                                      description: Country code in ISO 3166-1 alpha-2 form — exactly two uppercase
                                        letters (e.g. `US`, `GB`, `BR`).
                                    state:
                                      type: string
                                    city:
                                      type: string
                                    line_1:
                                      type: string
                                    line_2:
                                      type: string
                                      nullable: true
                                    zip_code:
                                      type: string
                                  required:
                                    - country
                                  additionalProperties: false
                              required:
                                - nanoid
                                - riseid
                                - avatar
                                - first_name
                                - middle_name
                                - last_name
                                - company_name
                                - email
                                - address
                              additionalProperties: false
                            payer:
                              type: object
                              properties:
                                nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^te-.*
                                  description: Identifier of a Rise team (a workspace below a company).
                                    15-character nanoid prefixed with `te-`.
                                riseid:
                                  type: string
                                  minLength: 42
                                  maxLength: 42
                                  description: On-chain identifier of a Rise team — the 42-character EVM address
                                    of the team's RiseAccount contract.
                                avatar:
                                  type: string
                                name:
                                  type: string
                              required:
                                - nanoid
                                - riseid
                                - avatar
                                - name
                              additionalProperties: false
                            invoice:
                              type: object
                              properties:
                                amount_cents:
                                  default: 0
                                  type: number
                                archived_at:
                                  type: string
                                  format: date-time
                                  nullable: true
                                archived_by:
                                  type: string
                                  nullable: true
                                automated_payment:
                                  default: true
                                  type: boolean
                                created_at:
                                  type: string
                                  format: date-time
                                currency:
                                  type: string
                                  enum:
                                    - AED
                                    - ARS
                                    - AUD
                                    - BDT
                                    - BIF
                                    - BOB
                                    - BRL
                                    - BTC
                                    - CAD
                                    - CDF
                                    - CHF
                                    - CLP
                                    - CNY
                                    - COP
                                    - CRC
                                    - CZK
                                    - DKK
                                    - EGP
                                    - ETB
                                    - EUR
                                    - GBP
                                    - GHS
                                    - GMD
                                    - GTQ
                                    - HKD
                                    - HUF
                                    - IDR
                                    - ILS
                                    - INR
                                    - JOD
                                    - JPY
                                    - KES
                                    - KRW
                                    - KWD
                                    - LKR
                                    - MAD
                                    - MMK
                                    - MNT
                                    - MWK
                                    - MXN
                                    - MYR
                                    - MZN
                                    - NGN
                                    - NOK
                                    - NPR
                                    - NZD
                                    - PEN
                                    - PHP
                                    - PKR
                                    - PLN
                                    - QAR
                                    - RON
                                    - RWF
                                    - SEK
                                    - SGD
                                    - THB
                                    - TRY
                                    - TZS
                                    - UGX
                                    - USD
                                    - USDC
                                    - USDT
                                    - UYU
                                    - UZS
                                    - VND
                                    - XAF
                                    - XOF
                                    - ZAR
                                  description: Any currency Rise supports — fiat (ISO-4217 codes like USD, GBP) or
                                    crypto (USDC, EURC, BTC, etc.).
                                documents_ids:
                                  type: array
                                  items:
                                    type: string
                                external_id:
                                  type: string
                                  nullable: true
                                external_id_unique_claim:
                                  type: boolean
                                  nullable: true
                                external_sow_url:
                                  type: string
                                  nullable: true
                                flat_type:
                                  type: string
                                  enum:
                                    - reimbursement
                                    - product
                                    - service
                                  nullable: true
                                group_nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^pg-.*
                                  description: Identifier of a payment group (a batch of payments scheduled
                                    together). 15-character nanoid prefixed with
                                    `pg-`.
                                group_onchain_id:
                                  type: string
                                hourly_rate_usd_cents:
                                  type: number
                                invoice_description:
                                  type: string
                                  nullable: true
                                invoice_number:
                                  default: ""
                                  type: string
                                  nullable: true
                                invoice_status:
                                  default: draft
                                  type: string
                                  enum:
                                    - draft
                                    - creating
                                    - open
                                    - processing
                                    - flushing
                                    - closed
                                    - open_canceled
                                    - canceled
                                    - failed
                                is_aor:
                                  default: false
                                  type: boolean
                                nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^iv-.*
                                  description: Identifier of an invoice. 15-character nanoid prefixed with `iv-`.
                                pay_intent_time:
                                  default: 0
                                  type: number
                                payer_nanoid:
                                  anyOf:
                                    - anyOf:
                                        - anyOf:
                                            - anyOf:
                                                - type: string
                                                  minLength: 15
                                                  maxLength: 15
                                                  pattern: ^us-.*
                                                  description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                                                - type: string
                                                  minLength: 15
                                                  maxLength: 15
                                                  pattern: ^co-.*
                                                  description: Identifier of a Rise company. 15-character nanoid prefixed with
                                                    `co-` (e.g.
                                                    `co-aBcD1234EfGh`).
                                            - type: string
                                              minLength: 15
                                              maxLength: 15
                                              pattern: ^te-.*
                                              description: Identifier of a Rise team (a workspace below a company).
                                                15-character nanoid prefixed
                                                with `te-`.
                                        - type: string
                                          minLength: 15
                                          maxLength: 15
                                          pattern: ^tr-.*
                                          description: Identifier of a team-scoped role assignment (e.g. team admin, team
                                            employee, contractor). 15-character
                                            nanoid prefixed with `tr-`.
                                    - type: string
                                      minLength: 15
                                      maxLength: 15
                                      pattern: ^tp-.*
                                      description: Identifier of a team payroll run. 15-character nanoid prefixed with
                                        `tp-`.
                                payer_payee_relationship:
                                  type: string
                                  enum:
                                    - contractor
                                    - aor_contractor
                                    - team_employee
                                    - external_recipient
                                  nullable: true
                                payment_details:
                                  type: string
                                  nullable: true
                                payment_onchain_id:
                                  type: string
                                  nullable: true
                                payroll_program:
                                  type: string
                                  enum:
                                    - riseworks_inc
                                    - riseworks_inc_gb
                                    - riseworks_eor_us
                                    - riseworks_pps_us
                                    - riseworks_eor_gb
                                    - riseworks_eor_ca
                                    - riseworks_eor_gr
                                    - riseworks_eor_ie
                                    - riseworks_eor_cy
                                    - riseworks_eor_cz
                                    - riseworks_eor_mx
                                    - riseworks_eor_co
                                    - riseworks_eor_in
                                    - riseworks_eor_au
                                    - riseworks_eor_nz
                                    - riseworks_eor_za
                                    - riseworks_eor_it
                                    - riseworks_eor_pt
                                    - riseworks_eor_fi
                                    - riseworks_eor_cr
                                    - riseworks_eor_ee
                                    - riseworks_eor_mt
                                    - riseworks_eor_pe
                                    - riseworks_eor_nl
                                    - riseworks_eor_lt
                                    - riseworks_eor_sg
                                    - riseworks_eor_ph
                                    - riseworks_eor_pl
                                    - riseworks_eor_ke
                                    - riseworks_eor_ae
                                    - riseworks_eor_ro
                                    - riseworks_eor_ch
                                    - riseworks_eor_sv
                                    - riseworks_eor_cl
                                    - riseworks_eor_pa
                                    - riseworks_eor_es
                                    - riseworks_eor_br
                                    - riseworks_eor_dk
                                  nullable: true
                                reason_id:
                                  type: number
                                  nullable: true
                                recipient_nanoid:
                                  anyOf:
                                    - anyOf:
                                        - anyOf:
                                            - anyOf:
                                                - type: string
                                                  minLength: 15
                                                  maxLength: 15
                                                  pattern: ^us-.*
                                                  description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                                                - type: string
                                                  minLength: 15
                                                  maxLength: 15
                                                  pattern: ^co-.*
                                                  description: Identifier of a Rise company. 15-character nanoid prefixed with
                                                    `co-` (e.g.
                                                    `co-aBcD1234EfGh`).
                                            - type: string
                                              minLength: 15
                                              maxLength: 15
                                              pattern: ^te-.*
                                              description: Identifier of a Rise team (a workspace below a company).
                                                15-character nanoid prefixed
                                                with `te-`.
                                        - type: string
                                          minLength: 15
                                          maxLength: 15
                                          pattern: ^tr-.*
                                          description: Identifier of a team-scoped role assignment (e.g. team admin, team
                                            employee, contractor). 15-character
                                            nanoid prefixed with `tr-`.
                                    - type: string
                                      minLength: 15
                                      maxLength: 15
                                      pattern: ^tp-.*
                                      description: Identifier of a team payroll run. 15-character nanoid prefixed with
                                        `tp-`.
                                recreated_as_transaction:
                                  type: string
                                  nullable: true
                                recurrence:
                                  type: string
                                  enum:
                                    - daily
                                    - weekly
                                    - bi_weekly
                                    - four_weeks
                                    - monthly
                                    - bi_monthly
                                    - quartely
                                    - six_months
                                    - annually
                                  nullable: true
                                rise_sow:
                                  type: boolean
                                role_description:
                                  type: string
                                  nullable: true
                                services_description:
                                  type: string
                                  nullable: true
                                sow_document_nanoid:
                                  type: string
                                  nullable: true
                                subscription_fee_metadata:
                                  type: object
                                  properties:
                                    subscription_type:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                    fee_month_epoch:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                    usage_month_epoch:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                    recipients:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          address:
                                            type: string
                                          amount:
                                            type: number
                                        required:
                                          - address
                                          - amount
                                        additionalProperties: false
                                    v1_migration_type:
                                      type: string
                                      enum:
                                        - V1_SUBSCRIPTION
                                        - V1_CHARGEBACK
                                    source_payment_invoice_number:
                                      type: string
                                  required:
                                    - subscription_type
                                    - fee_month_epoch
                                    - recipients
                                  additionalProperties: false
                                  nullable: true
                                time_entries:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      date:
                                        type: string
                                      hours:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                      minutes:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                      notes:
                                        type: string
                                    required:
                                      - date
                                      - hours
                                      - minutes
                                      - notes
                                    additionalProperties: false
                                type:
                                  type: string
                                  enum:
                                    - time_entry
                                    - flat
                                    - paynow
                                    - payonce
                                    - recurring
                                    - milestone
                                    - batch
                                    - payroll_cash_requirement
                                    - payroll_cash_requirement_chargeback
                                    - payroll_net_payment
                                    - external_recipient_payment
                                    - subscription_fee
                                updated_at:
                                  type: string
                                  format: date-time
                              required:
                                - amount_cents
                                - automated_payment
                                - currency
                                - documents_ids
                                - group_nanoid
                                - group_onchain_id
                                - hourly_rate_usd_cents
                                - invoice_number
                                - invoice_status
                                - is_aor
                                - nanoid
                                - pay_intent_time
                                - payer_nanoid
                                - recipient_nanoid
                                - rise_sow
                                - time_entries
                                - type
                              additionalProperties: false
                            payment:
                              type: object
                              properties:
                                created_at:
                                  type: string
                                  format: date-time
                                creation_transaction:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^tx-.*
                                  description: Identifier of a Rise transaction (the unit tracked end-to-end
                                    across the payment-handler pipeline).
                                    15-character nanoid prefixed with `tx-`.
                                    Distinct from on-chain tx hashes.
                                  nullable: true
                                group_onchain_id:
                                  type: string
                                invoice_nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^iv-.*
                                  description: Identifier of an invoice. 15-character nanoid prefixed with `iv-`.
                                nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^pa-.*
                                  description: Identifier of a single payment. 15-character nanoid prefixed with
                                    `pa-`.
                                onchain_id:
                                  type: string
                                payment_group_nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^pg-.*
                                  description: Identifier of a payment group (a batch of payments scheduled
                                    together). 15-character nanoid prefixed with
                                    `pg-`.
                                process_transaction:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^tx-.*
                                  description: Identifier of a Rise transaction (the unit tracked end-to-end
                                    across the payment-handler pipeline).
                                    15-character nanoid prefixed with `tx-`.
                                    Distinct from on-chain tx hashes.
                                  nullable: true
                                updated_at:
                                  type: string
                                  format: date-time
                                v1_metadata:
                                  anyOf:
                                    - anyOf:
                                        - type: string
                                        - type: object
                                          additionalProperties: {}
                                    - type: array
                                      items: {}
                                  nullable: true
                                state:
                                  type: string
                                  enum:
                                    - Undefined
                                    - Intent
                                    - Scheduled
                                    - Complete
                                    - Removed
                                pay_at_time:
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                                token_amount:
                                  type: string
                                amount_cents:
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                                currency_symbol:
                                  type: string
                                token_decimals:
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                                valid_minutes:
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                              required:
                                - creation_transaction
                                - group_onchain_id
                                - invoice_nanoid
                                - nanoid
                                - onchain_id
                                - payment_group_nanoid
                                - process_transaction
                                - state
                                - pay_at_time
                                - token_amount
                                - amount_cents
                                - currency_symbol
                                - token_decimals
                                - valid_minutes
                              additionalProperties: false
                          required:
                            - recipient
                            - payer
                            - invoice
                            - payment
                          additionalProperties: false
                    required:
                      - items
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    post:
      summary: Create typed data for payments
      tags:
        - B2B Payments
      description: Create typed data for payments. The typed data can be signed and
        then executed to create the payments on-chain.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                  description: Identifier of a Rise team (a workspace below a company).
                    15-character nanoid prefixed with `te-`.
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      to:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^us-.*
                        description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                      amount_cents:
                        type: integer
                        minimum: 100
                        maximum: 10000000000
                      currency_symbol:
                        default: USD
                        type: string
                        enum:
                          - USD
                      invoice_description:
                        type: string
                        maxLength: 5000
                    required:
                      - to
                      - amount_cents
                pay_now:
                  type: boolean
                  description: "true: the payment is created and executed immediately. false: the
                    payment is created as an intent and is not processed
                    straight away — it must be approved by a user with payment
                    execution permission before it is sent."
                network:
                  default: arbitrum
                  type: string
                  enum:
                    - arbitrum
              required:
                - from
                - to
                - pay_now
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
          in: header
          name: x-idempotency-key
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      to_sign:
                        anyOf:
                          - type: object
                            properties:
                              domain:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  version:
                                    type: string
                                  chainId:
                                    type: number
                                  verifyingContract:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                required:
                                  - name
                                  - version
                                  - chainId
                                  - verifyingContract
                                additionalProperties: false
                              types:
                                type: object
                                properties:
                                  CreatePaymentAuthorizationForwardRequest:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                        type:
                                          type: string
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                  RisePaymentAuthorizationRequest:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                        type:
                                          type: string
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                required:
                                  - CreatePaymentAuthorizationForwardRequest
                                  - RisePaymentAuthorizationRequest
                                additionalProperties: false
                              typed_data:
                                type: object
                                properties:
                                  from:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  to:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  salt:
                                    type: string
                                  expires:
                                    type: string
                                  data:
                                    type: object
                                    properties:
                                      groupID:
                                        type: string
                                      merkleRoot:
                                        type: string
                                      paymentsCount:
                                        type: string
                                      maxAmountPerPayment:
                                        type: string
                                      deadline:
                                        type: string
                                    required:
                                      - groupID
                                      - merkleRoot
                                      - paymentsCount
                                      - maxAmountPerPayment
                                      - deadline
                                    additionalProperties: false
                                required:
                                  - from
                                  - to
                                  - salt
                                  - expires
                                  - data
                                additionalProperties: false
                              primary_type:
                                type: string
                            required:
                              - domain
                              - types
                              - typed_data
                              - primary_type
                            additionalProperties: false
                          - type: object
                            properties:
                              domain:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  version:
                                    type: string
                                  chainId:
                                    type: number
                                  verifyingContract:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                required:
                                  - name
                                  - version
                                  - chainId
                                  - verifyingContract
                                additionalProperties: false
                              types:
                                type: object
                                properties:
                                  CreatePaymentsAndExecutePayNowForwardRequest:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                        type:
                                          type: string
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                  RisePayNowBatchRequest:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                        type:
                                          type: string
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                  RisePayNow:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                        type:
                                          type: string
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                required:
                                  - CreatePaymentsAndExecutePayNowForwardRequest
                                  - RisePayNowBatchRequest
                                  - RisePayNow
                                additionalProperties: false
                              typed_data:
                                type: object
                                properties:
                                  from:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  to:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  salt:
                                    type: string
                                  expires:
                                    type: string
                                  data:
                                    type: object
                                    properties:
                                      groupID:
                                        type: string
                                      token:
                                        type: string
                                        pattern: ^0x[a-fA-F0-9]{40}$
                                        description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                      payments:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                            recipient:
                                              type: string
                                              pattern: ^0x[a-fA-F0-9]{40}$
                                              description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                            amount:
                                              type: string
                                          required:
                                            - id
                                            - recipient
                                            - amount
                                          additionalProperties: false
                                    required:
                                      - groupID
                                      - token
                                      - payments
                                    additionalProperties: false
                                required:
                                  - from
                                  - to
                                  - salt
                                  - expires
                                  - data
                                additionalProperties: false
                              primary_type:
                                type: string
                            required:
                              - domain
                              - types
                              - typed_data
                              - primary_type
                            additionalProperties: false
                      payment_data:
                        type: object
                        properties:
                          checksum:
                            type: string
                        required:
                          - checksum
                        additionalProperties: false
                      failed_payments:
                        type: array
                        items:
                          type: object
                          properties:
                            userNanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^us-.*
                              description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                            error:
                              type: string
                          required:
                            - userNanoid
                            - error
                          additionalProperties: false
                      duplicates:
                        type: object
                        properties:
                          payments:
                            type: array
                            items:
                              type: object
                              properties:
                                to:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^us-.*
                                  description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                                amount_cents:
                                  type: integer
                                  minimum: 100
                                  maximum: 10000000000
                                currency_symbol:
                                  type: string
                                  enum:
                                    - AED
                                    - ARS
                                    - AUD
                                    - BDT
                                    - BIF
                                    - BOB
                                    - BRL
                                    - BTC
                                    - CAD
                                    - CDF
                                    - CHF
                                    - CLP
                                    - CNY
                                    - COP
                                    - CRC
                                    - CZK
                                    - DKK
                                    - EGP
                                    - ETB
                                    - EUR
                                    - GBP
                                    - GHS
                                    - GMD
                                    - GTQ
                                    - HKD
                                    - HUF
                                    - IDR
                                    - ILS
                                    - INR
                                    - JOD
                                    - JPY
                                    - KES
                                    - KRW
                                    - KWD
                                    - LKR
                                    - MAD
                                    - MMK
                                    - MNT
                                    - MWK
                                    - MXN
                                    - MYR
                                    - MZN
                                    - NGN
                                    - NOK
                                    - NPR
                                    - NZD
                                    - PEN
                                    - PHP
                                    - PKR
                                    - PLN
                                    - QAR
                                    - RON
                                    - RWF
                                    - SEK
                                    - SGD
                                    - THB
                                    - TRY
                                    - TZS
                                    - UGX
                                    - USD
                                    - USDC
                                    - USDT
                                    - UYU
                                    - UZS
                                    - VND
                                    - XAF
                                    - XOF
                                    - ZAR
                                  description: Any currency Rise supports — fiat (ISO-4217 codes like USD, GBP) or
                                    crypto (USDC, EURC, BTC, etc.).
                                invoice_description:
                                  type: string
                                  maxLength: 5000
                              required:
                                - to
                                - amount_cents
                                - currency_symbol
                              additionalProperties: false
                          days_checked:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                        required:
                          - payments
                          - days_checked
                        additionalProperties: false
                    required:
                      - to_sign
                      - payment_data
                      - failed_payments
                      - duplicates
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Execute Payments
      tags:
        - B2B Payments
      description: Execute payments by signing the typed data and sending the
        signature along with the request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                  description: Identifier of a Rise team (a workspace below a company).
                    15-character nanoid prefixed with `te-`.
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      to:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^us-.*
                        description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
                      amount_cents:
                        type: integer
                        minimum: 100
                        maximum: 10000000000
                      currency_symbol:
                        default: USD
                        type: string
                        enum:
                          - USD
                      invoice_description:
                        type: string
                        maxLength: 5000
                    required:
                      - to
                      - amount_cents
                pay_now:
                  type: boolean
                  description: "true: the payment is created and executed immediately. false: the
                    payment is created as an intent and is not processed
                    straight away — it must be approved by a user with payment
                    execution permission before it is sent."
                network:
                  default: arbitrum
                  type: string
                  enum:
                    - arbitrum
                signer:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                typed_data:
                  anyOf:
                    - type: object
                      properties:
                        from:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        to:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        salt:
                          type: string
                        expires:
                          type: string
                        data:
                          type: object
                          properties:
                            groupID:
                              type: string
                            merkleRoot:
                              type: string
                            paymentsCount:
                              type: string
                            maxAmountPerPayment:
                              type: string
                            deadline:
                              type: string
                          required:
                            - groupID
                            - merkleRoot
                            - paymentsCount
                            - maxAmountPerPayment
                            - deadline
                      required:
                        - from
                        - to
                        - salt
                        - expires
                        - data
                    - type: object
                      properties:
                        from:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        to:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        salt:
                          type: string
                        expires:
                          type: string
                        data:
                          type: object
                          properties:
                            groupID:
                              type: string
                            token:
                              type: string
                              pattern: ^0x[a-fA-F0-9]{40}$
                              description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                            payments:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  recipient:
                                    type: string
                                    pattern: ^0x[a-fA-F0-9]{40}$
                                    description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                                  amount:
                                    type: string
                                required:
                                  - id
                                  - recipient
                                  - amount
                          required:
                            - groupID
                            - token
                            - payments
                      required:
                        - from
                        - to
                        - salt
                        - expires
                        - data
                signature:
                  type: string
                  pattern: ^0x(?!0{130}$)[a-fA-F0-9]{130}$
                  description: ECDSA signature over an EVM message (0x + 130 hex chars covering r,
                    s, v).
                payment_data:
                  type: object
                  properties:
                    checksum:
                      type: string
                  required:
                    - checksum
              required:
                - from
                - to
                - pay_now
                - signer
                - typed_data
                - signature
                - payment_data
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
          in: header
          name: x-idempotency-key
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      transaction:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^tx-.*
                        description: Identifier of a Rise transaction (the unit tracked end-to-end
                          across the payment-handler pipeline). 15-character
                          nanoid prefixed with `tx-`. Distinct from on-chain tx
                          hashes.
                    required:
                      - transaction
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/payments/teams/{team_nanoid}/external_entity:
    get:
      summary: Get external recipients for team
      tags:
        - B2B Bill Pay
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        email:
                          type: string
                        status:
                          type: string
                          enum:
                            - active
                            - inactive
                      required:
                        - email
                        - status
                      additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/payments/teams/{team_nanoid}/external_entity/:
    post:
      summary: Create external recipient for billpay
      tags:
        - B2B Bill Pay
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
              required:
                - email
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/payments/external_entity/instant:
    post:
      summary: Create an instant payment
      tags:
        - B2B Bill Pay
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                  description: Identifier of a Rise team (a workspace below a company).
                    15-character nanoid prefixed with `te-`.
                amount_cents:
                  type: integer
                  minimum: 100
                  maximum: 10000000000
                currency_symbol:
                  default: USD
                  type: string
                  enum:
                    - USD
                network:
                  default: arbitrum
                  type: string
                  enum:
                    - arbitrum
                payment_data:
                  type: object
                  properties:
                    role_description:
                      type: string
                      minLength: 1
                      maxLength: 500
                    invoice_description:
                      type: string
                      minLength: 1
                      maxLength: 5000
                    services_description:
                      default: ""
                      type: string
                    payment_details:
                      default: ""
                      type: string
                    rise_sow:
                      type: boolean
                    sow_link:
                      type: string
                      pattern: ^(|http(s?):\/\/[^\s]+)$
                      description: Optional website URL — empty string or http(s) URL with no
                        whitespace.
                    reason_id:
                      type: number
                  required:
                    - role_description
                    - invoice_description
                    - rise_sow
                external_recipient_email:
                  type: string
              required:
                - from
                - amount_cents
                - payment_data
                - external_recipient_email
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      domain:
                        type: object
                        properties:
                          name:
                            type: string
                          version:
                            type: string
                          chainId:
                            type: number
                          verifyingContract:
                            type: string
                            pattern: ^0x[a-fA-F0-9]{40}$
                            description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        required:
                          - name
                          - version
                          - chainId
                          - verifyingContract
                        additionalProperties: false
                      types:
                        type: object
                        properties:
                          CreatePaymentForwardRequest:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                type:
                                  type: string
                              required:
                                - name
                                - type
                              additionalProperties: false
                          RisePayment:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                type:
                                  type: string
                              required:
                                - name
                                - type
                              additionalProperties: false
                        required:
                          - CreatePaymentForwardRequest
                          - RisePayment
                        additionalProperties: false
                      typed_data:
                        type: object
                        properties:
                          from:
                            type: string
                            pattern: ^0x[a-fA-F0-9]{40}$
                            description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                          to:
                            type: string
                            pattern: ^0x[a-fA-F0-9]{40}$
                            description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                          salt:
                            type: string
                          expires:
                            type: string
                          data:
                            type: object
                            properties:
                              id:
                                type: string
                              groupID:
                                type: string
                              payAtTime:
                                type: string
                              validMinutes:
                                type: string
                              payType:
                                type: string
                              token:
                                type: string
                                pattern: ^0x[a-fA-F0-9]{40}$
                                description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                              recipient:
                                type: string
                                pattern: ^0x[a-fA-F0-9]{40}$
                                description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                              amount:
                                type: string
                              data:
                                type: string
                            required:
                              - id
                              - groupID
                              - payAtTime
                              - validMinutes
                              - payType
                              - token
                              - recipient
                              - amount
                              - data
                            additionalProperties: false
                        required:
                          - from
                          - to
                          - salt
                          - expires
                          - data
                        additionalProperties: false
                      primary_type:
                        type: string
                    required:
                      - domain
                      - types
                      - typed_data
                      - primary_type
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Create a single payment
      tags:
        - B2B Bill Pay
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                  description: Identifier of a Rise team (a workspace below a company).
                    15-character nanoid prefixed with `te-`.
                amount_cents:
                  type: integer
                  minimum: 100
                  maximum: 10000000000
                currency_symbol:
                  default: USD
                  type: string
                  enum:
                    - USD
                network:
                  default: arbitrum
                  type: string
                  enum:
                    - arbitrum
                signer:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                typed_data:
                  type: object
                  properties:
                    from:
                      type: string
                      pattern: ^0x[a-fA-F0-9]{40}$
                      description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                    to:
                      type: string
                      pattern: ^0x[a-fA-F0-9]{40}$
                      description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                    salt:
                      type: string
                    expires:
                      type: string
                    data:
                      type: object
                      properties:
                        id:
                          type: string
                        groupID:
                          type: string
                        payAtTime:
                          type: string
                        validMinutes:
                          type: string
                        payType:
                          type: string
                        token:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        recipient:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: EVM address (0x + 40 hex chars) or null/empty for unknown.
                        amount:
                          type: string
                        data:
                          type: string
                      required:
                        - id
                        - groupID
                        - payAtTime
                        - validMinutes
                        - payType
                        - token
                        - recipient
                        - amount
                        - data
                  required:
                    - from
                    - to
                    - salt
                    - expires
                    - data
                signature:
                  type: string
                  pattern: ^0x(?!0{130}$)[a-fA-F0-9]{130}$
                  description: ECDSA signature over an EVM message (0x + 130 hex chars covering r,
                    s, v).
                external_recipient_email:
                  type: string
              required:
                - from
                - amount_cents
                - signer
                - typed_data
                - signature
                - external_recipient_email
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      transaction:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^tx-.*
                        description: Identifier of a Rise transaction (the unit tracked end-to-end
                          across the payment-handler pipeline). 15-character
                          nanoid prefixed with `tx-`. Distinct from on-chain tx
                          hashes.
                    required:
                      - transaction
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
  /v2/teams/{team_nanoid}/users:
    get:
      summary: Get team users
      tags:
        - B2B Teams
      description: Retrieves a list of users associated with the specified team
        identified by its nanoid. This endpoint is useful for obtaining user
        details for a specific team, including their names and email addresses.
        Supports optional offset pagination via page/offset/count query params;
        without them the full list is returned.
      parameters:
        - schema:
            type: string
          in: query
          name: page
          required: false
          description: 1-indexed page number.
        - schema:
            type: string
          in: query
          name: offset
          required: false
          description: Row offset (alternative to page).
        - schema:
            type: string
          in: query
          name: count
          required: false
          description: Page size, 1-500 (default 100). Pagination only activates when page
            or offset is set.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Unique identifier of the team for which to retrieve users.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^us-.*
                              description: Unique identifier for the user.
                            first_name:
                              type: string
                              description: User's first name.
                            middle_name:
                              type: string
                              description: User's middle name.
                            last_name:
                              type: string
                              description: User's last name.
                            email:
                              type: string
                              description: User's email address.
                            role:
                              type: string
                              description: User's team role.
                            rise_account:
                              type: string
                              pattern: ^0x(?!0{40}$)[a-fA-F0-9]{40}$
                              description: User's rise account.
                            riseid:
                              type: string
                              minLength: 42
                              maxLength: 42
                              description: User's riseid.
                            avatar:
                              type: string
                              description: User's avatar URL.
                            address:
                              type: object
                              properties:
                                line_1:
                                  type: string
                                  description: Primary address line
                                line_2:
                                  type: string
                                  description: Secondary address line
                                city:
                                  type: string
                                  description: City of the company
                                state:
                                  type: string
                                  description: State or region
                                country:
                                  type: string
                                  description: Country of the company
                                zip_code:
                                  type: string
                                  description: Postal code
                              required:
                                - line_1
                                - line_2
                                - city
                                - state
                                - country
                                - zip_code
                              additionalProperties: false
                          required:
                            - nanoid
                            - first_name
                            - middle_name
                            - last_name
                            - email
                            - role
                            - rise_account
                            - riseid
                            - avatar
                            - address
                          additionalProperties: false
                      pagination:
                        description: Present only when pagination was requested via page/offset query
                          params.
                        type: object
                        properties:
                          page:
                            type: number
                          count:
                            type: number
                          offset:
                            type: number
                          has_more:
                            type: boolean
                          next_page:
                            type: number
                            nullable: true
                          next_offset:
                            type: number
                            nullable: true
                        required:
                          - page
                          - count
                          - offset
                          - has_more
                          - next_page
                          - next_offset
                        additionalProperties: false
                    required:
                      - users
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams/{team_nanoid}/settings:
    get:
      summary: Get team settings
      tags:
        - B2B Teams
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Unique identifier of the team for which to retrieve users.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      payment_delay_in_minutes:
                        type: number
                    required:
                      - payment_delay_in_minutes
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Update team settings
      tags:
        - B2B Teams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                payment_delay_in_minutes:
                  type: number
              required:
                - payment_delay_in_minutes
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Unique identifier of the team for which to retrieve users.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams/{team_nanoid}:
    get:
      summary: Get team by nanoid
      tags:
        - B2B Teams
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Unique identifier of the team for which to retrieve users.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      nanoid:
                        type: string
                        description: Unique identifier for the team.
                      name:
                        type: string
                        minLength: 1
                        description: Name of the team.
                      avatar:
                        type: string
                        description: URL of the team avatar.
                      balance:
                        type: string
                        description: Current balance of the team.
                      administrators:
                        type: array
                        items:
                          type: object
                          properties:
                            relationship_nanoid:
                              type: string
                              description: Unique identifier for the relationship of the administrator.
                            user_nanoid:
                              type: string
                              description: Unique identifier for the user.
                            avatar:
                              type: string
                              description: URL of the administrator's avatar.
                            first_name:
                              type: string
                              description: First name of the administrator.
                            middle_name:
                              type: string
                              description: Middle name of the administrator.
                            last_name:
                              type: string
                              description: Last name of the administrator.
                            email:
                              type: string
                              description: Email address of the administrator.
                            type:
                              type: string
                              enum:
                                - team_admin
                                - team_finance_admin
                                - team_viewer
                                - team_payment_initiator
                                - team_invite_initiator
                              description: Role type of the administrator within the team.
                          required:
                            - relationship_nanoid
                            - user_nanoid
                            - avatar
                            - first_name
                            - middle_name
                            - last_name
                            - email
                            - type
                          additionalProperties: false
                    required:
                      - nanoid
                      - name
                      - avatar
                      - balance
                      - administrators
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Update team by nanoid
      tags:
        - B2B Teams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
              required:
                - name
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Unique identifier of the team for which to retrieve users.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        description: Name of the team.
                      nanoid:
                        type: string
                        description: Unique identifier for the team.
                      avatar:
                        type: string
                        description: URL of the team avatar.
                    required:
                      - name
                      - nanoid
                      - avatar
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams:
    post:
      summary: Create a team
      tags:
        - B2B Teams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: Name of the team, must be at least 1 character long and trimmed
                company_nanoid:
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^co-.*
                  description: Unique identifier for the company in nanoid format
                admins:
                  type: array
                  items:
                    type: object
                    properties:
                      nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^us-.*
                        description: Unique identifier for the admin user in nanoid format
                      type:
                        allOf:
                          - type: string
                            enum:
                              - team_admin
                              - team_finance_admin
                              - team_viewer
                          - {}
                        description: Role type of the admin within the team, can be team_admin,
                          team_finance_admin, or team_viewer
                    required:
                      - nanoid
                      - type
                avatar_file_name:
                  description: Optional filename for the team avatar
                  type: string
                withdraw_fee_coverage:
                  type: boolean
                  description: Indicates whether the team covers withdrawal fees
              required:
                - name
                - company_nanoid
                - admins
                - withdraw_fee_coverage
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        description: Name of the team.
                      nanoid:
                        type: string
                        description: Unique identifier for the team.
                      avatar:
                        type: string
                        description: URL of the team avatar.
                    required:
                      - name
                      - nanoid
                      - avatar
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams/{team_nanoid}/member/{user_nanoid}/summary:
    get:
      summary: Get team member summary
      tags:
        - B2B Teams
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^us-.*
          in: path
          name: user_nanoid
          required: true
          description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          nanoid:
                            type: string
                            minLength: 15
                            maxLength: 15
                            pattern: ^us-.*
                            description: Unique identifier for the user
                          avatar:
                            type: string
                            description: URL of the user's avatar
                          first_name:
                            type: string
                            description: User's first name
                          middle_name:
                            type: string
                            description: User's middle name
                          last_name:
                            type: string
                            description: User's last name
                          email:
                            type: string
                            description: User's email address
                          blockchain_address:
                            type: string
                            description: User's blockchain wallet address
                          phone:
                            type: string
                            description: User's phone number
                          dob:
                            type: string
                            nullable: true
                            description: User's date of birth, nullable
                          address:
                            type: object
                            properties:
                              line_1:
                                type: string
                                description: Primary address line
                              line_2:
                                type: string
                                description: Secondary address line
                              city:
                                type: string
                                description: City of residence
                              state:
                                type: string
                                description: State or region
                              country:
                                type: string
                                description: Country of residence
                              zip_code:
                                type: string
                                description: Postal code
                              timezone:
                                type: string
                                description: User's timezone
                            required:
                              - line_1
                              - line_2
                              - city
                              - state
                              - country
                              - zip_code
                              - timezone
                            additionalProperties: false
                          social:
                            type: object
                            properties:
                              linkedin:
                                type: string
                                description: User's LinkedIn profile URL
                              discord:
                                type: string
                                description: User's Discord handle
                              website:
                                type: string
                                description: User's personal website
                              x:
                                type: string
                                description: User's handle on platform X
                            required:
                              - linkedin
                              - discord
                              - website
                              - x
                            additionalProperties: false
                          certifications:
                            type: array
                            items:
                              type: object
                              properties:
                                nanoid:
                                  type: string
                                  minLength: 15
                                  maxLength: 15
                                  pattern: ^ce-.*
                                  description: Unique identifier for the certification
                                title:
                                  type: string
                                  description: Title of the certification
                                website:
                                  type: string
                                  description: Website URL for certification details
                                year:
                                  type: number
                                  description: Year the certification was obtained
                                file:
                                  type: string
                                  description: URL of the file related to the certification
                              required:
                                - nanoid
                                - title
                                - website
                                - year
                                - file
                              additionalProperties: false
                            description: List of user's certifications
                          onboarding:
                            type: object
                            properties:
                              onboarded:
                                description: Indicates whether the user is onboarded
                                type: boolean
                              step:
                                type: string
                                enum:
                                  - initial
                                  - details
                                  - compliance_process
                                  - security
                                  - signing
                                  - complete
                                  - riseid
                                  - signer
                                  - v1_migration_in_progress
                                  - v1_migration_need_rsk
                                  - v1_migration_need_kyc
                                nullable: true
                                description: Current onboarding step, nullable
                              role:
                                type: string
                                enum:
                                  - payer
                                  - payee
                                  - viewer
                                  - admin
                                  - delegate_admin
                                  - non_delegate_admin
                                nullable: true
                                description: User's role during onboarding, nullable
                              moderation_status:
                                type: string
                                enum:
                                  - pending
                                  - submitted
                                  - approved
                                  - rejected
                                nullable: true
                                description: Moderation status during onboarding, nullable
                            required:
                              - onboarded
                              - step
                              - role
                              - moderation_status
                            additionalProperties: false
                        required:
                          - nanoid
                          - avatar
                          - first_name
                          - middle_name
                          - last_name
                          - email
                          - blockchain_address
                          - phone
                          - dob
                          - address
                          - social
                          - certifications
                          - onboarding
                        additionalProperties: false
                      relationship_type:
                        type: string
                        enum:
                          - team_employee
                          - contractor
                          - aor_contractor
                        description: Type of relationship with the team
                      company:
                        description: Details of the associated company, optional
                        type: object
                        properties:
                          nanoid:
                            type: string
                            minLength: 15
                            maxLength: 15
                            pattern: ^co-.*
                            description: Unique identifier for the company
                          avatar:
                            type: string
                            description: URL of the company's avatar
                          name:
                            type: string
                            description: Company's name
                          website:
                            type: string
                            description: Company's website URL
                          blockchain_address:
                            type: string
                            description: Company's blockchain wallet address
                          address:
                            type: object
                            properties:
                              line_1:
                                type: string
                                description: Primary address line
                              line_2:
                                type: string
                                description: Secondary address line
                              city:
                                type: string
                                description: City of the company
                              state:
                                type: string
                                description: State or region
                              country:
                                type: string
                                description: Country of the company
                              zip_code:
                                type: string
                                description: Postal code
                              timezone:
                                type: string
                                description: Company's timezone
                            required:
                              - line_1
                              - line_2
                              - city
                              - state
                              - country
                              - zip_code
                              - timezone
                            additionalProperties: false
                          admin_contact:
                            type: object
                            properties:
                              fullname:
                                type: string
                                description: Administrator's full name
                              phone:
                                type: string
                                description: Administrator's phone number
                              email:
                                type: string
                                description: Administrator's email address
                            required:
                              - fullname
                              - phone
                              - email
                            additionalProperties: false
                            nullable: true
                            description: Contact information for the company administrator
                          incorporation_country:
                            type: string
                            description: Country of incorporation
                          incorporation_type:
                            type: string
                            enum:
                              - sole_proprietorship
                              - private_limited_company
                              - limited_liability_company
                              - s-corporation
                              - c-corporation
                              - public_limited_company
                              - limited_partnership
                              - holding_company
                              - non_government_organisation
                              - statutory_company
                              - subsidiary_company
                              - unlimited_partnership
                              - charitable_incorporated_organisation
                              - chartered_company
                              - association
                              - non_profit_organisation
                              - im_not_sure
                            description: Type of incorporation
                          private_data:
                            type: object
                            properties:
                              tax_id:
                                type: string
                                description: Company's tax identification number
                            required:
                              - tax_id
                            additionalProperties: false
                        required:
                          - nanoid
                          - avatar
                          - name
                          - website
                          - blockchain_address
                          - address
                          - admin_contact
                          - incorporation_country
                          - incorporation_type
                          - private_data
                        additionalProperties: false
                      pay_schedules:
                        type: array
                        items:
                          type: object
                          properties:
                            nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^ps-.*
                              description: Unique identifier for the pay schedule
                            type:
                              type: string
                              enum:
                                - milestone
                                - recurring
                              description: Type of pay schedule
                            amount:
                              type: string
                              description: Payment amount
                            payments_amount:
                              type: number
                              description: Total number of payments
                            start_date:
                              description: Start date of the pay schedule
                              type: string
                              format: date-time
                            end_date:
                              description: End date of the pay schedule
                              type: string
                              format: date-time
                          required:
                            - nanoid
                            - type
                            - amount
                            - payments_amount
                            - start_date
                            - end_date
                          additionalProperties: false
                        description: List of pay schedules associated with the user
                    required:
                      - user
                      - relationship_type
                      - pay_schedules
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams/{team_nanoid}/member/{user_nanoid}/settings:
    get:
      summary: Get team member settings
      tags:
        - B2B Teams
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^us-.*
          in: path
          name: user_nanoid
          required: true
          description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      withdraw_fee_coverage:
                        type: boolean
                    required:
                      - withdraw_fee_coverage
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    put:
      summary: Update team member settings
      tags:
        - B2B Teams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                withdraw_fee_coverage:
                  type: boolean
              required:
                - withdraw_fee_coverage
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^us-.*
          in: path
          name: user_nanoid
          required: true
          description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/teams/{team_nanoid}/member/{user_nanoid}:
    delete:
      summary: Delete team member
      tags:
        - B2B Teams
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: path
          name: team_nanoid
          required: true
          description: Identifier of a Rise team (a workspace below a company).
            15-character nanoid prefixed with `te-`.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^us-.*
          in: path
          name: user_nanoid
          required: true
          description: Identifier of a Rise user. 15-character nanoid prefixed with `us-`.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/user/organizations:
    get:
      summary: Get user organization's
      tags:
        - B2B Users
      description: Retrieves a list of organizations associated with the logged-in user.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      companies:
                        type: array
                        items:
                          type: object
                          properties:
                            nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^co-.*
                              description: Unique identifier for the company.
                            avatar:
                              type: string
                              description: URL of the company's avatar image.
                            name:
                              type: string
                              description: Name of the company.
                          required:
                            - nanoid
                            - avatar
                            - name
                          additionalProperties: false
                    required:
                      - companies
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/user/teams:
    get:
      summary: Get user team's
      tags:
        - B2B Users
      description: Retrieves a list of teams associated with the logged-in user.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      teams:
                        type: array
                        items:
                          type: object
                          properties:
                            nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^te-.*
                              description: Unique identifier for the team.
                            name:
                              type: string
                              minLength: 1
                              description: Name of the team.
                            riseid:
                              type: string
                              minLength: 42
                              maxLength: 42
                              description: Unique identifier for the team in Rise.
                            rise_account:
                              type: string
                              pattern: ^0x(?!0{40}$)[a-fA-F0-9]{40}$
                              description: Unique identifier for the team's Rise account.
                            role:
                              type: string
                              description: Role of the user in the team.
                            avatar:
                              type: string
                              description: URL of the team's avatar image.
                            balance:
                              type: string
                              description: Balance associated with the team.
                            payees_count:
                              type: number
                              description: Number of payees in the team.
                            administrators_count:
                              type: number
                              description: Number of administrators in the team.
                          required:
                            - nanoid
                            - name
                            - riseid
                            - rise_account
                            - role
                            - avatar
                            - balance
                            - payees_count
                            - administrators_count
                          additionalProperties: false
                    required:
                      - teams
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/user/address:
    put:
      summary: Update user address details
      tags:
        - B2B Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                line_1:
                  description: The first line of the address.
                  type: string
                line_2:
                  description: The second line of the address, optional.
                  type: string
                city:
                  description: The city of the address.
                  type: string
                state:
                  description: The state of the address.
                  type: string
                country:
                  description: The country of the address.
                  type: string
                zip_code:
                  description: The ZIP or postal code of the address.
                  type: string
                timezone:
                  description: The timezone associated with the address.
                  type: string
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/user/avatar/update:
    post:
      summary: Update user avatar
      tags:
        - B2B Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_name:
                  type: string
                  minLength: 1
              required:
                - file_name
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: string
                    enum:
                      - Your avatar was updated
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v1/webhooks:
    get:
      summary: Get V1 Webhook
      tags:
        - B2B Webhooks V1
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^co-.*
          in: query
          name: company_nanoid
          required: true
          description: Unique identifier of the company.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      webhook_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wh-.*
                        description: Unique identifier of the Webhook.
                      company_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^co-.*
                        description: Unique identifier of the company.
                      endpoint:
                        type: string
                        format: uri
                      is_active:
                        type: boolean
                      signer_address:
                        type: string
                        description: Ethereum address used to sign V1 webhook payloads.
                      created_at:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      updated_at:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    required:
                      - webhook_nanoid
                      - company_nanoid
                      - endpoint
                      - is_active
                      - signer_address
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/register:
    post:
      summary: Register Webhook
      tags:
        - B2B Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                company_nanoid:
                  description: Identifier of the company. Optional when team_nanoid is given (the
                    company is derived from the team); required otherwise.
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^co-.*
                team_nanoid:
                  description: Unique identifier of the team.
                  type: string
                  minLength: 15
                  maxLength: 15
                  pattern: ^te-.*
                url:
                  type: string
                  format: uri
                webhook_version:
                  default: v2
                  description: "v2: HMAC-signed payloads (requires secret and events). v1:
                    Ethereum-signed legacy payloads (omit secret; receives all
                    events)."
                  type: string
                  enum:
                    - v1
                    - v2
                events:
                  description: "Required for v2: non-empty list of subscribed event types. For v1
                    omit or use []; v1 always receives all events."
                  type: array
                  items:
                    type: string
                secret:
                  description: Required for v2 (minimum 16 characters). Must be omitted for v1.
                  type: string
                  minLength: 16
                is_active:
                  type: boolean
                name:
                  description: Optional display name for the webhook.
                  type: string
                  maxLength: 255
                description:
                  description: Optional description for the webhook.
                  type: string
              required:
                - url
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      webhook_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wh-.*
                        description: Unique identifier of the Webhook.
                      company_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^co-.*
                        description: Unique identifier of the company.
                      team_nanoid:
                        description: Unique identifier of the team, if applicable.
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^te-.*
                      webhook_version:
                        type: string
                        enum:
                          - v1
                          - v2
                        description: Whether this endpoint uses v1 (Ethereum-signed) or v2 (HMAC)
                          delivery.
                      url:
                        type: string
                        format: uri
                      events:
                        type: array
                        items:
                          type: string
                      is_active:
                        type: boolean
                      name:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                    required:
                      - webhook_nanoid
                      - company_nanoid
                      - webhook_version
                      - url
                      - events
                      - is_active
                      - name
                      - description
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/{webhook_nanoid}:
    put:
      summary: Update Webhook (v1/v2 cannot be changed; register a new endpoint to
        switch version)
      tags:
        - B2B Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                events:
                  minItems: 1
                  type: array
                  items:
                    type: string
                secret:
                  type: string
                  minLength: 16
                is_active:
                  type: boolean
                name:
                  description: Optional display name for the webhook.
                  type: string
                  maxLength: 255
                description:
                  description: Optional description for the webhook.
                  type: string
              additionalProperties: false
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      webhook_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wh-.*
                        description: Unique identifier of the Webhook.
                      webhook_version:
                        type: string
                        enum:
                          - v1
                          - v2
                        description: Immutable after registration; same value that was set when the
                          endpoint was created.
                      url:
                        type: string
                        format: uri
                      events:
                        type: array
                        items:
                          type: string
                      is_active:
                        type: boolean
                      name:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                    required:
                      - webhook_nanoid
                      - webhook_version
                      - url
                      - events
                      - is_active
                      - name
                      - description
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    delete:
      summary: Delete Webhook
      tags:
        - B2B Webhooks
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
    get:
      summary: Get Webhook
      tags:
        - B2B Webhooks
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      webhook_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wh-.*
                        description: Unique identifier of the Webhook.
                      company_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^co-.*
                        description: Unique identifier of the company.
                      team_nanoid:
                        description: Unique identifier of the team, if applicable.
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^te-.*
                      webhook_version:
                        type: string
                        enum:
                          - v1
                          - v2
                        description: Whether this endpoint uses v1 (Ethereum-signed) or v2 (HMAC)
                          delivery.
                      url:
                        type: string
                        format: uri
                      events:
                        type: array
                        items:
                          type: string
                      is_active:
                        type: boolean
                      name:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      updated_at:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    required:
                      - webhook_nanoid
                      - company_nanoid
                      - webhook_version
                      - url
                      - events
                      - is_active
                      - name
                      - description
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/{webhook_nanoid}/events/{event_nanoid}:
    get:
      summary: Get Webhook Event
      tags:
        - B2B Webhooks
      description: Returns the stored event row and payload when this event has at
        least one delivery for the webhook endpoint.
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^we-.*
          in: path
          name: event_nanoid
          required: true
          description: Unique identifier of the Webhook Event.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      event_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^we-.*
                        description: Unique identifier of the Webhook Event.
                      event_type:
                        type: string
                        description: Event type stored for this webhook event row.
                      version:
                        type: string
                      idempotency_key:
                        type: string
                      payload:
                        type: object
                        additionalProperties: {}
                        description: Original event data body sent to subscribed endpoints.
                      created_at:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    required:
                      - event_nanoid
                      - event_type
                      - version
                      - idempotency_key
                      - payload
                      - created_at
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks:
    get:
      summary: List Webhooks
      tags:
        - B2B Webhooks
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^co-.*
          in: query
          name: company_nanoid
          required: false
          description: Identifier of the company. Optional when team_nanoid is given (the
            company is derived from the team); required otherwise.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^te-.*
          in: query
          name: team_nanoid
          required: false
          description: Unique identifier of the team, if applicable.
        - schema:
            type: string
          in: query
          name: cursor
          required: false
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      webhooks:
                        type: array
                        items:
                          type: object
                          properties:
                            webhook_nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^wh-.*
                              description: Unique identifier of the Webhook.
                            webhook_version:
                              type: string
                              enum:
                                - v1
                                - v2
                              description: Whether this endpoint uses v1 (Ethereum-signed) or v2 (HMAC)
                                delivery.
                            url:
                              type: string
                              format: uri
                            events:
                              type: array
                              items:
                                type: string
                            is_active:
                              type: boolean
                            name:
                              type: string
                              nullable: true
                            description:
                              type: string
                              nullable: true
                            created_at:
                              type: string
                              format: date-time
                              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                            updated_at:
                              type: string
                              format: date-time
                              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          required:
                            - webhook_nanoid
                            - webhook_version
                            - url
                            - events
                            - is_active
                            - name
                            - description
                            - created_at
                            - updated_at
                          additionalProperties: false
                      next_cursor:
                        type: string
                        nullable: true
                    required:
                      - webhooks
                      - next_cursor
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/test/{webhook_nanoid}:
    post:
      summary: Test Webhook
      tags:
        - B2B Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                event_type:
                  type: string
                  enum:
                    - withdraw_account.duplicated_detected
                    - invite.accepted
                    - payment.sent
                    - deposit.received
                    - payment.group.created
                    - invite.expired
                    - invite.rejected
                    - onboarding.step_updated.basic_data
                    - onboarding.step_updated.kyc.accepted
                    - onboarding.step_updated.kyc.rejected
                    - onboarding.step_updated.kyc.pending
                    - onboarding.step_updated.rsk
                    - onboarding.step_updated.documents
                    - onboarding.completed
                    - team.member_blocked
                    - team.member_added
                    - team.member_removed
                    - document.signed
                    - document.expired
                    - document.closed
                    - payment.subscription.created
                    - payment.subscription.paid
                    - payment.chargeback.created
                    - payment.chargeback.paid
                    - payment.cash_requirement.created
                    - payment.cash_requirement.due
                    - payment.canceled
                    - payment.failed
                    - invoice.created
                    - invoice.canceled
                    - token.transfer
                    - deposit.crypto
                    - deposit.crosschain
                    - deposit.bitcoin
                    - deposit.fiat
                    - swap.token
                    - action_item.created
                    - action_item.completed
                    - action_item.finished
                version:
                  default: 2
                  description: Webhook payload major version (defaults to 2)
                  type: integer
                  minimum: 1
                  maximum: 10
              required:
                - event_type
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      delivery_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wl-.*
                        description: Unique identifier of the Webhook Delivery.
                      message:
                        type: string
                      test_payload:
                        description: Generated test payload for the webhook
                        type: object
                        additionalProperties: {}
                      version:
                        description: Major version of the webhook payload used
                        type: number
                    required:
                      - delivery_nanoid
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/retry/{delivery_nanoid}:
    post:
      summary: Retry Delivery
      tags:
        - B2B Webhooks
      parameters:
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wl-.*
          in: path
          name: delivery_nanoid
          required: true
          description: Unique identifier of the Webhook Delivery.
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      delivery_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^wl-.*
                        description: Delivery that was queued for retry (existing row; a new delivery is
                          created asynchronously).
                      event_nanoid:
                        type: string
                        minLength: 15
                        maxLength: 15
                        pattern: ^we-.*
                        description: Webhook event for this delivery; use with delivery history to group
                          all attempts.
                      status:
                        type: string
                    required:
                      - delivery_nanoid
                      - event_nanoid
                      - status
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
  /v2/webhooks/{webhook_nanoid}/deliveries:
    get:
      summary: Delivery History
      tags:
        - B2B Webhooks
      parameters:
        - schema:
            type: string
          in: query
          name: cursor
          required: false
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^we-.*
          in: query
          name: event_nanoid
          required: false
          description: When set, only deliveries for this webhook event are returned.
        - schema:
            type: string
            enum:
              - withdraw_account.duplicated_detected
              - invite.accepted
              - payment.sent
              - deposit.received
              - payment.group.created
              - invite.expired
              - invite.rejected
              - onboarding.step_updated.basic_data
              - onboarding.step_updated.kyc.accepted
              - onboarding.step_updated.kyc.rejected
              - onboarding.step_updated.kyc.pending
              - onboarding.step_updated.rsk
              - onboarding.step_updated.documents
              - onboarding.completed
              - team.member_blocked
              - team.member_added
              - team.member_removed
              - document.signed
              - document.expired
              - document.closed
              - payment.subscription.created
              - payment.subscription.paid
              - payment.chargeback.created
              - payment.chargeback.paid
              - payment.cash_requirement.created
              - payment.cash_requirement.due
              - payment.canceled
              - payment.failed
              - invoice.created
              - invoice.canceled
              - token.transfer
              - deposit.crypto
              - deposit.crosschain
              - deposit.bitcoin
              - deposit.fiat
              - swap.token
              - action_item.created
              - action_item.completed
              - action_item.finished
          in: query
          name: event_type
          required: false
          description: When set, only deliveries for this event type are returned.
        - schema:
            type: string
            minLength: 15
            maxLength: 15
            pattern: ^wh-.*
          in: path
          name: webhook_nanoid
          required: true
          description: Unique identifier of the Webhook Endpoint.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      deliveries:
                        type: array
                        items:
                          type: object
                          properties:
                            delivery_nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^wl-.*
                              description: Unique identifier of the Webhook Delivery.
                            event_nanoid:
                              type: string
                              minLength: 15
                              maxLength: 15
                              pattern: ^we-.*
                              description: Unique identifier of the Webhook Event.
                            event_type:
                              type: string
                              enum:
                                - withdraw_account.duplicated_detected
                                - invite.accepted
                                - payment.sent
                                - deposit.received
                                - payment.group.created
                                - invite.expired
                                - invite.rejected
                                - onboarding.step_updated.basic_data
                                - onboarding.step_updated.kyc.accepted
                                - onboarding.step_updated.kyc.rejected
                                - onboarding.step_updated.kyc.pending
                                - onboarding.step_updated.rsk
                                - onboarding.step_updated.documents
                                - onboarding.completed
                                - team.member_blocked
                                - team.member_added
                                - team.member_removed
                                - document.signed
                                - document.expired
                                - document.closed
                                - payment.subscription.created
                                - payment.subscription.paid
                                - payment.chargeback.created
                                - payment.chargeback.paid
                                - payment.cash_requirement.created
                                - payment.cash_requirement.due
                                - payment.canceled
                                - payment.failed
                                - invoice.created
                                - invoice.canceled
                                - token.transfer
                                - deposit.crypto
                                - deposit.crosschain
                                - deposit.bitcoin
                                - deposit.fiat
                                - swap.token
                                - action_item.created
                                - action_item.completed
                                - action_item.finished
                              description: Webhook event type for this delivery (from the associated webhook
                                event).
                            status:
                              type: string
                              enum:
                                - queued
                                - success
                                - failed
                                - retrying
                            response_code:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                              nullable: true
                            created_at:
                              type: string
                              format: date-time
                              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          required:
                            - delivery_nanoid
                            - event_nanoid
                            - event_type
                            - status
                            - response_code
                            - created_at
                          additionalProperties: false
                      next_cursor:
                        type: string
                        nullable: true
                    required:
                      - deliveries
                      - next_cursor
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Bad Request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Unauthorized
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Forbidden
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Not Found
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: string
                  error_code:
                    type: string
                required:
                  - success
                  - data
                additionalProperties: false
                description: Internal Server Error
servers:
  - url: https://b2b-api.dev-riseworks.io
    description: Development
  - url: https://integrations-api.staging-riseworks.io
    description: Staging
  - url: https://integrations-api.riseworks.io
    description: Production