{"$schema":"http:\/\/json-schema.org\/draft-07\/schema#","$id":"https:\/\/api.fmsync.net\/apiref\/schema\/acomba\/purchase","title":"acomba.purchase","description":"Using the Invoicing module of Acomba, a printable purchase will be created for the supplier. Created purchase cannot be modified, create a new acomba.purchase task and reverse any quantities and Shipping fees.","required":["token","code","date"],"type":"object","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 supplier, Bridge will use all informations for this supplier to create the purchase (Address, Terms, GL etc).","type":"string"},"date":{"description":"Date of the current purchase","type":"string"},"purchasetoclient":{"description":"Client code to address the purchase","type":"string"},"reference":{"description":"Purchase Reference","type":"string"},"description":{"description":"Purchase short description","type":"string"},"project":{"description":"Project number associate with this purchase","type":"number"},"taxgroup":{"description":"Name of the Tax Group, if not defined, bridge will use the default tax group of the supplier","type":"string"},"ship":{"description":"Shipping informations","type":"object","properties":{"name":{"description":"Name of the company where it will be shipped","type":"string"},"contact":{"description":"Contact name of the shipping address","type":"string"},"address":{"description":"Shipping address","type":"string"},"city":{"description":"Shipping City","type":"string"},"postal":{"description":"Shipping Postal\/ZIP Code","type":"string"},"country":{"description":"Shipping Country Name","type":"string"},"amount":{"description":"Shipping Fees","type":"number"}}},"lines":{"description":"Purchase Details.","required":["description","quantity","price"],"type":"array","minProperties":2,"maxProperties":100,"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":"Price of the line. Put 0 if you need a description line only.","type":"number"}}},"return":{"description":"Return informations to your application","required":["table","record","fnpurchasenumber"],"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":"integer"}}},"fnpurchasenumber":{"description":"Field name of Purchase Number for the created purchase.","type":"string"},"fnprefix":{"description":"Field name of the Prefix that should be attached to your Purchase 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":"integer"}}},"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":"1714919909","code":"5593366","date":"08\/01\/18","reference":"This my Reference","description":"This is my description","taxgroup":"GST","ship":{"name":"Miracle Company","contact":"John Doe","address":"123 Bonneville Street","city":"Montreal","postal":"J9E 4T4","country":"CA","amount":30.99},"lines":[{"product":"GiftCertificates","description":"Gift Certificat","quantity":1,"price":10},{"product":"WFrenchWin","description":"Steel French Window and 2 Tiled Windows","quantity":1.45,"price":375.45},{"description":"Descriptive line only","quantity":0,"price":0}],"return":{"table":"acomba.purchase","record":{"key":"id","value":1},"fnpurchasenumber":"nopurchase","fnprefix":"prefix","syslog":{"table":"syslog","record":{"key":"id","value":1},"fntaskid":"taskid","fnstatus":"status","fnmessage":"message"}}},"return":{"success":true,"message":null,"taskid":"20a686bf4bab9df1b0f30c85842d2b556d9898e5","context":"acomba.purchase","data":{"purchasenumber":"14657","prefix":"SU"}}}