Receiving unknown error at the moment of creating a sale

josueskuIQjosueskuIQ Member Posts: 6

Hi everyone!

Lately, we have ran into an issue that isn't allowing us to create sales via the LS API. When we try to create the sale, we are just receiving the following error message.

An error has occurred and we've been notified. Please try again and if this problem continues please contact support.

I believe it is important to mention that before creating the sale, we try to fetch the customer data using their email address. If we receive a successful response from LS, we send the customer data using the Customer field.

If additional information is needed, please let me know so I can share it!

Thanks

8 comments

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 199 moderator

    Hi @josueskuIQ,

    Thank you for contacting us.

    Can you please share me the call that you're making, URL and payload?

  • josueskuIQjosueskuIQ Member Posts: 6

    I am resending my comment in case you are not able to see my last comment.

    We are using the following API to create sales.

    /API/Account/{accountID}/Sale.json
    

    Below you can find the payload that we used to create two sales. We ended up receiving the mentioned error in both sales.

    Order 1

    {"taxCategoryID":"7","shopID":"1","employeeID":"81","registerID":"18","completed":true,"referenceNumberSource":"web","timeStamp":"2020-05-22 17:53:51 UTC","completeTime":"2020-05-22 17:53:51 UTC","referenceNumber":"2147132244102","SaleLines":{"SaleLine":[{"unitQuantity":4,"employeeID":"81","unitPrice":10.0,"itemID":"5520","tax":true,"taxClassID":"156"},{"unitQuantity":2,"employeeID":"81","unitPrice":13.0,"itemID":"6047","tax":true,"taxClassID":"397"},{"unitQuantity":1,"employeeID":"81","unitPrice":10.0,"itemID":"6163","tax":true,"taxClassID":"868"},{"unitQuantity":3,"employeeID":"81","unitPrice":11.0,"itemID":"3607","tax":true,"taxClassID":"2259"},{"unitQuantity":2,"employeeID":"81","unitPrice":13.0,"itemID":"5997","tax":true,"taxClassID":"397"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"4254","tax":true,"taxClassID":"861"},{"unitQuantity":1,"employeeID":"81","unitPrice":10.0,"itemID":"6073","tax":true,"taxClassID":"868"},{"unitQuantity":1,"employeeID":"81","unitPrice":10.0,"itemID":"6072","tax":true,"taxClassID":"868"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"6074","tax":true,"taxClassID":"141"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"6071","tax":true,"taxClassID":"141"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"6069","tax":true,"taxClassID":"141"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"6378","tax":true,"taxClassID":"141"},{"unitQuantity":10,"employeeID":"81","unitPrice":7.0,"itemID":"6414","tax":true,"taxClassID":"141"},{"unitQuantity":10,"employeeID":"81","unitPrice":7.0,"itemID":"6413","tax":true,"taxClassID":"141"},{"unitQuantity":10,"employeeID":"81","unitPrice":4.5,"itemID":"6408","tax":true,"taxClassID":"1077"},{"unitQuantity":10,"employeeID":"81","unitPrice":4.5,"itemID":"6404","tax":true,"taxClassID":"1077"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6169","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6168","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6167","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6166","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6165","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":25.0,"itemID":"6164","tax":true,"taxClassID":"484"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6010","tax":true,"taxClassID":"1485"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6062","tax":true,"taxClassID":"1485"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6012","tax":true,"taxClassID":"1485"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6011","tax":true,"taxClassID":"1485"},{"unitQuantity":1,"employeeID":"81","unitPrice":19.0,"itemID":"5524","tax":true,"taxClassID":"1959"},{"unitQuantity":1,"employeeID":"81","unitPrice":19.0,"itemID":"5523","tax":true,"taxClassID":"1959"},{"unitQuantity":1,"employeeID":"81","unitPrice":27.5,"itemID":"6122","tax":true,"taxClassID":"142"},{"unitQuantity":1,"employeeID":"81","unitPrice":27.5,"itemID":"6121","tax":true,"taxClassID":"142"},{"unitQuantity":1,"employeeID":"81","unitPrice":27.5,"itemID":"5984","tax":true,"taxClassID":"142"}]},"SalePayments":{"SalePayment":{"amount":875.86,"paymentTypeID":"14"}},"ShipTo":{"shipped":false,"Contact":{"address1":"321 Mokauea St, Unit B","city":"Honolulu","state":"HI","zip":"96819","country":"United States","Phones":{"ContactPhone":{"number":"+1 808-600-7762","useType":"Home"}}},"firstName":"Roldan","lastName":"Reyes"},"Customer":{"Contact":{"Addresses":{"ContactAddress":{"address1":"1018 Lunalilo Street, Apt 804","city":"Honolulu","state":"HI","zip":"96822","country":"United States"}},"Phones":{"Contact":{"number":"(808) 600-7762","useType":"Home"}},"Emails":{"ContactEmail":{"address":"[email protected]","useType":"Primary"}}},"firstName":"Roldan","lastName":"Reyes"}}
    

    Order 2

    {"taxCategoryID":"7","shopID":"1","employeeID":"81","registerID":"18","completed":true,"referenceNumberSource":"web","timeStamp":"2020-05-22 19:53:24 UTC","completeTime":"2020-05-22 19:53:24 UTC","referenceNumber":"2147376824454","SaleLines":{"SaleLine":[{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6011","discountAmount":1.22,"tax":true,"taxClassID":"5272"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6062","discountAmount":1.21,"tax":true,"taxClassID":"5272"},{"unitQuantity":8,"employeeID":"81","unitPrice":11.0,"itemID":"6270","discountAmount":3.66,"tax":true,"taxClassID":"10023"},{"unitQuantity":3,"employeeID":"81","unitPrice":10.0,"itemID":"6322","discountAmount":1.25,"tax":true,"taxClassID":"150"},{"unitQuantity":2,"employeeID":"81","unitPrice":13.0,"itemID":"6050","discountAmount":1.08,"tax":true,"taxClassID":"10024"},{"unitQuantity":3,"employeeID":"81","unitPrice":13.0,"itemID":"6049","discountAmount":1.62,"tax":true,"taxClassID":"10024"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"3418","discountAmount":0.83,"tax":true,"taxClassID":"502"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"4432","discountAmount":0.83,"tax":true,"taxClassID":"10025"},{"unitQuantity":2,"employeeID":"81","unitPrice":10.0,"itemID":"4431","discountAmount":0.83,"tax":true,"taxClassID":"10025"},{"unitQuantity":3,"employeeID":"81","unitPrice":10.0,"itemID":"3424","discountAmount":1.25,"tax":true,"taxClassID":"144"},{"unitQuantity":2,"employeeID":"81","unitPrice":13.0,"itemID":"3209","discountAmount":1.08,"tax":true,"taxClassID":"10026"},{"unitQuantity":2,"employeeID":"81","unitPrice":13.0,"itemID":"3208","discountAmount":1.08,"tax":true,"taxClassID":"10026"},{"unitQuantity":4,"employeeID":"81","unitPrice":11.0,"itemID":"2681","discountAmount":1.83,"tax":true,"taxClassID":"4571"},{"unitQuantity":5,"employeeID":"81","unitPrice":13.0,"itemID":"6223","discountAmount":2.7,"tax":true,"taxClassID":"5744"},{"unitQuantity":4,"employeeID":"81","unitPrice":13.0,"itemID":"3527","discountAmount":2.16,"tax":true,"taxClassID":"10027"},{"unitQuantity":3,"employeeID":"81","unitPrice":24.0,"itemID":"5544","discountAmount":3.0,"tax":true,"taxClassID":"144"},{"unitQuantity":5,"employeeID":"81","unitPrice":24.0,"itemID":"5543","discountAmount":4.99,"tax":true,"taxClassID":"10028"},{"unitQuantity":1,"employeeID":"81","unitPrice":19.0,"itemID":"6338","discountAmount":0.79,"tax":true,"taxClassID":"2755"},{"unitQuantity":2,"employeeID":"81","unitPrice":19.0,"itemID":"6339","discountAmount":1.58,"tax":true,"taxClassID":"10029"},{"unitQuantity":1,"employeeID":"81","unitPrice":19.0,"itemID":"5883","discountAmount":0.79,"tax":true,"taxClassID":"2755"},{"unitQuantity":5,"employeeID":"81","unitPrice":25.0,"itemID":"6169","discountAmount":5.2,"tax":true,"taxClassID":"10030"},{"unitQuantity":4,"employeeID":"81","unitPrice":25.0,"itemID":"6168","discountAmount":4.16,"tax":true,"taxClassID":"1696"},{"unitQuantity":5,"employeeID":"81","unitPrice":25.0,"itemID":"6167","discountAmount":5.2,"tax":true,"taxClassID":"10030"},{"unitQuantity":5,"employeeID":"81","unitPrice":25.0,"itemID":"6166","discountAmount":5.2,"tax":true,"taxClassID":"10030"},{"unitQuantity":5,"employeeID":"81","unitPrice":25.0,"itemID":"6165","discountAmount":5.2,"tax":true,"taxClassID":"10030"},{"unitQuantity":5,"employeeID":"81","unitPrice":25.0,"itemID":"6164","discountAmount":5.2,"tax":true,"taxClassID":"10030"},{"unitQuantity":2,"employeeID":"81","unitPrice":23.5,"itemID":"5771","discountAmount":1.96,"tax":true,"taxClassID":"6950"},{"unitQuantity":2,"employeeID":"81","unitPrice":19.0,"itemID":"5523","discountAmount":1.58,"tax":true,"taxClassID":"10028"},{"unitQuantity":1,"employeeID":"81","unitPrice":19.0,"itemID":"5524","discountAmount":0.79,"tax":true,"taxClassID":"10031"},{"unitQuantity":1,"employeeID":"81","unitPrice":29.0,"itemID":"6390","discountAmount":1.21,"tax":true,"taxClassID":"10032"},{"unitQuantity":2,"employeeID":"81","unitPrice":29.0,"itemID":"6151","discountAmount":2.41,"tax":true,"taxClassID":"10033"},{"unitQuantity":2,"employeeID":"81","unitPrice":29.0,"itemID":"6147","discountAmount":2.41,"tax":true,"taxClassID":"10033"},{"unitQuantity":3,"employeeID":"81","unitPrice":29.0,"itemID":"6148","discountAmount":3.62,"tax":true,"taxClassID":"3296"},{"unitQuantity":2,"employeeID":"81","unitPrice":29.0,"itemID":"6149","discountAmount":2.41,"tax":true,"taxClassID":"10033"}]},"SalePayments":{"SalePayment":{"amount":1859.92,"paymentTypeID":"14"}},"ShipTo":{"shipped":false,"Contact":{"address1":"1284 Kalani St. D104","city":"Honolulu","state":"HI","zip":"96817","country":"United States","Phones":{"ContactPhone":{"number":"(808) 383-0544","useType":"Home"}}},"firstName":"Nick","lastName":"Chang"},"Customer":{"Contact":{"Addresses":{"ContactAddress":{"address1":"1284 Kalani St. D104","city":"Honolulu","state":"HI","zip":"96817","country":"United States"}},"Phones":{"Contact":{"number":"(808) 383-0544","useType":"Home"}},"Emails":{"ContactEmail":{"address":"[email protected]","useType":"Primary"}}},"firstName":"Nick","lastName":"Chang"}}
    

    Please let me know if you need something else!

    Thank you

  • josueskuIQjosueskuIQ Member Posts: 6

    Hi @LucienVersendaal ,

    Just doing a quick follow up, did you had the chance to review the examples?

    Please let me know if you need anything else!

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 199 moderator

    Hi @josueskuIQ,

    Sorry for my late reply.

    Can you provide me the accountID, so I can check this directly for you?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 199 moderator

    I've tested some things out on my test account with similar payload, and this worked well for me, here you'll find my payload.

    {
      "employeeID": 2,
      "registerID": 3,
      "shopID": 2,
      "completed": true,
      "customerID" : 5,
      "SaleLines": {
        "SaleLine": [
        {
          "itemID": 135,
          "unitQuantity" : 1,
          "tax": true,
          "unitPrice": 50,
          "taxClassID": 1
        },
          {
          "itemID": 78,
          "unitQuantity" : 2,
          "tax": true,
          "unitPrice": 20,
          "taxClassID": 1
        }
       ]
      },
      "SalePayments": {
        "SalePayment": {
            "amount": 90,
            "paymentTypeID": 1
    	}
      }, 
      "ShipTo":{
      	   "shipToID": "10"
      }
    }
    

    After doing this call the sale is created.

  • josueskuIQjosueskuIQ Member Posts: 6

    Hi @LucienVersendaal ,

    Thank you for following up with me!

    The account ID is 122128.

    Using the same data structure, we are able to create sales. However, at times Lightspeed isn't allowing us to create some specific orders. The payload that we sent is from some orders that failed. Can you try creating an order using the params that I sent?

  • josueskuIQjosueskuIQ Member Posts: 6

    Hi @LucienVersendaal ,


    Any updates?

Sign In or Register to comment.