> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.sporti.io/sporty-provider-webhook/inbound-proveedor-sporty/llms.txt.
> For full documentation content, see https://docs.sporti.io/sporty-provider-webhook/inbound-proveedor-sporty/llms-full.txt.

# Enviar evento al webhook

POST https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings
Content-Type: application/json

Endpoint unico que recibe todos los eventos del proveedor. El campo `event` determina la accion:

- `booking.created` — Crea N reservas (una por bloque) con `source: provider`
- `booking.canceled` — Cancela todas las reservas con ese `external_id`
- `booking.paid` — Marca las reservas como completadas (pago recibido)
- `booking.confirmed` — Marca las reservas como completadas (confirmacion)

Reference: https://docs.sporti.io/sporty-provider-webhook/inbound-proveedor-sporty/handle-webhook-event

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/webhooks/provider/bookings:
    post:
      operationId: handle-webhook-event
      summary: Enviar evento al webhook
      description: >-
        Endpoint unico que recibe todos los eventos del proveedor. El campo
        `event` determina la accion:


        - `booking.created` — Crea N reservas (una por bloque) con `source:
        provider`

        - `booking.canceled` — Cancela todas las reservas con ese `external_id`

        - `booking.paid` — Marca las reservas como completadas (pago recibido)

        - `booking.confirmed` — Marca las reservas como completadas
        (confirmacion)
      tags:
        - subpackage_inboundProveedorSporty
      parameters:
        - name: Authorization
          in: header
          description: JWT obtenido del endpoint /api/v1/auth/login.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Evento procesado correctamente.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Inbound - Proveedor
                  Sporty_handleWebhookEvent_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                event:
                  $ref: >-
                    #/components/schemas/ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaEvent
                  description: Tipo de evento.
                external_id:
                  type: string
                  description: ID unico de la reserva en el sistema del proveedor.
                stadium_name:
                  type: string
                  description: >-
                    Nombre de la cancha (requerido para booking.created).
                    Busqueda case-insensitive.
                sport_name:
                  type: string
                  description: >-
                    Nombre del deporte (requerido para booking.created).
                    Busqueda case-insensitive.
                user_info:
                  $ref: >-
                    #/components/schemas/ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaUserInfo
                  description: Datos del usuario (opcional para booking.created).
                blocks:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaBlocksItems
                  description: >-
                    Bloques horarios a reservar (requerido para
                    booking.created).
                reason:
                  type: string
                  description: Motivo de cancelacion (opcional para booking.canceled).
              required:
                - event
                - external_id
servers:
  - url: https://sporti-api.onrender.com
components:
  schemas:
    ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaEvent:
      type: string
      enum:
        - booking.created
        - booking.canceled
        - booking.paid
        - booking.confirmed
      description: Tipo de evento.
      title: >-
        ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaEvent
    ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaUserInfo:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
      required:
        - name
      description: Datos del usuario (opcional para booking.created).
      title: >-
        ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaUserInfo
    ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaBlocksItems:
      type: object
      properties:
        date:
          type: string
          format: date
        start:
          type: string
        end:
          type: string
      required:
        - date
        - start
        - end
      title: >-
        ApiV1WebhooksProviderBookingsPostRequestBodyContentApplicationJsonSchemaBlocksItems
    Inbound - Proveedor Sporty_handleWebhookEvent_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Inbound - Proveedor Sporty_handleWebhookEvent_Response_200
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: JWT obtenido del endpoint /api/v1/auth/login.

```

## SDK Code Examples

```python booking.created - multiples bloques
import requests

url = "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

payload = {
    "event": "booking.created",
    "external_id": "supabase-uuid-test-001",
    "stadium_name": "Cancha 1",
    "sport_name": "Padel",
    "user_info": {
        "name": "Juan Garcia",
        "email": "juan@example.com",
        "phone": "+58412000001"
    },
    "blocks": [
        {
            "date": "2026-05-10",
            "start": "10:00",
            "end": "11:00"
        },
        {
            "date": "2026-05-10",
            "start": "11:00",
            "end": "12:00"
        },
        {
            "date": "2026-05-10",
            "start": "12:00",
            "end": "13:00"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript booking.created - multiples bloques
const url = 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event":"booking.created","external_id":"supabase-uuid-test-001","stadium_name":"Cancha 1","sport_name":"Padel","user_info":{"name":"Juan Garcia","email":"juan@example.com","phone":"+58412000001"},"blocks":[{"date":"2026-05-10","start":"10:00","end":"11:00"},{"date":"2026-05-10","start":"11:00","end":"12:00"},{"date":"2026-05-10","start":"12:00","end":"13:00"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go booking.created - multiples bloques
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

	payload := strings.NewReader("{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"11:00\",\n      \"end\": \"12:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"12:00\",\n      \"end\": \"13:00\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby booking.created - multiples bloques
require 'uri'
require 'net/http'

url = URI("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"11:00\",\n      \"end\": \"12:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"12:00\",\n      \"end\": \"13:00\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java booking.created - multiples bloques
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"11:00\",\n      \"end\": \"12:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"12:00\",\n      \"end\": \"13:00\"\n    }\n  ]\n}")
  .asString();
```

```php booking.created - multiples bloques
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings', [
  'body' => '{
  "event": "booking.created",
  "external_id": "supabase-uuid-test-001",
  "stadium_name": "Cancha 1",
  "sport_name": "Padel",
  "user_info": {
    "name": "Juan Garcia",
    "email": "juan@example.com",
    "phone": "+58412000001"
  },
  "blocks": [
    {
      "date": "2026-05-10",
      "start": "10:00",
      "end": "11:00"
    },
    {
      "date": "2026-05-10",
      "start": "11:00",
      "end": "12:00"
    },
    {
      "date": "2026-05-10",
      "start": "12:00",
      "end": "13:00"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp booking.created - multiples bloques
using RestSharp;

var client = new RestClient("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"11:00\",\n      \"end\": \"12:00\"\n    },\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"12:00\",\n      \"end\": \"13:00\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift booking.created - multiples bloques
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event": "booking.created",
  "external_id": "supabase-uuid-test-001",
  "stadium_name": "Cancha 1",
  "sport_name": "Padel",
  "user_info": [
    "name": "Juan Garcia",
    "email": "juan@example.com",
    "phone": "+58412000001"
  ],
  "blocks": [
    [
      "date": "2026-05-10",
      "start": "10:00",
      "end": "11:00"
    ],
    [
      "date": "2026-05-10",
      "start": "11:00",
      "end": "12:00"
    ],
    [
      "date": "2026-05-10",
      "start": "12:00",
      "end": "13:00"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python booking.canceled
import requests

url = "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

payload = {
    "event": "booking.canceled",
    "external_id": "supabase-uuid-test-001",
    "reason": "customer_request"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript booking.canceled
const url = 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event":"booking.canceled","external_id":"supabase-uuid-test-001","reason":"customer_request"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go booking.canceled
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

	payload := strings.NewReader("{\n  \"event\": \"booking.canceled\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"reason\": \"customer_request\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby booking.canceled
require 'uri'
require 'net/http'

url = URI("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"event\": \"booking.canceled\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"reason\": \"customer_request\"\n}"

response = http.request(request)
puts response.read_body
```

```java booking.canceled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event\": \"booking.canceled\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"reason\": \"customer_request\"\n}")
  .asString();
```

```php booking.canceled
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings', [
  'body' => '{
  "event": "booking.canceled",
  "external_id": "supabase-uuid-test-001",
  "reason": "customer_request"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp booking.canceled
using RestSharp;

var client = new RestClient("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event\": \"booking.canceled\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"reason\": \"customer_request\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift booking.canceled
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event": "booking.canceled",
  "external_id": "supabase-uuid-test-001",
  "reason": "customer_request"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python booking.paid
import requests

url = "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

payload = {
    "event": "booking.paid",
    "external_id": "supabase-uuid-test-001"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript booking.paid
const url = 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event":"booking.paid","external_id":"supabase-uuid-test-001"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go booking.paid
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

	payload := strings.NewReader("{\n  \"event\": \"booking.paid\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby booking.paid
require 'uri'
require 'net/http'

url = URI("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"event\": \"booking.paid\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}"

response = http.request(request)
puts response.read_body
```

```java booking.paid
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event\": \"booking.paid\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}")
  .asString();
```

```php booking.paid
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings', [
  'body' => '{
  "event": "booking.paid",
  "external_id": "supabase-uuid-test-001"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp booking.paid
using RestSharp;

var client = new RestClient("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event\": \"booking.paid\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift booking.paid
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event": "booking.paid",
  "external_id": "supabase-uuid-test-001"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python booking.confirmed
import requests

url = "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

payload = {
    "event": "booking.confirmed",
    "external_id": "supabase-uuid-test-001"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript booking.confirmed
const url = 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event":"booking.confirmed","external_id":"supabase-uuid-test-001"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go booking.confirmed
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

	payload := strings.NewReader("{\n  \"event\": \"booking.confirmed\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby booking.confirmed
require 'uri'
require 'net/http'

url = URI("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"event\": \"booking.confirmed\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}"

response = http.request(request)
puts response.read_body
```

```java booking.confirmed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event\": \"booking.confirmed\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}")
  .asString();
```

```php booking.confirmed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings', [
  'body' => '{
  "event": "booking.confirmed",
  "external_id": "supabase-uuid-test-001"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp booking.confirmed
using RestSharp;

var client = new RestClient("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event\": \"booking.confirmed\",\n  \"external_id\": \"supabase-uuid-test-001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift booking.confirmed
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event": "booking.confirmed",
  "external_id": "supabase-uuid-test-001"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python
import requests

url = "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

payload = {
    "event": "booking.created",
    "external_id": "supabase-uuid-test-001",
    "stadium_name": "Cancha 1",
    "sport_name": "Padel",
    "user_info": {
        "name": "Juan Garcia",
        "email": "juan@example.com",
        "phone": "+58412000001"
    },
    "blocks": [
        {
            "date": "2026-05-10",
            "start": "10:00",
            "end": "11:00"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event":"booking.created","external_id":"supabase-uuid-test-001","stadium_name":"Cancha 1","sport_name":"Padel","user_info":{"name":"Juan Garcia","email":"juan@example.com","phone":"+58412000001"},"blocks":[{"date":"2026-05-10","start":"10:00","end":"11:00"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings"

	payload := strings.NewReader("{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings', [
  'body' => '{
  "event": "booking.created",
  "external_id": "supabase-uuid-test-001",
  "stadium_name": "Cancha 1",
  "sport_name": "Padel",
  "user_info": {
    "name": "Juan Garcia",
    "email": "juan@example.com",
    "phone": "+58412000001"
  },
  "blocks": [
    {
      "date": "2026-05-10",
      "start": "10:00",
      "end": "11:00"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event\": \"booking.created\",\n  \"external_id\": \"supabase-uuid-test-001\",\n  \"stadium_name\": \"Cancha 1\",\n  \"sport_name\": \"Padel\",\n  \"user_info\": {\n    \"name\": \"Juan Garcia\",\n    \"email\": \"juan@example.com\",\n    \"phone\": \"+58412000001\"\n  },\n  \"blocks\": [\n    {\n      \"date\": \"2026-05-10\",\n      \"start\": \"10:00\",\n      \"end\": \"11:00\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event": "booking.created",
  "external_id": "supabase-uuid-test-001",
  "stadium_name": "Cancha 1",
  "sport_name": "Padel",
  "user_info": [
    "name": "Juan Garcia",
    "email": "juan@example.com",
    "phone": "+58412000001"
  ],
  "blocks": [
    [
      "date": "2026-05-10",
      "start": "10:00",
      "end": "11:00"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sporti-api.onrender.com/api/v1/webhooks/provider/bookings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```