"sale ref" required on sale creation

SybilSybil Member Posts: 2

I try to send a completed sale to our LS Retail account, but it fails with a strange 422 error.
We want to add a deposit to our customer credit account.
I sent this :
post https://us.merchantos.com/API/Account/<account_id>/Sale.json

"completed": true,
"customerID": "<customer_id>",
"taxCategoryID": "1",
"employeeID": "1",
"shopID": "1",
"registerID": "1",
"SaleLines": {},
"SalePayments": [
  {"SalePayment": {"amount": 1200.0, "paymentTypeID": "7"}},
  {"SalePayment": {"amount": -1200.0, "paymentTypeID": "4"}}
The API response is :
Lightspeed Retail Error (422) 422 - Unprocessable Entity: [Sale error] The sale ref field is required.
I cannot find this field on the API doc and we successfully made a lot of payments like this one in the past. Something changed ?

Thanks :)



  • Michael CareyMichael Carey Administrator, Lightspeed Staff Posts: 68 moderator
    Hi Sybil,

    Credit card payments require a reference ID when applying the payment to a sale. I suspect that paymentTypeID 7 is a credit card type and therefore requires a reference ID. Can you confirm if this is the case?

    Michael Carey

    Product Manager
    Lightspeed HQ
  • SybilSybil Member Posts: 2
    Hi Mickael.

    Thanks for your fast reply.
    Yeah we realized our customer connected its Vantiv to our credit card payment type. So now it requires a referenceID when we report a payment with this same payment type.

    Your suspicions were on point :)
    Thanks again,

Sign In or Register to comment.