# Pre-authorize a card, optionally adjust the amount, capture, and optionally refund.

Pre-authorize a card, optionally adjust the amount, capture, and optionally refund.

1. Create the pre-authorization to hold funds on the card. Sends both autoCapture=false and processAsSale=false so the gateway authorizes without settling - this is what makes it a pre-authorization rather than a sale. Save the returned paymentId; every later step needs it.
 [payment](/api/payment)
2. OPTIONAL — adjust the authorized amount before capture using an order-type adjustment. Only needed when the merchant must capture MORE than originally pre-authorized (for example, a hotel adds dinner to a room hold). Skip this step to capture the original amount or less. The adjustments array is polymorphic (order/status/customer/signature); this uses the order variant to change the amount.
 [adjustPayment](/api/adjust-payment)
3. Capture the pre-authorization to take the funds from the card. Sending an amount captures that value; omit amount to capture the full authorized amount. To capture more than authorized, run the optional adjust step first. Returns the payment with transactionResult.status reflecting the capture.
 [capturePayment](/api/capture-payment)
4. OPTIONAL — run a referenced refund against the captured payment once its batch is closed, returning funds to the cardholder. If the payment is still in an open batch this operation reverses it instead of refunding. Both amount and description are required. The new refund's id lives at refunds[0].refundId in the response, not at the top level.
 [refundPayment](/api/refund-payment)

## Workflow diagram

```mermaid
flowchart TD
  step0["1. pre-authorization request · API"]
  step1["2. adjustment request · API"]
  step0 --> step1
  step2["3. capture request · API"]
  step1 --> step2
  step3["4. refund request · API"]
  step2 --> step3
```
