Skip to main content
Autopay lets Tirdad charge a customer’s saved card whenever a new invoice is due, without any action from the customer. The card is captured once through the Tirdad checkout page, stored as a payment method, and reused for all subsequent invoice payments.
Autopay requires an active Moyasar connection with a valid Secret Key, Publishable Key, and Webhook Secret. See Moyasar Connection Setup before proceeding.

How it Works

1

Setup intent is created

Tirdad creates a payment record to track the card save attempt and returns a secure checkout URL.
2

Customer enters card details

The customer is redirected to the Tirdad checkout page and enters their card number, expiry, and CVC.
3

Card verified

Tirdad runs a 1 SAR verification charge to confirm the card is valid. Once confirmed, the charge is voided immediately. If the void fails, Tirdad issues a refund automatically. The customer is not charged.
4

Card saved

Tirdad receives confirmation, extracts the reusable card token, and saves it as an active payment method linked to the customer.
5

Invoices charged automatically

When a new invoice is generated for the customer, Tirdad charges the saved card directly. No redirect or manual payment step is required.

Setting Up Autopay for a Customer

Using the Tirdad Dashboard

1

Open the customer detail page

Go to Billing → Customers and select the customer.
2

Create a setup intent

In the Integrations section, locate the Moyasar entry and click Setup Autopay.
Setup Autopay button on the customer page
Tirdad opens the checkout page in the current tab. The customer sees a card entry form.

Using the API

Request body:
Response:
Redirect the customer to checkout_url. The JWT embedded in the URL expires after 2 hours.

Card Entry

The customer is taken to the Tirdad checkout page where they enter their card details.
Tirdad card entry form
If the card issuer requires 3DS authentication, the customer is redirected to their bank’s verification page and returned automatically after completing it.
3DS verification screen

Payment Tracking

Every autopay attempt is tracked as a payment record in Tirdad from the moment the setup intent is created. Each invoice charge attempt also creates its own record, so you can see exactly which invoices were collected automatically.

Payment Status


Automatic Invoice Charging

Once a customer has a saved payment method, Tirdad charges it automatically when a new invoice is generated.
1

Invoice is generated

A new invoice is created for the customer.
2

Payment method lookup

Tirdad looks for the customer’s default saved payment method. If no default is set, the most recently added active payment method is used.
3

Card charged

If a valid saved method is found, Tirdad creates a charge request using the stored token. The customer does not need to take any action.
4

Fallback

If no active saved payment method exists, Tirdad falls back to the invoice-link flow. See Moyasar Invoice Synchronization.
5

Invoice marked paid

When the charge is confirmed, Tirdad marks the invoice as PAID.

Troubleshooting