createPreApproval

@POST(value = "/collection/{apiVersion}/preapproval")
abstract suspend fun createPreApproval(@Body preApproval: PreApproval, @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 pre-approval, allowing the merchant to charge the PreApproval.payer's wallet without per-transaction prompts until the pre-approval expires.

Return

A Response with an empty body; HTTP 202 indicates the pre-approval was accepted.

Parameters

preApproval

The pre-approval payload containing the payer, currency, and validity.

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 pre-approval status.