Last updated: July 8, 2026
Charge a customer after fulfilling their order, not immediately. Common use cases include:
This integration uses the Orders API v2 to authorize and the Payments API v2 to capture later. To authorize first and capture later, change your integration to use intent: "AUTHORIZE". This reserves funds on the customer's payment method for up to 29 days.
The highest success rate is within the first 3 days (the honor period). After 3 days, you may use reauthorization to extend the hold.
What's the difference between authorization and capture?
Add the following to your existing server file from the quick start integration.
# Step 1: Create order with AUTHORIZE intent
curl -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{
"intent": "AUTHORIZE",
"purchase_units": [{
"amount": {
"currency_code": "USD",
"value": "100.00"
}
}]
}'
# Step 2: Capture the authorization later
curl -X POST https://api-m.sandbox.paypal.com/v2/payments/authorizations/AUTHORIZATION_ID/capture \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{}'# 1. Create authorization (returns orderId)
curl -X POST http://localhost:3000/api/orders \
-H "Content-Type: application/json" \
-d '{"amount": "100.00"}'
# Expected response:
# {"id":"5O190127TN364715T"}
# 2. Later, capture the authorization (use authorizationId from PayPal)
curl -X POST http://localhost:3000/api/orders/ORDER_ID/capture \
-H "Content-Type: application/json" \
-d '{"authorizationId": "AUTH_ID_FROM_PAYPAL"}'
# Expected response:
# {"status":"COMPLETED","captureId":"3C679366HH908993F"}purchase_units[0].payments.authorizations[0].id. Store this value in your database immediately.Sandbox authorizations don't expire after 29 days. Test authorizations with negative testing instead.
| Test scenario | Setup | Expected result |
|---|---|---|
| Authorize and capture | Create an order with intent: "AUTHORIZE", then capture after 1 minute | Authorization successful, capture completes |
| Partial capture | Authorize $100, capture $60 | $60 captured, $40 remains available |
| Invalid authorization ID | Use "INVALID_AUTH_123" as auth ID | Returns 404 error |
| Capture after 5 days | Wait 5 days past honor period | Capture may succeed with lower rate |
.env file, set ENABLE_NEGATIVE_TESTING=true and set NEGATIVE_TEST_TYPE to one of the error codes in the table..env file: node server.js.| Test scenario | Error code | Expected result |
|---|---|---|
| Expired authorization | AUTHORIZATION_EXPIRED | Returns 422 error with "Authorization expired or invalid" |
| Already captured | AUTHORIZATION_ALREADY_CAPTURED | Returns 422 error with "Authorization already captured" |
These values are suggested monitoring thresholds for your integration, not performance guarantees from PayPal.
| Metric | Target | Action if below target |
|---|---|---|
| Authorization success rate | 95% | Investigate authorization failures with issuing banks |
| Capture rate within 3 days | 90% | Optimize fulfillment workflow for faster processing |
| Authorization expiration rate | <2% | Improve expiration alerts and capture automation |
| API response time | <2 seconds | Check PayPal API status |
| Capture success rate | 98% | Review expired or voided authorizations |