[#1517] JSON-RPC book method (company public service): Coupon/Promo Code is not applying to the generated Invoice

Migrated from Redmine #1517 | Author: institutalgovita institutalgovita
Status: Feedback | Priority: High, I’m very impatient | Created: 2026-01-28


Here is a clear, technical description you can post on the SimplyBook forum or send to their support ticket system. It isolates the problem to the API parameter structure.
Subject: JSON-RPC book method: Coupon/Promo Code is not applying to the generated Invoice
Description:
Hello,
I am using the JSON-RPC API to create bookings. I am trying to apply a valid Promo Code (from the Coupons & Gift Cards plugin) to a booking so that the generated invoice reflects the discount.
I successfully validate the code first using validatePromoCode (it returns true). However, when I call the book method, the booking is created and the invoice is generated, but the discount is ignored (the amount remains full price).

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: [
5, // eventId
2, // unitId
“2026-01-29”, // date
“16:00:00”, // time
{ // clientData
“name”: “John Doe”,
“email”: “john@example.com”,
“phone”: “1234567890”
},
{ // additional fields
“handle_invoice”: true,
“promo_code”: “24yccaqah”, // <— Attempt 1
“promocode”: “24yccaqah”, // <— Attempt 2
“promotion_code”: “24yccaqah” // <— Attempt 3
},
1, // count
null // batchId
],
“id”: 1
}

Val Komarov wrote:

Hi, promocodes are not supported in our public JSON RPC API, but you can use them in admin API (method @applyPromoCode@ API documentation | SimplyBook.me Online Scheduling)

The @validatePromoCode@ method of public API which you tried to use refers to our legacy custom feature which is currently available only to users who enabled it in the past and continue using it. It is no longer available for new users.

institutalgovita institutalgovita wrote:

From what I understand, it’s not possible to validate the code before the booking exists via the api (rest or RPC).