Request body to create item invoices

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
nkm
Experienced User
10 Posts
Experienced User
Experienced User

10Posts

1Kudos

0Solutions

Request body to create item invoices

Hi,

I am trying to create item invoices. The item invoice body from https://developer.myob.com/api/accountright/v2/sale/invoice/invoice_item/ , seems to have different fields from the Postman collection request body. The request body for the Postman collection seems to have fields such as BillQuantity, which is not in the item invoice body stated in the documentation. So the correct request body to follow is the one that is stated on the API documentation?

{
	"Number": "PSMN002",
	"Date": "2018-09-02T00:00:00",
	"SupplierInvoiceNumber": null,
	"Customer": {
		"UID": "dde4659b-7bb3-4ef7-9312-c13b2fa02f58"
	},
	"ShipToAddress": "Postman Sample, Address, Here",
	"Terms": { 
		"PaymentIsDue": "DayOfMonthAfterEOM",
		"DiscountDate": 1,
		"BalanceDueDate": 30,
		"DiscountForEarlyPayment": 0,
		"MonthlyChargeForLatePayment": 0,
		"DiscountExpiryDate": "2018-09-21T00:00:00",
		"Discount": 0,
		"DueDate": "2018-10-02T00:00:00"
	},
	"IsTaxInclusive": false,
	"IsReportable": false,
	"Lines": [{
		"Type": "Transaction",
		"Description": "Iten 123",
		"BillQuantity": 100,
		"ReceivedQuantity": 100,
		"BackorderQuantity": 0,
		"Total": 1000,
		"UnitPrice": 10,
		"Job": null,
		"DiscountPercent": 0,
		"TaxCode": {
			"UID": "3bd2fbea-54d7-4115-8030-b84360048465"
		},
		"Item": {
			"UID": "fed621c4-9e1b-4afa-a9f0-d7a85d0557bf"
		}
	}],
	"Subtotal": 1000,
	"Freight": 0,
	"FreightTaxCode": {
		"UID": "e4b03cbc-a1aa-4fe0-92a2-bc34530e1fc3"
	},
	"TotalTax": 100,
	"TotalAmount": 1100,
	"Category": null,
	"Comment": "",
	"ShippingMethod": null,
	"PromisedDate": null,
	"JournalMemo": "Purchase; 786",
	"BillDeliveryStatus": "Print",
	"AppliedToDate": 0,
	"BalanceDueAmount": 1100,
	"Status": "Open",
	"LastPaymentDate": null,
	"Order": null,
	"ForeignCurrency": null
}

 

1 REPLY 1
The_Doc
Ultimate Partner
1,537 Posts
Ultimate Partner
Australia
Ultimate Partner

1,537Posts

236Kudos

162Solutions

Re: Request body to create item invoices

Hi @nkm 

 

Though I followed the Postman collection in working this all out in the early days - once I got my code working I didn't use Postman - just didn't need it.

 

Yes there appears to be discrepancies and differences - small - your best bet - well it worked for me was to capture an item invoice directly from MYOB in JSON format - then use that as a template - it is trial and error.

 

The Doc

 

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post