curl --request POST \
--url https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'x-idempotency-key: <x-idempotency-key>'import requests
url = "https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences"
payload = "-----011000010111000001101001\r\n-----011000010111000001101001--"
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
const options = {
method: 'POST',
headers: {'x-idempotency-key': '<x-idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences', 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.staging.payrails.io/dispute/disputes/{disputeId}/evidences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"x-idempotency-key: <x-idempotency-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.staging.payrails.io/dispute/disputes/{disputeId}/evidences"
payload := strings.NewReader("-----011000010111000001101001\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.staging.payrails.io/dispute/disputes/{disputeId}/evidences")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"evidences": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"displayTitle": "<string>",
"status": "Active",
"provenance": "Merchant",
"contentType": "<string>",
"contentLength": 123,
"payload": {},
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"labels": [
"<string>"
]
}
],
"failedEvidences": [
{
"name": "<string>",
"errorMessage": "<string>"
}
],
"classifications": [
{
"evidenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disputeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "classifying",
"contentSummary": "<string>",
"documentType": "<string>",
"provesStatement": "<string>",
"keyFacts": [
"<string>"
],
"suggestedPlanMatches": [
{
"defenseReasonCode": "<string>",
"slug": "<string>",
"position": 123,
"rationale": "<string>"
}
],
"providerResponseId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "internal",
"detail": "An internal error occurred",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#internal"
}
]
}Upload evidence files
Upload evidence files on the dispute.
curl --request POST \
--url https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'x-idempotency-key: <x-idempotency-key>'import requests
url = "https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences"
payload = "-----011000010111000001101001\r\n-----011000010111000001101001--"
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
const options = {
method: 'POST',
headers: {'x-idempotency-key': '<x-idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences', 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.staging.payrails.io/dispute/disputes/{disputeId}/evidences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"x-idempotency-key: <x-idempotency-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.staging.payrails.io/dispute/disputes/{disputeId}/evidences"
payload := strings.NewReader("-----011000010111000001101001\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.staging.payrails.io/dispute/disputes/{disputeId}/evidences")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"evidences": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"displayTitle": "<string>",
"status": "Active",
"provenance": "Merchant",
"contentType": "<string>",
"contentLength": 123,
"payload": {},
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"labels": [
"<string>"
]
}
],
"failedEvidences": [
{
"name": "<string>",
"errorMessage": "<string>"
}
],
"classifications": [
{
"evidenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disputeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "classifying",
"contentSummary": "<string>",
"documentType": "<string>",
"provesStatement": "<string>",
"keyFacts": [
"<string>"
],
"suggestedPlanMatches": [
{
"defenseReasonCode": "<string>",
"slug": "<string>",
"position": 123,
"rationale": "<string>"
}
],
"providerResponseId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "internal",
"detail": "An internal error occurred",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#internal"
}
]
}Authorizations
You can use an OAuth2 JWT bearer token in the Authorization header of your API requests for supported endpoints: Authorization: Bearer <YOUR_JWT_HERE>.
These tokens are valid for 10 minutes and can be requested via the access token endpoint endpoint.
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Path Parameters
Identifier of the resource in Payrails.
Body
Evidence to upload for the dispute. Provide at least one of files[] (binary file uploads) or inlineContexts (inline JSON context); both may be combined in a single request. A request with neither is rejected.
List of files supporting the dispute defense.
Inline merchant-context evidences supplied as a JSON array in a single inlineContexts form field. Each item is stored as JSON evidence with no uploaded file. Maximum 10 items.
Response
Dispute evidences uploaded.
Hide child attributes
Hide child attributes
Unique identifier of the Dispute in Payrails.
Date and time when the Dispute was created in Payrails.
Date and time when the Dispute was last updated in Payrails.
Display title of the evidence, usually the file name.
Status of the dispute evidence.
Active, Inactive, Unknown Provenance of the dispute evidence.
Merchant, Payrails, Unknown MIME type of the evidence content.
Size of the evidence content in bytes.
Inline JSON payload for inline-context evidences. Present only for evidences created from inlineContexts; omitted for file-backed evidence.
Workspace ID that the Dispute belongs to.
Labels assigned to this evidence for the dispute, used to categorise the document during representment.
AI classifications for the uploaded evidence files. Present for each file where classification completed (status "classified" or "failed"). Omitted when the evidence agent feature is not enabled.
Hide child attributes
Hide child attributes
Unique identifier of the evidence file that was classified.
Unique identifier of the dispute the evidence belongs to.
Classification status.
classifying, classified, failed AI-generated summary of the evidence file content.
AI-inferred document type (e.g. "receipt", "shipping_label").
AI-generated statement of what the evidence proves in the dispute context.
List of key facts extracted from the evidence.
Representment plan slots this evidence is suggested to fill, ordered by confidence.
Hide child attributes
Hide child attributes
Defense reason code of the plan slot this evidence matches.
Slug identifier of the matching plan evidence slot.
Position of the matching slot within the defense type.
AI-generated explanation for why this evidence matches the slot.
Identifier of the LLM provider response that produced this classification.
Date and time when the classification was created.
Date and time when the classification was last updated.