Skip to main content
Migo Docs

Recurring Payments Overview

Migo's recurring engine is built around three entities:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” subscribes β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” charges β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Plan │─────────────►│ Subscription │──────────►│ Charge β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ amount β”‚ β”‚ client β”‚ β”‚ amount β”‚
β”‚ period β”‚ β”‚ cardId β”‚ β”‚ state β”‚
β”‚ trial β”‚ β”‚ status β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • A Plan defines the money: how much, how often, with or without a trial.
  • A Subscription binds a plan to a client (cardholder) and a default payment method.
  • A Charge is a single billing event β€” automatic (scheduled) or manual (on-demand).

What gets charged when​

EventTriggered byEndpoint
Subscription creationPOST /v1/subscriptions/verify-card with shouldCreateSubscription: true (tied to an existing transaction)Internal
Scheduled chargeMigo crons at the plan's cadenceAutomatic
On-demand chargeYou call POST /v1/subscriptions/charges (batch intake)Manual, async
Bulk chargesYou call POST /v1/subscriptions/charges/upload-csvManual, async

All Middleware API endpoints​

EndpointPurpose
POST /v1/plansCreate a plan
PUT /v1/plansUpdate a plan
GET /v1/plans/listList plans
GET /v1/plans/{planId}/client/{client}/detailPlan details for a specific client
PUT /v1/subscriptionsUpdate a subscription's notification email
GET /v1/subscriptionsList subscriptions (requires userId + clientId)
GET /v1/subscriptions/detail/{subUid}Detail by subscription id
DELETE /v1/subscriptions/{subUid}Cancel a subscription
POST /v1/subscriptions/payment-methodsAdd a payment method
DELETE /v1/subscriptions/payment-methodsRemove a payment method
PUT /v1/subscriptions/payment-methods/set-defaultChange default card
POST /v1/subscriptions/verify-cardVerify a card (and optionally create a subscription)
GET /v1/subscriptions/payment-historyCharge history
POST /v1/subscriptions/chargesOn-demand charge (batch intake)
POST /v1/subscriptions/charges/upload-csvBulk charges

All calls require Authorization: Bearer <middleware-jwt> β€” see Authentication.