{"$schema":"http:\/\/json-schema.org\/draft-07\/schema#","$id":"https:\/\/api.fmsync.net\/apiref\/schema\/sage300\/invoice","title":"sage300.invoice","description":"Add an invoice into a Batch. If the sum is negative, Bridge will create a credit invoice.","required":["token","code","date","invoice","lines"],"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\/tokenizer\/sage300\">online Tokenizer<\/a> to generate new tokens.","type":"string"},"batch":{"description":"Name of the batch you want to add the invoice, if it doesn't exist, Bridge will create a new Batch.","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":"Unique Invoice Number","type":"string"},"order":{"description":"Order Number","type":"string"},"po":{"description":"Purchase order number","type":"string"},"date":{"description":"Date of the current invoice","type":"string"},"description":{"description":"Invoice Description","type":"string"},"termcode":{"description":"Payment term code","type":"string"},"currency":{"description":"3 Digits currency code ( CAD, USD )","type":"string"},"lines":{"description":"Invoice Details.","required":["account","description","price","amount"],"type":"array","additionalProperties":false,"properties":{"account":{"description":"Ledger account number","type":"string"},"description":{"description":"Description code","type":"string"},"amount":{"description":"Total amount of the line. Add all amounts in negative to create a credit invoice.","type":"number"}}},"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}}}