Authorize payment for order

POST {{base_url}}/v2/checkout/orders/:order_id/authorize

Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response.

Note: For error handling and troubleshooting, see Orders v2 errors .

HEADERS

| Key | Datatype | Required | Description | | Content-Type | string | | The Content-Type header field is used to specify the nature of the data in the body of an entity. PayPal REST APIs support application/json. | | Prefer | string | | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul> | | PayPal-Request-Id | string | | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. | | PayPal-Client-Metadata-Id | string | | Optional. Verifies that the payment originates from a valid, user-consented device and application. Reduces fraud and decreases declines. Transactions that do not include a client metadata ID are not eligible for PayPal Seller Protection. | | PayPal-Partner-Attribution-Id | string | | Optional. Identifies the caller as a PayPal partner. To receive revenue attribution, specify a unique build notation (BN) code. BN codes provide tracking on all transactions that originate or are associated with a particular partner. To find your BN code, see Code and Credential Reference. | | PayPal-Auth-Assertion | string | | An API client-provided JSON Web Token (JWT) assertion that identifies the merchant. To use this header, you must get consent to act on behalf of a merchant. |

RESPONSES

status: Created

{&quot;id&quot;:&quot;9P375962UG756752D&quot;,&quot;status&quot;:&quot;COMPLETED&quot;,&quot;purchase_units&quot;:[{&quot;reference_id&quot;:&quot;default&quot;,&quot;shipping&quot;:{&quot;name&quot;:{&quot;full_name&quot;:&quot;FooBuyer Jones&quot;},&quot;address&quot;:{&quot;address_line_1&quot;:&quot;1 Main St&quot;,&quot;admin_area_2&quot;:&quot;San Jose&quot;,&quot;admin_area_1&quot;:&quot;CA&quot;,&quot;postal_code&quot;:&quot;95131&quot;,&quot;country_code&quot;:&quot;US&quot;}},&quot;payments&quot;:{&quot;authorizations&quot;:[{&quot;status&quot;:&quot;CREATED&quot;,&quot;id&quot;:&quot;8VF53974JG831581P&quot;,&quot;amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;1000.00&quot;},&quot;seller_protection&quot;:{&quot;status&quot;:&quot;ELIGIBLE&quot;,&quot;dispute_categories&quot;:[&quot;ITEM_NOT_RECEIVED&quot;,&quot;UNAUTHORIZED_TRANSACTION&quot;]},&quot;expiration_time&quot;:&quot;2022-02-18T19:00:45Z&quot;,&quot;links&quot;:[{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/authorizations/8VF53974JG831581P&quot;,&quot;rel&quot;:&quot;self&quot;,&quot;method&quot;:&quot;GET&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/authorizations/8VF53974JG831581P/capture&quot;,&quot;rel&quot;:&quot;capture&quot;,&quot;method&quot;:&quot;POST&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/authorizations/8VF53974JG831581P/void&quot;,&quot;rel&quot;:&quot;void&quot;,&quot;method&quot;:&quot;POST&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/authorizations/8VF53974JG831581P/reauthorize&quot;,&quot;rel&quot;:&quot;reauthorize&quot;,&quot;method&quot;:&quot;POST&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/checkout/orders/9P375962UG756752D&quot;,&quot;rel&quot;:&quot;up&quot;,&quot;method&quot;:&quot;GET&quot;}],&quot;create_time&quot;:&quot;2022-01-20T19:00:45Z&quot;,&quot;update_time&quot;:&quot;2022-01-20T19:00:45Z&quot;}]}}],&quot;payer&quot;:{&quot;name&quot;:{&quot;given_name&quot;:&quot;FooBuyer&quot;,&quot;surname&quot;:&quot;Jones&quot;},&quot;email_address&quot;:&quot;foobuyer@gmail.com&quot;,&quot;payer_id&quot;:&quot;QYR5Z8XDVJNXQ&quot;,&quot;address&quot;:{&quot;country_code&quot;:&quot;US&quot;}},&quot;links&quot;:[{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/checkout/orders/9P375962UG756752D&quot;,&quot;rel&quot;:&quot;self&quot;,&quot;method&quot;:&quot;GET&quot;}]}