ROKIConnect
Connectors Start API SDKs Migrate MCP Portal ES
DocumentationAutomatic debit - enrolling a card

Automatic debit - enrolling a card

Same flow as the merchant portal's automatic debit: ROKI charges 1.00 HNL with 3-D Secure, voids it, and saves the card (pm_* plus the signed agreement) only if the processor returns a PAN token.

Read this before using the API route. POST /automatic-debit/authorizations takes card_pan, card_expiry_month, card_expiry_year and card_cvv in your backend's request. That is the one Connect route where card data passes through the merchant's server, and it puts that server in PCI scope for card data - unlike every mode in this guide. If you can, share the merchant's hosted enrolment page (https://aura.roki.systems/automatic-debit/{merchant-slug}) instead: the card is entered on ROKI, and the pm_* appears under Connect -> Automatic Debit -> Authorizations.

Verified 2026-10-28 on a merchant with no agreement template: GET /automatic-debit/agreement answers 200 with ready: false, template: null and a message; enrolment answers 422 automatic_debit_not_configured - before the Idempotency-Key check; an unknown enrolment id answers 422 automatic_debit_authorization_not_found (not 404). An enrolment itself was not run.

The flow:

  1. GET /automatic-debit/agreement - ready, scopes (all, subscriptions, recurring, subscriptions_and_recurring) and template.terms_text (HTML, localized by Accept-Language). Show the terms before enrolling.
  2. POST /automatic-debit/authorizations with Idempotency-Key and customer (name, email, identification_type, identity_number, optional phone), internal_reference (the contract or account number, as in the portal), the card fields, scope, optional cap_per_charge, terms_accepted: true, optional signature (PNG data-URL) and optional HTTPS success_url / cancel_url.
  3. The answer is status: "requires_action" with a signed, expiring authentication_url: redirect the customer there for 3-D Secure.
  4. GET /automatic-debit/authorizations/{id}: succeeded (has payment_method_id), incomplete (3DS and void succeeded but no PAN token - do not charge), failed, or still requires_action.

The pm_* it produces is what recurring arrangements (26) charge.