Personal tools

Web API Examples

From TrueERP wiki

Revision as of 14:25, 27 February 2012 by Simon Clive (Talk | contribs)

Jump to: navigation, search

https://Server1/Sample_Company/TCustomer

{
"tcustomer":[
{
"href":"http\/\/Server1\/erpapi\/tcustomer\/1",
"ID":1,
"msTimeStamp":"2010-10-02 01:31:15",
"ClientName":"Cash Customer",
"GlobalRef":"DEF1"
},
{
"href":"http\/\/Server1\/erpapi\/tcustomer\/2",
"ID":2,
"msTimeStamp":"2011-07-13 10:08:42",
"ClientName":"Workshop",
"GlobalRef":"DEF2"
},
{
"href":"http\/\/Server1\/erpapi\/tcustomer\/3",
"ID":3,
"msTimeStamp":"2011-07-13 10:08:42",
"ClientName":"Apple Corp",
"GlobalRef":"DEF3"
},
{
"href":"http\/\/Server1\/erpapi\/tcustomer\/5",
"ID":5,
"msTimeStamp":"2011-11-22 19:37:10",
"ClientName":"Mr Smith",
"GlobalRef":"DEF5"


https://Server1/erpapi/TCustomer/5

{
"type":"TCustomer",
"fields":
{
"ABN":"",
"Active":true,
"Altcontact":"",
"AltPhone":"",
"ARBalance":60,
"Area":0,
"AssessorsName":"",
"BailmentAmountEx":0,
"BailmentNumber":"",
"Balance":60,
"BankAccountBSB":"",
"BankAccountName":"",
"BankAccountNo":"",
"BankCode":"",
"Billcountry":"Australia",
"BillingAddress":"87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"BillingAddressWithName":"Mr Smith\r\n87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"BillPostcode":"3851",
"BillState":"VIC",
"BillStreet":"87 Nerang Street",
"BillStreet2":"",
"BillStreet3":"",
"Billsuburb":"GOLDEN BEACH",
"BodyType":"",
"CallPriority":5,
"CardNumber":"",
"ClientAddress":"Mr Smith\r\n87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"ClientDetails":"Mr Joe Smith\r\nMr Smith\r\n87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"ClientName":"Mr Smith",
"ClientNo":"",
"ClientTypeName":"Default",
"Colour":"",
"Contacts":[
{
"type":"TContact",
"fields":
{
"AccountNo":"",
"Active":true,
"CardNumber":"",
"Company":"John Smith",
"ContactAddress":"87 Nerang Street",
"ContactAddress2":"",
"ContactAddress3":"",
"ContactAltPH":"",
"ContactCity":"GOLDEN BEACH",
"ContactCountry":"",
"ContactEmail":"",
"ContactFax":"0755658978",
"ContactFirstName":"John",
"ContactMOB":"",
"ContactPcode":"3851",
"ContactPH":"0755987856",
"ContactState":"VIC",
"ContactSurName":"Smith",
"ContactTitle":"",
"CustomerName":"Mr Smith",
"EmployeeName":"",
"GlobalRef":"DEF59",
"ID":59,
"IsPrimaryContact":false,
"JobName":"",
"JobTitle":"",
"MsTimeStamp":"2011-08-03 10:15:51",
"Notes":"",
"OtherContactName":"",
"SupplierName":"",
"TeamviewerID":"",
"UseOnRun":false
}
},
{
"type":"TContact",
"fields":
{
"AccountNo":"",
"Active":true,
"CardNumber":"",
"Company":"Mr Smith",
"ContactAddress":"87 Nerang Street",
"ContactAddress2":"",
"ContactAddress3":"",
"ContactAltPH":"",
"ContactCity":"GOLD COAST MC",
"ContactCountry":"",
"ContactEmail":"",
"ContactFax":"0755658978",
"ContactFirstName":"Joe",
"ContactMOB":"0142545878",
"ContactPcode":"9727",
"ContactPH":"0755987856",
"ContactState":"QLD",
"ContactSurName":"Smith",
"ContactTitle":"Mr",
"CustomerName":"Mr Smith",
"EmployeeName":"",
"GlobalRef":"DEF46",
"ID":46,
"IsPrimaryContact":true,
"JobName":"",
"JobTitle":"",
"MsTimeStamp":"2010-09-01 20:41:53",
"Notes":"",
"OtherContactName":"",
"SupplierName":"",
"TeamviewerID":"",
"UseOnRun":false
}
}],
"Country":"Australia",
"CreditBalance":803.5,
"CreditLimit":2000,
"CUSTDATE1":"",
"CUSTFLD3":"",
"CUSTFLD4":"",
"CustomerNextInvoiceNo":1,
"CustomfieldValues":null,
"DefaultClassName":"",
"DefaultContactMethod":"",
"DeliveryNotes":"",
"DischargeDate":"",
"Discount":0,
"DontContact":false,
"Email":"",
"EmailXML":"",
"ExcessAmount":0,
"Faxnumber":"0755658978",
"FinalDestination":"",
"FirstName":"Joe",
"ForcePONumOnInvoice":false,
"ForcePOOnBooking":false,
"ForcePOOnRepair":false,
"ForeignExchangeCode":"AUD",
"GlobalRef":"DEF5",
"GracePeriod":5,
"GroupDiscountOverridesAll":false,
"hours":0,
"ID":5,
"IncoPlace":"",
"InvoiceComment":"",
"InvoiceCommentPopUp":false,
"IsCustomer":true,
"IsOtherContact":false,
"IsSupplier":false,
"LastName":"Smith",
"ManufactureName":"",
"Mobile":"0142545878",
"Model":null,
"MsTimeStamp":"2011-11-22 19:37:10",
"NewOrUsed":"",
"Notes":"",
"OtherFollowUps":null,
"ParentClientName":"",
"ParentRelatedClientName":"",
"PaymentMethodName":"",
"Phone":"0755987856",
"PhonesupportTill":"",
"PickingPriority":5,
"POComment":"",
"POCommentPopup":false,
"PortOfDischarge":"",
"PortOfLanding":"",
"Postcode":"3851",
"ProductGroupDiscount":null,
"RelatedCustomers":null,
"RepName":"John Citizen",
"RewardPointsExpireDate":"",
"RewardPointsOpeningBalance":0,
"RewardPointsOpeningDate":"",
"SalesOrderBalance":743.5,
"ShippingAgentCode":"",
"ShippingMethodName":"",
"ShipToAddress":"Mr Smith\r\n87 Nerang Street\r\nGOLDEN BEACH VIC 3851",
"SkypeName":"",
"SourceName":"Radio",
"SpecialDiscount":0,
"SpecialProductPriceOverridesAll":false,
"SpecialProducts":null,
"State":"VIC",
"StockReceivedDate":0,
"StopCredit":false,
"StormDate":"",
"StormLocation":"",
"Street":"87 Nerang Street",
"Street2":"",
"Street3":"",
"StreetAddress":"87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"StreetAddressWithName":"Mr Smith\r\n87 Nerang Street\r\nGOLDEN BEACH VIC 3851\r\nAustralia",
"Suburb":"GOLDEN BEACH",
"TaxCodeName":"",
"TeamviewerID":"",
"TermsName":"EOM",
"Title":"Mr",
"URL":"",
"UseCustomerInvoiceNo":false,
"Year":""
}
}


https://Server1/Sample_Company/TInvoice

{
"type":"TInvoice",
"fields":
{
"GLAccountName":"Accounts Receivable",
"CustomerName":"4X4 World",
"TermsName":"COD",
"EmployeeName":"Admin .",
"SaleClassName":"Default",
"SaleDate":"2012-02-27",
"ShipToDesc":"XYZ Pty Ltd\r\n12 Mud Drive\r\nROTTNEST ISLAND WA 6161\r\nAustralia",
"Lines":[
{
"type":"TInvoiceLine",
"fields":
{
"ProductName":"MatrixXSRed",
"UnitOfMeasure":"Units",
"UOMQtySold":2,
"LinePrice":10,
"LineTaxCode":"GST",
"LinePriceInc":11,
"TotalLineAmount":20,
"TotalLineAmountInc":22
}
},
{
"type":"TInvoiceLine",
"fields":
{
"ProductName":"MatrixSmlRed",
"UnitOfMeasure":"Units",
"UOMQtySold":1,
"LinePrice":10,
"LineTaxCode":"GST",
"LinePriceInc":11,
"TotalLineAmount":10,
"TotalLineAmountInc":11
}
}],
"Comments":"This is comment line one\r\nand this is comment line two.",
"TotalAmount":30,
"TotalAmountInc":33
}
}


{
"type":"TInvoice",
"fields":
{
"AddToManifest":false,
"AmountDue":0,
"ApplyFlag":false,
"ARNotes":"",
"AutoSmartOrderRef":"",
"BackOrderGlobalRef":"",
"BarcodePickingDone":false,
"BaseNo":"",
"BlindBalancePeriodID":0,
"Cancelled":false,
"ChequeNumber":"",
"CleanContributionAmount":0,
"ClientName":"4X4 World",
"Comments":"This is comment line one\r\nand this is comment line two.",
"CommissionPaid":false,
"ConNote":"",
"ContactName":"",
"ContributionAmount":0,
"Converted":false,
"CreationDate":"2012-02-27 00:00:00",
"CustomerName":"4X4 World",
"CustPONumber":"",
"Deleted":false,
"Deposited":false,
"DocNumber":"1768",
"DueDate":"2012-02-27 00:00:00",
"EarlyPaymentDiscountAmount":0,
"EmployeeName":"Admin .",
"EnteredAt":"12:34:53 PM",
"EnteredBy":"Web User",
"ForeignBalanceAmount":0,
"ForeignExchangeCode":"AUD",
"ForeignExchangeRate":1,
"ForeignPaidAmount":0,
"ForeignTotalAmount":0,
"GLAccountName":"Accounts Receivable",
"GlobalRef":"DEF1768",
"HoldSale":true,
"ID":1768,
"InvoicePrintDesc":"",
"InvoiceToDesc":"4X4 World\r\n12 Mud Drive\r\nROTTNEST ISLAND WA 6161\r\nAustralia",
"IsBarcodePicking":false,
"IsInternalOrder":false,
"IsManifest":false,
"IsPaid":false,
"Lines":[
{
"type":"TInvoiceLine",
"fields":
{
"Active":true,
"AssetAccount":"",
"Attrib1Sale":0,
"Attrib1SaleRate":0,
"Attrib2Sale":0,
"AutoSmartOrder":false,
"BaseLineGlobalRef":"",
"BOQty":2,
"CalcGrossProfitPercentInc":0,
"CalcProfit":0,
"CalcProfitEx":0,
"CalcProfitPercent":0,
"CalcProfitPercentEx":0,
"CogsAccount":"",
"CreationDate":"",
"CustomData":"",
"Deleted":false,
"DiscountAmount":0,
"DiscountPercent":0,
"DocketNumber":"F",
"FESalesLines":null,
"ForeignExchangeCode":"",
"ForeignExchangeRate":0,
"ForeignHedgingUsed":false,
"ForeignLinePrice":11,
"ForeignTotalLineAmount":0,
"FormulaID":0,
"GlobalRef":"DEF2637",
"GrossProfitbasedLatestCostPercentInc":100,
"GrossProfitPercentInc":100,
"ID":2637,
"IncomeAccount":"",
"Invoiced":false,
"IsFormulaRElatedProduct":false,
"IsQuote":false,
"IsRelatedProduct":false,
"LatestCostPrice":0,
"LatestCostPriceInc":0,
"LaybyId":"0",
"LineCost":0,
"LineCostInc":0,
"LineNotes":"",
"LinePrice":10,
"LinePriceInc":11,
"LineTaxCode":"GST",
"LineTaxRate":0.1,
"LineTaxTotal":0,
"MarkupAmount":0,
"MarkupPercent":0,
"MatrixDesc":"",
"MatrixPrice":0,
"MatrixRef":"",
"MemoLine":"",
"MsTimeStamp":"2012-02-27 12:34:54",
"OrderQty":2,
"OriginalLinePrice":10,
"ParentProductName":"",
"PartBarcode":"",
"PartSpecID":0,
"PQA":null,
"ProductDescription":"",
"ProductGroup":"",
"ProductName":"MatrixXSRed",
"ProductType":"",
"Product_Description":"",
"Product_Description_Memo":"",
"Profit":20,
"ProfitbasedLatestCost":20,
"ProfitbasedLatestCostInc":22,
"ProfitbasedLatestCostPercent":100,
"ProfitbasedLatestCostPercentInc":100,
"ProfitInc":22,
"ProfitPercent":100,
"ProfitPercentInc":100,
"ProgressPaymentRef":"",
"Qty":0,
"QtyBackOrder":2,
"QtyShipped":0,
"QtySold":2,
"RefundQty":0,
"RelatedParentLineRef":"",
"RelatedProductQty":0,
"SalesLinesCustField1":"",
"SalesLinesCustField10":"",
"SalesLinesCustField2":"",
"SalesLinesCustField3":"",
"SalesLinesCustField4":"",
"SalesLinesCustField5":"",
"SalesLinesCustField6":"",
"SalesLinesCustField7":"",
"SalesLinesCustField8":"",
"SalesLinesCustField9":"",
"SeqNo":1,
"SerialNumbers":"",
"ShipDate":"2012-02-27 00:00:00",
"SmartOrderCreated":false,
"SoldSerials":"",
"SortID":10,
"SpecDescription":"",
"SpecValue":"0",
"SupplierName":"",
"TimeCostUsed":false,
"TotalLineAmount":0,
"TotalLineAmountInc":0,
"TransDate":"2012-02-27 00:00:00",
"UnitOfMeasure":"Units",
"UOMMultiplier":1,
"UOMNameProductKey":"Units:",
"UOMOrderQty":2,
"UOMQty":0,
"UOMQtyBackOrder":2,
"UOMQtyShipped":0,
"UOMQtySold":2,
"WarrantyEndsOn":"",
"WarrantyPeriod":""
}
},
{
"type":"TInvoiceLine",
"fields":
{
"Active":true,
"AssetAccount":"",
"Attrib1Sale":0,
"Attrib1SaleRate":0,
"Attrib2Sale":0,
"AutoSmartOrder":false,
"BaseLineGlobalRef":"",
"BOQty":1,
"CalcGrossProfitPercentInc":0,
"CalcProfit":0,
"CalcProfitEx":0,
"CalcProfitPercent":0,
"CalcProfitPercentEx":0,
"CogsAccount":"",
"CreationDate":"",
"CustomData":"",
"Deleted":false,
"DiscountAmount":0,
"DiscountPercent":0,
"DocketNumber":"F",
"FESalesLines":null,
"ForeignExchangeCode":"",
"ForeignExchangeRate":0,
"ForeignHedgingUsed":false,
"ForeignLinePrice":11,
"ForeignTotalLineAmount":0,
"FormulaID":0,
"GlobalRef":"DEF2638",
"GrossProfitbasedLatestCostPercentInc":100,
"GrossProfitPercentInc":100,
"ID":2638,
"IncomeAccount":"",
"Invoiced":false,
"IsFormulaRElatedProduct":false,
"IsQuote":false,
"IsRelatedProduct":false,
"LatestCostPrice":0,
"LatestCostPriceInc":0,
"LaybyId":"0",
"LineCost":0,
"LineCostInc":0,
"LineNotes":"",
"LinePrice":10,
"LinePriceInc":11,
"LineTaxCode":"GST",
"LineTaxRate":0.1,
"LineTaxTotal":0,
"MarkupAmount":0,
"MarkupPercent":0,
"MatrixDesc":"",
"MatrixPrice":0,
"MatrixRef":"",
"MemoLine":"",
"MsTimeStamp":"2012-02-27 12:34:54",
"OrderQty":1,
"OriginalLinePrice":10,
"ParentProductName":"",
"PartBarcode":"",
"PartSpecID":0,
"PQA":null,
"ProductDescription":"",
"ProductGroup":"",
"ProductName":"MatrixSmlRed",
"ProductType":"",
"Product_Description":"",
"Product_Description_Memo":"",
"Profit":10,
"ProfitbasedLatestCost":10,
"ProfitbasedLatestCostInc":11,
"ProfitbasedLatestCostPercent":100,
"ProfitbasedLatestCostPercentInc":100,
"ProfitInc":11,
"ProfitPercent":100,
"ProfitPercentInc":100,
"ProgressPaymentRef":"",
"Qty":0,
"QtyBackOrder":1,
"QtyShipped":0,
"QtySold":1,
"RefundQty":0,
"RelatedParentLineRef":"",
"RelatedProductQty":0,
"SalesLinesCustField1":"",
"SalesLinesCustField10":"",
"SalesLinesCustField2":"",
"SalesLinesCustField3":"",
"SalesLinesCustField4":"",
"SalesLinesCustField5":"",
"SalesLinesCustField6":"",
"SalesLinesCustField7":"",
"SalesLinesCustField8":"",
"SalesLinesCustField9":"",
"SeqNo":2,
"SerialNumbers":"",
"ShipDate":"2012-02-27 00:00:00",
"SmartOrderCreated":false,
"SoldSerials":"",
"SortID":20,
"SpecDescription":"",
"SpecValue":"0",
"SupplierName":"",
"TimeCostUsed":false,
"TotalLineAmount":0,
"TotalLineAmountInc":0,
"TransDate":"2012-02-27 00:00:00",
"UnitOfMeasure":"Units",
"UOMMultiplier":1,
"UOMNameProductKey":"Units:",
"UOMOrderQty":1,
"UOMQty":0,
"UOMQtyBackOrder":1,
"UOMQtyShipped":0,
"UOMQtySold":1,
"WarrantyEndsOn":"",
"WarrantyPeriod":""
}
}],
"MedType":"",
"Memo":"",
"MsTimeStamp":"2012-02-27 12:34:54",
"NoOfBoxes":0,
"OrderNumber":"",
"OriginalDocNumber":"DEF1768",
"PayDueDate":"",
"PayMethod":"",
"PickMemo":"",
"PickupFromDesc":"",
"PlannedDeliveryFrom":"",
"PlannedDeliveryTo":"",
"POCreated":false,
"POSPostCode":"",
"PrintedAt":"",
"PrintedBy":"",
"PrintedOn":"",
"PrintFlag":false,
"PrintHold":false,
"QuoteGlobalRef":"",
"RepairGlobalRef":"",
"RepairID":0,
"SaleClassName":"Default",
"SaleDate":"2012-02-27 00:00:00",
"SaleDateTime":"2012-02-27 00:00:00",
"SalesCategory":"",
"SalesOrderGlobalRef":"",
"SalesStatus":"",
"ShipDate":"2012-02-27 00:00:00",
"Shipping":"",
"ShippingCost":0,
"ShipToDesc":"XYZ Pty Ltd\r\n12 Mud Drive\r\nROTTNEST ISLAND WA 6161\r\nAustralia",
"ShipToID":0,
"SOProgressPaymentGlobalRef":"",
"SOProgressPaymentOriginalRef":"",
"TermsName":"COD",
"TillID":1,
"TillName":"",
"TimeOfSale":"",
"TotalAmount":0,
"TotalAmountInc":0,
"TotalAttrib1Sale":0,
"TotalAttrib1SaleRate":0,
"TotalAttrib2Sale":0,
"TotalBalance":0,
"TotalCost":0,
"TotalDiscount":0,
"TotalMarkup":0,
"TotalPaid":0,
"TotalQtyBackOrdered":0,
"TotalQuoteAmount":0,
"TotalQuoteAmtInc":0,
"TotalTax":0,
"TotalWEGTax":0,
"TotalWETTax":0,
"UsedOnManifest":false,
"UseWholesalePrice":false
}
}