Authorise now, capture later
Authorise a payment at checkout, then capture or void it within two minutes, for example after your own fraud or stock check.
With captureMethod: "manual", the checkout only authorises the payment. Nothing is charged until you capture it. You get two minutes after authorisation to run your own checks, such as a fraud review or a stock check, and then capture the payment or void it. The customer waits on the checkout's processing screen in the meantime and sees the outcome of your decision.
Enabled per account in live mode
Test mode always accepts manual capture, so you can build and test your
integration straight away. Before you use it in live mode, ask your account
manager to enable it for your account. Until then, a live POST /payments
with captureMethod: "manual" is refused.
How it works
1. Create the payment
Create the payment as usual, with captureMethod: "manual":
const response = await fetch("https://sandbox.mintcash.me/payments", {
method: "POST",
headers: { Authorization: ..., "Content-Type": "application/json" },
body: JSON.stringify({
externalId: `order_${orderId}`,
amount: 49.99,
currency: "USD",
captureMethod: "manual",
customer: { externalId: customerId, email, name },
}),
});
const { id, redirectUrl, methods } = await response.json();This flow needs the hosted checkout, so it can't be combined with cardToken. Bank methods are never offered. methods on the response lists what the customer will see.
2. Decide on payment.authorized
When the customer's bank approves the payment, you receive payment.authorized. Its captureBefore is two minutes after authorisation. Call capture or void before then:
// In your webhook handler, after verifying the signature
if (event.event === "payment.authorized" && event.data.captureMethod === "manual") {
const approved = await runYourChecks(event.data);
const action = approved ? "capture" : "void";
await fetch(`https://sandbox.mintcash.me/payments/${event.data.id}/${action}`, {
method: "POST",
headers: { Authorization: ... },
});
}Decide quickly: the customer is still on the checkout. If you do neither before captureBefore, the payment is voided with voidReason: "expired" and the customer is told nothing was charged. The window is the same for every account.
3. Capture or void
Capture
POST /payments/{paymentId}/capture charges the full amount and returns the payment as it stands afterwards:
status | What happened |
|---|---|
succeeded | The payment is charged. payment.succeeded follows: fulfil the order on it, as for any payment |
failed | The bank declined the charge, with a failureCode such as insufficient_funds. This is final: the order needs a new payment |
authorized | The bank hasn't answered within 10 seconds. captureRequestedAt is set, and payment.succeeded or payment.failed follows by webhook |
Calling capture again is safe: on a payment already captured, or with its capture in flight, it returns the payment as it is now.
Void
POST /payments/{paymentId}/void releases the payment without charging anything. If the bank was holding the money, the hold is released. If the card was only verified, it can't be used for this payment any more. The payment moves to voided with voidReason: "merchant". Calling void again returns the payment unchanged.
Held money and verified cards
fundsHeld on payment.authorized tells you what your capture does:
true: the bank holds the money, and your capture collects it. A void gives it back to the customer.false: the card was only verified at checkout, so your capture is a new charge, and the bank can still decline it, for example withinsufficient_funds.
What you receive
| Outcome | Events |
|---|---|
| Approved and captured | payment.authorized → payment.succeeded |
| Approved, card declined at capture | payment.authorized → payment.failed, with captureRequestedAt set |
| Voided by you | payment.authorized → payment.voided with voidReason: "merchant" |
| No decision within two minutes | payment.authorized → payment.voided with voidReason: "expired" |
| Hold cancelled by the provider | payment.authorized → payment.voided with voidReason: "provider" |
| Declined at checkout | payment.failed, as for any payment |
The fields that describe manual capture (captureMethod, fundsHeld, captureBefore, captureRequestedAt and voidReason) are covered in the payload reference.
Fulfil on payment.succeeded only
payment.authorized means the bank approved the payment, not that you've
been paid. Fulfil the order on payment.succeeded, and don't save the card
for later charges before then: card.token stays null until the payment is
captured.
What the customer sees
After authorising, the customer stays on the checkout's processing screen until you decide. A capture shows the usual success screen, a declined capture shows a decline, and a void, by you or by the deadline, says the payment couldn't be completed and nothing was charged.
If you embed the checkout, the page posts mintcash:progress with stage: "authorized" when the bank approves the payment, then mintcash:checkout with the outcome: succeeded, declined for a declined capture, or voided.
Errors
Capture and void are refused with 400 failed_precondition when the payment can't take them. details.reason says why:
details.reason | Returned by | Meaning |
|---|---|---|
manual_capture_not_enabled | POST /payments | Manual capture isn't enabled for your account in live mode |
not_manual_capture | capture and void | The payment wasn't created with captureMethod: "manual" |
not_authorized | capture | The payment hasn't been authorised yet |
capture_window_expired | capture | captureBefore has passed. The payment is voided |
payment_voided | capture | The payment was already voided |
payment_failed | capture | The payment already failed |
capture_in_progress | void | Your capture is in flight. Wait for its outcome |
payment_captured | void | The payment was already captured. Refund it instead |
Test it
In test mode, the test cards decide whether a payment reaches authorized. To test a capture the bank declines, create the payment with an amount ending in .51, for example 10.51, and pay with a succeeding card. See Simulating a declined capture.
See also
- Capture a payment and Void a payment in the API reference
- Payment states: where
authorizedandvoidedfit - Issue a refund: for a payment you've already captured
Choose what the checkout offers
Pick the payment methods a payment's page offers with `methods`, narrow what one frame shows with `view`, and lay out the same payment across several frames of your own checkout.
Set up a subscription
Create a recurring billing agreement with one API call. Mintcash handles renewals, retries, dunning emails, and cancellation.