Registra uma conversão (server-to-server)
Resolves attribution, applies the commission rule and runs fraud scoring, returning the result in the same response. Repeated requests with the same sourceEventId return 200 with the header Idempotent-Replay: true. If the customer already has an active conversion in the program, the new one is deduplicated. When no affiliate can be matched, nothing is recorded and attributed is false.
curl --request POST \
--url https://api.userepass.com/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "subscription_created",
"amountCents": 1990,
"customer": {
"id": "cust_8842",
"email": "[email protected]"
},
"sourceEventId": "order_2026-0001",
"currency": "BRL",
"occurredAt": "2026-06-13T12:00:00.000Z",
"productId": "plan_pro_monthly",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"visitorId": "vis_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"emailHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"fingerprint": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"couponCode": "MARIA10",
"gclid": "Cj0KCQiA_gclid_example"
}
'import requests
url = "https://api.userepass.com/conversions"
payload = {
"type": "subscription_created",
"amountCents": 1990,
"customer": {
"id": "cust_8842",
"email": "[email protected]"
},
"sourceEventId": "order_2026-0001",
"currency": "BRL",
"occurredAt": "2026-06-13T12:00:00.000Z",
"productId": "plan_pro_monthly",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"visitorId": "vis_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"emailHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"fingerprint": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"couponCode": "MARIA10",
"gclid": "Cj0KCQiA_gclid_example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'subscription_created',
amountCents: 1990,
customer: {id: 'cust_8842', email: '[email protected]'},
sourceEventId: 'order_2026-0001',
currency: 'BRL',
occurredAt: '2026-06-13T12:00:00.000Z',
productId: 'plan_pro_monthly',
programId: 'prog_01J9Z3K8N2QF4T7B9XP0WMD5RC',
clickId: 'clk_01J9Z3K8N2QF4T7B9XP0WMD5RC',
visitorId: 'vis_01J9Z3K8N2QF4T7B9XP0WMD5RC',
emailHash: 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
fingerprint: 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
couponCode: 'MARIA10',
gclid: 'Cj0KCQiA_gclid_example'
})
};
fetch('https://api.userepass.com/conversions', 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.userepass.com/conversions",
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([
'type' => 'subscription_created',
'amountCents' => 1990,
'customer' => [
'id' => 'cust_8842',
'email' => '[email protected]'
],
'sourceEventId' => 'order_2026-0001',
'currency' => 'BRL',
'occurredAt' => '2026-06-13T12:00:00.000Z',
'productId' => 'plan_pro_monthly',
'programId' => 'prog_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'clickId' => 'clk_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'visitorId' => 'vis_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'emailHash' => 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
'fingerprint' => 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
'couponCode' => 'MARIA10',
'gclid' => 'Cj0KCQiA_gclid_example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.userepass.com/conversions"
payload := strings.NewReader("{\n \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.userepass.com/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.userepass.com/conversions")
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 \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\n}"
response = http.request(request)
puts response.read_body{
"attributed": true,
"deduplicated": false,
"replayed": false,
"reconciled": false,
"conversion": {
"id": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"organizationId": "org_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"couponId": "coup_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"parentConversionId": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"type": "subscription_created",
"status": "approved",
"amountCents": 1990,
"currency": "BRL",
"customerId": "cust_8842",
"customerEmailHash": "<string>",
"productId": "plan_pro_monthly",
"sourceEventId": "order_2026-0001",
"source": "api",
"matchMethod": "click_id",
"commissionSkippedReason": "affiliate_paused",
"fraudDecision": "approve",
"voidReason": "Reembolso solicitado pelo cliente",
"attributionSnapshot": {
"model": "last_click",
"windowDays": 30,
"matchMethod": "click_id",
"candidates": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"occurredAt": "2026-06-10T09:30:00.000Z"
}
],
"winners": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"weightBps": 10000
}
],
"gclid": "Cj0KCQiA_gclid_example",
"couponPolicy": "click_wins"
},
"ruleSnapshot": {
"precedence": "tier",
"ruleId": "comm_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"version": 3,
"type": "percentage",
"percentageBps": 1500,
"fixedAmountCents": 1990,
"recurrence": {
"kind": "one_time",
"months": 12,
"steps": [
{
"cycle": 1,
"percentageBps": 1500
}
]
},
"tiers": [
{
"minCount": 0,
"percentageBps": 2000,
"fixedAmountCents": 5000
}
],
"applicableProductIds": [
"plan_pro_monthly",
"plan_pro_yearly"
]
},
"fraudSnapshot": {
"score": 0.12,
"decision": "approve",
"signals": [
{
"key": "ip_velocity",
"weight": 0.3,
"triggered": false,
"detail": "3 conversões do mesmo IP em 1h"
}
],
"policy": {
"approveBelow": 0.3,
"reviewAbove": 0.7
}
},
"occurredAt": "2026-06-13T12:00:00.000Z",
"createdAt": "2026-06-13T12:00:05.000Z",
"updatedAt": "2026-06-13T12:00:05.000Z"
}
}{
"attributed": true,
"deduplicated": false,
"replayed": false,
"reconciled": false,
"conversion": {
"id": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"organizationId": "org_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"couponId": "coup_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"parentConversionId": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"type": "subscription_created",
"status": "approved",
"amountCents": 1990,
"currency": "BRL",
"customerId": "cust_8842",
"customerEmailHash": "<string>",
"productId": "plan_pro_monthly",
"sourceEventId": "order_2026-0001",
"source": "api",
"matchMethod": "click_id",
"commissionSkippedReason": "affiliate_paused",
"fraudDecision": "approve",
"voidReason": "Reembolso solicitado pelo cliente",
"attributionSnapshot": {
"model": "last_click",
"windowDays": 30,
"matchMethod": "click_id",
"candidates": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"occurredAt": "2026-06-10T09:30:00.000Z"
}
],
"winners": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"weightBps": 10000
}
],
"gclid": "Cj0KCQiA_gclid_example",
"couponPolicy": "click_wins"
},
"ruleSnapshot": {
"precedence": "tier",
"ruleId": "comm_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"version": 3,
"type": "percentage",
"percentageBps": 1500,
"fixedAmountCents": 1990,
"recurrence": {
"kind": "one_time",
"months": 12,
"steps": [
{
"cycle": 1,
"percentageBps": 1500
}
]
},
"tiers": [
{
"minCount": 0,
"percentageBps": 2000,
"fixedAmountCents": 5000
}
],
"applicableProductIds": [
"plan_pro_monthly",
"plan_pro_yearly"
]
},
"fraudSnapshot": {
"score": 0.12,
"decision": "approve",
"signals": [
{
"key": "ip_velocity",
"weight": 0.3,
"triggered": false,
"detail": "3 conversões do mesmo IP em 1h"
}
],
"policy": {
"approveBelow": 0.3,
"reviewAbove": 0.7
}
},
"occurredAt": "2026-06-13T12:00:00.000Z",
"createdAt": "2026-06-13T12:00:05.000Z",
"updatedAt": "2026-06-13T12:00:05.000Z"
}
}Authorizations
Chave de API (prefixo rstr_) enviada como Authorization: Bearer rstr_....
Body
Tipo da conversão. subscription_created: nova assinatura. one_time_purchase: compra avulsa. trial_converted: trial convertido em assinatura paga. upgrade: upgrade de plano. custom: evento de conversão customizado.
subscription_created, one_time_purchase, trial_converted, upgrade, custom "subscription_created"
Valor da conversão em centavos (inteiro). Ex.: 1990 = R$ 19,90.
0 <= x <= 90071992547409911990
Dados do cliente que originou a conversão.
Show child attributes
Show child attributes
Identificador único do evento de origem na loja, usado para deduplicação/idempotência permanente.
1 - 255"order_2026-0001"
Moeda da conversão. Apenas BRL (Real brasileiro).
BRL Data/hora em que a conversão ocorreu (ISO-8601). Default: momento do recebimento.
"2026-06-13T12:00:00.000Z"
Identificador do produto vendido. Confrontado com applicableProductIds da regra vigente.
1 - 255"plan_pro_monthly"
Programa ao qual a conversão pertence. Obrigatório quando a organização tem mais de um programa.
^prog_[0-9A-HJKMNP-TV-Z]{26}$"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC"
Identificador do clique a ser atribuído (matching por click_id).
^clk_[0-9A-HJKMNP-TV-Z]{26}$"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC"
Identificador do visitante rastreado (matching por visitor_id).
^vis_[0-9A-HJKMNP-TV-Z]{26}$"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC"
Hash SHA-256 do e-mail do cliente, usado no matching por email_hash.
^[a-f0-9]{64}$"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"
Hash SHA-256 da impressão digital do dispositivo, usado no matching por fingerprint.
^[a-f0-9]{64}$"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"
Código de cupom de afiliado utilizado na compra (matching por coupon).
1 - 64"MARIA10"
Google Click Identifier, propagado no snapshot de atribuição.
1 - 255"Cj0KCQiA_gclid_example"
Response
Default Response
Indica se a conversão foi atribuída a um afiliado e persistida.
true
Indica se a conversão foi descartada por já existir uma ativa para o cliente no programa.
false
Indica replay idempotente do mesmo sourceEventId (resposta armazenada reenviada).
false
Indica que este evento S2S confirmou/sobrescreveu uma conversão client-side provisória de mesmo sourceEventId (atualização in-place, não criação nova).
false
Conversão criada (null quando nada foi atribuído/persistido).
Show child attributes
Show child attributes
curl --request POST \
--url https://api.userepass.com/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "subscription_created",
"amountCents": 1990,
"customer": {
"id": "cust_8842",
"email": "[email protected]"
},
"sourceEventId": "order_2026-0001",
"currency": "BRL",
"occurredAt": "2026-06-13T12:00:00.000Z",
"productId": "plan_pro_monthly",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"visitorId": "vis_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"emailHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"fingerprint": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"couponCode": "MARIA10",
"gclid": "Cj0KCQiA_gclid_example"
}
'import requests
url = "https://api.userepass.com/conversions"
payload = {
"type": "subscription_created",
"amountCents": 1990,
"customer": {
"id": "cust_8842",
"email": "[email protected]"
},
"sourceEventId": "order_2026-0001",
"currency": "BRL",
"occurredAt": "2026-06-13T12:00:00.000Z",
"productId": "plan_pro_monthly",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"visitorId": "vis_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"emailHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"fingerprint": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"couponCode": "MARIA10",
"gclid": "Cj0KCQiA_gclid_example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'subscription_created',
amountCents: 1990,
customer: {id: 'cust_8842', email: '[email protected]'},
sourceEventId: 'order_2026-0001',
currency: 'BRL',
occurredAt: '2026-06-13T12:00:00.000Z',
productId: 'plan_pro_monthly',
programId: 'prog_01J9Z3K8N2QF4T7B9XP0WMD5RC',
clickId: 'clk_01J9Z3K8N2QF4T7B9XP0WMD5RC',
visitorId: 'vis_01J9Z3K8N2QF4T7B9XP0WMD5RC',
emailHash: 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
fingerprint: 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
couponCode: 'MARIA10',
gclid: 'Cj0KCQiA_gclid_example'
})
};
fetch('https://api.userepass.com/conversions', 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.userepass.com/conversions",
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([
'type' => 'subscription_created',
'amountCents' => 1990,
'customer' => [
'id' => 'cust_8842',
'email' => '[email protected]'
],
'sourceEventId' => 'order_2026-0001',
'currency' => 'BRL',
'occurredAt' => '2026-06-13T12:00:00.000Z',
'productId' => 'plan_pro_monthly',
'programId' => 'prog_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'clickId' => 'clk_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'visitorId' => 'vis_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'emailHash' => 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
'fingerprint' => 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3',
'couponCode' => 'MARIA10',
'gclid' => 'Cj0KCQiA_gclid_example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.userepass.com/conversions"
payload := strings.NewReader("{\n \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.userepass.com/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.userepass.com/conversions")
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 \"type\": \"subscription_created\",\n \"amountCents\": 1990,\n \"customer\": {\n \"id\": \"cust_8842\",\n \"email\": \"[email protected]\"\n },\n \"sourceEventId\": \"order_2026-0001\",\n \"currency\": \"BRL\",\n \"occurredAt\": \"2026-06-13T12:00:00.000Z\",\n \"productId\": \"plan_pro_monthly\",\n \"programId\": \"prog_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"clickId\": \"clk_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"visitorId\": \"vis_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"emailHash\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"fingerprint\": \"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3\",\n \"couponCode\": \"MARIA10\",\n \"gclid\": \"Cj0KCQiA_gclid_example\"\n}"
response = http.request(request)
puts response.read_body{
"attributed": true,
"deduplicated": false,
"replayed": false,
"reconciled": false,
"conversion": {
"id": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"organizationId": "org_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"couponId": "coup_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"parentConversionId": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"type": "subscription_created",
"status": "approved",
"amountCents": 1990,
"currency": "BRL",
"customerId": "cust_8842",
"customerEmailHash": "<string>",
"productId": "plan_pro_monthly",
"sourceEventId": "order_2026-0001",
"source": "api",
"matchMethod": "click_id",
"commissionSkippedReason": "affiliate_paused",
"fraudDecision": "approve",
"voidReason": "Reembolso solicitado pelo cliente",
"attributionSnapshot": {
"model": "last_click",
"windowDays": 30,
"matchMethod": "click_id",
"candidates": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"occurredAt": "2026-06-10T09:30:00.000Z"
}
],
"winners": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"weightBps": 10000
}
],
"gclid": "Cj0KCQiA_gclid_example",
"couponPolicy": "click_wins"
},
"ruleSnapshot": {
"precedence": "tier",
"ruleId": "comm_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"version": 3,
"type": "percentage",
"percentageBps": 1500,
"fixedAmountCents": 1990,
"recurrence": {
"kind": "one_time",
"months": 12,
"steps": [
{
"cycle": 1,
"percentageBps": 1500
}
]
},
"tiers": [
{
"minCount": 0,
"percentageBps": 2000,
"fixedAmountCents": 5000
}
],
"applicableProductIds": [
"plan_pro_monthly",
"plan_pro_yearly"
]
},
"fraudSnapshot": {
"score": 0.12,
"decision": "approve",
"signals": [
{
"key": "ip_velocity",
"weight": 0.3,
"triggered": false,
"detail": "3 conversões do mesmo IP em 1h"
}
],
"policy": {
"approveBelow": 0.3,
"reviewAbove": 0.7
}
},
"occurredAt": "2026-06-13T12:00:00.000Z",
"createdAt": "2026-06-13T12:00:05.000Z",
"updatedAt": "2026-06-13T12:00:05.000Z"
}
}{
"attributed": true,
"deduplicated": false,
"replayed": false,
"reconciled": false,
"conversion": {
"id": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"organizationId": "org_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"programId": "prog_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"couponId": "coup_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"parentConversionId": "conv_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"type": "subscription_created",
"status": "approved",
"amountCents": 1990,
"currency": "BRL",
"customerId": "cust_8842",
"customerEmailHash": "<string>",
"productId": "plan_pro_monthly",
"sourceEventId": "order_2026-0001",
"source": "api",
"matchMethod": "click_id",
"commissionSkippedReason": "affiliate_paused",
"fraudDecision": "approve",
"voidReason": "Reembolso solicitado pelo cliente",
"attributionSnapshot": {
"model": "last_click",
"windowDays": 30,
"matchMethod": "click_id",
"candidates": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"occurredAt": "2026-06-10T09:30:00.000Z"
}
],
"winners": [
{
"clickId": "clk_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"weightBps": 10000
}
],
"gclid": "Cj0KCQiA_gclid_example",
"couponPolicy": "click_wins"
},
"ruleSnapshot": {
"precedence": "tier",
"ruleId": "comm_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"version": 3,
"type": "percentage",
"percentageBps": 1500,
"fixedAmountCents": 1990,
"recurrence": {
"kind": "one_time",
"months": 12,
"steps": [
{
"cycle": 1,
"percentageBps": 1500
}
]
},
"tiers": [
{
"minCount": 0,
"percentageBps": 2000,
"fixedAmountCents": 5000
}
],
"applicableProductIds": [
"plan_pro_monthly",
"plan_pro_yearly"
]
},
"fraudSnapshot": {
"score": 0.12,
"decision": "approve",
"signals": [
{
"key": "ip_velocity",
"weight": 0.3,
"triggered": false,
"detail": "3 conversões do mesmo IP em 1h"
}
],
"policy": {
"approveBelow": 0.3,
"reviewAbove": 0.7
}
},
"occurredAt": "2026-06-13T12:00:00.000Z",
"createdAt": "2026-06-13T12:00:05.000Z",
"updatedAt": "2026-06-13T12:00:05.000Z"
}
}