system
March 28, 2022, 11:21pm
1
Migrated from Redmine #860 | Author: Leo Dimacuha
Status: New | Priority: Normal | Created: 2022-03-28
Hi,
I’m trying to get the booking with invoice to work but no luck. I think I am using handle_invoice: true in the wrong place. Can someone kindly assist please?
Here is the payload:
{“jsonrpc”:“2.0”,“method”:“book”,“params”:{“eventId”:“1”,“unitId”:“1”,“clientId”:“22”,“startDate”:“2022-03-31”,“startTime”:“17:30:00”,“endDate”:“2022-03-31”,“endTime”:“18:00:00”,“additional”:[{“handle_invoice”:true}],“count”:1},“id”:1}
Thanks!
system
March 29, 2022, 8:32am
2
Dmytro Bondarev wrote:
Hi,
Please use array of parameters, instead of object:
eg:
[1,1,22…]
system
March 30, 2022, 4:00am
3
Leo Dimacuha wrote:
Dmitry Bondarev wrote:
Hi,
Please use array of parameters, instead of object:
eg:
[1,1,22…]
Hi Dmitry, thanks for the quick reply.
I have tried array of parameters but still no invoice created with the booking.
Here is the new payload:
{“jsonrpc”:“2.0”,“method”:“book”,“params”:[“1”,“1”,“29”,“2022-03-31”,“17:00:00”,“2022-03-31”,“18:00:00”,null,{“handle_invoice”:true},1],“id”:1}
My code for params is below if it helps:
const params = [
eventId,
unitId,
id,
date,
time,
date,
format(add(parsedDate, { minutes: parseInt(eventDuration) }), 'HH:mm:ss'),
null,
{ handle_invoice: true },
1,
];
Thanks,
system
March 30, 2022, 4:07am
4
Leo Dimacuha wrote:
Hey Dmitry,
I figured out I should use make_invoice: true because I am using the Admin API.
This ticket can be closed now.
thank you!