[#1189] How to include payment status when making a new booking through the REST API?

Migrated from Redmine #1189 | Author: Guilherme Bueno
Status: Feedback | Priority: High, I’m very impatient | Created: 2024-03-04


When creating a new booking, all the bookings are getting created with a payment status of “Paid”

How do I set the value to false for me to update it at a later date?

This is the body of the request I’m passing at the moment:

{“count”:“1”,“start_datetime”:“2024-03-04 15:00:00”,“end_datetime”:“2024-03-04 15:15:00”,“location_id”:2,“provider_id”:“2”,“service_id”:“26”,“client_id”:16508,“accept_payment”:false,“payment_processor”:“Stripe”,“additional_fields”:[{“field”:“d5f910103c49904d8ac7b7a59be249b5”,“value”:"Customer agreed to pay $0 for the following tests: "}]}

Guilherme Bueno wrote:

Hi, I really needed an answer on this ASAP. Is this even supported by the REST API?

Dmytro Bondarev wrote:

Hi, please add parameter accept_payment: true

Guilherme Bueno wrote:

No, I need the booking to appear as NOT paid, when using the parameter you mentioned I currently get a status of “PAID”, I have a function we call to update the booking after the customer has paid on our website, and the update works fine. I just need to create a booking with a status of “NOT paid” before we collect the payment from the customer

Dmytro Bondarev wrote:

Hi,
Without this parameter your booking will not have any payment at all.
If you pass this parameter then order will be created, depending on payment_processor it will be approved immediately or when you confirm it. (pass null or delay to confirm it later)