Skip to main content
POST
/
v1
/
admin
/
webhooks
Configure outbound webhook
curl --request POST \
  --url https://payments.sandbox.lerian.net/v1/admin/webhooks \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "active": true,
  "callbackUrl": "<string>",
  "enabledEvents": [
    "<string>"
  ],
  "secret": "<string>"
}
'
import requests

url = "https://payments.sandbox.lerian.net/v1/admin/webhooks"

payload = {
    "active": True,
    "callbackUrl": "<string>",
    "enabledEvents": ["<string>"],
    "secret": "<string>"
}
headers = {
    "X-Organization-Id": "<x-organization-id>",
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'X-Organization-Id': '<x-organization-id>',
    Authorization: '<api-key>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    active: true,
    callbackUrl: '<string>',
    enabledEvents: ['<string>'],
    secret: '<string>'
  })
};

fetch('https://payments.sandbox.lerian.net/v1/admin/webhooks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://payments.sandbox.lerian.net/v1/admin/webhooks",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'active' => true,
    'callbackUrl' => '<string>',
    'enabledEvents' => [
        '<string>'
    ],
    'secret' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "Content-Type: application/json",
    "X-Organization-Id: <x-organization-id>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://payments.sandbox.lerian.net/v1/admin/webhooks"

	payload := strings.NewReader("{\n  \"active\": true,\n  \"callbackUrl\": \"<string>\",\n  \"enabledEvents\": [\n    \"<string>\"\n  ],\n  \"secret\": \"<string>\"\n}")

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

	req.Header.Add("X-Organization-Id", "<x-organization-id>")
	req.Header.Add("Authorization", "<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(string(body))

}
HttpResponse<String> response = Unirest.post("https://payments.sandbox.lerian.net/v1/admin/webhooks")
  .header("X-Organization-Id", "<x-organization-id>")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"active\": true,\n  \"callbackUrl\": \"<string>\",\n  \"enabledEvents\": [\n    \"<string>\"\n  ],\n  \"secret\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://payments.sandbox.lerian.net/v1/admin/webhooks")

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

request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"active\": true,\n  \"callbackUrl\": \"<string>\",\n  \"enabledEvents\": [\n    \"<string>\"\n  ],\n  \"secret\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "active": true,
  "callbackUrl": "<string>",
  "createdAt": "<string>",
  "enabledEvents": [
    "<string>"
  ],
  "id": "<string>",
  "secret": "<string>",
  "updatedAt": "<string>"
}
{
  "code": "PBP-0001",
  "details": {},
  "message": "dueDate must be in YYYY-MM-DD format",
  "title": "Bad Request"
}
{
  "code": "PBP-0001",
  "details": {},
  "message": "dueDate must be in YYYY-MM-DD format",
  "title": "Bad Request"
}
{
  "code": "PBP-0001",
  "details": {},
  "message": "dueDate must be in YYYY-MM-DD format",
  "title": "Bad Request"
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Headers

X-Organization-Id
string
required

Tenant organization ID

Body

application/json

Webhook configuration payload

active
boolean
callbackUrl
string
enabledEvents
string[]
secret
string

Response

OK

active
boolean
callbackUrl
string
createdAt
string
enabledEvents
string[]
id
string
secret
string
updatedAt
string