Create order

POST {{base_url}}/v2/checkout/orders

Creates an order.

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

Request Body

{"intent"=>"{{order_intent}}", "purchase_units"=>[{"amount"=>{"currency_code"=>"USD", "value"=>"100.00"}}]}

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;0K4795520C763571A&quot;,&quot;intent&quot;:&quot;CAPTURE&quot;,&quot;status&quot;:&quot;COMPLETED&quot;,&quot;payment_source&quot;:{&quot;card&quot;:{&quot;last_digits&quot;:&quot;4111&quot;,&quot;brand&quot;:&quot;VISA&quot;,&quot;type&quot;:&quot;UNKNOWN&quot;}},&quot;purchase_units&quot;:[{&quot;reference_id&quot;:&quot;PUHF&quot;,&quot;amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;240.00&quot;,&quot;breakdown&quot;:{&quot;item_total&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;200.00&quot;},&quot;shipping&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;20.00&quot;},&quot;handling&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;10.00&quot;},&quot;tax_total&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;20.00&quot;},&quot;insurance&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;0.00&quot;},&quot;shipping_discount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;5.00&quot;},&quot;discount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;5.0&quot;}}},&quot;payee&quot;:{&quot;email_address&quot;:&quot;sb-jgbqn12111212@business.example.com&quot;,&quot;merchant_id&quot;:&quot;65MXV4T2ZV6KY&quot;},&quot;description&quot;:&quot;Sporting Goods&quot;,&quot;custom_id&quot;:&quot;CUST-HighFashions&quot;,&quot;invoice_id&quot;:&quot;1642724317&quot;,&quot;soft_descriptor&quot;:&quot;PP*HIGHFASHIONS&quot;,&quot;items&quot;:[{&quot;name&quot;:&quot;T-Shirt&quot;,&quot;unit_amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;100.00&quot;},&quot;tax&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;10.00&quot;},&quot;quantity&quot;:&quot;1&quot;,&quot;description&quot;:&quot;Green XL&quot;,&quot;sku&quot;:&quot;sku01&quot;},{&quot;name&quot;:&quot;Shoes&quot;,&quot;unit_amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;50.00&quot;},&quot;tax&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;5.00&quot;},&quot;quantity&quot;:&quot;2&quot;,&quot;description&quot;:&quot;Running, Size 10.5&quot;,&quot;sku&quot;:&quot;sku02&quot;}],&quot;shipping&quot;:{&quot;address&quot;:{&quot;address_line_1&quot;:&quot;123 Townsend St&quot;,&quot;address_line_2&quot;:&quot;Floor 6&quot;,&quot;admin_area_2&quot;:&quot;San Francisco&quot;,&quot;admin_area_1&quot;:&quot;CA&quot;,&quot;postal_code&quot;:&quot;94107&quot;,&quot;country_code&quot;:&quot;US&quot;},&quot;options&quot;:[{&quot;id&quot;:&quot;SHIP0000001&quot;,&quot;label&quot;:&quot;1 Day Priority&quot;,&quot;type&quot;:&quot;SHIPPING&quot;,&quot;amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;20.00&quot;},&quot;selected&quot;:true}]},&quot;payments&quot;:{&quot;captures&quot;:[{&quot;id&quot;:&quot;26W18329M9058473L&quot;,&quot;status&quot;:&quot;COMPLETED&quot;,&quot;amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;240.00&quot;},&quot;final_capture&quot;:true,&quot;disbursement_mode&quot;:&quot;INSTANT&quot;,&quot;seller_protection&quot;:{&quot;status&quot;:&quot;NOT_ELIGIBLE&quot;},&quot;seller_receivable_breakdown&quot;:{&quot;gross_amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;240.00&quot;},&quot;paypal_fee&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;8.87&quot;},&quot;net_amount&quot;:{&quot;currency_code&quot;:&quot;USD&quot;,&quot;value&quot;:&quot;231.13&quot;}},&quot;invoice_id&quot;:&quot;1642724317&quot;,&quot;custom_id&quot;:&quot;CUST-HighFashions&quot;,&quot;links&quot;:[{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/captures/26W18329M9058473L&quot;,&quot;rel&quot;:&quot;self&quot;,&quot;method&quot;:&quot;GET&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/payments/captures/26W18329M9058473L/refund&quot;,&quot;rel&quot;:&quot;refund&quot;,&quot;method&quot;:&quot;POST&quot;},{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/checkout/orders/0K4795520C763571A&quot;,&quot;rel&quot;:&quot;up&quot;,&quot;method&quot;:&quot;GET&quot;}],&quot;create_time&quot;:&quot;2022-01-21T00:18:41Z&quot;,&quot;update_time&quot;:&quot;2022-01-21T00:18:41Z&quot;,&quot;processor_response&quot;:{&quot;avs_code&quot;:&quot;A&quot;,&quot;cvv_code&quot;:&quot;M&quot;,&quot;response_code&quot;:&quot;0000&quot;}}]}}],&quot;create_time&quot;:&quot;2022-01-21T00:18:41Z&quot;,&quot;update_time&quot;:&quot;2022-01-21T00:18:41Z&quot;,&quot;links&quot;:[{&quot;href&quot;:&quot;https://api.sandbox.paypal.com/v2/checkout/orders/0K4795520C763571A&quot;,&quot;rel&quot;:&quot;self&quot;,&quot;method&quot;:&quot;GET&quot;}]}