{ "operationId": "createPurchaseOrders", "method": "PUT", "path": "/PurchaseOrders", "summary": "Xero Creates one or more purchase orders", "requestExamples": [ { "contentType": "application/json", "example": { "PurchaseOrders": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "710" } ], "Date": "2019-03-13" } ] } } ], "responseExamples": [ { "status": "200", "contentType": "application/json", "example": { "Id": "aa2f9d23-fd76-4bee-9600-30c0f0f34036", "Status": "OK", "ProviderName": "Provider Name Example", "DateTimeUTC": "/Date(1552522946173)/", "PurchaseOrders": [ { "PurchaseOrderID": "56204648-8fbe-46f8-b09c-2125f7939533", "PurchaseOrderNumber": "PO-0004", "DateString": "2019-03-13 00:00:00", "Date": "/Date(1552435200000+0000)/", "HasErrors": false, "IsDiscounted": false, "TotalDiscount": 0.0, "SentToContact": false, "Type": "PURCHASEORDER", "CurrencyRate": 1.0, "CurrencyCode": "NZD", "Contact": { "ContactID": "430fa14a-f945-44d3-9f97-5df5e28441b8", "ContactStatus": "ACTIVE", "Name": "Liam Gallagher", "FirstName": "Liam", "LastName": "Gallagher", "EmailAddress": "liam@rockstar.com", "BankAccountDetails": "", "Addresses": [ null, { "AddressType": "POBOX", "City": "Anytown", "Region": "NY", "PostalCode": "10101", "Country": "USA", "AttentionTo": "" } ], "Phones": [ { "PhoneType": "DEFAULT", "PhoneNumber": "222-2222", "PhoneAreaCode": "212", "PhoneCountryCode": "" }, null, { "PhoneType": "FAX", "PhoneNumber": "333-2233", "PhoneAreaCode": "212", "PhoneCountryCode": "" }, { "PhoneType": "MOBILE", "PhoneNumber": "444-3433", "PhoneAreaCode": "212", "PhoneCountryCode": "" } ], "UpdatedDateUTC": "/Date(1551747281053+0000)/", "ContactGroups": [ { "ContactGroupID": "17b44ed7-4389-4162-91cb-3dd5766e4e22", "Name": "Oasis", "Status": "ACTIVE", "Contacts": [], "HasValidationErrors": false } ], "IsSupplier": true, "IsCustomer": true, "SalesTrackingCategories": [], "PurchasesTrackingCategories": [], "ContactPersons": [], "HasValidationErrors": false }, "Status": "DRAFT", "LineAmountTypes": "Exclusive", "LineItems": [ { "Description": "Foobar", "UnitAmount": 20.0, "TaxType": "INPUT2", "TaxAmount": 3.0, "LineAmount": 20.0, "AccountCode": "710", "Tracking": [], "Quantity": 1.0, "LineItemID": "792b7e40-b9f2-47f0-8624-b09f4b0166dd" } ], "SubTotal": 20.0, "TotalTax": 3.0, "Total": 23.0, "UpdatedDateUTC": "/Date(1552522946077+0000)/", "StatusAttributeString": "ERROR", "Warnings": [ { "Message": "Only AUTHORISED and BILLED purchase orders may have SentToContact updated." } ], "ValidationErrors": [ { "Message": "Order number must be unique" } ] } ] } } ] }