API reference / Payments

post/v1/capture

Authorise payment for an application

Operation
capturePayment
Authentication
API key

Authorise now, capture on government approval — the manual-capture model, because the decision is not ours to make.

Idempotent. Send an `Idempotency-Key` header; without one the application id and version are used, so a double-tapped button cannot create two authorisations. A replay returns the original result with `replayed: true` rather than charging again.

Scoped to the authenticated tenant. Keys issued to one tenant can never read or modify another tenant’s resources.

Request

Parameters

idempotency-keyheaderstring

Body

application_idstringrequired
provider_idstringrequired
return_urlstringrequired
localestring
checkout_reminder_requestedboolean

Applicant-requested single checkout reminder. Optional, never marketing consent.

Responses

200The payment, or a replay of it.
payment_idstringrequired
statusstringrequired
provider_refstringnullrequired
replayedboolean

True when the same idempotency key was seen before and the original result is being returned rather than charging twice.

400The request body or query failed validation.
errorobjectrequired
401No key, an unknown key, a revoked key, or a key whose tenant is not active. All four return an identical body on purpose: distinguishing them would let a caller discover which partners we have.
errorobjectrequired
403The key is valid but does not hold the scope this route requires.
errorobjectrequired
404Not found, or not yours. A resource belonging to another tenant answers 404 rather than 403, because 403 would confirm the record exists.
errorobjectrequired

Example

curl
curl -X POST https://api.haavisa.com/v1/capture \
  -H "Authorization: Bearer $HAAVISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "application_id": "<application_id>",
    "provider_id": "<provider_id>",
    "return_url": "<return_url>"
  }'

More in Payments

Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.