Migrated from Redmine #998 | Author: Stephan Tensen
Status: Closed | Priority: Normal | Created: 2023-01-10
Some time ago I have had a conversation with Alex. I asked him if it is possible to get the discount code(s) used for a booking through the API.
He answered: “Yes, you can get this for every appointment. You would need to get the code from the invoice entity”
My developer has tried to get this done, but he didn’t succeed. I want to give it another try.
This is the message from my developer to you (the developers of Simplybook):
I am afraid that I am doing something wrong.
I checked both the regular API and the REST API, but no luck.
- In the regular API, there is very limited invoice information availible. See also Support #786: About API - API - Simplybook.me support for developers where it is stated that the regular API does not have the functionality to retrieve discount codes, but Dmytro is having a hint to check the REST API
- So I checked API documentation | SimplyBook.me Online Scheduling is giving the “AdminInvoiceEntity” as return. That one is stating the AMOUNT of discount, but not WHY or WHAT CODE has been used.
- I also have checked API documentation | SimplyBook.me Online Scheduling, what is giving back the “AdminBookingDetailsEntity”. Also in there is the AMOUNT visible, but not the used promo-codes for that booking.
Can you please tell me what I am doing wrong and what return type or API call I am looking for. As an example; On the invoice I see that booking “vo4368ru7” has used 2 promo-codes: “KERSTVAKANTIE” and “36503034”, but I cannot find these 2 codes back anywhere in the API.
Looking forward for your response.
Our user ID is ‘onehourlockup’
See also Support #786: About API - API - Simplybook.me support for developers