Paypal Express Checkout Order Api

kisan11
Contributor
Contributor

I'm trying to integrate paypal express checkout. While sending items in purchase units to create order api v2 it returns error of update config. Please Help

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Merchant Technical Support community.

Here is the information on adding quantity to the Orders API V2:

https://developer.paypal.com/docs/api/orders/v2/#definition-item

Post to :https://api.sandbox.paypal.com/v2/checkout/orders

Here's the general format:
{
  "intent": "CAPTURE",
  "purchase_units": [
        {
          "amount": {
            "currency_code": "USD",
            "value": "25.00",
            "breakdown": {
                   "item_total":{
                                  "currency_code": "USD",
                                  "value": "20.00"
                   },
                   "shipping":{
                                  "currency_code": "USD",
                                  "value": "5.00"
                   },
                   "tax_total":{
                                  "currency_code": "USD",
                                "value": "1.00"
                   },
                   "shipping_discount":{
                                  "currency_code": "USD",
                                  "value": "1.00"
                   }
            }
          },
         
          "items": [
                   {
                   "name": "Coffee Cup 12oz",
                   "unit_amount":{
                                  "currency_code": "USD",
                                  "value": "20.00"
                   },
                   "tax": {
                                  "currency_code": "USD",
                                  "value": "1.00"
                   },
                   "quantity": "1",
                   "description": "Amazing Coffee mug to hold that Java",
                   "sku": "123456",
                   "category": "PHYSICAL_GOODS"
          }],
          "shipping": {
                   "name": {
                                  "full_name": "Bob Smith"
                   },
                   "address": {
                                                 "address_line_1": "234 Main St",
                                                  
                                                 "admin_area_2": "Mesa",
                                                 "admin_area_1": "AZ",
                                                 "postal_code": "85201",
                                                 "country_code": "US"
                   }
          }
        }
      ]
}
After the account holder agrees to the payment then you can run a Capture Call:
https://api.sandbox.paypal.com/v2/checkout/orders/{{order_id}}/capture
You just need to get the order_id from the response and then you can run a Capture call. 

Thank you,

Jennifer

PayPal

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.