createInvoice

@POST(value = "/collection/{apiVersion}/invoice")
abstract suspend fun createInvoice(@Body invoice: Invoice, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String, @Header(value = "X-Reference-Id") uuid: String): Response<Unit>

Creates a Collection invoice, prompting the Invoice.intendedPayer to pay via their wallet.

The invoice expires after Invoice.validityDuration seconds. Poll getInvoiceStatus using the same uuid as the reference ID to check whether payment has been completed.

Return

A Response with an empty body; HTTP 202 indicates the invoice was accepted.

Parameters

invoice

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

apiVersion

The API version to target (e.g., v1_0 or v2_0).

productSubscriptionKey

The Ocp-Apim-Subscription-Key for the Collection product.

environment

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

uuid

A UUID V4 used as the X-Reference-Id; use this same ID to query the invoice status.