---
title: "Generate representment PDF"
method: POST
path: "/dispute/disputes/{disputeId}/evidences/generate-representment"
tags: ["Disputes"]
---

# Generate representment PDF

`POST /dispute/disputes/{disputeId}/evidences/generate-representment`

## Request

- Base URL: `https://api.staging.payrails.io`
- URL: `https://api.staging.payrails.io/dispute/disputes/{disputeId}/evidences/generate-representment`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/payrails/apis/payrails-api-reference/docs/dispute/disputes/:disputeId/evidences/generate-representment/post.ts> (a function with typed inputs; its response is checked against the schema)

Compile your representment sections into a PDF and attach it to the dispute. Call this after you are satisfied with the written sections and ready to finalize your representment.

## Path parameters

- `disputeId` string, uuid, required

## Headers

- `x-idempotency-key` string, uuid, required

## Request body

- object
  - `caseDetails` object[]
    - `label` string
    - `value` string
  - `includeTimeline` boolean: When true, renders the "Timeline of Events" section in the PDF if the dispute has timeline events. Omitted or false leaves the timeline out.

## Response `200`

Representment PDF compiled and attached to the dispute.

- object
  - `representmentPlan` object: Updated representment plan after representment PDF was generated.
    - `disputeId` string, uuid, required: Unique identifier of the dispute in Payrails.
    - `providerResponseId` string: Provider response identifier for representment plan generation.
    - `createdAt` string, date-time, required: Date and time when the representment plan was created in Payrails.
    - `updatedAt` string, date-time, required: Date and time when the representment plan was last updated in Payrails.
    - `status` 'GeneratingPlan' | 'PlanReady' | 'StoringEvidences' | 'LabelingEvidences' | 'EvidencesReady' | 'GeneratingRepresentment' | 'RepresentmentReady' | 'Submitted', required: Status of the representment plan lifecycle.
    - `recommendation` string: Recommended action for the merchant (e.g. "defend" or "accept").
    - `rationale` string: Explanation supporting the recommendation.
    - `defenseReasons` object[]: Defense reason codes with evidence options, grouped by provider reason code.
      - `code` string, required: Adyen defense document type code.
      - `title` string, required: Human-readable name for this defense document type.
      - `description` string, required: Explanation of what this defense document type covers.
      - `selected` boolean, required: Whether this defense type is the recommended selection.
      - `options` object[], required: Evidence suggestions within this defense type.
        - `position` integer, required: Ordering position of this option within the defense type.
        - `slug` string: Machine-readable identifier for the evidence type.
        - `title` string, required: Suggested title for this evidence.
        - `description` string, required: Suggested details to include for this evidence.
        - `required` boolean, required: Whether this evidence is mandatory for the defense.
        - `evidenceInfo` object: Display metadata for the already-uploaded evidence file, present when evidenceId is set.
          - `displayTitle` string: Human-readable file name or title of the uploaded evidence.
          - `contentType` string: MIME type of the uploaded evidence file.
          - `contentLength` integer: Size of the uploaded evidence file in bytes.
  - `generatedEvidence` object: Generated representment PDF evidence metadata.
    - `id` string, uuid, required: Unique identifier of the Dispute in Payrails.
    - `createdAt` string, date-time, required: Date and time when the Dispute was created in Payrails.
    - `updatedAt` string, date-time, required: Date and time when the Dispute was last updated in Payrails.
    - `displayTitle` string: Display title of the evidence, usually the file name.
    - `status` 'Active' | 'Inactive' | 'Unknown': Status of the dispute evidence.
    - `provenance` 'Merchant' | 'Payrails' | 'Unknown': Provenance of the dispute evidence.
    - `contentType` string: MIME type of the evidence content.
    - `contentLength` integer: Size of the evidence content in bytes.
    - `payload` object: Inline JSON payload for inline-context evidences. Present only for evidences created from `inlineContexts`; omitted for file-backed evidence.
    - `workspaceId` string, uuid: Workspace ID that the Dispute belongs to.
    - `labels` string[]: Labels assigned to this evidence for the dispute, used to categorise the document during representment.

## Other responses

- `400`: Bad Request.
- `401`: Unauthorized.
- `403`: Forbidden.
- `404`: Not Found.
- `409`: Conflict.
- `429`: Too Many Requests.
- `500`: Internal Server Error.

---

[API](https://skmtc.dev/payrails/apis/payrails-api-reference.md) - [All operations](https://skmtc.dev/payrails/apis/payrails-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/payrails/apis/payrails-api-reference/revisions/9dd2f0158582?raw)
