What happens to cart items submitted to orders endpoint

RichardLanham
Contributor
Contributor

I added "items" from a cart to the payload of my call to the /v2/checkout/orders endpoint inside purchase_unit with the following structure. The order and following capture all work, but the items are not shown in the server side jsonResponse to the order or the client-side response to the capture. This is in Sandbox. Am I doing this correctly? Will these items be recorded in PayPal anywhere when I go live -- or do I need to record them in a db?

Below is the items json, and below that is the whole payload to the orders endpoint.

const items = [

{

"name": "dance_admission",

"unit_amount": {

"currency_code": "USD",

"value": "150.00"

},

"quantity": "1",

"description": "Dancer: Test Test, Under 30: Yes, Dietary: omnivore"

},

{

"name": "dance_admission",

"unit_amount": {

"currency_code": "USD",

"value": "150.00"

},

"quantity": "1",

"description": "Dancer: Saturday guy, Under 30: No, Dietary: vegetarian"

}

]

This is the complete payload, showing where the above items are placed.

    body: JSON.stringify({
      purchase_units: [
        {
          amount: {
            currency_code: "USD",
            value: totalAmount,
            breakdown: {
              item_total: {
                  currency_code: "USD",
                  value: totalAmount
              }
          }
          },
          items:items
        },
   ]
Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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