How to change to dynamic URL (instead of hardcoding) when passing data over to Xano?

Hi! Trying to get my Stripe integration to work with Xano. Currently I have a “POST” Rest API request to Xano.

Xano is expecting these inputs:

Following a tutorial, I managed to make it work by using this javascript code in “raw body”

image

The code that worked:

{ “success_url”: “https://www.domain.com/checkout_success”, “cancel_url”: “https://www.domain.com/checkout_failed”, “line_items”: [ { “price”: “price_4sdf4sgs”, “quantity”: “1” } ] }

My question is how do I use a URL that I have stored in a variable instead of hardcoding the success_url and cancel_url?

Is it using “parsed fields”? If I use “parsed fields” then what about the price and quantity, because those are not text fields?

You can achieve it with both solutions, parsed and row body, formula or javascript


Capture d’écran 2023-05-25 à 17.37.13

You can click on your variables in the explorer in both formula and javascript mode to add the variable!

Let’s say if I use “parsed fields”, I can’t add in “line_items”: [ { “price”: “price_4sdf4sgs”, “quantity”: “1” } ], right? (only text inputs like cancel url and success url?)

You can bind anything, you’re not restricted to a text input, the value can be an array