Lightspark Internal Accounts API

Internal account management endpoints for creating and managing internal accounts

OpenAPI Specification

lightspark-internal-accounts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Grid Agent Management Internal Accounts API
  description: 'API for managing global payments on the open Money Grid. Built by Lightspark. See the full documentation at https://docs.lightspark.com/.

    '
  version: '2025-10-13'
  contact:
    name: Lightspark Support
    email: support@lightspark.com
  license:
    name: Proprietary
    url: https://lightspark.com/terms
servers:
- url: https://api.lightspark.com/grid/2025-10-13
  description: Production server
security:
- BasicAuth: []
- AgentAuth: []
tags:
- name: Internal Accounts
  description: Internal account management endpoints for creating and managing internal accounts
paths:
  /customers/internal-accounts:
    get:
      summary: List Customer internal accounts
      description: 'Retrieve a list of internal accounts with optional filtering parameters. Returns all

        internal accounts that match the specified filters. If no filters are provided, returns all internal accounts

        (paginated).


        Internal accounts are created automatically when a customer is created based on the platform configuration.

        '
      operationId: listCustomerInternalAccounts
      tags:
      - Internal Accounts
      security:
      - BasicAuth: []
      parameters:
      - name: currency
        in: query
        description: Filter by currency code
        required: false
        schema:
          type: string
      - name: customerId
        in: query
        description: Filter by internal accounts associated with a specific customer
        required: false
        schema:
          type: string
      - name: type
        in: query
        description: Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.
        required: false
        schema:
          $ref: '#/components/schemas/InternalAccountType'
      - name: limit
        in: query
        description: Maximum number of results to return (default 20, max 100)
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
      - name: cursor
        in: query
        description: Cursor for pagination (returned from previous request)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalAccountListResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '500':
          description: Internal service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
  /platform/internal-accounts:
    get:
      summary: List platform internal accounts
      description: 'Retrieve a list of all internal accounts that belong to the platform, as opposed to an individual customer.


        These accounts are created automatically when the platform is configured for each supported currency. They can be used for things like distributing bitcoin rewards to customers, or for other platform-wide purposes.

        '
      operationId: listPlatformInternalAccounts
      tags:
      - Internal Accounts
      security:
      - BasicAuth: []
      parameters:
      - name: currency
        in: query
        description: Filter by currency code
        required: false
        schema:
          type: string
      - name: type
        in: query
        description: Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.
        required: false
        schema:
          $ref: '#/components/schemas/InternalAccountType'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformInternalAccountListResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '500':
          description: Internal service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
  /internal-accounts/{id}:
    parameters:
    - name: id
      in: path
      description: The id of the internal account to update.
      required: true
      schema:
        type: string
      example: InternalAccount:019542f5-b3e7-1d02-0000-000000000002
    patch:
      summary: Update internal account
      description: 'Update mutable fields on an internal account. Today this supports updating the wallet privacy setting for an Embedded Wallet internal account.


        Updating wallet privacy is a two-step signed-retry flow:


        1. Call `PATCH /internal-accounts/{id}` with the request body `{ "privateEnabled": true }` and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.


        2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated internal account.

        '
      operationId: updateInternalAccount
      tags:
      - Internal Accounts
      security:
      - BasicAuth: []
      parameters:
      - name: Grid-Wallet-Signature
        in: header
        required: false
        description: Full API-key stamp built over the prior `payloadToSign` with the session API keypair of a verified authentication credential on the target internal account. Required on the signed retry; ignored on the initial call.
        schema:
          type: string
        example: eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9
      - name: Request-Id
        in: header
        required: false
        description: The `requestId` returned in a prior `202` response, echoed back on the signed retry so the server can correlate it with the issued challenge. Required on the signed retry; must be paired with `Grid-Wallet-Signature`.
        schema:
          type: string
        example: Request:019542f5-b3e7-1d02-0000-000000000010
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InternalAccountUpdateRequest'
            examples:
              updateWalletPrivacy:
                summary: Update wallet privacy request (both steps)
                value:
                  privateEnabled: true
      responses:
        '200':
          description: Signed retry accepted. Returns the updated internal account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalAccount'
              examples:
                enabled:
                  summary: Wallet privacy enabled
                  value:
                    id: InternalAccount:019542f5-b3e7-1d02-0000-000000000002
                    customerId: Customer:019542f5-b3e7-1d02-0000-000000000001
                    type: EMBEDDED_WALLET
                    status: ACTIVE
                    balance:
                      amount: 12550
                      currency:
                        code: USD
                        name: United States Dollar
                        symbol: $
                        decimals: 2
                    totalBalance:
                      amount: 12550
                      currency:
                        code: USD
                        name: United States Dollar
                        symbol: $
                        decimals: 2
                    fundingPaymentInstructions: []
                    privateEnabled: true
                    createdAt: '2026-04-08T15:30:00Z'
                    updatedAt: '2026-04-08T15:35:02Z'
        '202':
          description: Challenge issued. The response contains `payloadToSign` (which binds the submitted update fields) plus a `requestId`. Build an API-key stamp over `payloadToSign` with the session API keypair and echo `requestId` on the retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedRequestChallenge'
              examples:
                challenge:
                  summary: Internal account update challenge
                  value:
                    payloadToSign: '{"organizationId":"org_2m9F...","parameters":{"encoding":"PAYLOAD_ENCODING_HEXADECIMAL","hashFunction":"HASH_FUNCTION_NO_OP","payload":"9f3b...","signWith":"sp1q..."},"timestampMs":"1775681700000","type":"ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2"}'
                    requestId: Request:019542f5-b3e7-1d02-0000-000000000010
                    expiresAt: '2026-04-08T15:35:00Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized. Returned when the provided `Grid-Wallet-Signature` is missing, malformed, or does not match a pending internal account update challenge, when the `Request-Id` does not match an unexpired pending challenge, or when the retry body does not match the update fields bound into `payloadToSign` on the initial call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '404':
          description: Internal account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '500':
          description: Internal service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
  /internal-accounts/{id}/export:
    post:
      summary: Export internal account wallet credentials
      description: 'Export the wallet credentials of an Embedded Wallet internal account. The returned wallet credentials are HPKE-encrypted to the `clientPublicKey` supplied in the request body.


        Export is a two-step signed-retry flow (same pattern as add-additional credential, revoke credential, and revoke session):


        1. Call `POST /internal-accounts/{id}/export` with the request body `{ "clientPublicKey": "..." }` and no signature headers. Grid binds the `clientPublicKey` into the `payloadToSign` it returns, so the subsequent stamp in `Grid-Wallet-Signature` commits to the target encryption key. The response is `202` with `payloadToSign`, `requestId`, and `expiresAt`.


        2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the **same** `clientPublicKey` submitted in step 1 — Grid rejects the retry with `401` if it disagrees with what was bound into `payloadToSign`. The signed retry returns `200` with `encryptedWalletCredentials`, which the client decrypts with the matching private key.


        The `clientPublicKey` is ephemeral: generate a fresh P-256 keypair for this export and discard the private key after decrypting. Do not reuse the keypair from any prior verify call — that private key was already discarded after decrypting the session signing key it was issued against.

        '
      operationId: exportInternalAccount
      tags:
      - Internal Accounts
      security:
      - BasicAuth: []
      parameters:
      - name: id
        in: path
        description: The id of the internal account to export.
        required: true
        schema:
          type: string
      - name: Grid-Wallet-Signature
        in: header
        required: false
        description: Full API-key stamp built over the prior `payloadToSign` with the session API keypair of a verified authentication credential on the target internal account. Required on the signed retry; ignored on the initial call.
        schema:
          type: string
        example: eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9
      - name: Request-Id
        in: header
        required: false
        description: The `requestId` returned in a prior `202` response, echoed back exactly on the signed retry so the server can correlate it with the issued challenge. Required on the signed retry; must be paired with `Grid-Wallet-Signature`.
        schema:
          type: string
        example: Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InternalAccountExportRequest'
            examples:
              export:
                summary: Export request (both steps)
                value:
                  clientPublicKey: 04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2
      responses:
        '200':
          description: Signed retry accepted. Returns the encrypted wallet credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalAccountExportResponse'
        '202':
          description: Challenge issued. The response contains `payloadToSign` (which binds the submitted `clientPublicKey`) plus a `requestId`. Build an API-key stamp over `payloadToSign` with the session API keypair and echo `requestId` on the retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedRequestChallenge'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized. Returned when the provided `Grid-Wallet-Signature` is missing, malformed, or does not match a pending export challenge for this internal account, when the `Request-Id` does not match an unexpired pending challenge, or when the retry's `clientPublicKey` does not match the one bound into `payloadToSign` on the initial call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '404':
          description: Internal account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '500':
          description: Internal service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
components:
  schemas:
    InternalAccountExportResponse:
      title: Internal Account Export Response
      type: object
      required:
      - id
      - encryptedWalletCredentials
      properties:
        id:
          type: string
          description: The id of the internal account that was exported.
          example: InternalAccount:019542f5-b3e7-1d02-0000-000000000002
        encryptedWalletCredentials:
          type: string
          description: 'Encrypted wallet mnemonic, sealed to the `clientPublicKey` from the request body using HPKE: DHKEM(P-256, HKDF-SHA256) + HKDF-SHA256 + AES-256-GCM. Decrypt with the matching private key, then manage the mnemonic securely because it is the master key of the self-custodial Embedded Wallet.

            The value is a JSON string of the form `{"version": "v1.0.0", "data": "<hex>", "dataSignature": "<hex>", "enclaveQuorumPublic": "<hex>"}`. `data` hex-decodes to JSON `{"encappedPublic": "<hex>", "ciphertext": "<hex>", "organizationId": "<id>"}`, where `encappedPublic` is the uncompressed SEC1 ephemeral public key. `dataSignature` is an ECDSA-P256-SHA256 signature over the `data` bytes produced by the issuer key in `enclaveQuorumPublic`; verify before decrypting.

            In sandbox, `dataSignature` and `enclaveQuorumPublic` are empty strings. Clients should bypass attestation verification when calling against sandbox.'
          example: '{"version":"v1.0.0","data":"7b22656e6361707065645075626c6963223a22303433...","dataSignature":"3045022100c9...","enclaveQuorumPublic":"04a1b2c3..."}'
    PaymentEmbeddedWalletInfo:
      title: Embedded Wallet
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - type: object
        required:
        - accountType
        - payloadToSign
        properties:
          accountType:
            type: string
            enum:
            - EMBEDDED_WALLET
            description: Discriminator value identifying this as Embedded Wallet payment instructions.
          payloadToSign:
            type: string
            description: JSON-encoded transaction signing payload that must be stamped, as-is (byte-for-byte, without re-serialization), with the session private key of a verified authentication credential on the source Embedded Wallet. The resulting Grid wallet signature is passed as the `Grid-Wallet-Signature` header on `POST /quotes/{quoteId}/execute` to authorize the outbound transfer from the wallet.
            example: '{"type":"ACTIVITY_TYPE_SIGN_TRANSACTION_V2","timestampMs":"1746736509954","organizationId":"org_abc123","parameters":{"signWith":"wallet_abc123def456","unsignedTransaction":"ea69b4bf05f775209f26ff0a34a05569180f7936579d5c4af9377ae550194f72","type":"TRANSACTION_TYPE_ETHEREUM"},"generateAppProofs":true}'
    EurAccountInfoBase:
      type: object
      required:
      - accountType
      - iban
      properties:
        accountType:
          type: string
          enum:
          - EUR_ACCOUNT
        iban:
          type: string
          description: The IBAN of the bank account
          example: DE89370400440532013000
          minLength: 15
          maxLength: 34
          pattern: ^[A-Z]{2}[0-9]{2}[A-Za-z0-9]{11,30}$
        swiftCode:
          type: string
          description: The SWIFT/BIC code of the bank
          example: DEUTDEFF
          minLength: 8
          maxLength: 11
          pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$
      example:
        accountType: EUR_ACCOUNT
        iban: DE89370400440532013000
        swiftCode: DEUTDEFF
    PaymentBwpAccountInfo:
      title: BWP Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/BwpAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    PaymentSlvAccountInfo:
      title: SLV Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/SlvAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    PaymentVndAccountInfo:
      title: VND Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/VndAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    TzsAccountInfo:
      allOf:
      - $ref: '#/components/schemas/TzsAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - MOBILE_MONEY
    PaymentBrlAccountInfo:
      title: BRL Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - type: object
        required:
        - qrCode
        properties:
          accountType:
            type: string
            enum:
            - BRL_ACCOUNT
          qrCode:
            type: string
            description: A PIX QR code payload that can be used to fund the transaction. This can be rendered as a QR code image or pasted into a PIX-compatible banking app.
            minLength: 1
    PaymentJmdAccountInfo:
      title: JMD Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/JmdAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    PaymentHkdAccountInfo:
      title: HKD Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/HkdAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    Error404:
      type: object
      required:
      - message
      - status
      - code
      properties:
        status:
          type: integer
          enum:
          - 404
          description: HTTP status code
        code:
          type: string
          description: '| Error Code | Description |

            |------------|-------------|

            | TRANSACTION_NOT_FOUND | Transaction not found |

            | INVITATION_NOT_FOUND | Invitation not found |

            | USER_NOT_FOUND | Customer not found |

            | QUOTE_NOT_FOUND | Quote not found |

            | LOOKUP_REQUEST_NOT_FOUND | Lookup request not found |

            | TOKEN_NOT_FOUND | Token not found |

            | BULK_UPLOAD_JOB_NOT_FOUND | Bulk upload job not found |

            | REFERENCE_NOT_FOUND | Reference not found |

            | UMA_NOT_FOUND | The UMA address is well-formed but no receiver exists at the counterparty VASP |

            | STABLECOIN_PROVIDER_ACCOUNT_NOT_FOUND | Stablecoin provider account link not found |

            '
          enum:
          - TRANSACTION_NOT_FOUND
          - INVITATION_NOT_FOUND
          - USER_NOT_FOUND
          - QUOTE_NOT_FOUND
          - LOOKUP_REQUEST_NOT_FOUND
          - TOKEN_NOT_FOUND
          - BULK_UPLOAD_JOB_NOT_FOUND
          - REFERENCE_NOT_FOUND
          - UMA_NOT_FOUND
          - STABLECOIN_PROVIDER_ACCOUNT_NOT_FOUND
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Additional error details
          additionalProperties: true
    InrAccountInfo:
      allOf:
      - $ref: '#/components/schemas/InrAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - UPI
              - NEFT
              - RTGS
    GtqAccountInfoBase:
      type: object
      required:
      - accountType
      - accountNumber
      - bankAccountType
      - bankName
      properties:
        accountType:
          type: string
          enum:
          - GTQ_ACCOUNT
        accountNumber:
          type: string
          description: The account number of the bank
          minLength: 1
          maxLength: 34
        bankAccountType:
          type: string
          description: The bank account type
          enum:
          - CHECKING
          - SAVINGS
        bankName:
          type: string
          description: The name of the beneficiary's bank
          minLength: 1
          maxLength: 255
      example:
        accountType: GTQ_ACCOUNT
        accountNumber: '1234567890'
        bankAccountType: CHECKING
        bankName: Example Bank
    CadAccountInfoBase:
      type: object
      required:
      - accountType
      - bankCode
      - branchCode
      - accountNumber
      properties:
        accountType:
          type: string
          enum:
          - CAD_ACCOUNT
        bankCode:
          type: string
          description: Canadian financial institution number (3 digits)
          example: '001'
          minLength: 3
          maxLength: 3
          pattern: ^[0-9]{3}$
        branchCode:
          type: string
          description: Transit number identifying the branch (5 digits)
          example: '00012'
          minLength: 5
          maxLength: 5
          pattern: ^[0-9]{5}$
        accountNumber:
          type: string
          description: Bank account number (7-12 digits)
          example: '1234567'
          minLength: 7
          maxLength: 12
          pattern: ^[0-9]{7,12}$
    EgpAccountInfo:
      allOf:
      - $ref: '#/components/schemas/EgpAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - BANK_TRANSFER
              - MOBILE_MONEY
    PaymentNgnAccountInfo:
      title: NGN Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/NgnAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    PaymentHtgAccountInfo:
      title: HTG Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/HtgAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    BaseWalletInfo:
      type: object
      required:
      - address
      - accountType
      properties:
        accountType:
          type: string
          enum:
          - BASE_WALLET
        address:
          type: string
          description: Base eth wallet address
          example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12'
    PaymentEgpAccountInfo:
      title: EGP Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/EgpAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: Unique reference code that must be included with the payment to properly credit it
            example: UMA-Q12345-REF
    GbpAccountInfoBase:
      type: object
      required:
      - accountType
      - sortCode
      - accountNumber
      properties:
        accountType:
          type: string
          enum:
          - GBP_ACCOUNT
        sortCode:
          type: string
          description: The UK sort code
          example: '123456'
          minLength: 6
          maxLength: 6
          pattern: ^[0-9]{6}$
        accountNumber:
          type: string
          description: UK bank account number (8 digits)
          minLength: 8
          maxLength: 8
          example: '12345678'
          pattern: ^[0-9]{8}$
      example:
        accountType: GBP_ACCOUNT
        sortCode: '123456'
        accountNumber: '12345678'
    PaymentSparkWalletInfo:
      title: Spark Wallet
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/SparkWalletInfo'
      - type: object
        required:
        - assetType
        properties:
          assetType:
            type: string
            description: Type of asset or configured Spark token currency code
          invoice:
            type: string
            description: Invoice for the payment
            example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s
    ThbAccountInfo:
      allOf:
      - $ref: '#/components/schemas/ThbAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - BANK_TRANSFER
    MwkAccountInfo:
      allOf:
      - $ref: '#/components/schemas/MwkAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - MOBILE_MONEY
    SignedRequestChallenge:
      title: Signed Request Challenge
      type: object
      required:
      - payloadToSign
      - requestId
      - expiresAt
      description: Common base for two-step signed-retry challenge responses on Embedded Wallet endpoints (credential registration or revocation, session refresh or revocation, wallet export, customer email updates, and similar). Holds the signing fields shared across every challenge shape; each variant composes this base via `allOf` and adds its own resource `id` (and `type`, when applicable) with variant-specific description and example.
      properties:
        payloadToSign:
          type: string
          description: Canonical payload for the retry authorization stamp. Build an API-key stamp over this exact value with the session API keypair, then send the full base64url-encoded stamp in `Grid-Wallet-Signature` on the retry that completes the original request.
          example: '{"organizationId":"org_2m9F...","parameters":{"userId":"user_2m9F..."},"timestampMs":"1775681700000","type":"ACTIVITY_TYPE_EXAMPLE"}'
        requestId:
          type: string
          description: Grid-issued `Request:<uuid>` identifier for this pending request. Echo this value exactly in the `Request-Id` header on the signed retry so the server can correlate the retry with the issued challenge.
          example: Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21
        expiresAt:
          type: string
          format: date-time
          description: Timestamp after which this challenge is no longer valid. The signed retry must be submitted before this time.
          example: '2026-04-08T15:35:00Z'
    XafAccountInfo:
      allOf:
      - $ref: '#/components/schemas/XafAccountInfoBase'
      - type: object
        required:
        - paymentRails
        properties:
          paymentRails:
            type: array
            items:
              type: string
              enum:
              - MOBILE_MONEY
    PaymentPhpAccountInfo:
      title: PHP Account
      allOf:
      - $ref: '#/components/schemas/BasePaymentAccountInfo'
      - $ref: '#/components/schemas/PhpAccountInfo'
      - type: object
        required:
        - reference
        properties:
          reference:
            type: string
            description: 

# --- truncated at 32 KB (110 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lightspark/refs/heads/main/openapi/lightspark-internal-accounts-api-openapi.yml