curl --request PATCH \
--url https://gateway.3xpay.co/med-contest/exposes/{medId} \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--header 'api_secret: <api-key>' \
--form file='@example-file' \
--form 'description=<string>'import requests
url = "https://gateway.3xpay.co/med-contest/exposes/{medId}"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "description": "<string>" }
headers = {
"api_key": "<api-key>",
"api_secret": "<api-key>"
}
response = requests.patch(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('description', '<string>');
const options = {method: 'PATCH', headers: {api_key: '<api-key>', api_secret: '<api-key>'}};
options.body = form;
fetch('https://gateway.3xpay.co/med-contest/exposes/{medId}', 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://gateway.3xpay.co/med-contest/exposes/{medId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"api_key: <api-key>",
"api_secret: <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://gateway.3xpay.co/med-contest/exposes/{medId}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("api_secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://gateway.3xpay.co/med-contest/exposes/{medId}")
.header("api_key", "<api-key>")
.header("api_secret", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.3xpay.co/med-contest/exposes/{medId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_key"] = '<api-key>'
request["api_secret"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 1024,
"transactionId": 50231,
"status": "WAITING_CONTENT",
"content": "https://s3.../comprovante.pdf",
"description": "Comprovante de pagamento original.",
"external_med_id": "dispute_8f3a...",
"processor_name": "woovi",
"retry_count": 0,
"last_error": "<string>",
"created_at": "2026-05-12T10:30:00.000Z",
"updated_at": "2026-05-12T10:30:00.000Z"
}Enviar Evidência da Disputa
Envia o arquivo de evidência e a descrição da defesa. Pode ser chamado múltiplas vezes para anexar evidências adicionais — a última prevalece no campo content. Internamente, o gateway envia a defesa ao PSP upstream (hoje apenas Woovi tem caminho server-to-server).
curl --request PATCH \
--url https://gateway.3xpay.co/med-contest/exposes/{medId} \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--header 'api_secret: <api-key>' \
--form file='@example-file' \
--form 'description=<string>'import requests
url = "https://gateway.3xpay.co/med-contest/exposes/{medId}"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "description": "<string>" }
headers = {
"api_key": "<api-key>",
"api_secret": "<api-key>"
}
response = requests.patch(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('description', '<string>');
const options = {method: 'PATCH', headers: {api_key: '<api-key>', api_secret: '<api-key>'}};
options.body = form;
fetch('https://gateway.3xpay.co/med-contest/exposes/{medId}', 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://gateway.3xpay.co/med-contest/exposes/{medId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"api_key: <api-key>",
"api_secret: <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://gateway.3xpay.co/med-contest/exposes/{medId}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("api_secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://gateway.3xpay.co/med-contest/exposes/{medId}")
.header("api_key", "<api-key>")
.header("api_secret", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.3xpay.co/med-contest/exposes/{medId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_key"] = '<api-key>'
request["api_secret"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 1024,
"transactionId": 50231,
"status": "WAITING_CONTENT",
"content": "https://s3.../comprovante.pdf",
"description": "Comprovante de pagamento original.",
"external_med_id": "dispute_8f3a...",
"processor_name": "woovi",
"retry_count": 0,
"last_error": "<string>",
"created_at": "2026-05-12T10:30:00.000Z",
"updated_at": "2026-05-12T10:30:00.000Z"
}medId indicado. Internamente, o gateway encaminha a defesa ao PSP upstream.
content.Status final retornado
Ostatus na resposta indica o resultado imediato do envio:
| Status | Significado |
|---|---|
DEFENSE_SUBMITTED | Defesa entregue ao PSP com sucesso (caminho feliz). |
DEFENSE_FAILED | O PSP rejeitou o envio (erro de transporte/4xx). Detalhes em last_error. Pode chamar o PATCH novamente para tentar outra evidência. |
REQUESTED | O PSP da transação ainda não tem caminho server-to-server suportado (hoje apenas Woovi). Nesses casos o time interno é notificado e acompanha manualmente. |
Exemplo cURL
curl -X PATCH "https://gateway.3xpay.co/med-contest/exposes/1024" \
-H "api_key: SUA_API_KEY" \
-H "api_secret: SEU_API_SECRET" \
-F "file=@/caminho/comprovante.pdf" \
-F "description=Comprovante de pagamento original emitido pelo nosso PSP."
Path Parameters
ID numérico da disputa.
Body
Response
Evidência registrada com sucesso
Registro da disputa de MED. O campo id é o medId usado nos demais endpoints.
ID numérico da disputa (medId).
1024
ID interno da transação relacionada.
50231
Status do registro de disputa.
WAITING_CONTENT, REQUESTED, DEFENSE_SUBMITTED, DEFENSE_FAILED, APPROVED, REJECTED, REFUNDED, CANCELLED URL do arquivo de evidência armazenado. null enquanto a evidência não foi enviada.
"https://s3.../comprovante.pdf"
Descrição/texto da defesa enviada com a evidência.
"Comprovante de pagamento original."
ID da disputa no PSP upstream (preenchido após o envio).
"dispute_8f3a..."
Nome do PSP upstream que recebeu a defesa.
"woovi"
Quantidade de tentativas de envio.
0
Mensagem do último erro de transporte, se houver.
"2026-05-12T10:30:00.000Z"
"2026-05-12T10:30:00.000Z"