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

# Register Webhook

POST https://third/v1/provider/webhook
Content-Type: application/json

Registers a webhook URL to receive real-time transaction status notifications.

Once registered, Wallib will send POST requests to the specified URL whenever a transaction changes state. This allows your system to react to events such as payment completion, failure, or expiration without polling.

**Authentication:** Bearer token (`{{JWT_LOGIN}}`) + `x-api-key` header.

**Key body fields**

* `url`: The publicly accessible HTTPS endpoint that will receive webhook event payloads.

Reference: https://docs-colombia.wallib.io/wallib-payments-api-colombia/register-webhook

## Request

### Headers

- `x-api-key` (string, optional)

### Body (application/json)

- `url` (string, required)

## Response

### 200

OK

- `message` (string, required)
- `webhookUrl` (string, required)
- `webhookSecret` (string, required)

## Examples

**Request**

```json
{
  "url": "https://develop.provider.com/webhook"
}
```

**Response**

```json
{
  "message": "Webhook registered successfully",
  "webhookUrl": "https://develop.provider.com/webhook",
  "webhookSecret": "e63db47b7d28d7abbedba0766a159897e0465c61bd40e90871a3d8348ac2005b"
}
```

**SDK Code**

```python Register Webhook_example
import requests

url = "https://third/v1/provider/webhook"

payload = { "url": "https://develop.provider.com/webhook" }
headers = {
    "x-api-key": "{{X_API_KEY}}",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Register Webhook_example
const url = 'https://third/v1/provider/webhook';
const options = {
  method: 'POST',
  headers: {'x-api-key': '{{X_API_KEY}}', 'Content-Type': 'application/json'},
  body: '{"url":"https://develop.provider.com/webhook"}'
};

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

```go Register Webhook_example
package main

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

func main() {

	url := "https://third/v1/provider/webhook"

	payload := strings.NewReader("{\n  \"url\": \"https://develop.provider.com/webhook\"\n}")

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

	req.Header.Add("x-api-key", "{{X_API_KEY}}")
	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 Register Webhook_example
require 'uri'
require 'net/http'

url = URI("https://third/v1/provider/webhook")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{X_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"https://develop.provider.com/webhook\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://third/v1/provider/webhook")
  .header("x-api-key", "{{X_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"https://develop.provider.com/webhook\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://third/v1/provider/webhook', [
  'body' => '{
  "url": "https://develop.provider.com/webhook"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '{{X_API_KEY}}',
  ],
]);

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

```csharp Register Webhook_example
using RestSharp;

var client = new RestClient("https://third/v1/provider/webhook");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "{{X_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"https://develop.provider.com/webhook\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Register Webhook_example
import Foundation

let headers = [
  "x-api-key": "{{X_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = ["url": "https://develop.provider.com/webhook"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://third/v1/provider/webhook")! 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()
```