Skip to main content
Migo Docs

Payment methods

Every subscription has a default card and, optionally, other registered cards. Charges try the default first and, if it fails, walk the rest.

The card is stored automatically when your customer pays the payment link β€” you never have to register or see it.

Every route on this page uses Authorization: Bearer <your-merchant-token>.

Change the default card​

curl -X PUT https://sb-mw.migopayments.com/api/v1/subscriptions/payment-methods/set-default \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"userId": "<userId>",
"clientId": "<clientId>",
"subscriptionId": "sub_000001",
"paymentMethodId": "<payment-method-id>"
}'

All four fields are mandatory.

Delete a payment method​

Requires both query parameters, methodId and subId (400 if either is missing):

curl -X DELETE "https://sb-mw.migopayments.com/api/v1/subscriptions/payment-methods?methodId=<id>&subId=sub_000001" \
-H "Authorization: Bearer <token>"
warning

You cannot delete the default card of an active subscription. Set another one as default first, then delete the old one.

Expiring cards​

The engine emails the cardholder before their card expires. The lead time is configured per plan with daysNotifyExpiringCard.

There is no automatic card updater

Migo does not rotate the number or expiry date for you (no Account Updater). When a card expires the charge fails, retries are exhausted and the subscription becomes inactive. Recovery means your customer pays a new link.

Verify a card​

Only for PCI-scoped integrations

If you charge with your own card form instead of the hosted checkout, the card is verified with POST /api/v1/subscriptions/verify-card, tied to an existing transaction. It requires transactionUid, processor and cardInfo; it tokenizes the card, pre-authorizes it, reverses that authorization and β€” with shouldCreateSubscription: true and planUid β€” creates the subscription.

If you use the payment link, you don't need this endpoint: the hosted checkout already does all of it.

curl -X POST https://sb-mw.migopayments.com/api/v1/subscriptions/verify-card \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"uid": "<transaction-uid>",
"processor": "<processor-slug>",
"cardInfo": { "...": "card data tokenized by the processor" },
"shouldCreateSubscription": true,
"planUid": "<plan-uid>"
}'

There is also POST /api/v1/subscriptions/payment-methods, normally invoked internally after verify-card, with the card data nested under tokenizeData.