Skip to main content

Recurring and authorizations

Recurrence charges repeat on a schedule; preauthorization holds funds before capture or void. Amounts remain in minor units everywhere.
This section covers:
  • recurring payment creation and cancellation
  • preauthorization capture (full/partial)
  • authorization void

Create recurrence

import { Currency } from 'gopay-sdk';

const recurrence = await client.createRecurrence(paymentId, {
  amount: 9900,
  currency: Currency.CZK,
  order_number: 'REC-2026-0001',
  order_description: 'Monthly subscription charge',
  items: [
    {
      type: 'ITEM',
      name: 'Pro subscription',
      amount: 9900,
      count: 1,
    },
  ],
});

Void recurrence

await client.voidRecurrence(paymentId);

Capture full authorization

await client.captureAuthorization(paymentId);

Capture partial authorization

await client.captureAuthorizationPartial(paymentId, {
  amount: 4900,
  items: [
    {
      type: 'ITEM',
      name: 'Partially shipped item',
      amount: 4900,
      count: 1,
    },
  ],
});

Void authorization

await client.voidAuthorization(paymentId);

Card operations

Get card details

const card = await client.getCardDetails(cardId);
console.log(card.card_brand, card.status);

Delete card

await client.deleteCard(cardId);
deleteCard expects 204 No Content from the API on success.