user-1
(User 1)
August 20, 2024, 2:00pm
1
This topic was automatically generated from Slack. You can find the original thread here .
Guys, can someone help me here? How do I create an API call with parameters for “nested” key-value pairs…?
Sample json below:
{
"customer_id": "d45ee88c-8b27-4be8-8d81-77dda1b81826",
"meta": {
"tax": 2,
"subtotal": 10,
"lineItems": [
{
"id": "optional-fm-catalog-item-id",
"item": "Demo Item",
"details": "this is a regular demo item",
"quantity": 10,
"price": 1
}
],
"isCCPaymentEnabled": true,
"isACHPaymentEnabled": true,
"isTipEnabled": true,
"internalMemo": "internalMemo",
"memo": "customer facing memo"
},
"total": "12.00",
"url": "https://app.staxpayments.com/#/bill/",
"send_now": false,
"is_partial_payment_enabled": true,
"files": [
"e8ee8f1a-a5b2-11e8-88ce-7611f4940a74"
]
}
user-1
(User 1)
August 20, 2024, 2:00pm
2
Hi , could you elaborate on what you’re trying to do?
user-1
(User 1)
August 20, 2024, 2:00pm
3
Hi I’m trying to call a create invoice API from Stax.
I wanted to use the parameters, but there are nested fields in the json, and I don’t know how to use the parameters to do that. So I am now editing a raw json.
Here’s the API ref: Stax API · Apiary
My code is below, but I am getting errors. Can’t figure out what I am doing wrong. Keeps telling “total” and “url” are not there
{
“customer_id”: “28ff2610-8305-42a1-bfc3-5744645d54eb”,
“meta”: {
“lineItems”: [
{
“id”: 88e14d2a-ac2d-4a00-ad92-9a679007beec,
“quantity”: 28572,
“price”: 0.0175
}
],
“isCCPaymentEnabled”: true,
“isACHPaymentEnabled”: true,
“isTipEnabled”: true,
“internalMemo”: “internalMemo”,
“memo”: “customer facing memo”
},
“total”: “500.00”,
“url”: “https://app.staxpayments.com/#/bill/ ”,
“send_now”: false
}
user-1
(User 1)
August 20, 2024, 2:00pm
4
Can you file a support ticket at Support - Pipedream and share your workflow URL in the ticket so I can take a look?