Skip to main content
Migo Docs

Scheduled Charges

Migo bills active subscriptions automatically when they fall due. You don't need to do anything β€” just handle fulfillment / access control.

Cadence​

The charge cron runs every 12 hours. Each run selects subscriptions whose nextRenewalDate falls within the current day in the client timezone (default America/Guatemala).

Charge flow​

[cron, every 12h] ──► for each due subscription:
1. Load default payment method
2. Charge through the processor
3. If succeeded: advance the next renewal date
4. If failed: enter the retry schedule (see below)

Retry schedule​

Retries are configured per plan, not on a fixed global schedule:

  • dailyAttempts β€” number of charge attempts.
  • intervalAttempt β€” time between attempts (default 24 hours).
  • graceDays β€” optional grace window before the subscription is considered failed.

Once the attempts are exhausted, the subscription transitions to inactive.

There is no fixed 3-day / 5-day / 7-day schedule and no metadata.retryPolicy override.

View payment history​

GET /v1/subscriptions/payment-history requires the subscriptionId query parameter (returns 400 if missing). It does not support limit or page.

curl "https://mw.migopayments.com/v1/subscriptions/payment-history?subscriptionId=sub_01HAAA" \
-H "Authorization: Bearer <middleware-jwt>"

Response β€” data is a flat array of formatted transactions:

{
"success": true,
"message": "Payment history found",
"data": [ ]
}

There is no paginated { items, total, page, limit } envelope.

3-D Secure on scheduled charges​

Recurring charges run without an interactive cardholder, so the cron sets the transaction's modKeys['3ds'] = false. A 3DS challenge is only triggered when the client/processor configuration has 3DS enabled and the transaction is in progress. There is no threeDsChallenge: "skip" parameter and no "merchant-initiated credential" concept in code.

Notifications​

The subscription/cron flow sends email notifications (e.g. subPayProblem, subscriptionSuspended) and a merchant callback (subsCallback) rather than a public outbound webhook contract. See Subscriptions β†’ Notifications.