Migrated from Redmine #1006 | Author: Stu Dio Status: Feedback | Priority: High, I’m very impatient | Created: 2023-02-03
Hi there!
I have been using this endpoint for about a year now to get the promotions and there codes for validation on our web integration.
However, we are now using connected services for promotions, and Im unable to get this data via the api. I have linked services to the promotion and the PromotionInstanceEntity returns a promotion object, within this object it knows it has affect services as it set to true. But the service restrictions array is empty, along with all the arrays inside the promotion object.
I feel like the promotion object needs to be told to populate its inner arrays, is this something I can tell it to? or is this a bug?
hi, not sure what you mean. Please provide code example and what exactly is not working as expected
Sorry for not being clear enough.
I have a promotion(coupon) that grants 30% off - I have selected a handful of services that this promotion can be used with.
I hit this endpoint https://user-api-v2.simplybook.me/admin/promotions/coupons and it returns an array of promotions I have set up on my account, weather there active or not. I use this array to check if the code provided is valid and to load the info in about the discount and such.
Now, I want to check if the service selected is assigned to the promotion and if it can be applied. And the data is not there in the response for the api. I attached an image of a item in the array returned form that endpoint. you can clearly see that within the promotion array It knows that this promotion has services linked to it as the boolean affect_services is true. But the service restrictions is an empty array.
So my question is, do I have to have to hit another endpoint to get this information? can I added a filter to this endpoint like populate=* to get this information or is this a bug?
I can provide code samples but its just a get request to that endpoint and then assigning the response.data to an array.
Hi, affect_services is true and empty array means that it affects any service.
Hi, Okay but then what is it not pulling through the services that are linked to it? it should only be linked to 5 out of 20 services. meaning affect_services is true and the service array should have 5 service ids in it.
Yes in case it is linked to 5 of 20 services array should contain 5 services.
Please contact support and provide company login.
Or please provide company login here.
Yes in case it is linked to 5 of 20 services array should contain 5 services.
Please contact support and provide company login.
Or please provide company login here.
Hi, the live chat support chat, says they cant help with api issue and just send me a link to the docs.
here is out simply book shop url University Arms | Scheduling and Booking Website
But this issue is not on here i believe its on our own integration on our website using the rest api endpoints.