Skip to content

Two-step payments

With two-step payments, initPayment only approves the amount — it is held on the payer’s card but not charged. You then deposit it with confirmPayment or release it with cancelPayment. This suits orders you can only fulfil after checking stock.

two-step.ts
import { ameria } from "./client.js";
// With two-step payments enabled on your account, initPayment only
// approves (holds) the amount. Later you either deposit it...
await ameria.confirmPayment("PAYMENT-ID", 10);
// ...or release the hold.
await ameria.cancelPayment("PAYMENT-ID");

You can confirm less than the approved amount.

Two-step is a setting on your API client, not a request option:

  • Test: ask Ameriabank’s technical support to switch your test client to two-step.
  • Production: send an application through Ameriabank’s mobile or internet banking.