Subscriptions
Create, retrieve and cancel subscriptions, and mint card-update links. Retries and customer emails are handled for you.
A Subscription represents a recurring agreement to charge a customer on a fixed interval. The lifecycle moves through created → pending → active → past_due → cancelled — see Concepts → Subscriptions for the full state machine and the retry schedule.
Create a subscription
Create a subscription.
Authentication: Basic Auth (public_key:secret_key) with merchant role.
In: header
Response Body
application/json
application/json
curl -X POST "https://sandbox.mintcash.me/subscriptions" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "billingIntervalDays": 0, "currency": "string", "externalId": "string" }'{
"amount": 0,
"billingIntervalDays": 0,
"createdAt": "string",
"currency": "string",
"currentPeriodEnd": "string",
"currentPeriodStart": "string",
"externalId": "string",
"id": "string",
"phases": [
{
"amount": 0,
"billingIntervalDays": 0,
"id": "string",
"iterations": 0,
"name": "string",
"order": 0
}
],
"redirectUrl": "string",
"status": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}Retrieve a subscription
Get a subscription by ID.
Authentication: Basic Auth (public_key:secret_key) with merchant role.
In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://sandbox.mintcash.me/subscriptions/string"{
"amount": 0,
"billingIntervalDays": 0,
"createdAt": "string",
"currency": "string",
"currentPeriodEnd": "string",
"currentPeriodStart": "string",
"externalId": "string",
"id": "string",
"phases": [
{
"amount": 0,
"billingIntervalDays": 0,
"id": "string",
"iterations": 0,
"name": "string",
"order": 0
}
],
"redirectUrl": "string",
"status": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}Update the card on a subscription
Returns a URL where the customer enters a new card, which then becomes the one every future renewal bills. The subscription must be active or past_due; any other status is rejected with 400.
past_due— the new card pays the failed renewal, and the subscription returns toactive. You receivesubscription.succeededandsubscription.payment_method_updated.active— the card is checked with the customer's bank and nothing is charged. Once it is confirmed you receivesubscription.payment_method_updated. This is enabled per merchant; until it is, the call is rejected with400. The optionalproviderpicks the route the card is checked on.
mode picks the surface: hosted for a self-contained page you send the customer, embedded (the default) for the bare card form to put in a page of your own.
Links last 7 days — though an embedded URL is a checkout session that expires after 15 minutes, so call again for a fresh one. On past_due, an invoice accepts at most 5 submitted cards across every link it has, the ones in dunning emails included, and handing out a link does not pause the retry schedule. On active, a subscription accepts at most 5 cards in any 24 hours. See Guides → Update a card on a subscription for the full behaviour and limits.
Update the card a subscription bills.
Returns a URL where the customer enters a new card. What happens next depends on the subscription:
- past_due — the new card pays the failed renewal. The customer is charged the invoice's amount, the subscription returns to active, and the card bills future renewals. MintCash sends subscription.succeeded and subscription.payment_method_updated. Reach for it when a customer tells you their card is dead, instead of waiting for the next dunning email. - active — the card is checked with the customer's bank and nothing is charged. Once it is confirmed, renewals bill the new card and MintCash sends subscription.payment_method_updated. This is enabled per merchant, and not every payment route supports it yet.
Either way the card that was replaced is left alone rather than deleted: payment methods are shared across a customer's other subscriptions and saved-card charges.
Modes. hosted returns a self-contained page to send the customer as-is; embedded — the default — returns the bare checkout form to embed in a page of your own.
Limits. A link stops working after 7 days. hosted hands back that link, so its URL lasts as long; embedded hands back a checkout session, whose URL expires after 15 minutes — call again for a fresh one. On a past_due subscription at most 5 cards may be submitted across every link on the failed invoice, the ones in dunning emails included; on an active one, at most 5 in any 24 hours. Opening a link costs nothing, only a submitted card counts. Calling twice in embedded mode re-serves the same link and checkout session, so a double-click cannot charge twice. Card only: Apple Pay and Google Pay are hidden, since a wallet sale leaves no token renewals could bill.
It does not pause dunning. On a past_due subscription, scheduled retries keep running on the old card while a link is live, and a failed attempt does not advance the ladder. Whichever charge settles the invoice first wins; a second success on the same invoice is flagged for refund.
Authentication: Basic Auth (public_key:secret_key) with merchant role.
In: header
Path Parameters
hosted is a self-contained page to send the customer as-is; embedded is the bare card form to put in a page of your own.
card on. The value your payment routing scheme reads from metadata.provider. Defaults to the subscription's own metadata.provider, then to the acquirer that last took a payment for it. The new card is bound to that route, so later renewals bill through it. Ignored on past_due, where the card pays the renewal as any payment does.
On embedded this is checkout's own return URL — the customer is sent there after the attempt, with paymentId appended. On hosted the recovery page keeps the customer on our side through the result and offers this as the way back to you, so a link without it simply has no return button.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://sandbox.mintcash.me/subscriptions/string/card-update" \ -H "Content-Type: application/json" \ -d '{}'{
"mode": "string",
"url": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}Cancel a subscription
Cancellation is immediate and irreversible. Pending invoices are not charged.
Cancel an active or past_due subscription.
Cancellation is immediate. The subscription will not renew. The current period remains valid (no prorated refund at MVP).
Authentication: Basic Auth (public_key:secret_key) with merchant role.
In: header
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X DELETE "https://sandbox.mintcash.me/subscriptions/string"{
"amount": 0,
"billingIntervalDays": 0,
"createdAt": "string",
"currency": "string",
"currentPeriodEnd": "string",
"currentPeriodStart": "string",
"externalId": "string",
"id": "string",
"phases": [
{
"amount": 0,
"billingIntervalDays": 0,
"id": "string",
"iterations": 0,
"name": "string",
"order": 0
}
],
"redirectUrl": "string",
"status": "string"
}{
"code": "not_found",
"details": {},
"message": "string"
}