Webhook event

BookingCreatedEvent

The BookingCreatedEvent webhook notifies subscribers when a new booking has been successfully created within the Sodtrack platform.

Sodtrack sends POST with Content-Type: application/json to the endpoint configured for your tenant. See webhooks overview for delivery and security guidance.

Payload

Payload
{
  "timestamp": "1761494400",
  "userTriggererEmail": "pedro.rojas@example.com",
  "booking": {
    "id": 10452,
    "reference": "ORD-2025-001",
    "createdDate": "2025-03-10T14:22:00.000Z",
    "serviceVariantTotalPrice": 150000,
    "serviceVariantTotalCost": 80000,
    "serviceName": "Instalación",
    "totalAddonsCost": 5000,
    "totalAddonsPrice": 9000,
    "totalAddonsDuration": 30,
    "status": "created",
    "variantDuration": 90,
    "transportCost": 0,
    "quantity": 1,
    "date": "2025-03-15T09:00:00.000Z",
    "doneDate": null,
    "periodStartTime": null,
    "periodEndTime": null,
    "finalCost": 85000,
    "finalPrice": 159000,
    "totalDuration": 120,
    "category": {
      "id": 5,
      "name": "Hogar"
    },
    "saleChannel": {
      "id": 1,
      "name": "Canal principal"
    },
    "shoppingCartId": 501,
    "project": {
      "id": 88,
      "reference": "PROJ-EXT-100"
    },
    "serviceVariant": {
      "id": 321,
      "name": "Instalación cortinas",
      "skus": [
        {
          "id": 77,
          "sku": "install_curtains_sku"
        }
      ]
    },
    "addons": [
      {
        "id": 501,
        "quantity": 1,
        "name": "Material extra",
        "duration": 30,
        "totalCost": 5000,
        "totalPrice": 9000,
        "unitCost": 5000,
        "unitPrice": 9000
      }
    ],
    "products": [
      {
        "id": 300,
        "quantity": 1,
        "productPromisedDeliveryDate": "2025-03-14T00:00:00.000Z",
        "sku": "CURTAIN-001",
        "name": "Cortina roller",
        "description": "Cortina roller blackout 1.20 m",
        "price": 45000,
        "unit": {
          "id": 9001,
          "serialNumber": "SN-000123"
        }
      }
    ],
    "dynamicFieldValues": [
      {
        "id": 12,
        "value": "Piso 3"
      }
    ],
    "dynamicFormFields": [
      {
        "reference": "purchase_channel",
        "value": "online"
      }
    ]
  },
  "customer": {
    "id": 2001,
    "name": "Laura",
    "identificationNumber": "12345678-9",
    "lastName": "Gómez",
    "email": "laura.gomez@example.com",
    "phoneNumber": "+56987654321"
  },
  "address": {
    "id": 3001,
    "coordinates": {
      "lng": -70.58645659063548,
      "lat": -33.43324794409109
    },
    "address": "Av. Providencia 1234",
    "formattedAddress": "Av. Providencia 1234, Santiago, Chile",
    "areas": [
      {
        "id": 15,
        "name": "Santiago Oriente",
        "reference": "AREA-STGO-OR"
      }
    ]
  },
  "professional": {
    "id": 42,
    "isCompany": false,
    "reference": "PROV-REF-42",
    "name": "María",
    "lastName": "Técnica",
    "email": "maria.tecnica@example.com",
    "phoneNumber": "+56912345678"
  }
}

Purpose

The BookingCreatedEvent webhook notifies subscribers when a new booking has been successfully created within the Sodtrack platform.

This event is triggered once a booking is created and initialized in the system — typically after a customer completes a service request, a booking is generated from a shopping cart, or a booking is created from a budget execution. At this point, the booking enters the "created" status and becomes ready for provider assignment and scheduling.

Each booking carries the project it belongs to, so a receiving system that stores projects (for example from ProjectCreatedEvent) can link every new booking to its project without any additional call to Sodtrack.


Trigger Condition

This webhook is triggered when:

  • A new booking is successfully created in the Sodtrack system, and

  • The booking has been initialized with all required information and assigned the "created" status.

Only bookings that have been fully validated and persisted by the system generate this event.


Example Use Cases

  • Automatically synchronize new booking records in external CRMs, ERPs, or scheduling systems.

  • Link each new booking to a project already stored locally, using booking.project.id or booking.project.reference.

  • Initiate notification workflows to stakeholders about new service requests.


Field Definitions

📋 Event

FieldTypeDescription
timestampstringMoment the event was emitted.
userTriggererEmailstringEmail of the user or system that triggered the event.

🧩 Booking — booking

FieldTypeDescription
booking.idnumberUnique Sodtrack booking ID.
booking.referencestringnull
booking.createdDateDateBooking creation timestamp.
booking.statusstringBooking status at creation.
booking.serviceNamestringName of the booked service.
booking.serviceVariantTotalPricenumberTotal price of the service variant.
booking.serviceVariantTotalCostnumberTotal cost of the service variant.
booking.totalAddonsPricenumberTotal price of the add-ons.
booking.totalAddonsCostnumberTotal cost of the add-ons.
booking.totalAddonsDurationnumberTotal duration of the add-ons.
booking.variantDurationnumberDuration of the service variant.
booking.transportCostnumberTransport cost.
booking.quantitynumberBooked quantity.
booking.dateDateScheduled date.
booking.doneDateDatenull
booking.periodStartTimeDatenull
booking.periodEndTimeDatenull
booking.finalPricenumberFinal price of the booking.
booking.finalCostnumberFinal cost of the booking.
booking.totalDurationnumberTotal duration of the booking.
booking.shoppingCartIdnumberSodtrack ID of the shopping cart the booking belongs to.
booking.projectobjectnull
booking.categoryobjectCategory of the booking (id, name).
booking.saleChannelobjectnull
booking.serviceVariantobjectBooked service variant (id, name, skus[] with id and sku).
booking.addonsarrayAdd-ons of the booking (id, quantity, name, duration, totalCost, totalPrice, unitCost, unitPrice).
booking.productsarrayProducts of the booking (id, quantity, productPromisedDeliveryDate, sku, name, description, price, unit with id and serialNumber).
booking.dynamicFieldValuesarrayDynamic field values of the booking (id, value).
booking.dynamicFormFieldsarrayAnswers of the booking creation form (reference, value).

📁 Project — booking.project

FieldTypeDescription
booking.project.idnumberSodtrack project ID. Same value as project.id in ProjectCreatedEvent.
booking.project.referencestringnull

🧍 Customer — customer

FieldTypeDescription
customer.idnumberSodtrack customer ID.
customer.namestringCustomer first name.
customer.lastNamestringCustomer last name.
customer.identificationNumberstringCustomer identification number.
customer.emailstringCustomer email.
customer.phoneNumberstringCustomer phone.

🏠 Address — address

FieldTypeDescription
address.idnumberSodtrack address ID.
address.addressstringAddress as entered.
address.formattedAddressstringNormalized address as resolved by Sodtrack.
address.coordinatesobjectGeographic coordinates (lng, lat).
address.areasarrayAreas that contain the address (id, name, reference).

👷 Professional — professional

FieldTypeDescription
professional.idnumberSodtrack provider ID.
professional.isCompanybooleantrue when the provider is a company.
professional.referencestringProvider external reference.
professional.namestringProvider first name.
professional.lastNamestringProvider last name.
professional.emailstringProvider email.
professional.phoneNumberstringProvider phone.

Payload Example

json
{
  "timestamp": "1761494400",
  "userTriggererEmail": "pedro.rojas@example.com",
  "booking": {
    "id": 10452,
    "reference": "ORD-2025-001",
    "createdDate": "2025-03-10T14:22:00.000Z",
    "serviceVariantTotalPrice": 150000,
    "serviceVariantTotalCost": 80000,
    "serviceName": "Instalación",
    "totalAddonsCost": 5000,
    "totalAddonsPrice": 9000,
    "totalAddonsDuration": 30,
    "status": "created",
    "variantDuration": 90,
    "transportCost": 0,
    "quantity": 1,
    "date": "2025-03-15T09:00:00.000Z",
    "doneDate": null,
    "periodStartTime": null,
    "periodEndTime": null,
    "finalCost": 85000,
    "finalPrice": 159000,
    "totalDuration": 120,
    "category": {
      "id": 5,
      "name": "Hogar"
    },
    "saleChannel": {
      "id": 1,
      "name": "Canal principal"
    },
    "shoppingCartId": 501,
    "project": {
      "id": 88,
      "reference": "PROJ-EXT-100"
    },
    "serviceVariant": {
      "id": 321,
      "name": "Instalación cortinas",
      "skus": [
        {
          "id": 77,
          "sku": "install_curtains_sku"
        }
      ]
    },
    "addons": [
      {
        "id": 501,
        "quantity": 1,
        "name": "Material extra",
        "duration": 30,
        "totalCost": 5000,
        "totalPrice": 9000,
        "unitCost": 5000,
        "unitPrice": 9000
      }
    ],
    "products": [
      {
        "id": 300,
        "quantity": 1,
        "productPromisedDeliveryDate": "2025-03-14T00:00:00.000Z",
        "sku": "CURTAIN-001",
        "name": "Cortina roller",
        "description": "Cortina roller blackout 1.20 m",
        "price": 45000,
        "unit": {
          "id": 9001,
          "serialNumber": "SN-000123"
        }
      }
    ],
    "dynamicFieldValues": [
      {
        "id": 12,
        "value": "Piso 3"
      }
    ],
    "dynamicFormFields": [
      {
        "reference": "purchase_channel",
        "value": "online"
      }
    ]
  },
  "customer": {
    "id": 2001,
    "name": "Laura",
    "identificationNumber": "12345678-9",
    "lastName": "Gómez",
    "email": "laura.gomez@example.com",
    "phoneNumber": "+56987654321"
  },
  "address": {
    "id": 3001,
    "coordinates": {
      "lng": -70.58645659063548,
      "lat": -33.43324794409109
    },
    "address": "Av. Providencia 1234",
    "formattedAddress": "Av. Providencia 1234, Santiago, Chile",
    "areas": [
      {
        "id": 15,
        "name": "Santiago Oriente",
        "reference": "AREA-STGO-OR"
      }
    ]
  },
  "professional": {
    "id": 42,
    "isCompany": false,
    "reference": "PROV-REF-42",
    "name": "María",
    "lastName": "Técnica",
    "email": "maria.tecnica@example.com",
    "phoneNumber": "+56912345678"
  }
}

Booking not linked to a project:

json
{
  "booking": {
    "id": 10460,
    "reference": "ORD-2025-009",
    "shoppingCartId": 507,
    "project": null
  }
}

The second example only shows the fields relevant to the project; the rest of the payload is the same as in the first example.


Business Rules & Constraints

Project of the booking

  • booking.project identifies the project of the shopping cart the booking belongs to, with its id and reference.

  • booking.project is null when the booking's shopping cart is not linked to a project.

  • The project id and reference are the same values sent in ProjectCreatedEvent. A receiver that stores projects from that webhook can use either of them to link the booking.

  • When a project and its bookings are created together, ProjectCreatedEvent and the BookingCreatedEvent of each booking are delivered as separate webhooks. Delivery order is not guaranteed, so a receiver must handle a booking that arrives before its project.

  • To retrieve the full project with all its shopping carts and bookings, use Get Project.

Data and format

  • All identifiers are delivered as numbers.

  • address.coordinates is a flat object with lng and lat properties. It is not GeoJSON.


Changes from the previous version

  • Added booking.project (id, reference), so each booking can be linked to its project.

  • Added field definitions for every object of the payload and a complete payload example.