cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaryT0905
Resolver I
Resolver I

Json Help

I know I'm missing something simple, but can someone help me format this json?  Sometimes the item variant will be empty and that's what I was trying to do, but I'm missing a , or something

 

 

{		
	"type": "object",		
	"properties": {				
		"@@odata.context": {						
			"type": "string"				
		},				
		"@@odata.etag": {						
			"type": "string"				
		},				
		"id": {						
			"type": "string"				
		},				
		"number": {						
			"type": "string"				
		},				
		"externalDocumentNumber": {						
			"type": "string"				
		},				
		"orderDate": {						
			"type": "string"				
		},				
		"postingDate": {						
			"type": "string"				
		},				
		"customerId": {						
			"type": "string"				
		},				
		"customerNumber": {						
			"type": "string"				
		},				
		"customerName": {						
			"type": "string"				
		},				
		"billToName": {						
			"type": "string"				
		},				
		"billToCustomerId": {						
			"type": "string"				
		},				
		"billToCustomerNumber": {						
			"type": "string"				
		},				
		"shipToName": {						
			"type": "string"				
		},				
		"shipToContact": {						
			"type": "string"				
		},				
		"sellToAddressLine1": {						
			"type": "string"				
		},				
		"sellToAddressLine2": {						
			"type": "string"				
		},				
		"sellToCity": {						
			"type": "string"				
		},				
		"sellToCountry": {						
			"type": "string"				
		},				
		"sellToState": {						
			"type": "string"				
		},				
		"sellToPostCode": {						
			"type": "string"				
		},				
		"billToAddressLine1": {						
			"type": "string"				
		},				
		"billToAddressLine2": {						
			"type": "string"				
		},				
		"billToCity": {						
			"type": "string"				
		},				
		"billToCountry": {						
			"type": "string"				
		},				
		"billToState": {						
			"type": "string"				
		},				
		"billToPostCode": {						
			"type": "string"				
		},				
		"shipToAddressLine1": {						
			"type": "string"				
		},				
		"shipToAddressLine2": {						
			"type": "string"				
		},				
		"shipToCity": {						
			"type": "string"				
		},				
		"shipToCountry": {						
			"type": "string"				
		},				
		"shipToState": {						
			"type": "string"				
		},				
		"shipToPostCode": {						
			"type": "string"				
		},				
		"currencyId": {						
			"type": "string"				
		},				
		"currencyCode": {						
			"type": "string"				
		},				
		"pricesIncludeTax": {						
			"type": "boolean"				
		},				
		"paymentTermsId": {						
			"type": "string"				
		},				
		"shipmentMethodId": {						
			"type": "string"				
		},				
		"salesperson": {						
			"type": "string"				
		},				
		"partialShipping": {						
			"type": "boolean"				
		},				
		"requestedDeliveryDate": {						
			"type": "string"				
		},				
		"discountAmount": {						
			"type": "integer"				
		},				
		"discountAppliedBeforeTax": {						
			"type": "boolean"				
		},				
		"totalAmountExcludingTax": {						
			"type": "integer"				
		},				
		"totalTaxAmount": {						
			"type": "integer"				
		},				
		"totalAmountIncludingTax": {						
			"type": "integer"				
		},				
		"fullyShipped": {						
			"type": "boolean"				
		},				
		"status": {						
			"type": "string"				
		},				
		"lastModifiedDateTime": {						
			"type": "string"				
		},				
		"phoneNumber": {						
			"type": "string"				
		},				
		"email": {						
			"type": "string"				
		},				
		"salesOrderLines": {						
			"type": "array",						
			"items": {								
				"type": "object",								
				"properties": {										
					"@@odata.etag": {												
						"type": "string"										
					},										
					"id": {												
						"type": "string"										
					},										
					"documentId": {												
						"type": "string"										
					},										
					"sequence": {												
						"type": "integer"										
					},										
					"itemId": {												
						"type": "string"										
					},										
					"accountId": {												
						"type": "string"										
					},										
					"lineType": {												
						"type": "string"										
					},										
					"lineObjectNumber": {												
						"type": "string"										
					},										
					"description": {												
						"type": "string"										
					},										
					"unitOfMeasureId": {												
						"type": "string"										
					},										
					"unitOfMeasureCode": {												
						"type": "string"										
					},										
					"quantity": {												
						"type": "integer"										
					},										
					"unitPrice": {												
						"type": "integer"										
					},										
					"discountAmount": {												
						"type": "integer"										
					},										
					"discountPercent": {												
						"type": "integer"										
					},										
					"discountAppliedBeforeTax": {												
						"type": "boolean"										
					},										
					"amountExcludingTax": {												
						"type": "integer"										
					},										
					"taxCode": {												
						"type": "string"										
					},										
					"taxPercent": {												
						"type": "integer"										
					},										
					"totalTaxAmount": {												
						"type": "integer"										
					},										
					"amountIncludingTax": {												
						"type": "integer"										
					},										
					"invoiceDiscountAllocation": {												
						"type": "integer"										
					},										
					"netAmount": {												
						"type": "integer"										
					},										
					"netTaxAmount": {												
						"type": "integer"										
					},										
					"netAmountIncludingTax": {												
						"type": "integer"										
					},										
					"shipmentDate": {												
						"type": "string"										
					},										
					"shippedQuantity": {												
						"type": "integer"										
					},										
					"invoicedQuantity": {												
						"type": "integer"										
					},										
					"invoiceQuantity": {												
						"type": "integer"										
					},										
					"shipQuantity": {												
						"type": "integer"										
					},										
					"itemVariantId": {												
						"type": "string"										
					},										
					"locationId": {												
						"type": "string"										
					},										
					"account": {					
					},										
					"item": {												
						"type": "object",												
						"properties": {														
							"@@odata.etag": {																
								"type": "string"														
							},														
							"id": {																
								"type": "string"														
							},														
							"number": {																
								"type": "string"														
							},														
							"displayName": {																
								"type": "string"														
							},														
							"type": {																
								"type": "string"														
							},														
							"itemCategoryId": {																
								"type": "string"														
							},														
							"itemCategoryCode": {																
								"type": "string"														
							},														
							"blocked": {																
								"type": "boolean"														
							},														
							"gtin": {																
								"type": "string"														
							},														
							"inventory": {																
								"type": "integer"														
							},														
							"unitPrice": {																
								"type": "integer"														
							},														
							"priceIncludesTax": {																
								"type": "boolean"														
							},														
							"unitCost": {																
								"type": "integer"														
							},														
							"taxGroupId": {																
								"type": "string"														
							},														
							"taxGroupCode": {																
								"type": "string"														
							},														
							"baseUnitOfMeasureId": {																
								"type": "string"														
							},														
							"baseUnitOfMeasureCode": {																
								"type": "string"														
							},														
							"lastModifiedDateTime": {																
								"type": "string"														
							},														
							"itemCategory": {																
								"type": "object",																
								"properties": {																		
									"@@odata.etag": {																				
										"type": "string"																		
									},																		
									"id": {																				
										"type": "string"																		
									},																		
									"code": {																				
										"type": "string"																		
									},																		
									"displayName": {																				
										"type": "string"																		
									},																		
									"lastModifiedDateTime": {																				
										"type": "string"																		
									}																
								}														
							}												
						}										
					},										
					"itemVariant": {												
						"type": [							
							"object",							
							"null"						
						],												
						"properties": {														
							"@@odata.etag": {																
								"type": "string"														
							},														
							"id": {																
								"type": "string"														
							},														
							"itemId": {																
								"type": "string"														
							},														
							"itemNumber": {																
								"type": "string"														
							},														
							"code": {																
								"type": "string"														
							},														
							"description": {																
								"type": "string"														
							}												
						}										
					}								
				},								
				"required": [										
					"@@odata.etag",										
					"id",										
					"documentId",										
					"sequence",										
					"itemId",										
					"accountId",										
					"lineType",										
					"lineObjectNumber",										
					"description",										
					"unitOfMeasureId",										
					"unitOfMeasureCode",										
					"quantity",										
					"unitPrice",										
					"discountAmount",										
					"discountPercent",										
					"discountAppliedBeforeTax",										
					"amountExcludingTax",										
					"taxCode",										
					"taxPercent",										
					"totalTaxAmount",										
					"amountIncludingTax",										
					"invoiceDiscountAllocation",										
					"netAmount",										
					"netTaxAmount",										
					"netAmountIncludingTax",										
					"shipmentDate",										
					"shippedQuantity",										
					"invoicedQuantity",										
					"invoiceQuantity",										
					"shipQuantity",										
					"locationId",										
					"account",										
					"item"								
				]						
			}				
		},				
		"customer": {						
			"type": "object",						
			"properties": {								
				"@@odata.etag": {										
					"type": "string"								
				},								
				"id": {										
					"type": "string"								
				},								
				"number": {										
					"type": "string"								
				},								
				"displayName": {										
					"type": "string"								
				},								
				"type": {										
					"type": "string"								
				},								
				"addressLine1": {										
					"type": "string"								
				},								
				"addressLine2": {										
					"type": "string"								
				},								
				"city": {										
					"type": "string"								
				},								
				"state": {										
					"type": "string"								
				},								
				"country": {										
					"type": "string"								
				},								
				"postalCode": {										
					"type": "string"								
				},								
				"phoneNumber": {										
					"type": "string"								
				},								
				"email": {										
					"type": "string"								
				},								
				"website": {										
					"type": "string"								
				},								
				"taxLiable": {										
					"type": "boolean"								
				},								
				"taxAreaId": {										
					"type": "string"								
				},								
				"taxAreaDisplayName": {										
					"type": "string"								
				},								
				"taxRegistrationNumber": {										
					"type": "string"								
				},								
				"currencyId": {										
					"type": "string"								
				},								
				"currencyCode": {										
					"type": "string"								
				},								
				"paymentTermsId": {										
					"type": "string"								
				},								
				"shipmentMethodId": {										
					"type": "string"								
				},								
				"paymentMethodId": {										
					"type": "string"								
				},								
				"blocked": {										
					"type": "string"								
				},								
				"lastModifiedDateTime": {										
					"type": "string"								
				}						
			]				
		}		
	}
}
}

 

1 REPLY 1
Pstork1
Dual Super User
Dual Super User

Remove Item from the required properties and change the Type in the schema to accept either an object or null like this.

"items": {								
	"type": ["object", "null"],

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,585)