...
Create blank invoice,
Book invoice.
Sales prices and amounts are considered to include VAT part by default, e.g. price, discount or total amount on invoice.
Get sales orders (paged)
Word: POST
URL: {host_url}/api/financial/SalesOrder/GetSalesOrdersPage
...
[product]
[product_category]
[product_variant] if product supports variants - variant is required
[product_instance] if product supports instances - instance is required
[financial_account_number]- taken by rules described above
[vat_type] - taken from accounting microservice by financial account number
[sales_price] - calculated by following rule: If product instance is selected and its sales price is not null- product instance's sales price. If not- check variant. If variant is selected and its sales price is not null- variant's sales price. If sales price still not calculated - should be used sales price from product. [sales_price] is considered to include VAT part.
[quantity] - user input. Please note that quantity should be 1 for sales order items where product instance is defined
[manual_discount] - user input. Sale item amount will be calculated as [sales_price] * [quantity]. If it is needed to register sale item with different amount - [manual_discount] should be specified
All enlisted entities will be used in example below. [manual_discount] is considered to include VAT part.[cost_price] - the rule is:
take cost price from instance, if any
take cost price from variant, if any
take cost price from product, if it is null and product.isDefaultCostPriceApplicable = true then product.defaultCostPrice should be used
...
In response sales order Id will be presented.
Advanced flows:
Some customers need to continue modifying sales order even after it is ready or invoiced (e.g. to add work hours to sales order and invoice it separately.). In this case sapera can be told that sales order should support such a flow by setting
AllowModifyingWhenReady = {value: true}
at creation time in root ofCreateSalesOrderCommand
body. When it is set - client app will ask at invoice time if sales order should be completed. User can choose to complete
Update Sales Order
It is possible to update sales order after creation (add or change customer data or contact info, add, change or remove sale items). All model updates described above that are used in CreateSalesOrderCommand may be used in UpdateSalesOrderCommand, they may be reviewed in Swagger.
...
[product]
[product_category]
[product_variant] if product supports variants - variant is required
[product_instance] if product supports instances - instance is required
[financial_account_number] - taken by rules described above ([Get product financial and VAT data])
[vat_type] - taken from accounting microservice by financial account number
[sales_price] - calculated by following rule: If product instance is selected and its sales price is not null- product instance's sales price. If not- check variant. If variant is selected and its sales price is not null- variant's sales price. If sales price still not calculated - should be used sales price from product. [sales_price] is considered to include VAT part.
[quantity] - user input. Please note that quantity should be 1 for sales order items where product instance is defined
[manual_discount] - user input. Sale item amount will be calculated as [sales_price] * [quantity]. If it is needed to register sale item with different amount - [manual_discount] should be specified. [manual_discount] is considered to include VAT part.
All enlisted entities will be used in example below.
...