Reauthorize
Last updated: Sept 19th, 3:26am
You may need to reauthorize payment if it has been more than the 3 days honor period since the order was authorized by the customer and less than 29 days from when the authorization was created.
Note: If a longer honor period is required, merchants may work with their account manager to extend the honor period up to 10 days.
Know before you code
- The Payments API must be used with the Orders v2 API.
- See the Orders v2 API reference documentation to learn more about Orders.
- See the Payments v2 API reference documentation to learn more about Payments.
- Complete the steps in Get Started to setup your developer environment.
-
Use Postman to explore and test PayPal APIs.
- If you are a partner acting on behalf of merchants on your platform, you'll need to include the
PayPal-Auth-Assertionheader in your API request. You can generate the value according to the following pseudocode. See REST Requests for more information. You'll need to be an approved partner and complete seller onboarding.
1<base64-encoding <span class="hljs-keyword">of</span>-({<span class="hljs-string">"alg"</span>:<span class="hljs-string">"none"</span>})>.<base64-encoding-<span class="hljs-keyword">of</span>-({<span class="hljs-string">"iss"</span>:<span class="hljs-string">"<var>client_id</var>"</span>,<span class="hljs-string">"payer_id"</span>:<span class="hljs-string">"<var>payer_id</var>"</span>})>.
Reauthorize authorization
To reauthorize an authorization, call the "Reauthorize Authorized Payment" API at /v2/payments/authorizations/{authorization_id}/reauthorize.
Sample API request
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/payments/authorizations/12P54155LA952100L/reauthorize -H "Content-Type: application/json" -H "Authorization: Bearer Access-Token" -H "PayPal-Request-Id: 123e4567-e89b-12d3-a456-426655440017"
Modify the code
- Set the
Access Tokento the one you used when you authorized the order. - Change
PayPal-Request-Idto a unique value, such as GUID, for each order to ensure idempotency. - Update
authorization_idto theidobtained from a successful authorization call.
API response
You will get an HTTP 201 Created response.
Note:** If you did not receive the response, making the same API call without changing anything will result in an HTTP 200 OK with confirmation of reauthorized authorization.
Sample API response
1{2 "id": "8AA831015G517922L",3 "status": "CREATED",4 "amount": {5 "currency_code": "USD",6 "value": "200.00"7 },8 "seller_protection": {9 "status": "ELIGIBLE",10 "dispute_categories": [11 "ITEM_NOT_RECEIVED",12 "UNAUTHORIZED_TRANSACTION"13 ]14 },15 "expiration_time": "2022-09-16T10:56:26-07:00",16 "create_time": "2022-08-18T10:56:26-07:00",17 "update_time": "2022-08-18T10:56:48-07:00",18 "links": [19 {20 "rel": "self",21 "method": "GET",22 "href": "https://api-m.paypal.com/v2/payments/authorizations/8AA831015G517922L"23 },24 {25 "rel": "capture",26 "method": "POST",27 "href": "https://api-m.paypal.com/v2/payments/authorizations/8AA831015G517922L/capture"28 },29 {30 "rel": "void",31 "method": "POST",32 "href": "https://api-m.paypal.com/v2/payments/authorizations/8AA831015G517922L/void"33 },34 {35 "rel": "reauthorize",36 "method": "POST",37 "href": "https://api-m.paypal.com/v2/payments/authorizations/8AA831015G517922L/reauthorize"38 }39 ]40}
Next Steps
Testing
Test and go live with this integration.
- Complete production onboarding to be eligible to process cards with your live PayPal account.
- Remember to swap the credentials and API URL from sandbox to production when going live with your integration.