Question

Line Item Group not structured as nested/collected

  • 4 October 2021
  • 0 replies
  • 10 views

Hello,

I am currently working on an APP in Zapier, where I created a module to POST the data to the API.

I have this example structure how should the body parameters send to the endpoint:

 { 

"orderNumber": "ABC-123-456",
"shopToken": "SHOP1",
"language": "de",
"customerNumber": "654321",
"shippingAddress": {
"firstName": "Test",
"lastName": "Test",
"street": "Main Street",
"streetNumber": "17a",
"city": "Test",
"postalCode": "12345",
"country": "DE",
"email": "user@example.com",
"addition3": "string",
"addition2": "string",
"addition1": "string",
"department": "Marketing",
"company": "Test GMBH",
"salutation": "Herr"
},
"billingAddress": {
"firstName": "Test",
"lastName": "Test",
"street": "Main Street",
"streetNumber": "17a",
"city": "Test",
"postalCode": "12345",
"country": "DE",
"email": "user@example.com",
"addition3": "string",
"addition2": "string",
"addition1": "string",
"department": "Marketing",
"company": "Test GMBH",
"salutation": "Herr"
},
.........
}


I am using in the Zapier Platfrom UI to build the modules where I have add the line item group called shippingAddress and the other called billingAddres.

const options = {
url: 'https://api.paqato.com/v3/orders',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
params: {
'token': bundle.inputData.token,
},
body: {
'orderNumber': bundle.inputData.orderNumber,
'shopToken': bundle.inputData.shopToken,
'language': bundle.inputData.language,
'customerNumber': bundle.inputData.customerNumber,
'shippingAddress': bundle.inputData.shippingAddress,
'billingAddress': bundle.inputData.billingAddress
}
}

return z.request(options)
.then((response) => {
// trying to see log the input, but they don't show in Zapier UI console.
console.log(bundle.inputData);
response.throwForStatus();
const results = response.json;
return results;
});

However, I am sending in this way the body parameters, but the API response with the message that parameters shippingAddress.firstName… is missing.


Is this the right way how I am sending the parameter like Shipping Address which is Line Item Group and contains the information like FirstName, LastName etc?

Is there any way that I can view the Request Parameters in Zapier UI (Web Builder)?

Looking forward to your help/advice!

 


0 replies

Be the first to reply!

Reply