> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbridge.co.tz/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger a mobile (USSD) collection

> Initiates a USSD push to the payer's phone. Uses the Collections gateway server + its own Bearer token. `transactionId` is your own unique reference (used to poll status and as an idempotency key).



## OpenAPI

````yaml /api-reference/openapi.json post /collection/mobile
openapi: 3.1.0
info:
  title: Bridge API
  version: 1.0.0
  description: >-
    Bridge is Banking-as-a-Service: launch wallets, lending, and payment
    collections while a bank/FSP retains custody and compliance. This reference
    covers the production-proven surface. Get a `keyId`/`secret` from the
    Dashboard, exchange them at `/generate-token` for a 1-hour Bearer token,
    then call the product APIs.


    **Auth recovery:** tokens expire after ~1h. On a 401, re-call
    `/generate-token` and retry once.
servers:
  - url: https://{baasHost}/api
    description: BaaS core (KYC, Lending, Wallets)
    variables:
      baasHost:
        default: services.finance.reli.co.tz
  - url: https://{gatewayHost}/api
    description: >-
      Collections gateway (payment collection) — a separate service and key from
      the BaaS core.
    variables:
      gatewayHost:
        default: bridge-fsp.usereli.tech
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Exchange API keys for a Bearer token.
  - name: KYC
    description: Customers and identity. KYC is the authoritative customer store.
  - name: Lending
    description: Loan products, origination, schedules, and repayments.
  - name: Wallets
    description: Stored-value wallets, deposits, and escrow.
  - name: Collections
    description: Mobile (USSD) payment collection. Separate service + key.
paths:
  /collection/mobile:
    post:
      tags:
        - Collections
      summary: Trigger a mobile (USSD) collection
      description: >-
        Initiates a USSD push to the payer's phone. Uses the Collections gateway
        server + its own Bearer token. `transactionId` is your own unique
        reference (used to poll status and as an idempotency key).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MobileCollectionRequest'
            example:
              amount: 1000
              currency: TZS
              payerPhone: '+255700000000'
              fspId: CLICKPESA
              transactionId: ORDER_12345
      responses:
        '201':
          description: Collection initiated (a USSD prompt is sent to the payer)
          content:
            application/json:
              example:
                id: LCPCATJHWWYQBY
                orderReference: MMPFDM3YGNYPLM
                gatewayResponse:
                  status: PROCESSING
                  channel: AIRTEL-MONEY
                  orderReference: MMPFDM3YGNYPLM
                  collectedAmount: '1000.00'
                  collectedCurrency: TZS
        '400':
          description: >-
            Validation error (payerPhone must be E.164 like +255…, amount below
            the 1,000 minimum) or FSP credentials not configured for the
            business
        '401':
          $ref: '#/components/responses/Unauthorized'
      servers:
        - url: https://{gatewayHost}/api
          variables:
            gatewayHost:
              default: bridge-fsp.usereli.tech
components:
  schemas:
    MobileCollectionRequest:
      type: object
      required:
        - amount
        - currency
        - payerPhone
        - fspId
        - transactionId
      properties:
        amount:
          type: number
          description: Collection amount. Minimum 1,000.
        currency:
          type: string
          example: TZS
        payerPhone:
          type: string
          description: Payer phone in international (E.164) format.
          example: '+255700000000'
        fspId:
          type: string
          default: CLICKPESA
          description: >-
            Currently CLICKPESA (covers Airtel Money, Mixx by Yas, Halotel).
            More FSPs coming soon; bank collections on request.
          example: CLICKPESA
        transactionId:
          type: string
          description: >-
            Your unique reference; used to poll status and as the idempotency
            key.
  responses:
    Unauthorized:
      description: Missing/expired token. Re-call /generate-token and retry once.
      content:
        application/json:
          example:
            error:
              code: UNAUTHORIZED
              message: Token expired or invalid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token from POST /generate-token. Expires ~1h; on 401, re-generate
        and retry once.

````