Handle payments for orders that customers purchase online and pick up at a physical store location. This pattern authorizes payment at checkout and captures funds after verifying pickup. This ensures payment is secured and collected only when the customer receives their items. Common scenarios include:Documentation Index
Fetch the complete documentation index at: https://docs.paypal.ai/llms.txt
Use this file to discover all available pages before exploring further.
- Retail stores offering same-day pickup
- Grocery orders for curbside pickup
- Restaurant orders for takeout
- Click-and-collect services
Integrate server side
Add the following endpoints to your existing server file from the quick start integration.Test endpoints
- Create an authorization.
Endpoint:
/v2/checkout/orders/{id}/authorize- Capture payment at pickup.
Best practices
- Set clear pickup timeframes: Communicate pickup windows. Typical holds: 7 days for retail, 24 hours for restaurants or groceries. Balance customer convenience with inventory management. Automatically void expired authorizations.
- Implement pickup verification: Require order number and pickup code. Capture payment only after verifying the customer.
- Handle partial pickups: If part of the order is collected, capture the partial amount and void the remainder.
- Train store staff: Ensure staff know when to trigger capture and how to handle pickup exceptions.
- Monitor unclaimed orders: Track unclaimed orders and void authorizations promptly to release funds.
Important details
- Capture only after pickup verification: Do not capture payment before verifying the customer has received their items. This protects both you and the customer from fraud.
- Add items at pickup: If customers want to add items at pickup, process additional items as a separate transaction at the store.
- Handle partial pickups: If only part of an order is available, capture only the amount for available items and void the remaining authorization.
- Notification timing: Email customers when orders are ready for pickup, but only capture payment after pickup. The authorization secures payment while the order waits.
- Identity verification methods: Verify customer identity through order number, pickup code, photo ID, or app confirmation before capturing. Works the same for in-store, curbside, or drive-up pickup.
Test your integration
Before testing pickup flows, authorize an order to obtain an authorization ID.Standard testing
| Test scenario | Setup | Expected result |
|---|---|---|
| Successful pickup | Create order and verify with correct code | Authorization succeeds and capture completes on pickup. |
| Invalid pickup code | Use incorrect pickup code | Returns 401 error: invalid pickup code. |
| Abandoned order | Do not pick up within timeframe | Authorization is voided automatically. |
| Partial pickup | Authorize $100, pick up $60 | Capture $60 and void remaining $40. |
Negative testing
For negative testing:- Make sure to enable negative testing in your sandbox business account as described in the quick start prerequisites.
- In the
.envfile, setENABLE_NEGATIVE_TESTING=trueand setNEGATIVE_TEST_TYPEto one of the error codes in the table. - Restart the server after changing the
.envfile:node server.js.
| Test scenario | Error code | Expected result |
|---|---|---|
| Expired authorization | AUTHORIZATION_EXPIRED | Error: authorization expired and order canceled. |
| Already picked up | AUTHORIZATION_ALREADY_CAPTURED | Error: authorization already captured. |
Go-live checklist
- Integrate store pickup system with payment capture.
- Test pickup verification at all store locations.
- Configure automatic voids for unclaimed orders.
- Train store staff on capture process.
- Test with a real $1 order and pickup.
Post-launch monitoring
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. |
| Capture success at pickup | 90% | Check for expired authorizations or staff process gaps. |
| Authorization expiration rate | <15% | Monitor for abnormal increases. |
| Void success rate (abandoned) | 98% | Investigate void failures. |
| API response time | <2 seconds | Check PayPal API status. |