Create a payment
curl --location --globoff 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"clientRequestId":"string","date":"string","amount":0,"creditorAccount":{"holder":{}},"autoRetryStrategy":{"skipWeekend":false,"days":[1,2,3]}}'Auto Retry Strategy The auto retry strategy is introduced to simplify client integration and reduce the need for manual retry handling. When autoRetryStrategy is provided in the API request: Klavi will automatically perform retries based on the configured strategy within the current billing cycle. Any retry API calls initiated by the partner will be rejected. Example: Using Auto Retry Strategy 1. Retry Settlement on first, second and third days of the available window, including if it’s weekends. Settlement date: 05/March (Thursday) Retry settlement dates: 06/March (Friday), 07/March (Saturday), 08/March (Sunday) autoRetryStrategy: { "skipWeekend": false, "days": [1,2,3] } 2. Retry Settlement on first, second and third days of the available window, excluding if it’s weekends. Settlement date: 05/March (Thursday) Retry settlement dates: 06/March (Friday), 09/March (Monday), 10/March (Tuesday) autoRetryStrategy: { "skipWeekend": true, "days": [1,2,3] }
Re-creation Scenarios Description
You can obtain the status of the original payment, along with the status reason code for abnormal status, from both synchronous API responses and asynchronous events. If you want to continue with the current billing cycle, the following describes the scenarios in which re-creation of the original payment is needed:
- The status of the original payment is ERROR or CANCELED.
- The status of the original payment is PAYMENT_REJECTED and the status reason code is one of the following:
- INVALID_ATTEMPT_DETAIL(The parameter(s) provided for the new payment attempt do not match the original failed payment and are not allowed in the new payment attempt.)
- INVALID_VALUE(The amount provided is not valid for the consent associated with the payment.)
- DIFFERENT_PAYMENT_CONSENT(Payment data differs from the consent data.)
Terminal Exception Scenarios Description
In this scenario, the failed original payment already counts as a payment for that cycle. Neither re-creating the original payment nor retrying the payment is allowed. That is the original payment status is PAYMENT_REJECTED, and the status reason code is one of the following:
- INFRASTRUCTURE_HOLDER_FAILURE(Indicates a failure in the infrastructure of the institution.)
- TRANSACTION_CONSENT_VALUE_LIMIT_EXCEEDED(The transaction amount exceeds the per-transaction limit defined in the consent.)
We recommend that you contact the customer and charge them in some other way.