#darwin_34890

1 messages · Page 1 of 1 (latest)

rare geyserBOT
river saffron
#

Hi

#

could you please check on the issue I'm getting

white stirrup
#

Let's open your request on your Dashboard request log

#

To see how it looks like

#

Probably that's the curl syntax

river saffron
#

Yeah I think I just need to the format when I'm passing metadata

#

It's should be in JSON form right?

#
  "success_url": "https://localhost:7217/success",
  "line_items": {
    "0": {
      "price_data": {
        "unit_amount": "100",
        "currency": "USD",
        "product_data": {
          "metadata": "'{{\"brand\":\"JLR Poland\"}}'",
          "name": "Reservation Fee"
        }
      },
      "quantity": "1"
    }
  },
  "cancel_url": "https://localhost:7217/create-checkout-session/cancel",
  "mode": "payment"
}```
white stirrup
#

Not very familiar with curl sorry. You may need to try and error

#

I think it's not the JSON form, it should be just key and value

#

This is less levels but example:

curl https://api.stripe.com/v1/customers \
  -u sk_test_xxx: \
  -d "metadata[order_id]"=6735
rare geyserBOT
river saffron
#

Oh I see

#

Let me try

#

I tried "param": "line_items[0][price_data][product_data][brand]",

jagged edge
river saffron
#

Yeah I know but I tried this format you shown metadata[order_id]"=6735

#

i don't understand it's easy to pass that data via SDK Library

jagged edge
#

can you share your exact code snippet?

river saffron
#

Actually I'm trying it in Postman

jagged edge
#

to be clear, metadata expects a string. the way to go about it for that screenshot, should actually be
line_items[0][price_data][product_data][metadata][brand]

river saffron
#

Actually it was an object on the collection

jagged edge
#

and then in the value, you input JLR-POL

river saffron
#

When I put string I'm still getting an error

white stirrup
#

Let's try putting [brand] after [metadata]

river saffron
white stirrup
#

You are lacking [metadata]

river saffron
#

Oh I see

#

It went through but I can't see it in the portal

white stirrup
#

Have you checked the request in Dashboard and see if you really passed in metadata?

#

Also, this is metadata for the Product of the line item

river saffron
#

Nothing is showing up on the dashboard related to the transaction

jagged edge
#

have you attempted to pay on the Checkout Session?

#

A PaymentIntent will only be created (and hence show in that Dashboard page) after you attempt to pay

river saffron
#

I already did the payment but there's no metadata reflected

#

This is the paymentIntentId - pi_3O0HXaAgh0zbdxN71Uz4Ml0B

jagged edge
river saffron
#

Great! It works!