Skip to main content

I am integrating with BOOKEO, I am using a POST function, but I am getting the following "message" error: "Invalid JSON", which may be the problem. Thank you

 

const options = {
  url: 'https://api.bookeo.com/v2/bookings/1556006123381863/payments?',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  params: {
    'secretKey': '',
    'apiKey': ''
  },
  body: {
    'paymentMethod': 'cash',
    'reason': 'prueba',
    'amount': '85000'
  }
}

return z.request(options)
  .then((response) => {
    response.throwForStatus();
    const results = response.json;

    // You can do any parsing you need for results here before returning them

    return results;
  });

@baruc You JSON is formatted correctly, but it is not valid for POSTing to a booking payment.  Take a look at the API documentation of the fields required for this JSON: https://www.bookeo.com/apiref/index.html#!/Bookings/bookings__bookingNumber__payments_post

David