Saved Cards & Recurring

Save a buyer's card as a token to charge it again later, on its own or on a schedule with subscriptions. Step-by-step guides: Save a card and charge it later and Build recurring billing with subscriptions.

Endpoint reference: Generate, Pay, Cancel, Pause, Resume, Update Price, List Subscriptions. Statuses: Subscription Statuses.

How charging works

Failed charges and retries

Subscription callbacks

Set sub_callback_url on generate-subscription. If it is empty, the account's default callback URL is used (the same merchant_callback_url that serves as the fallback for sale callbacks).

Tokens and buyer_key

Common flows

Charge now, then monthly, without a double charge. Capture the card once (capture_buyer), charge the first payment as a one-off sale with that buyer_key, then call generate-subscription with the same buyer_key and sub_start_date in the next period. A future sub_start_date means no subscription charge before then.

Changing the price. set-price changes future charges only. It does not touch sub_next_date, sub_start_date, sub_prev_date, the iteration counters or the status, charges nothing, and sends the buyer an information email. The billing day stays anchored to sub_start_date.

Mid-cycle upgrade. There is no built-in proration. Compute the difference ((new price minus old price) times days left divided by cycle length), charge it once with generate-sale and the existing buyer_key, then call set-price with the new price; the next cycle charges the full new price on the same billing day. Do not cancel and re-create the subscription: that resets sub_start_date and the counters.

Changing the card. There is no buyer_key swap and no endpoint for an active subscription. While the status is initial, failed or failed-retry, replace the card by paying the subscription again with a new payment method: PATCH /api/subscriptions/{sub_payme_id} with a payment object, or pay-subscription with sub_payme_id. This creates a new buyer token and attaches it.

Joining a subscription link after its start date. Nothing is charged retroactively. The first charge moves into the current period: daily today; weekly the same weekday this week; monthly the same day this month (capped at the month's length); yearly the same day and month this year. A start date still in the future is kept.

Cancelling. End customers have no self-cancel link: the seller cancels, in the dashboard or with cancel-subscription. The seller receives an email when a subscription is cancelled (by hand or automatically), on every successful charge and when it completes, subject to the account's notification settings.

Your own reference: subscription_id

subscription_id is your free-form reference (max 50 characters, alphanumeric). It is not enforced unique: a repeated value on generate-subscription creates a second subscription and is neither rejected nor returned as "existing", so de-duplicate on your side. get-subscriptions accepts it as a filter (a single value or an array) and returns it on each item. PayMe's own identifiers are sub_payme_id (the GUID used in the API) and the numeric sub_payme_code.

Wallets

Google Pay is for one-time payments only and cannot pay a subscription. Apple Pay can: either pass a buyer_key captured earlier with Apple Pay to generate-subscription, or create the subscription and pay it with the Apple Pay token (pay-subscription, or PATCH /api/subscriptions/{sub_payme_id} with payment.method apple-pay). Off-session Apple Pay charges need a merchant token issued when the payment runs as recurring, and PayMe-side configuration of your account: contact PayMe Partners (partners@payme.io). capture_buyer on a wallet payment returns the same kind of buyer_key as a card.

How to create a subscription

image.png

In this group