Authorizations
Authorizations — methods, parameters, and examples for easy-sdk (gem).
An authorization holds funds on a card without capturing them. Use them for delayed-capture flows: pre-orders, ride-hailing, hotels — anywhere the final amount isn't known when the customer pays.
Authorizations are created implicitly through checkout /
embedded_checkout / transfers (when the appropriate flag is set).
The SDK exposes the read + capture/void surface on the resulting
authorization object.
Accessed via client.authorizations.
Methods
list(limit: nil, offset: nil, ids: nil)
GET /authorizations.
client.authorizations.list(limit: 50)retrieve(id)
GET /authorizations/:id.
capture(id, amount:)
POST /authorizations/:id/capture. amount is in minor units and may
be less than or equal to the authorized amount.
client.authorizations.capture("auth_…", amount: 1_000)void(id)
POST /authorizations/:id/void. Release the held funds without
capturing.
client.authorizations.void("auth_…")Object shape
:id, :state (SUCCEEDED, CAPTURED, VOIDED, …), :amount,
:captured_amount, :currency, :source, :expires_at, :created_at, …
Webhook events
Subscribe to authorization.created, authorization.updated, and
authorization.voided.
Examples
Capture less than the authorized amount
auth = client.authorizations.retrieve("auth_…")
client.authorizations.capture(auth[:id], amount: auth[:amount] - 500)Void on cancelled order
client.authorizations.void("auth_…")