I am using “send to an API”. I spent about 2 hours total working on this request. The body looked like (see first snippet). However after about an hour of troubleshooting. I was able to narrow it down to two fields that were causing the error, but I can’t tell why. I used about a dozen JSON validators, beautifiers, linters, and checkers… all of them gave me valid, 3 thumbs up, 6 stars. I even considered the possibility of hidden characters, left/right quotations etc ( I tried this tool, as well as a few others)
{
"records":[
{
"fields":{
"Order: Name":"{Order: Name}",
"Order: Id":"{Order: Id}",
"Order: Processed At":"{Order: Processed At}",
"Order: Email":"{Order: Email}",
"Line Items: Id":"{Line Items: Id}",
"Line Items: Title":"{Line Items: Title}",
"Line Items: Name":"{Line Items: Name}",
"Line Items: Variant Id":[
"{Line Items: Variant Id}"
],
"Line Items: Quantity":
"{Line Items: Quantity}",
"Line Items: Vendor":"{Line Items: Vendor}",
"Line Items: Fulfillment Service":"{Line Items: Fulfillment Service}",
"Line Items: Product Id":[
"{Line Items: Product Id}"
],
"Line Items: Requires Shipping":"{Line Items: Requires Shipping}",
"Line Items: Taxable":"{Line Items: Taxable}",
"Line Items: Gift Card":"{Line Items: Gift Card}",
"Line Items: Properties":"{Line Items: Properties}",
"Line Items: Product Exists":"{Line Items: Product Exists}",
"Line Items: Fulfillable Quantity":"{Line Items: Fulfillable Quantity}",
"Line Items: Price":"{Line Items: Price}",
"Line Items: Total Discount":"{Line Items: Total Discount}",
"Line Items: Total Tax Lines":"{Line Items: Total Tax Lines}",
"Line Items: Total Discount Allocations":"{Line Items: Total Discount Allocations}",
"Line Items: Total Duties":"{Line Items: Total Duties}",
"Line Items: Grams":"{Line Items: Grams}",
"Line Items: Discount Allocations":"{Line Items: Discount Allocations}",
"Line Items: Duties":"{Line Items: Duties}",
"Line Items: Tax Lines":"{Line Items: Tax Lines}",
"Line Items: Origin Location: Id":"{Line Items: Origin Location: Id}",
"Line Items: Origin Location: Country Code":"{Line Items: Origin Location: Country Code}",
"Line Items: Origin Location: Province Code":"{Line Items: Origin Location: Province Code}",
"Line Items: Origin Location: Name":"{Line Items: Origin Location: Name}",
"Line Items: Origin Location: Address1":"{Line Items: Origin Location: Address1}",
"Line Items: Origin Location: Address2":"{Line Items: Origin Location: Address2}",
"Line Items: Origin Location: City":"{Line Items: Origin Location: City}",
"Line Items: Origin Location: Zip":"{Line Items: Origin Location: Zip}",
"Order: Financial Status":"{}",
"Order: Customer: Id":"{}",
"Order: Customer: Orders Count":"{Order: Customer: Orders Count}",
"Order: Customer: Total Spent":"{Order: Customer: Total Spent}",
"Order: Customer: First Name":"{Order: Customer: First Name}",
"Order: Customer: Last Name":"{Order: Customer: Last Name}",
"Order: Customer: Email":"{Order: Customer: Email}",
"Order: Customer: Accepts Marketing":"{Order: Customer: Accepts Marketing}",
"Order: Customer: Created At":"{Order: Customer: Created At}",
"Order: Customer: Updated At":"{Order: Customer: Updated At}",
"Order: Customer: State":"{Order: Customer: State}",
"Order: Customer: Last Order Id":"{Order: Customer: Last Order Id}",
"Order: Customer: Verified Email":"{Order: Customer: Verified Email}",
"Order: Customer: Tax Exempt":"{Order: Customer: Tax Exempt}",
"Order: Customer: Last Order Name":"{Order: Customer: Last Order Name}",
"Order: Customer: Currency":"{Order: Customer: Currency}",
"Order: Customer: Accepts Marketing Updated At":"{Order: Customer: Accepts Marketing Updated At}",
"Order: Customer: Admin Graphql Api Id":"{Order: Customer: Admin Graphql Api Id}",
"Order: Customer: Default Address: Id":"{Order: Customer: Default Address: Id}",
"Order: Customer: Default Address: Customer Id":"{Order: Customer: Default Address: Customer Id}",
"Order: Customer: Default Address: First Name":"{Order: Customer: Default Address: First Name}",
"Order: Customer: Default Address: Last Name":"{Order: Customer: Default Address: Last Name}",
"Order: Customer: Default Address: Address1":"{Order: Customer: Default Address: Address1}",
"Order: Customer: Default Address: Address2":"{Order: Customer: Default Address: Address2}",
"Order: Customer: Default Address: City":"{Order: Customer: Default Address: City}",
"Order: Customer: Default Address: Province":"{Order: Customer: Default Address: Province}",
"Order: Customer: Default Address: Country":"{Order: Customer: Default Address: Country}",
"Order: Customer: Default Address: Zip":"{Order: Customer: Default Address: Zip}",
"Order: Customer: Default Address: Name":"{Order: Customer: Default Address: Name}",
"Order: Customer: Default Address: Province Code":"{Order: Customer: Default Address: Province Code}",
"Order: Customer: Default Address: Country Code":"{Order: Customer: Default Address: Country Code}",
"Order: Customer: Default Address: Country Name":"{Order: Customer: Default Address: Country Name}",
"Order: Customer: Default Address: Default":"{Order: Customer: Default Address: Default}",
"Order: Created At":"{Order: Created At}",
"Order: Updated At":"{Order: Updated At}",
"Order: Number":"{Order: Number}",
"Order: Token":"{Order: Token}",
"Order: Gateway":"{Order: Gateway}",
"Order: Test":"{Order: Test}",
"Order: Total Weight":"{Order: Total Weight}",
"Order: Taxes Included":"{Order: Taxes Included}",
"Order: Confirmed":"{Order: Confirmed}",
"Order: Cart Token":"{Order: Cart Token}",
"Order: Buyer Accepts Marketing":"{Order: Buyer Accepts Marketing}",
"Order: Landing Site":"{Order: Landing Site}",
"Order: Checkout Token":"{Order: Checkout Token}",
"Order: Customer Locale":"{Order: Customer Locale}",
"Order: App Id":"{Order: App Id}",
"Order: Browser Ip":"{Order: Browser Ip}",
"Order: Client Details: Accept Language":"{Order: Client Details: Accept Language}",
"Order: Client Details: Browser Height":"{Order: Client Details: Browser Height}",
"Order: Client Details: Browser Ip":"{Order: Client Details: Browser Ip}",
"Order: Client Details: Browser Width":"{Order: Client Details: Browser Width}",
"Order: Client Details: User Agent":"{Order: Client Details: User Agent}",
"Order: Order Number":"{Order: Order Number}",
"Order: Discount Codes":"{Order: Discount Codes}",
"Order: Note Attributes":"{Order: Note Attributes}",
"Order: Payment Details: Credit Card Bin":"{Order: Payment Details: Credit Card Bin}",
"Order: Payment Details: Avs Result Code":"{Order: Payment Details: Avs Result Code}",
"Order: Payment Details: Cvv Result Code":"{Order: Payment Details: Cvv Result Code}",
"Order: Payment Details: Credit Card Number":"{Order: Payment Details: Credit Card Number}",
"Order: Payment Details: Credit Card Company":"{Order: Payment Details: Credit Card Company}",
"Order: Payment Gateway Names":"{Order: Payment Gateway Names}",
"Order: Processing Method":"{Order: Processing Method}",
"Order: Checkout Id":"{Order: Checkout Id}",
"Order: Source Name":"{Order: Source Name}",
"Order: Tax Lines":"{Order: Tax Lines}",
"Order: Contact Email":"{Order: Contact Email}",
"Order: Order Status Url":"{Order: Order Status Url}",
"Order: Billing Address: First Name":"{Order: Billing Address: First Name}",
"Order: Billing Address: Address1":"{Order: Billing Address: Address1}",
"Order: Billing Address: City":"{Order: Billing Address: City}",
"Order: Billing Address: Zip":"{Order: Billing Address: Zip}",
"Order: Billing Address: Province":"{Order: Billing Address: Province}",
"Order: Billing Address: Country":"{Order: Billing Address: Country}",
"Order: Billing Address: Last Name":"{Order: Billing Address: Last Name}",
"Order: Billing Address: Latitude":"{Order: Billing Address: Latitude}",
"Order: Billing Address: Longitude":"{Order: Billing Address: Longitude}",
"Order: Billing Address: Name":"{Order: Billing Address: Name}",
"Order: Billing Address: Country Code":"{Order: Billing Address: Country Code}",
"Order: Billing Address: Province Code":"{Order: Billing Address: Province Code}",
"Order: Shipping Address: First Name":"{Order: Shipping Address: First Name}",
"Order: Shipping Address: Address1":"{Order: Shipping Address: Address1}",
"Order: Shipping Address: City":"{Order: Shipping Address: City}",
"Order: Shipping Address: Zip":"{Order: Shipping Address: Zip}",
"Order: Shipping Address: Province":"{Order: Shipping Address: Province}",
"Order: Shipping Address: Country":"{Order: Shipping Address: Country}",
"Order: Shipping Address: Last Name":"{Order: Shipping Address: Last Name}",
"Order: Shipping Address: Address2":"{Order: Shipping Address: Address2}",
"Order: Shipping Address: Latitude":"{Order: Shipping Address: Latitude}",
"Order: Shipping Address: Longitude":"{Order: Shipping Address: Longitude}",
"Order: Shipping Address: Name":"{Order: Shipping Address: Name}",
"Order: Shipping Address: Country Code":"{Order: Shipping Address: Country Code}",
"Order: Shipping Address: Province Code":"{Order: Shipping Address: Province Code}",
"Fulfilled By":"{Fulfilled By}",
"Order#":
"{Order#}"
}
}
]
}
When I removed these to lines, it worked, mind you I had to check each line until I found out where it was failing.
These are the two stinkers that took an hour of my life and gave me experience in exchanges
- “Line Items: Total Discount Allocations”:"{Line Items: Total Discount Allocations}",
- “Line Items: Discount Allocations”:"{Line Items: Discount Allocations}",
{
"records": [{
"fields": {
"Order: Name": "{Order: Name}",
"Order: Id": "{Order: Id}",
"Order: Processed At": "{Order: Processed At}",
"Order: Email": "{Order: Email}",
"Line Items: Id": "{Line Items: Id}",
"Line Items: Title": "{Line Items: Title}",
"Line Items: Name": "{Line Items: Name}",
"Line Items: Variant Id": [
"{Line Items: Variant Id}"
],
"Line Items: Quantity": "{Line Items: Quantity}",
"Line Items: Vendor": "{Line Items: Vendor}",
"Line Items: Fulfillment Service": "{Line Items: Fulfillment Service}",
"Line Items: Product Id": [
"{Line Items: Product Id}"
],
"Line Items: Requires Shipping": "{Line Items: Requires Shipping}",
"Line Items: Taxable": "{Line Items: Taxable}",
"Line Items: Gift Card": "{Line Items: Gift Card}",
"Line Items: Properties": "{Line Items: Properties}",
"Line Items: Product Exists": "{Line Items: Product Exists}",
"Line Items: Fulfillable Quantity": "{Line Items: Fulfillable Quantity}",
"Line Items: Price": "{Line Items: Price}",
"Line Items: Total Discount": "{Line Items: Total Discount}",
"Line Items: Total Tax Lines": "{Line Items: Total Tax Lines}",
"Line Items: Total Duties": "{Line Items: Total Duties}",
"Line Items: Grams": "{Line Items: Grams}",
"Line Items: Duties": "{Line Items: Duties}",
"Line Items: Tax Lines": "{Line Items: Tax Lines}",
"Line Items: Origin Location: Id": "{Line Items: Origin Location: Id}",
"Line Items: Origin Location: Country Code": "{Line Items: Origin Location: Country Code}",
"Line Items: Origin Location: Province Code": "{Line Items: Origin Location: Province Code}",
"Line Items: Origin Location: Name": "{Line Items: Origin Location: Name}",
"Line Items: Origin Location: Address1": "{Line Items: Origin Location: Address1}",
"Line Items: Origin Location: Address2": "{Line Items: Origin Location: Address2}",
"Line Items: Origin Location: City": "{Line Items: Origin Location: City}",
"Line Items: Origin Location: Zip": "{Line Items: Origin Location: Zip}",
"Order: Financial Status": "{}",
"Order: Customer: Id": "{}",
"Order: Customer: Orders Count": "{Order: Customer: Orders Count}",
"Order: Customer: Total Spent": "{Order: Customer: Total Spent}",
"Order: Customer: First Name": "{Order: Customer: First Name}",
"Order: Customer: Last Name": "{Order: Customer: Last Name}",
"Order: Customer: Email": "{Order: Customer: Email}",
"Order: Customer: Accepts Marketing": "{Order: Customer: Accepts Marketing}",
"Order: Customer: Created At": "{Order: Customer: Created At}",
"Order: Customer: Updated At": "{Order: Customer: Updated At}",
"Order: Customer: State": "{Order: Customer: State}",
"Order: Customer: Last Order Id": "{Order: Customer: Last Order Id}",
"Order: Customer: Verified Email": "{Order: Customer: Verified Email}",
"Order: Customer: Tax Exempt": "{Order: Customer: Tax Exempt}",
"Order: Customer: Last Order Name": "{Order: Customer: Last Order Name}",
"Order: Customer: Currency": "{Order: Customer: Currency}",
"Order: Customer: Accepts Marketing Updated At": "{Order: Customer: Accepts Marketing Updated At}",
"Order: Customer: Admin Graphql Api Id": "{Order: Customer: Admin Graphql Api Id}",
"Order: Customer: Default Address: Id": "{Order: Customer: Default Address: Id}",
"Order: Customer: Default Address: Customer Id": "{Order: Customer: Default Address: Customer Id}",
"Order: Customer: Default Address: First Name": "{Order: Customer: Default Address: First Name}",
"Order: Customer: Default Address: Last Name": "{Order: Customer: Default Address: Last Name}",
"Order: Customer: Default Address: Address1": "{Order: Customer: Default Address: Address1}",
"Order: Customer: Default Address: Address2": "{Order: Customer: Default Address: Address2}",
"Order: Customer: Default Address: City": "{Order: Customer: Default Address: City}",
"Order: Customer: Default Address: Province": "{Order: Customer: Default Address: Province}",
"Order: Customer: Default Address: Country": "{Order: Customer: Default Address: Country}",
"Order: Customer: Default Address: Zip": "{Order: Customer: Default Address: Zip}",
"Order: Customer: Default Address: Name": "{Order: Customer: Default Address: Name}",
"Order: Customer: Default Address: Province Code": "{Order: Customer: Default Address: Province Code}",
"Order: Customer: Default Address: Country Code": "{Order: Customer: Default Address: Country Code}",
"Order: Customer: Default Address: Country Name": "{Order: Customer: Default Address: Country Name}",
"Order: Customer: Default Address: Default": "{Order: Customer: Default Address: Default}",
"Order: Created At": "{Order: Created At}",
"Order: Updated At": "{Order: Updated At}",
"Order: Number": "{Order: Number}",
"Order: Token": "{Order: Token}",
"Order: Gateway": "{Order: Gateway}",
"Order: Test": "{Order: Test}",
"Order: Total Weight": "{Order: Total Weight}",
"Order: Taxes Included": "{Order: Taxes Included}",
"Order: Confirmed": "{Order: Confirmed}",
"Order: Cart Token": "{Order: Cart Token}",
"Order: Buyer Accepts Marketing": "{Order: Buyer Accepts Marketing}",
"Order: Landing Site": "{Order: Landing Site}",
"Order: Checkout Token": "{Order: Checkout Token}",
"Order: Customer Locale": "{Order: Customer Locale}",
"Order: App Id": "{Order: App Id}",
"Order: Browser Ip": "{Order: Browser Ip}",
"Order: Client Details: Accept Language": "{Order: Client Details: Accept Language}",
"Order: Client Details: Browser Height": "{Order: Client Details: Browser Height}",
"Order: Client Details: Browser Ip": "{Order: Client Details: Browser Ip}",
"Order: Client Details: Browser Width": "{Order: Client Details: Browser Width}",
"Order: Client Details: User Agent": "{Order: Client Details: User Agent}",
"Order: Order Number": "{Order: Order Number}",
"Order: Note Attributes": "{Order: Note Attributes}",
"Order: Payment Details: Credit Card Bin": "{Order: Payment Details: Credit Card Bin}",
"Order: Payment Details: Avs Result Code": "{Order: Payment Details: Avs Result Code}",
"Order: Payment Details: Cvv Result Code": "{Order: Payment Details: Cvv Result Code}",
"Order: Payment Details: Credit Card Number": "{Order: Payment Details: Credit Card Number}",
"Order: Payment Details: Credit Card Company": "{Order: Payment Details: Credit Card Company}",
"Order: Payment Gateway Names": "{Order: Payment Gateway Names}",
"Order: Processing Method": "{Order: Processing Method}",
"Order: Checkout Id": "{Order: Checkout Id}",
"Order: Source Name": "{Order: Source Name}",
"Order: Tax Lines": "{Order: Tax Lines}",
"Order: Contact Email": "{Order: Contact Email}",
"Order: Order Status Url": "{Order: Order Status Url}",
"Order: Billing Address: First Name": "{Order: Billing Address: First Name}",
"Order: Billing Address: Address1": "{Order: Billing Address: Address1}",
"Order: Billing Address: City": "{Order: Billing Address: City}",
"Order: Billing Address: Zip": "{Order: Billing Address: Zip}",
"Order: Billing Address: Province": "{Order: Billing Address: Province}",
"Order: Billing Address: Country": "{Order: Billing Address: Country}",
"Order: Billing Address: Last Name": "{Order: Billing Address: Last Name}",
"Order: Billing Address: Latitude": "{Order: Billing Address: Latitude}",
"Order: Billing Address: Longitude": "{Order: Billing Address: Longitude}",
"Order: Billing Address: Name": "{Order: Billing Address: Name}",
"Order: Billing Address: Country Code": "{Order: Billing Address: Country Code}",
"Order: Billing Address: Province Code": "{Order: Billing Address: Province Code}",
"Order: Shipping Address: First Name": "{Order: Shipping Address: First Name}",
"Order: Shipping Address: Address1": "{Order: Shipping Address: Address1}",
"Order: Shipping Address: City": "{Order: Shipping Address: City}",
"Order: Shipping Address: Zip": "{Order: Shipping Address: Zip}",
"Order: Shipping Address: Province": "{Order: Shipping Address: Province}",
"Order: Shipping Address: Country": "{Order: Shipping Address: Country}",
"Order: Shipping Address: Last Name": "{Order: Shipping Address: Last Name}",
"Order: Shipping Address: Address2": "{Order: Shipping Address: Address2}",
"Order: Shipping Address: Latitude": "{Order: Shipping Address: Latitude}",
"Order: Shipping Address: Longitude": "{Order: Shipping Address: Longitude}",
"Order: Shipping Address: Name": "{Order: Shipping Address: Name}",
"Order: Shipping Address: Country Code": "{Order: Shipping Address: Country Code}",
"Order: Shipping Address: Province Code": "{Order: Shipping Address: Province Code}",
"Fulfilled By": "{Fulfilled By}",
"Order#": "{Order#}"
}
}]
}
I am curious if someone can tell me why.
I would also suggest you guys at the very least, provide the line or word where syntax is failing.