Giftcard API error on Charging

We are trying to integrate GiftCard API. All is working well but when try to charge GiftCard using API return error

"CALL TO A MEMBER FUNCTINO getValue() or null".

i have attached the screen short of my php script and response of API call


  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 991 moderator

    Hi @umairakram500 ,

    What you can do best is take a look here: and if you follow the steps from: this will work.

    Let me know if this worked for you.

    Kind Regards,

    Lucien Versendaal

  • umairakram500umairakram500 Member Posts: 3

    I have followed every single step but I am still getting this error

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator


    Once a gift card has been topped up with a value you can only charge/use gift cards via a Sale

    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • jonasverhulstjonasverhulst Member Posts: 2
    edited August 2019

    Hi Adrian,

    If I understand well, we are not talking about using the gift cards. The issue occurs when trying to top up the gift card for the first time. According to the code this is done via a Sale transaction with paymentTypeId 1 and paymentTypeId 5.

    So why are we getting this error message here?

  • umairakram500umairakram500 Member Posts: 3

    @Adrian Samuel

    The Problem is that I am unable to top up my gift card through API

    We are following every step carefully but still get that error response from the server that I have sent you previously

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator

    Hey @umairakram500 @jonasverhulst,

    This payload works, try this using a API client such as Postman:


              "employeeID": EMPLOYEE_ID,

              "registerID": REGISTER_ID, // ensure register matches shop

              "shopID": SHOP_ID, 

              "completed": true,

              "SalePayments": {

                "SalePayment": [{

                    "amount": -100,

                    "creditAccountID": creditAccountID,

                    "paymentTypeID": "5"



                    "amount": 100,

                    "paymentTypeID": PAYMENT_TYPE_ID // PaymentMethod the customer pays with





    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • quotedquoted Member Posts: 21

    When using the payload above, my gift card is not being charged.

    In the result of the sale the "CreditAccountID" is set to "0", although I did include it in my call exactly like above...

    Could someone help me out here please?

Sign In or Register to comment.