External API Request via function with input queried from database

Options
I am building a function that would be fired from an incoming post that would take some of the input data in addition to retrieve some data from database tables in Xano to ultimately compile a post request with these compiled values. Below is example of the data needing to be compiled (and not the entire API request). How would this POST request be compiled given the mix of text and variables using the External API Request:

{
  "shipping_method": "string",
  "recipient": {
    "name": "",
    "address": {
      "address1": "",
      "address2": "",
      "city": "",
      "state": "",
      "country": "",
      "zip_code": ""
    },
    "email": "",
    "phone_number": ""
  },
  "products": [
    {
      "id": ,
      "quantity":
    }
  ],
  "reference_id": "",
  "order_number": "",
  "purchase_date": "",
}

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hy  - you'll see Xano allows for a mix of values - which can be from variables, inputs, text, etc...

    The data you require first from the database should first be retrieved in the function stack with a database request... then you can use dot notation on the variable to add this data dynamically to the body of your API request