{"$schema":"http:\/\/json-schema.org\/draft-07\/schema#","$id":"https:\/\/api.fmsync.net\/apiref\/schema\/sage50ca\/invoice","title":"sage50ca.invoice","description":"Add\/Update Sage Invoices.","required":["token","code","date"],"type":"object","additionalProperties":false,"properties":{"token":{"description":"Encrypted token that contains de credential to access the accounting software. Use the <a href=\"https:\/\/fmsync.net\/en\/tokenizer\">online Tokenizer<\/a> to generate new tokens.","type":"string"},"code":{"description":"The unique identifier for a client, Bridge will use all informations for this client to create the invoice (Address, Terms, GL etc).","type":"string"},"invoice":{"description":"Existing Invoice Number that you need to modify","type":"string"},"date":{"description":"Date of the current invoice","type":"string"},"reference":{"description":"Invoice Reference","type":"string"},"comment":{"description":"Invoice comments","type":"string"},"ship":{"description":"Shipping Informations","type":"array","required":["date","address"],"minItems":1,"maxItems":2,"properties":{"date":{"description":"Shipping date","type":"string"},"address":{"description":"Shipping address","type":"array"}}},"lines":{"description":"Invoice Details.","required":["description","quantity","price","amount","taxcode"],"type":"array","additionalProperties":false,"properties":{"product":{"description":"Product Code of the line, need to be a valid product code from Acomba Inventory.","type":"string"},"description":{"description":"Product Code of the line, need to be a valid product code from Acomba Inventory.","type":"string"},"quantity":{"description":"Quantity of the line. Put 0 if you need a description line only.","type":"number"},"price":{"description":"Unit Price of the line. Put 0 if you need a description line only.","type":"number"},"amount":{"description":"Total amount of the line. If less than Price*Quantity, Sage will add a discount to the line. Put 0 if you need a description line only.","type":"number"},"taxcode":{"description":"Tax code for this line.","type":"string"}}},"return":{"description":"Return informations to your application","required":["table","record","fninvoicenumber"],"type":"object","properties":{"table":{"description":"Table\/Layout where your informations will be returned","type":"string"},"record":{"description":"Record that need to be updated","required":["key","value"],"type":"object","properties":{"key":{"description":"Primary Key Name","type":"string"},"value":{"description":"Primary Key Value","type":"string"}}},"fninvoicenumber":{"description":"Field name of Invoice Number for the created invoice.","type":"string"},"fnprefix":{"description":"Field name of the Prefix that should be attached to your Invoice number.","type":"string"},"syslog":{"description":"Status returned to your system table","required":["table","record","fnstatus"],"type":"object","properties":{"table":{"description":"Name of your system table","type":"string"},"record":{"description":"Record that need to be updated","required":["key","value"],"type":"object","properties":{"key":{"description":"Primary Key Name","type":"string"},"value":{"description":"Primary Key Value","type":"string"}}},"fnstatus":{"description":"Field Name of the status column","type":"string"},"fntaskid":{"description":"Field Name of the taskid column","type":"string"},"fnmessage":{"description":"Field Name of the message column","type":"string"}}}}}},"example":{"token":"eyJjaWUiOiJDOlxcVXNlcnNcXFB1YmxpY1xcRG9jdW1lbnRzXFxTaW1wbHkgQWNjb3VudGluZ1xcMjAxOFxcU2FtZGF0YVxcRW50ZXJwcmlzZVxcVW5pdmVyc2wuU0FJIiwidXNlciI6ImZtc3luYyIsInBhc3MiOiJmbXN5bmMifQ==","code":"Askew Shopping Centre","date":"Mar 31, 2015","reference":"This my Reference","comment":"This is my comment","lines":[{"product":"C1020","description":"Trump's Toilet paper","quantity":1,"price":10,"amount":10,"taxcode":"GP"},{"product":"D1020","description":"T-Shirt","quantity":2,"price":10,"amount":20,"taxcode":"GP"}]},"return":{"success":true,"taskid":"96fc4830f56bee198be6aa8c91a59450cfa4dc74","data":{"noinvoice":"10082","prefix":"CA"},"context":"acomba.invoice","source":{"type":"odbc","sent":true,"message":null},"syslog":{"type":"odbc","sent":true,"message":null}}}