createInvoice

fun createInvoice(apiVersion: String, invoice: Invoice, uuid: String, productSubscriptionKey: String, environment: String): ERROR CLASS: Symbol not found for Flow<io/rekast/sdk/repository/data/NetworkResult<kotlin/Unit>>

Creates a Collection invoice, prompting the intended payer to approve payment from their wallet.

Poll getInvoiceStatus with the same uuid as the reference ID to check whether the invoice has been paid. The invoice expires after the duration specified in Invoice.validityDuration.

Return

A Flow emitting a NetworkResult with an empty Unit body on success (HTTP 202).

Parameters

apiVersion

The version of the API to use.

invoice

The invoice payload containing amount, currency, and optional payer details.

uuid

A UUID V4 used as the X-Reference-Id; reuse this same ID when calling getInvoiceStatus.

productSubscriptionKey

The subscription key for the Collection product.

environment

The target environment (e.g., sandbox or production).