User Tools

Site Tools


webapi_swagger_documentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
webapi_swagger_documentation [2020/05/06 13:43 (4 years ago)] kevinwebapi_swagger_documentation [2020/05/25 11:16 (4 years ago)] – [Troubleshooting] kevin
Line 278: Line 278:
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
-===Access Violation when making API call===+===== Common Errors/Issues ===== 
 + 
 +** Getting POS Failure! {"error":"Assertion failure (R:\system5\projects\prgs\FullInvoice.pas, line 50886)"} when pushing an order through WEB API .** 
 + 
 +Reasons :  
 +The JSON that is being used is invalid.  
 + 
 +Only 1 InvoiceLines Array is allowed. 
 +The Description must only have 255 characters MAXIMUM! The database will throw away anything longer.  
 +The Invoice Comment must not contain invalid characters. (Carriage Returns and Line Feeds) 
 + 
 +Additional information: 
 +You do not need to include the InvoiceCustomer / InvoiceShipTo unique numbers AND the InvoiceShipping / InvoiceBilling 
 +One or the other is all that is required. If you know the Unique Numbers, use them. The system will ignore the InvoiceShipping and InvoiceBilling data. 
 +If you don’t, then use the InvoiceShipping and InvoiceBilling. The system will look-up the Account records or create them. 
 + 
 +Here is what is should look like: 
 +<code> 
 +
 +  "Invoice":
 +    { 
 +      "InvoiceHeader":
 +        "InvoiceSubTotal": 87, 
 +        "InvoiceTaxTotal": 8.97, 
 +        "InvoiceOrdered": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceDate": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceType": "W", 
 +        "InvoiceSubType": "O", 
 +        "InvoiceDepartment": 0, 
 +        "InvoiceBookMonth": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceCustomer": 31599, 
 +        "InvoiceShipTo": 31599, 
 +        "InvoiceSalesman": 1, 
 +        "InvoiceComment": "This is a test order. Please do not process! Item 1: This is a delivered product. Delivery 321 elm street  60607 Business. Product Name: Arrangement. Product Options: Color: Earth - 0, Size: Large - 20, Delivery: 60607 - 17. Recipient: TesterChicago, 3332221111, [email protected]. Card message: Hi, nnLook forward to you receiving these testing flowers.nnJoe. Delivery date 08/31/19." 
 +      }, 
 +      "InvoiceTenders":
 +        { 
 +          "Type": "O", 
 +          "Amount": 95.92 
 +        } 
 +      ], 
 +      "InvoiceLines":
 +        { 
 +          "PartUnique": 15868, 
 +          "Ordered": 1, 
 +          "Price": 50, 
 +          "Description": "This is a test order. Please do not process!" 
 +        }, 
 +        { 
 +          "Part": "SHIPPING", 
 +          "Ordered": 1, 
 +          "Price": 17, 
 +          "Description": "SHIPPING/DELIVERY" 
 +        } 
 +      ] 
 +    } 
 +  ], 
 +  "ConnectionInfo":
 +    "TerminalNumber":
 +  } 
 +
 +</code> 
 + 
 +You can prevent all of these problems by simply checking the JSON payload in a JSON editor like: 
 +https://jsoneditoronline.org/ 
 + 
 + 
 + 
 +** Adding Newline Feed on Invoice Comment ** 
 + 
 +In /addInvoice method, you can add Invoice Comment. In the parameter, look for this field "InvoiceComment" and add your comment.  
 + 
 +To add a new line feed, add this \\n in the comment. 
 + 
 +** Access Violation when making API call ** 
 + 
 +When troubleshooting the s5webAPI if receiving an access violation when making and API call, XML may require re-installation. 
  
-When troubleshooting the s5webAPI if receiving an access violation when making and API call re-install XML. 
webapi_swagger_documentation.txt · Last modified: 2022/02/23 13:40 (2 years ago) by kevin