cURL
curl --request POST \
--url https://api.lomadee.com.br/affiliate/shortener/url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"organizationId": "<string>",
"featureId": "<string>",
"url": "<string>",
"mdasc": "<string>"
}
'import requests
url = "https://api.lomadee.com.br/affiliate/shortener/url"
payload = {
"organizationId": "<string>",
"featureId": "<string>",
"url": "<string>",
"mdasc": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: '<string>',
featureId: '<string>',
url: '<string>',
mdasc: '<string>'
})
};
fetch('https://api.lomadee.com.br/affiliate/shortener/url', 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://api.lomadee.com.br/affiliate/shortener/url",
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([
'organizationId' => '<string>',
'featureId' => '<string>',
'url' => '<string>',
'mdasc' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.lomadee.com.br/affiliate/shortener/url"
payload := strings.NewReader("{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.lomadee.com.br/affiliate/shortener/url")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lomadee.com.br/affiliate/shortener/url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<string>",
"availableChannel": {
"id": "<string>",
"name": "<string>"
},
"shortUrls": [
"<string>"
],
"message": "<string>"
}
]{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}Shorten
Shorten a URL
Shorten a URL
POST
/
affiliate
/
shortener
/
url
cURL
curl --request POST \
--url https://api.lomadee.com.br/affiliate/shortener/url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"organizationId": "<string>",
"featureId": "<string>",
"url": "<string>",
"mdasc": "<string>"
}
'import requests
url = "https://api.lomadee.com.br/affiliate/shortener/url"
payload = {
"organizationId": "<string>",
"featureId": "<string>",
"url": "<string>",
"mdasc": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: '<string>',
featureId: '<string>',
url: '<string>',
mdasc: '<string>'
})
};
fetch('https://api.lomadee.com.br/affiliate/shortener/url', 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://api.lomadee.com.br/affiliate/shortener/url",
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([
'organizationId' => '<string>',
'featureId' => '<string>',
'url' => '<string>',
'mdasc' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.lomadee.com.br/affiliate/shortener/url"
payload := strings.NewReader("{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.lomadee.com.br/affiliate/shortener/url")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lomadee.com.br/affiliate/shortener/url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"organizationId\": \"<string>\",\n \"featureId\": \"<string>\",\n \"url\": \"<string>\",\n \"mdasc\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<string>",
"availableChannel": {
"id": "<string>",
"name": "<string>"
},
"shortUrls": [
"<string>"
],
"message": "<string>"
}
]{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}Shorten a URL
Generates shortened links per affiliate channel. Requires scopeshortener:write.
HTTP Request
POST https://api-beta.lomadee.com.br/affiliate/shortener/url
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Brand organization UUID |
type | string | Yes | Coupon, Offer, BrandPage, Custom, or Home |
featureId | string | For Coupon/Offer | Campaign operation ID from GET /affiliate/campaigns |
url | string | For Custom only | HTTPS URL to shorten |
mdasc | string | No | Appended as ?mdasc= on generated links |
url is only allowed when type is Custom. For Coupon and Offer, featureId is required.
Example — Brand page
curl -X POST "https://api-beta.lomadee.com.br/affiliate/shortener/url" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"organizationId": "e36f5bbb-3e5f-42e2-be4c-6c32dac101c2",
"type": "BrandPage"
}'
Response
Array of channel objects, each withid, name, availableChannel, shortUrls, and optional message when link generation is blocked.
[
{
"id": "channel-uuid",
"name": "My Blog",
"availableChannel": { "id": "...", "name": "Blog" },
"shortUrls": ["https://staging.lmdee.link/abc123"]
}
]
Errors
| Status | Cause |
|---|---|
400 | Missing featureId for Coupon/Offer, url missing for Custom, invalid domain, campos desconhecidos no body, ou UUID/tipo inválido |
401 | Invalid API key |
403 | Missing shortener:write scope |
429 | Rate limit exceeded (60 req/60s) |
Authorizations
Body
application/json
ID of the organization to generate the URL for
Link type. Coupon and Offer require featureId. Custom requires url (HTTPS).
Available options:
Coupon, BrandPage, Offer, Custom, Home Campaign operation ID. Required when type is Coupon or Offer.
HTTPS URL. Required only when type is Custom.
Optional tracking identifier appended as ?mdasc= on generated links.
⌘I