Dmytro Bondarev wrote:
To apply promocode use API documentation | SimplyBook.me Online Scheduling
(You are using wrong url).
To accept payment use API documentation | SimplyBook.me Online Scheduling
Dmytro Bondarev wrote:
To apply promocode use API documentation | SimplyBook.me Online Scheduling
(You are using wrong url).
To accept payment use API documentation | SimplyBook.me Online Scheduling
Fayaz Ahamed PA wrote:
Please ignore this part, I have given a wrong example. But please help us with the coupon.
Also, for payment we have tried with confirmBookingPayment, this method contain sign parameter and it has been defined with a procedure( $sign = md5($bookingId . $bookingHash . $secretKey)), if it is the formula then would you explain this formula for api integration
Dmytro Bondarev wrote:
The confirmBookingPayment is deprecated please use API documentation | SimplyBook.me Online Scheduling .
And you can use API documentation | SimplyBook.me Online Scheduling to apply coupon code.
(mentioned these method in previous answer)
If you have troubles with them feel free to ask. But better in separate Issue.
Fayaz Ahamed PA wrote:
Thanks for getting back to us quickly, we initially used admin API, but after you pointed that admin API will book even without completing the payment, and suggested going with user API. Now we have entirely used user API and getting token from them, how can we send admin API calls from this user API credentials? Let me create separate issue, from next item, we have detailed conversation in this thread.
Dmytro Bondarev wrote:
You actually can use both APIs in this case.
To book and getting timeslots you can use public API and for operations like approve payment or apply promocode you have to use admin API.
You can JSON RPC Admin API if it is more convenient for you. API documentation | SimplyBook.me Online Scheduling
Fayaz Ahamed PA wrote:
Sorry, we are little confused here. Let me explain the whole story.
We built a website to book slots and accept payment via your services, for this we used REST API, in the documentation its mentioned to use admin credentials, we used the same and complete the entire application flow, the only concern that we had is the email that user gets even before competing the payment. When we reached you for this, we have been instructed to use User API, we then entirely changed our app to User API, getting token from User API and processing the flow. Now, you’re suggesting to use admin API, for certain functions and User API for certain functions, we really not sure why admin function needs to be called when there is a user flow. We kind of stuck here.
Dmytro Bondarev wrote:
Currently we do not provide such functionality for public API.
You do not need to change entire app, just booking process is enough.
You can use Admin API to implement applying promo code and accept payment.
Fayaz Ahamed PA wrote:
We tried booking with user API, but we are not receiving an invoice, which we need for coupon and payment.
URL: https://user-api.simplybook.me/
METHOD: POST
HEADER: POST /api/book HTTP/1.1
Host: localhost:5000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
Content-Length: 747
Origin: http://localhost:3000
Connection: keep-alive
Referer: http://localhost:3000/
Cookie: safebuyRedis=s%3AnsaUHdpLsYNWJ-dh1RHpUxUJeboGCA9j.KOjcsJl7tBGLBEI0LMQLNMxl6QZgZoUpNanErYCB4%2BE
Body: { jsonrpc: ‘2.0’,
method: ‘book’,
params:
[ 2,
1,
‘2021-04-14’,
‘09:30:00’,
{ name: ‘Indhumathi’,
email: ‘indhumathi@studioq.co.in’,
phone: 7896895364 },
{ ‘174f93dea26a3e68edd5863971f1a776’: ‘Parak’,
‘1e03f7a8574a6acea8d9871c3fb65b25’: 4829351637,
‘2d42cf2bb70e82898ba9ffc46dba74f2’: ‘Melbourne VIC, Australia’,
‘9f785f73333f13a44dbd5cc9df0060f4’: ‘Kira 20’,
ac59cc4cfbdefb7805668ea679018e02: 12000,
a25f4d5f4cba4c7428d27430d7dca0d6: ‘VIN’,
‘661e7ff7914016277b3e4de4c62fb285’: ‘4859EOJDEK23’,
a6bf0d4d47602038ef0bbb2fd3ff6f22: null,
‘36820785829f0404de8fb18d886350a7’: ‘By Developers’ },
1 ],
id: 8 }
Response:
{“result”:{“require_confirm”:true,“bookings”:[{“id”:“462”,“event_id”:2,“unit_id”:1,“client_id”:“439”,“client_hash”:“cfefa9c4015b4fb751a34c00d28472a5”,“start_date_time”:“2021-04-14 09:30:00”,“end_date_time”:“2021-04-14 12:00:00”,“time_offset”:“0”,“is_confirmed”:“1”,“require_payment”:true,“code”:“1gabctx47”,“hash”:“cf1d8fdb87628e691b2db6c6bfb6eb0f”}],“invoice”:null},“id”:“8”,“jsonrpc”:“2.0”,“success”:true}
Dmytro Bondarev wrote:
Please pass ‘handle_invoice’: true to $addition, so your request will look like:
{ jsonrpc: ‘2.0’,
method: ‘book’,
params:
[ 2,
1,
‘2021-04-14’,
‘09:30:00’, { name: ‘Indhumathi’,
email: ‘indhumathi@studioq.co.in’,
phone: 7896895364 }, { ‘174f93dea26a3e68edd5863971f1a776’: ‘Parak’,
‘1e03f7a8574a6acea8d9871c3fb65b25’: 4829351637,
‘2d42cf2bb70e82898ba9ffc46dba74f2’: ‘Melbourne VIC, Australia’,
‘9f785f73333f13a44dbd5cc9df0060f4’: ‘Kira 20’,
ac59cc4cfbdefb7805668ea679018e02: 12000,
a25f4d5f4cba4c7428d27430d7dca0d6: ‘VIN’,
‘661e7ff7914016277b3e4de4c62fb285’: ‘4859EOJDEK23’,
a6bf0d4d47602038ef0bbb2fd3ff6f22: null,
‘36820785829f0404de8fb18d886350a7’: ‘By Developers’,
‘handle_invoice’: true
},1 ],id: 8 }
Fayaz Ahamed PA wrote:
Let us try.
(Short original content)
Fayaz Ahamed PA wrote:
Thanks for the handle Invoice, its working good now, we don’t see any params in documentation.
I tried to pass service addons to params but no addons were added in the booking. In documentation there is no methods found passing service addons.
Booking :
URL: https://user-api.simplybook.me/
METHOD: POST
HEADER: POST /api/book HTTP/1.1
Host: localhost:5000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
Content-Length: 747
Origin: http://localhost:3000
Connection: keep-alive
Referer: http://localhost:3000/
Cookie: safebuyRedis=s%3AnsaUHdpLsYNWJ- dh1RHpUxUJeboGCA9j.KojcsJl7tBGLBEI0LMQLNMxl6QZgZoUpNanErYCB4%2BE
BODY: {"jsonrpc":"2.0",
"method":"book",
"params":["2","1","2021-04-14","11:00:00", {"name":"indhumathi","email":"indhumathi@studioq.co.in","phone":"7092860626"}, {"174f93dea26a3e68edd5863971f1a776":"Pragi","1e03f7a8574a6acea8d9871c3fb65b25":"8220536636","2d42cf2bb70e82898ba9ffc46dba74f2":"Melbourone.VIC,Australia","9f785f73333f13a44dbd5cc9df0060f4":"JaguarSVU","ac59cc4cfbdefb7805668ea679018e02":"11000","a25f4d5f4cba4c7428d27430d7dca0d6":"VIN","661e7ff7914016277b3e4de4c62fb285":"123DHW293E78596","a6bf0d4d47602038ef0bbb2fd3ff6f22":"","36820785829f0404de8fb18d886350a7":"By developers","handle_invoice": true,"products":"2,4"
},1],“id”:8}
RESPONSE: {
"result": {
"require_confirm": false,
"bookings": [
{
"id": "483",
"event_id": "2",
"unit_id": "1",
"client_id": "466",
"client_hash": "edf6c70073c3b2c516006535c695e526",
"start_date_time": "2021-04-14 11:00:00",
"end_date_time": "2021-04-14 13:30:00",
"time_offset": "0",
"is_confirmed": "1",
"require_payment": false,
"code": "1gabde351",
"hash": "234ffb37118068374e934c9ac97abf62"
}
],
"invoice": {
"id": 390,
"number": "O-00000390",
"datetime": "2021-04-10 16:15:57",
"due_datetime": "2021-04-10 16:20:57",
"payment_datetime": null,
"amount": 240,
"deposit": 240,
"is_with_deposit_amount": false,
"rest_amount": 0,
"discount_amount": 0,
"taxes": [
{
"amount": 21.8182,
"id": 1,
"name": "GST",
"ratio": 0.1,
"is_default": true
}
],
"tax_amount": 21.8182,
"currency": "AUD",
"client_id": 466,
"description": "",
"payment_received": false,
"payment_processor": null,
"lines": [
{
"booking_ids": [
483
],
"bookings": [
{
"id": 483,
"code": "1gabde351",
"start_datetime": "2021-04-14 11:00:00",
"end_datetime": "2021-04-14 13:30:00",
"location_id": null,
"category_id": null,
"service_id": 2,
"provider_id": 1,
"client_id": 466,
"duration": null
}
],
"tickets": [],
"deposit": 240,
"is_with_deposit_amount": false,
"description_string": "Service: Comprehensive Mobile Inspection Service (14-04-2021 11:00 AM, 1gabde351) x1 240.00 AUD",
"id": "624",
"invoice_id": 390,
"name": "Comprehensive Mobile Inspection Service (14-04-2021 11:00 AM, 1gabde351)",
"type": "booking",
"discount_ratio": 0,
"discount_amount": 0,
"discount": 0,
"price": 240,
"final_price": 240,
"qty": 1,
"package_qty": 0,
"tax": {
"id": 1,
"name": "GST",
"ratio": 0.1,
"is_default": true
},
"tax_ratio": 0.1,
"tax_amount": 21.8182,
"amount": 240,
"rest_amount": 0,
"currency": "AUD"
}
],
"status": "new",
"support_recurring_payment_method": false,
"recurring_profile_id": null,
"promotion_instances": [],
"package_instances": [],
"deposit_child_invoice": null,
"deposit_parent_invoice": null
}
},
“id”: “8”,
“jsonrpc”: “2.0”
}
In sample website I would able to see the timing with 30 mins(7.00, 7.30…) interval . I tried with the starttimematrix function its not showing response as same like that. Would you explain the procedure for getting the response with 30 mins time interval.
TimeMatrix
URL: https://user-api.simplybook.me/
METHOD: POST
HEADER: server: nginx
date: Sat, 10 Apr 2021 05:15:32 GMT
content-type: application/json; charset=UTF-8
content-length: 107
access-control-allow-origin: *
access-control-allow-methods: POST, GET, OPTIONS
access-control-allow-headers: content-type, x-company-login, x-application-token, x-user-token, x-token, x-requested-with
x-xss-protection: 1; mode=block
Body: {“jsonrpc”:“2.0”,“method”:“getStartTimeMatrix”,“params”:[“2021-04-15”,“2021-04-15”,2,1,1],“id”:1}
RESPONSE:
{
“result”: {
“2021-04-15”: [
“07:00:00”,
“09:30:00”,
“12:00:00”,
“14:30:00”
]
},
“id”: “1”,
“jsonrpc”: “2.0”
}
Dmytro Bondarev wrote:
Please pass products as
products: [{id: 1, qty: 1}, …].
The same for attributes.
To pass attributes in getStartTimeMatrix please pass ids array to the last param.
e.g.:
getStartTimeMatrix(“2021-04-15”,“2021-04-15”,2,1,1,null,[1,2,3])
Fayaz Ahamed PA wrote:
In sample website I would able to see the time slots with (7.00,7.30, 8.00, 8.30, 9.00,9.30…) but when I tried with getStartTimeMatrix function the response were not the same as shown in the sample website.
URL: https://user-api.simplybook.me/
METHOD: POST
HEADER: POST / HTTP/2
Host: user-api.simplybook.me
user-agent: insomnia/2021.1.1
content-type: application/json
x-company-login: safebuy
x-token: xxxxx
accept: /
content-length: 106
BODY: {“jsonrpc”:“2.0”,“method”:“getStartTimeMatrix”,“params”:[“2021-04-16”,“2021-04-16”,5,1,1,null,[4]],“id”:1}
RESPONSE: {
“result”: {
“2021-04-16”: [
“07:00:00”,
“10:00:00”,
“13:00:00”
]
},
“id”: “1”,
“jsonrpc”: “2.0”
}
Redmine Admin wrote:
please provide booking link with all params and responce from API you are getting with same params
Fayaz Ahamed PA wrote:
URL: https://user-api.simplybook.me/
METHOD: POST
HEADER: POST / HTTP/2
Host: user-api.simplybook.me
user-agent: insomnia/2021.1.1
content-type: application/json
x-company-login: safebuy
x-token: xxxxxx
accept: /
content-length: 653
BODY: {“jsonrpc”:“2.0”,“method”:“book”,“params”:[“5”,“1”,“2021-04-16”,“10:00:00”,{“name”:“indhumathi”,“email”:“indhumathi@studioq.co.in”,“phone”:“7092860626”},{“174f93dea26a3e68edd5863971f1a776”:“Pragi”,“1e03f7a8574a6acea8d9871c3fb65b25”:“8220536636”,“2d42cf2bb70e82898ba9ffc46dba74f2”:“Melbourone. VIC, Australia”,“9f785f73333f13a44dbd5cc9df0060f4”:“Jaguar SVU”,“ac59cc4cfbdefb7805668ea679018e02”:“11000”,“a25f4d5f4cba4c7428d27430d7dca0d6”:“VIN”,“661e7ff7914016277b3e4de4c62fb285”:“123DHW293E78596”,“a6bf0d4d47602038ef0bbb2fd3ff6f22”:“25000”,“36820785829f0404de8fb18d886350a7”:“By developers”,“handle_invoice”: true,“products”:[{“id”:4,“qty”:1}]
| },1],“id”:8}
RESPONSE: {
“result”: {
“require_confirm”: true,
“bookings”: [
{
“id”: “485”,
“event_id”: “5”,
“unit_id”: “1”,
“client_id”: “468”,
“client_hash”: “449883f667b84c7194744396b60eab46”,
“start_date_time”: “2021-04-16 10:00:00”,
“end_date_time”: “2021-04-16 13:00:00”,
“time_offset”: “0”,
“is_confirmed”: “1”,
“require_payment”: true,
“code”: “1gabdgnmn”,
“hash”: “f6951437ccd0dbf94a6a3217b10941d9”
}
],
“invoice”: {
“id”: 392,
“number”: “O-00000392”,
“datetime”: “2021-04-13 17:02:09”,
“due_datetime”: “2021-04-13 17:07:09”,
“payment_datetime”: null,
“amount”: 370,
“deposit”: 370,
“is_with_deposit_amount”: false,
“rest_amount”: 0,
“discount_amount”: 0,
“taxes”: [
{
“amount”: 33.6364,
“id”: 1,
“name”: “GST”,
“ratio”: 0.1,
“is_default”: true
}
],
“tax_amount”: 33.6364,
“currency”: “AUD”,
“client_id”: 468,
“description”: “”,
“payment_received”: false,
“payment_processor”: null,
“lines”: [
{
“booking_ids”: [
485
],
“bookings”: [
{
“id”: 485,
“code”: “1gabdgnmn”,
“start_datetime”: “2021-04-16 10:00:00”,
“end_datetime”: “2021-04-16 13:00:00”,
“location_id”: null,
“category_id”: null,
“service_id”: 5,
“provider_id”: 1,
“client_id”: 468,
“duration”: null
}
],
“tickets”: ,
“deposit”: 340,
“is_with_deposit_amount”: false,
“description_string”: “Service: Premium Mobile Inspection (16-04-2021 10:00 AM, 1gabdgnmn) x1 340.00 AUD”,
“id”: “627”,
“invoice_id”: 392,
“name”: “Premium Mobile Inspection (16-04-2021 10:00 AM, 1gabdgnmn)”,
“type”: “booking”,
“discount_ratio”: 0,
“discount_amount”: 0,
“discount”: 0,
“price”: 340,
“final_price”: 340,
“qty”: 1,
“package_qty”: 0,
“tax”: {
“id”: 1,
“name”: “GST”,
“ratio”: 0.1,
“is_default”: true
},
“tax_ratio”: 0.1,
“tax_amount”: 30.9091,
“amount”: 340,
“rest_amount”: 0,
“currency”: “AUD”
},
{
“product_id”: 4,
“product”: {
“id”: 4,
“name”: “Car Valuation Report”,
“barcode”: null,
“description”: “”,
“price”: 30,
“currency”: “AUD”,
“tax_id”: “1”,
“tax”: {
“id”: 1,
“name”: “GST”,
“ratio”: 0.1,
“is_default”: true
},
“duration”: 0,
“type”: “attribute”
},
“booking_id”: 485,
“description_string”: “attribute: Car Valuation Report (Booking #1gabdgnmn) x1 30.00 AUD”,
“id”: “628”,
“invoice_id”: 392,
“name”: “Car Valuation Report (Booking #1gabdgnmn)”,
“type”: “product”,
“discount_ratio”: 0,
“discount_amount”: 0,
“discount”: 0,
“price”: 30,
“final_price”: 30,
“qty”: 1,
“package_qty”: 0,
“tax”: {
“id”: 1,
“name”: “GST”,
“ratio”: 0.1,
“is_default”: true
},
“tax_ratio”: 0.1,
“tax_amount”: 2.7273,
“amount”: 30,
“deposit”: 30,
“is_with_deposit_amount”: false,
“rest_amount”: 0,
“currency”: “AUD”
}
],
“status”: “new”,
“support_recurring_payment_method”: false,
“recurring_profile_id”: null,
“promotion_instances”: ,
“package_instances”: ,
“deposit_child_invoice”: null,
“deposit_parent_invoice”: null
}
},
“id”: “8”,
“jsonrpc”: “2.0”
}
Fayaz Ahamed PA wrote:
This the sample wwebiste that we get from the control panel http://safebuy.simplybook.me/
Redmine Admin wrote:
In sample website I would able to see the time slots with (7.00,7.30, 8.00, 8.30, 9.00,9.30…)
What is full url for this?
Fayaz Ahamed PA wrote:
Fayaz Ahamed PA wrote:
Fayaz Ahamed PA wrote:
Redmine Admin wrote:
there is flexible timeline which is not supported by API, so results will be different