Multiple items smart button

Santi76
New Community Member

Hello,

 

I am trying to implement the smart button and I need to pass more than one item to it in the checkout call.

Is this possible?

The code I am using is the following:

purchase_units: [{
amount: {
currency_code: "USD",
value: "110.0",
breakdown: {
item_total: {currency_code: "USD", value: "100.00"},
tax_total: {currency_code: "USD", value: "10.00"}
}
},
items: [{name: "wiersze", tax: {currency_code: "USD", value: "10.00"}, quantity: "1", unit_amount: {currency_code: "USD", value: "100.00"}}]
}],
redirect_urls: {
    return_url: "https: //example/ok.php",
    cancel_url: "https: //example/error.php"
}

Login to Me Too
1 REPLY 1

MTS-Aaron
PayPal Employee
PayPal Employee

Hi @Santi76 

 

Yes, this is definitely possible and it looks like you're on the right track!

 

Here is the documentation for the Item Object  which it looks like you've already been looking at based on how you've crafted your call. Keep in mind If you specify amount.breakdown, the amount equals item_total plus tax_total plus shipping plus handling plus insurance minus shipping_discount minus discount.

 

Is there a particular error you're running into? I would just try that out in sandbox, working the kinks out as you go. However that looks like a valid call to my eyes.

 

Hope that helps!

-Aaron

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.