Simula uma conversão sem persistir
Aplica atribuição, regra de comissão e antifraude ao afiliado informado sem criar conversão, comissão, clique ou evento.
curl --request POST \
--url https://api.userepass.com/programs/{programId}/conversions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"amountCents": 10000,
"currency": "BRL",
"customerEmail": "[email protected]",
"productId": "<string>",
"touches": [
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"offsetDays": 5
}
],
"couponAffiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
}
'import requests
url = "https://api.userepass.com/programs/{programId}/conversions/preview"
payload = {
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"amountCents": 10000,
"currency": "BRL",
"customerEmail": "[email protected]",
"productId": "<string>",
"touches": [
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"offsetDays": 5
}
],
"couponAffiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
}
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({
affiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
amountCents: 10000,
currency: 'BRL',
customerEmail: '[email protected]',
productId: '<string>',
touches: [{affiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC', offsetDays: 5}],
couponAffiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC'
})
};
fetch('https://api.userepass.com/programs/{programId}/conversions/preview', 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/programs/{programId}/conversions/preview",
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([
'affiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'amountCents' => 10000,
'currency' => 'BRL',
'customerEmail' => '[email protected]',
'productId' => '<string>',
'touches' => [
[
'affiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'offsetDays' => 5
]
],
'couponAffiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC'
]),
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/programs/{programId}/conversions/preview"
payload := strings.NewReader("{\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\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/programs/{programId}/conversions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.userepass.com/programs/{programId}/conversions/preview")
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 \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\n}"
response = http.request(request)
puts response.read_body{
"simulated": true,
"status": "approved",
"amountCents": 0,
"currency": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"affiliate": {
"id": "<string>",
"name": "<string>",
"status": "approved"
},
"journey": {
"windowDays": 0,
"matchMethod": "click_id",
"touches": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"isWinner": true,
"weightBps": 0,
"clickId": "<string>"
}
],
"winners": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"weightBps": 0,
"isPrimary": true
}
]
},
"attribution": {
"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"
},
"fraud": {
"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
}
},
"rule": {
"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"
]
},
"commissions": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"amountCents": 0,
"currency": "<string>",
"calculation": {
"basis": "gross",
"chargedAmountCents": 1990,
"baseAmountCents": 1990,
"weightBps": 10000,
"gatewayFeeCents": 99,
"rule": {
"ruleId": "cmrl_01J9Z3K8QXY4M2N6P7R0S1T2V3",
"version": 1,
"precedence": "default",
"type": "percentage"
},
"appliedPercentageBps": 1500,
"appliedFixedAmountCents": 500,
"recurrenceKind": "one_time",
"tier": {
"minCount": 0,
"approvedConversionsCount": 12
},
"splitRemainderCents": 1,
"refund": {
"refundedAmountCents": 1990,
"chargedAmountCents": 1990,
"originalCommissionAmountCents": 298,
"chargeback": false
},
"reprocess": {
"jobId": "job_01J9Z3K8QXY4M2N6P7R0S1T2V3",
"originalAmountCents": 298,
"recalculatedAmountCents": 350
},
"description": "Bônus de campanha de junho"
},
"holdUntil": "2023-11-07T05:31:56Z"
}
],
"skip": {
"reason": "affiliate_paused"
}
}Authorizations
Chave de API (prefixo rstr_) enviada como Authorization: Bearer rstr_....
Path Parameters
^prog_[0-9A-HJKMNP-TV-Z]{26}$Body
Afiliado primário da simulação. Sem touches, recebe 100% do crédito (match manual). Com touches, ainda identifica o afiliado de referência da resposta.
^aff_[0-9A-HJKMNP-TV-Z]{26}$"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
Valor simulado da conversão, em centavos.
0 <= x <= 90071992547410000
BRL E-mail opcional do cliente simulado, usado na checagem de autoindicação.
254^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Produto opcional usado para avaliar a aplicabilidade da regra.
1 - 255Jornada sintética de cliques. Quando presente, a simulação usa o motor real de atribuição do programa em vez do match manual de um único afiliado.
1 - 10 elementsShow child attributes
Show child attributes
Afiliado dono de um cupom sintético (sem persistir cupom). Combinado com touches para exercitar a política cupom×clique do programa.
^aff_[0-9A-HJKMNP-TV-Z]{26}$"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
Response
Default Response
true Status da conversão. pending: aguardando revisão (ex.: travada por fraude). approved: aprovada e elegível a comissão. voided: anulada (manualmente ou por confirmação de fraude). refunded: estornada após reembolso do cliente.
pending, approved, voided, refunded "approved"
-9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Snapshot da decisão de atribuição registrada na conversão.
Show child attributes
Show child attributes
Snapshot da avaliação antifraude registrada na conversão.
Show child attributes
Show child attributes
Snapshot da regra de comissão aplicada na conversão.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
curl --request POST \
--url https://api.userepass.com/programs/{programId}/conversions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"amountCents": 10000,
"currency": "BRL",
"customerEmail": "[email protected]",
"productId": "<string>",
"touches": [
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"offsetDays": 5
}
],
"couponAffiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
}
'import requests
url = "https://api.userepass.com/programs/{programId}/conversions/preview"
payload = {
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"amountCents": 10000,
"currency": "BRL",
"customerEmail": "[email protected]",
"productId": "<string>",
"touches": [
{
"affiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC",
"offsetDays": 5
}
],
"couponAffiliateId": "aff_01J9Z3K8N2QF4T7B9XP0WMD5RC"
}
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({
affiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
amountCents: 10000,
currency: 'BRL',
customerEmail: '[email protected]',
productId: '<string>',
touches: [{affiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC', offsetDays: 5}],
couponAffiliateId: 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC'
})
};
fetch('https://api.userepass.com/programs/{programId}/conversions/preview', 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/programs/{programId}/conversions/preview",
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([
'affiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'amountCents' => 10000,
'currency' => 'BRL',
'customerEmail' => '[email protected]',
'productId' => '<string>',
'touches' => [
[
'affiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC',
'offsetDays' => 5
]
],
'couponAffiliateId' => 'aff_01J9Z3K8N2QF4T7B9XP0WMD5RC'
]),
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/programs/{programId}/conversions/preview"
payload := strings.NewReader("{\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\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/programs/{programId}/conversions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.userepass.com/programs/{programId}/conversions/preview")
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 \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"amountCents\": 10000,\n \"currency\": \"BRL\",\n \"customerEmail\": \"[email protected]\",\n \"productId\": \"<string>\",\n \"touches\": [\n {\n \"affiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\",\n \"offsetDays\": 5\n }\n ],\n \"couponAffiliateId\": \"aff_01J9Z3K8N2QF4T7B9XP0WMD5RC\"\n}"
response = http.request(request)
puts response.read_body{
"simulated": true,
"status": "approved",
"amountCents": 0,
"currency": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"affiliate": {
"id": "<string>",
"name": "<string>",
"status": "approved"
},
"journey": {
"windowDays": 0,
"matchMethod": "click_id",
"touches": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"isWinner": true,
"weightBps": 0,
"clickId": "<string>"
}
],
"winners": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"weightBps": 0,
"isPrimary": true
}
]
},
"attribution": {
"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"
},
"fraud": {
"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
}
},
"rule": {
"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"
]
},
"commissions": [
{
"affiliateId": "<string>",
"affiliateName": "<string>",
"amountCents": 0,
"currency": "<string>",
"calculation": {
"basis": "gross",
"chargedAmountCents": 1990,
"baseAmountCents": 1990,
"weightBps": 10000,
"gatewayFeeCents": 99,
"rule": {
"ruleId": "cmrl_01J9Z3K8QXY4M2N6P7R0S1T2V3",
"version": 1,
"precedence": "default",
"type": "percentage"
},
"appliedPercentageBps": 1500,
"appliedFixedAmountCents": 500,
"recurrenceKind": "one_time",
"tier": {
"minCount": 0,
"approvedConversionsCount": 12
},
"splitRemainderCents": 1,
"refund": {
"refundedAmountCents": 1990,
"chargedAmountCents": 1990,
"originalCommissionAmountCents": 298,
"chargeback": false
},
"reprocess": {
"jobId": "job_01J9Z3K8QXY4M2N6P7R0S1T2V3",
"originalAmountCents": 298,
"recalculatedAmountCents": 350
},
"description": "Bônus de campanha de junho"
},
"holdUntil": "2023-11-07T05:31:56Z"
}
],
"skip": {
"reason": "affiliate_paused"
}
}