> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.yoco.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.yoco.com/_mcp/server.

Before going live, test your webhook integration to confirm that your endpoint correctly receives,
verifies, and processes events.

## Sending test events

Use the
[send test webhook event](https://developer.yoco.com/api-reference/yoco-api/webhooks/send-test-webhook-event-v-1-webhooks-subscriptions-subscription-id-test-post)
endpoint to deliver a test event to your subscription.

### Request

POST [https://api.yoco.com/v1/webhooks/subscriptions/\{subscription_id}/test](https://api.yoco.com/v1/webhooks/subscriptions/\{subscription_id}/test)

```curl
curl -X POST https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "event_type": "payment.created"
}'
```

```python
import requests

url = "https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test"

payload = { "event_type": "payment.created" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"event_type":"payment.created"}'
};

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://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test"

	payload := strings.NewReader("{\n  \"event_type\": \"payment.created\"\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://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test")

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_type\": \"payment.created\"\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://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event_type\": \"payment.created\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test', [
  'body' => '{
  "event_type": "payment.created"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event_type\": \"payment.created\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["event_type": "payment.created"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.yoco.com/v1/webhooks/subscriptions/subscription_id/test")! 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()
```

Your endpoint receives a webhook delivery with a sample payload matching the specified event type.

> **Tip**
>
> Test events follow the same delivery and retry behaviour as live events, including signature
> headers for verification.

## Local development with tunnelling

During development, your endpoint is typically running on `localhost` and isn't reachable from the
internet. Use a tunnelling service to expose your local endpoint to Yoco's webhook delivery system.

#### Start a tunnel

Use a tunnelling service to create a public URL that
forwards to your local server.

**`ngrok`**

```shell title="ngrok"
ngrok http 3000
```

**`Cloudflare Tunnel`**

```shell title="Cloudflare Tunnel"
cloudflared tunnel --url http://localhost:3000
```

**`Svix CLI`**

```shell title="Svix CLI"
svix listen http://localhost:3000/webhooks/yoco
```

This produces a public HTTPS URL that you can use as your webhook `notification_url`.

> **Tip**
>
> For installation instructions, see the documentation for
> [ngrok](https://ngrok.com/),
> [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/),
> or the
> [Svix command-line tool](https://github.com/svix/svix-cli).

#### Register the tunnel URL

[Create a webhook subscription](/docs/api/webhooks/creating-a-subscription)
using the tunnel URL as the `notification_url`.

#### Send a test event

Use the test endpoint to trigger a delivery and confirm
your local handler processes it correctly.

> **Warning**
>
> Remember to update your subscription's `notification_url` to your production URL before going
> live. Tunnel URLs are temporary and change each time you restart the tunnel.

## Debugging with Svix Play

[Svix Play](https://www.svix.com/play/) is a free webhook debugger you can use to inspect incoming
webhook payloads. It provides a temporary URL that captures and displays all received requests,
which is useful for examining the exact headers and body Yoco sends.