[#562] Batch booking API tickets and invoice

Migrated from Redmine #562 | Author: Dhanushka Krishnajith
Status: Feedback | Priority: High, I’m very impatient | Created: 2020-09-01


Hi, I am using batch booking API to book multiple services. The order of API calls in my code is given below. I have following issues with the email received (screenshot of the email is attached).

  • The email received does not attach any tickets or does not include a link to them (in this case, both events had tickets enabled).
  • The invoice is not attached to the email or does not include a link to it.
  • The email does not have a link to cancel the bookings.
  • I couldn’t find this email template in the settings.
{jsonrpc: "2.0", method: "createBatch", params: [], id: 5} -> {"result":"18","id":"5","jsonrpc":"2.0"}

{"jsonrpc":"2.0","method":"book","params":["16",10,"2020-09-08","16:00:00",{"name":"xx","email":"xx","phone":"xx"},{"ageRange":"18-25","subscribe":false},null,"18"],"id":6}

{"jsonrpc":"2.0","method":"book","params":["17",10,"2020-09-13","12:00:00",{"name":"xx","email":"xx","phone":"xx"},{"ageRange":"18-25","subscribe":true,"products":[{"id":"2","qty":1}]},null,"18"],"id":7} 

{"jsonrpc":"2.0","method":"confirmBookingBatch","params":[18,"batch_multiple_booking","hash"],"id":1}

Redmine Admin wrote:

Hi
what is your company login and what is result fo confirmBookingBatch call?

Dhanushka Krishnajith wrote:

Attachment did not work: Email hosted at ImgBB — ImgBB

Dhanushka Krishnajith wrote:

Redmine Admin wrote:

Hi
what is your company login and what is result fo confirmBookingBatch call?
{“result”:true,“id”:“1”,“jsonrpc”:“2.0”}

Company login is: VicinityTest (https://vicinitytest.simplybook.me/)

Redmine Admin wrote:

please call confirmBookingBatchPayment instead of confirmBookingBatch

{"jsonrpc":"2.0","method":"confirmBookingBatchPayment","params":[18,"batch_multiple_booking", "delay", "hash"],"id":1}

‘delay’ is name of payment processor used to get payment for this batch, Allow delayed payments must be turned on in settings

Redmine Admin wrote:

No, sorry, this method is obsolate and not working with invoices

Dmytro Bondarev wrote:

Hi. Sorry for delay.

  1. Make batch (you already done it)
  2. Call book method and pass batch id (you already done it)
  3. call method @closeBatch($batchId, $batchType, $sign)@ , where
    @$batchId@ - is your batch id from first step.
    @$batchType@ - batch_multiple_booking
    @$sign@ - @md5($batchId . $hash . $secret)@

As result of closeBatch you will receive object that contains array of bookings and @invoice@ object.
You can confirm payment by calling @confirmInvoice($id, $paymentSystem)@ of Admin API. (The confirming payment via public API is not available.)

After receiving payment client will receive email with invoice and confirmation email with tickets.

Dmytro Bondarev wrote:

API documentation | SimplyBook.me Online Scheduling - to confirm payment please use this method.

Dhanushka Krishnajith wrote:

Dmitry Bondarev wrote:

Hi. Sorry for delay.

  1. Make batch (you already done it)
  2. Call book method and pass batch id (you already done it)
  3. call method @closeBatch($batchId, $batchType, $sign)@ , where
    @$batchId@ - is your batch id from first step.
    @$batchType@ - batch_multiple_booking
    @$sign@ - @md5($batchId . $hash . $secret)@

As result of closeBatch you will receive object that contains array of bookings and @invoice@ object.
You can confirm payment by calling @confirmInvoice($id, $paymentSystem)@ of Admin API. (The confirming payment via public API is not available.)

After receiving payment client will receive email with invoice and confirmation email with tickets.

This worked perfectly. Thank you!