Start a new topic

Adding a sale, with deposits

The following example adds a sale, with deposits.


{
  "customer": {
    "customerNo":"ER118"
  },
  "customerPO": 11111,
  "items": [
    {
      "inventory": {
        "whse": "VA",
        "partNo": "4RTT",
        "description": "Medium Elastic Bandage 12 cm x 4.5m\/4.7\" x 14.8\""
      },
      "description": "Medium Elastic Bandage 12 cm x 4.5m\/4.7\" x 14.8\"",
      "orderQty": "3.0000",
      "committedQty": "3.0000",
      "unitPrice": "5.1000"
    }
  ],
  "payments": [
    {
      "method": 1,
      "amount": "10.00"
    },
    {
      "method": 2,
      "amount": "9.90"
    },
    {
      "method": 5,
      "amount": "1.00"
    }
  ]
}


The sales can be added using the following end point.   Remember to replace "inspire2_10" with the company database.


https://localhost:10880/api/v1/companies/inspire2_10/sales/orders/


Your JSON is not valid.


The error has been improved / corrected in Spire 3.2.

It will now say;

"message":"JSON parse error - ....."



Please use a tool like  https://jsonlint.com  to validate your JSON.


If i use this script in orders, i get:

 

{
    "type":"error",
    "message":"Customer is missing or invalid",
    "traceback":"",
    "error_type":"RequiredFieldError"
}

 I am 100% sure the customer number exists. advice?


 

{
  "customer": {
    "customerNo":"ANGSPE01"
  },
  "customerPO": 'feb 2019',
  "items": [
    {
      "inventory": {
        "whse": "00",
        "partNo": "LL9.1138.0467.0",
        "description": "Medium Elastic Bandage 12 cm x 4.5m\/4.7\" x 14.8\""
      },
      "description": "Medium Elastic Bandage 12 cm x 4.5m\/4.7\" x 14.8\"",
      "orderQty": "3.0000",
      "committedQty": "3.0000",
      "unitPrice": "5.1000"
    }
  ],
  }

 

Login or Signup to post a comment