Create Receipt
Creates new receipt in Octopos system. Receipt expects payload with list of items and payments.
Method: POST
Path: /weborder
Sample request
This is request with minimum required data. Prerequisite for this type of request is that all product codes from request already exist is database.
Sample request with creating new products
This is request will create or update existing products in database. For each item you need to provide additional fields such as: Name, Group, Unit measure, Tax label.
Sample request with modifiers
This is request will create order with optional modifiers for items.
Sample request with returning fiscal receipt
This is request will create order and return textual representation of fiscal receipt.
Sample response
Response returns orderId. After success you can call method get order to get order details. If you want to get fiscal receipt in response, you need to specify ReturnFiscalReceipt=true and FiscalReceiptLineWidth=40 (32 to 60) in payload.
Sample response with returning fiscal receipt
Response returns orderId and fiscalReceipt.
Payload details
Field | Data type | Mandatory | Description |
---|---|---|---|
TableName | string | No | Table name from method get all tables |
CompanyTaxNumber | string | No | Tax number of customer for which order is being created |
Info | string | No | Additional note for order |
Items | array | Yes | List of receipt items |
Items/ProductCode | string | Yes | Product Code from get products or new product code. |
Items/ProductName | string | No | Product name (mandatory when creating new product) |
Items/GroupName | string | No | Group name (mandatory when creating new product) |
Items/UnitMeasure | string | No | Unit measure name (mandatory when creating new product) |
Items/TaxLabel | string | No | Tax label (mandatory when creating new product) e.g. А, Е, Ђ |
Items/Quantity | number | Yes > 0 | Order quantity. Must be greater than 0. |
Items/Price | number | Yes | Product price from get products. Price can be one of happy hour prices if there is happy hour definition for product. |
Items/Info | string | No | Additional description for order item. |
Items/Modifiers | array | No | If product has modifiers. |
Items/Modifiers/ProductCode | number | Yes | Product Code from get products or new product code. |
Items/Modifiers/ProductName | string | No | Product name (mandatory when creating new product) |
Items/Modifiers/GroupName | string | No | Group name (mandatory when creating new product) |
Items/Modifiers/UnitMeasure | string | No | Unit measure name (mandatory when creating new product) |
Items/Modifiers/TaxLabel | string | No | Tax label (mandatory when creating new product) e.g. А, Е, Ђ |
Items/Modifiers/Quantity | number | Yes | Sum of quantity for one order item must be >= product.ModifierMinCount and <= product.ModifierMaxCount. |
Items/Modifiers/Price | number | No | If modifier has price. |
Payments | array | No | Mandoatory if TableName is empty. Hold a list of payment types to close receipt. |
Payments/PaymentTypeId | number | Yes | 2=Cash, 3=CreditCard, 4=Invoice |
Payments/FiscalPaymentTypeId | number | No | Use this field for electronic fiscalization in Serbia (PaymentTypeId either don’t send or set to 0). Values are
1=Cash (Gotovina) 2=CreditCard (Kartica) 3=Cheque (Ček) 4=Wire transfer (Prenos na račun) 5=Voucher (Vaučer) 6=Mobile payment (Instant plaćanje) 0=Other (Drugo) |
Payments/Amount | number | Yes | Amount paid. Sum of all payment amounts must be the same as amount of all order items including modifier prices. |
ExternalId | string | No | Use this field to identify your order id. It is not mandatory but it is recommended in order to prevent duplicate requests. In sandbox environment use some prefix because other customers may use same ExternalId (e.g. ExternalId=”octopos-908″) |
ElectronicFiscalizationInvoiceType | number | No | Default value is 0 (Normal)
Possible values:
|
FiscalReceiptData | object | No | Additional values for fiscal receipt |
FiscalReceiptData/ReturnTextualRepresentation | bool | Yes | Default value is false. Set true if you want get fiscal receipt in response. |
FiscalReceiptData/LineWidth | number | No | Default value is 40. This will be used to create textual representation of fiscal receipt if FiscalReceiptData/ReturnTextualRepresentation is set to true. |
FiscalReceiptData/Jmbg | string | No | JMBG for customer identification |
FiscalReceiptData/TaxNumber | string | No | TaxNumber for customer identification |
FiscalReceiptData/BuyerId | string | No | Buyer id according to TaxCore specification Рачун са идентификацијом купца (purs.gov.rs) |
FiscalReceiptData/BuyerCostCenterId | string | No | Buyer cost center id accoring to TaxCode specificationРачун са идентификацијом купца (purs.gov.rs) |
FiscalReceiptData/TextBefore | string | No | Free text to print before Start fiscal receipt line |
FiscalReceiptData/TextAfter | string | No | Free text to print after End fiscal receipt line |
ReferenceDocumentNumber | string | No | Reference fiscal receipt number (for copy, refund, etc.) |
ReferenceDocumentDT | date | No | Reference fiscal receipt issue time (for copy, refund, etc.) |