Authorize and Capture
DocsLast updated: June 15th 2023, @ 5:00:00 pm
Authorize and capture allows you to authorize your buyers' funds before you capture them. An authorization places a hold on the funds and is valid for 29 days.
Integration Steps
Before implementing authorize and capture, you must complete Seller Onboarding and Checkout. Then, complete the following steps:
Note: Authorize and capture is not supported with Managed Path Onboarding. Sellers also cannot accept Alternative Payment Methods with authorize and capture.
1. Create an order
Before you authorize funds, you must create an order with the intent
field set to AUTHORIZE
.
- cURL
- Node
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders2-H 'Content-Type: application/json'3-H 'Authorization: Bearer <Access-Token>'4-H 'PayPal-Partner-Attribution-Id: <BN-Code>'5-d '{6"intent": "AUTHORIZE",7"purchase_units": [{8 "amount": {9 "currency_code": "USD",10 "value": "100.00"11 },12 "payee": {13 "email_address": "seller@example.com"14 }15}]16}'
- Use the
purchase_units/payee
object to specify the end receiver of the funds.
2. Authorize an order
After your buyer approves the order, you call authorize order to authorize the buyer's funds.
- cURL
- Node
1curl -v -k -X POST https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T/authorize2-H 'PayPal-Partner-Attribution-Id:'<BN-Code>'3-H 'Authorization: Bearer <Access-Token>'4-H 'Content-Type: application/json'5-d '{}'
An authorization places a hold on the funds and is valid for 29 days. After a successful authorization, PayPal recommends that you capture the funds within the three-day honor period. Success of the capture is subject to risk and availability of funds on the authorized funding instrument. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. A re-authorization generates a new Authorization ID and restarts the honor period and any subsequent capture should be performed on the new Authorization ID. If you do a re-authorization on the 27th day of the authorization, you get only two days of honor period. You can capture less than the original authorization, full authorization amount, or even more than the authorization amount (up to 115% of the original authorization or $75 USD more, whichever is less).
Note: Orders cannot be authorized until the status of the order is set to
APPROVED
. The order status is set toAPPROVED
when the buyer successfully completes the checkout flow.
3. Capture an authorization
When you are ready to capture the funds you authorized, call /v2/payments/authorizations/{authorization_id}/capture. You can retrieve the authorization_id
from the purchase_units/payments/authorizations/id
field of the response from the previous step to authorize an order or from a show order details call.
curl -v -X POST https://api-m.sandbox.paypal.com/v2/payments/authorizations/5O190127TN364715T/capture \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"payment_instruction": {
"disbursement_mode": "INSTANT",
"platform_fees": [
{
"amount": {
"currency_code": "USD",
"value": "2.00"
}
}
]
}
}'
- Use the
payment_instruction/disbursement_mode
field to specify when funds should be disbursed to the seller. To capture these funds and hold them before disbursing to the seller, see the Delay Disbursements guide. - Use the
payment_instruction/platform_fees
array to specify any fees you want to collect on this transaction.