To apply a discount code, you should make a rated query to the `/item` endpoint and include a `discount_code={code}` in the parameters. This will return a slip for the item that includes the discount. You can find more information in our documentation here: http://api.checkfront.com/ref/item.html?highlight=discount#item
If an item already exists in your session and you are trying to add a discount code to it, then you should first get a new slip for the item using the above method. Once you have the slip, you can replace the existing slip using something like: `booking/session?session_id={session_id}&line_id={the_line_id_of_the_item}&slip={new_slip}`
I hope this helps, and please let me know if you have any more questions.
How can I get line id for 'booking/session?session_id={session_id}&line_id={the_line_id_of_the_item}&slip={new_slip}' ? Is there any other API where can I find that?
I have some confusion in the new slip. Is it mandatory to pass discount coupon or can i pass our related query parameter such as date, number of adults?
I am not sure I understand what you are asking. In order to get a slip, you must make a rated query to the `/item` endpoint. A rated query is made by including at least a `start_date` parameter with your query. You can also optionally include the values for the booking parameters (number of adults). Please find more information about rated queries here: http://api.checkfront.com/ref/item.html?highlight=rated#item
One of the optional parameters that can be included with a rated query is the `discount_code`. When making the query for the "new slip", you will need to include all of the parameters from your original query, but also add the `discount_code`.
Query for original slip: /item/14?start_date=tomorrow¶m[qty]=5
Query for new slip with discount: /item/14?start_date=tomorrow¶m[qty]=5&discount_code=mydiscount
I hope this helps, but please let me know if I have misunderstood your question.
Comments
Thank you for using our forums!
To apply a discount code, you should make a rated query to the `/item` endpoint and include a `discount_code={code}` in the parameters. This will return a slip for the item that includes the discount. You can find more information in our documentation here:
http://api.checkfront.com/ref/item.html?highlight=discount#item
If an item already exists in your session and you are trying to add a discount code to it, then you should first get a new slip for the item using the above method. Once you have the slip, you can replace the existing slip using something like:
`booking/session?session_id={session_id}&line_id={the_line_id_of_the_item}&slip={new_slip}`
I hope this helps, and please let me know if you have any more questions.
All the best,
Chase
Technical Support Analyst
Checkfront | www.checkfront.com/contact | Email: support@checkfront.com
How can I get line id for 'booking/session?session_id={session_id}&line_id={the_line_id_of_the_item}&slip={new_slip}' ?
Is there any other API where can I find that?
The 'line_id' of the item is its position in the session. The first item has line_id of '1', the second is '2'.
Package add-ons use decimals. The first add-on of the first item is '1.1'.
You can see the line_ids of the items in the response from `booking/session`. Here is an example:
Let me know if anything is still unclear.
All the best,
Chase
Technical Support Analyst
Checkfront | www.checkfront.com/contact | Email: support@checkfront.com
I have some confusion in the new slip. Is it mandatory to pass discount coupon or can i pass our related query parameter such as date, number of adults?
Thank you for your reply.
I am not sure I understand what you are asking. In order to get a slip, you must make a rated query to the `/item` endpoint. A rated query is made by including at least a `start_date` parameter with your query. You can also optionally include the values for the booking parameters (number of adults). Please find more information about rated queries here:
http://api.checkfront.com/ref/item.html?highlight=rated#item
One of the optional parameters that can be included with a rated query is the `discount_code`. When making the query for the "new slip", you will need to include all of the parameters from your original query, but also add the `discount_code`.
Query for original slip:
/item/14?start_date=tomorrow¶m[qty]=5
Query for new slip with discount:
/item/14?start_date=tomorrow¶m[qty]=5&discount_code=mydiscount
I hope this helps, but please let me know if I have misunderstood your question.
All the best,
Technical Support Analyst
Checkfront | www.checkfront.com/contact | Email: support@checkfront.com