Add an evidence library document
Add a terms, policy or product description document to the evidence library as version 1, and Payrails AI suggests its reason codes.
reasonCodes. Each dispute gets the document’s latest
version. A dispute without a Visa or Mastercard reason code gets no library document
automatically, and you can still attach any document to any dispute.
Payrails AI reads the file and suggests the reason codes a few seconds after you add the
document. Until then, reasonCodes is null and Payrails attaches the document to no
dispute. You can change the reason codes with Update an evidence library document.
The kind is the document type: terms, policy or productDescription. It decides
where the document appears in a dispute’s defense: terms and policies in the Merchant
policy section, product descriptions in the Product as described section.
validFromis deprecated and ignored.- Without
workspaceIdthe document applies to every workspace. Callers limited to some workspaces must setworkspaceIdto one of theirs; they get 403 for a merchant-wide document. - Each document type can have a title only once. Returns 409 when a document of the same type already has the title, also when that document is archived or in another workspace. Payrails ignores upper and lower case and extra spaces when it compares titles.
- The same title is allowed for a different document type.
- Payrails removes extra spaces from the title before it saves it.
- The title must not end with a version, such as
Refund policy v2orRefund policy version 2. Returns 422 for such a title. To update the file, add a new version instead. - Returns 404 when the
evidenceLibraryEnabledfeature flag is off.
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.
Scopes
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Body
The document title. It must not end with a version, such as v2.
200"Terms & conditions"
Kind of library document. terms and policy documents are attached to every dispute; productDescription documents to not-as-described disputes.
terms, policy, productDescription The document.
Workspace the document belongs to. Omit to apply it to every workspace.
Ignored. New disputes always get the latest version.
Response
Document and its version 1 created.
Kind of library document. terms and policy documents are attached to every dispute; productDescription documents to not-as-described disputes.
terms, policy, productDescription Always matchingReasonCodes. Payrails attaches a document to a new dispute when the dispute's card network reason code is one of the document's reasonCodes. allDisputes is no longer returned.
matchingReasonCodes, allDisputes Number of disputes that use any version of the document. If your credentials can access only some workspaces, only disputes in those workspaces count.
Absent when the document applies to every workspace.
The card network reason codes this document helps defend. Payrails AI suggests them when you add the document or a new version, and you can change them. null until Payrails AI or a person sets them. An empty list means that no reason code applies.
A card network reason code. Visa: 10.4 other fraud, card-absent; 13.1 merchandise or services not received; 13.2 cancelled recurring transaction; 13.3 not as described or defective; 13.6 credit not processed; 13.7 cancelled merchandise or services. Mastercard: 4837 no cardholder authorization; 4853 cardholder dispute; 4855 goods or services not provided.
10.4, 13.1, 13.2, 13.3, 13.6, 13.7, 4837, 4853, 4855 Who set reasonCodes. ai: Payrails AI. user: a person on your team in the Payrails portal. client: your system through the API. null until the reason codes are set. Payrails AI never replaces reason codes that a person or your system set.
ai, user, client, null The latest version that is not archived. New disputes get this version. Absent when every version is archived.
When a dispute last started to use a version of the document. If your credentials can access only some workspaces, only disputes in those workspaces count.
All versions of the document, oldest first. Returned by Add document (version 1 only), Get document, Add version, Archive document and Archive version. List documents does not return it.
The 100 disputes that most recently started to use the document, newest first, with the version each one uses. A dispute that uses two versions appears twice. usedInCount is the total number of disputes. Returned by Get document, Add version, Archive document and Archive version. To see every dispute, use List the disputes that use an evidence library document.
100The changes to the document, newest first, with who made each change and when. Returned by Get document only. For documents changed before this history existed, it shows only what their stored dates show. An archive and restore that happened before then does not appear.