> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a claim letter

> Generate a claim letter PDF for a parcel. The claim letter is created based on the provided items, currency, tax rate, and ticket category, combined with parcel and sender details fetched from the system.

Company details and addresses are auto-populated from the parcel and sender information stored in the system.

**Note:** Claim letters are currently generated in French only.

The generated PDF returns a file token that can be used with the [Create a requested data response](/api/v3/support/provide-requested-data) endpoint or when creating tickets.



## OpenAPI

````yaml /.openapi/v3/support/openapi.yaml post /dsf/documents/generate/claim-letter
openapi: 3.1.0
info:
  title: Support API [BETA]
  version: 3.0.0
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: >-
    The Sendcloud Support API lets you create support tickets easily and
    efficiently. This API can be used in conjunction with other core Sendcloud
    features or independently.
servers:
  - url: https://panel.sendcloud.sc/api/v3
    description: Sendcloud Production
security: []
tags:
  - name: Support
    description: Sendcloud's Support API
  - name: File upload
  - name: Carrier support contacts
  - name: Create ticket
  - name: Documents
  - name: Requested data
paths:
  /dsf/documents/generate/claim-letter:
    post:
      tags:
        - Documents
      summary: Create a claim letter
      description: >-
        Generate a claim letter PDF for a parcel. The claim letter is created
        based on the provided items, currency, tax rate, and ticket category,
        combined with parcel and sender details fetched from the system.


        Company details and addresses are auto-populated from the parcel and
        sender information stored in the system.


        **Note:** Claim letters are currently generated in French only.


        The generated PDF returns a file token that can be used with the [Create
        a requested data response](/api/v3/support/provide-requested-data)
        endpoint or when creating tickets.
      operationId: sc-public-v3-dsf-post-documents_generate_claim_letter
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateClaimLetterRequest'
            example:
              tracking_number: 3SABCD1234567
              items:
                - description: T-Shirt
                  quantity: 3
                  unit_price: 19.95
                - description: Pants
                  quantity: 1
                  unit_price: 45
              currency_code: EUR
              tax_rate: 21
              ticket_category: damaged
        required: true
      responses:
        '201':
          $ref: '#/components/responses/ClaimLetterCreated'
        '400':
          $ref: '#/components/responses/ClaimLetterGenerationFailed'
        '401':
          description: Unauthorized
        '429':
          $ref: '#/components/responses/RateLimitExceededResponse'
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  schemas:
    GenerateClaimLetterRequest:
      title: Generate claim letter request
      type: object
      properties:
        tracking_number:
          description: Parcel tracking number
          type: string
          example: 3SABCD1234567
        items:
          type: array
          description: List of invoice line items
          items:
            type: object
            properties:
              description:
                type: string
                description: Description of the item
              quantity:
                type: integer
                description: Quantity of the item
                minimum: 1
              unit_price:
                type: number
                format: double
                description: Unit price of the item. **Must be tax-included.**
            required:
              - description
              - quantity
              - unit_price
        currency_code:
          type: string
          description: ISO 4217 currency code
          example: EUR
        tax_rate:
          type: number
          format: double
          description: Tax rate percentage (0-99)
          minimum: 0
          maximum: 99
          example: 21
        ticket_category:
          type: string
          description: The type of claim this letter is for
          enum:
            - damaged
            - lost
            - unjust_return
            - delivered_not_received
        force:
          type: boolean
          description: >-
            Bypasses the maximum invoice amount validation (5000 EUR). Only use
            this when strictly necessary, as the validation exists to prevent
            erroneous documents.
          default: false
      required:
        - tracking_number
        - items
        - currency_code
        - tax_rate
        - ticket_category
    GenerateDocumentResponse:
      title: Generate document response
      type: object
      properties:
        file_token:
          type: string
          description: >-
            A token referencing the generated document. Use this token when
            attaching the document to a ticket (in the `attachments` array) or
            when submitting it as part of a requested data response.
        preview_url:
          type: string
          description: >-
            Temporary pre-signed URL for previewing or downloading the generated
            PDF. This URL expires after 72 hours and should not be stored for
            long-term use.
      required:
        - file_token
        - preview_url
    ErrorsResponseSchema:
      description: Support API error response.
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                title: Error code
                type: string
              detail:
                title: Error description
                type: string
              title:
                title: Error title
                type: string
              status:
                title: HTTP status code
                type: integer
      required:
        - errors
  responses:
    ClaimLetterCreated:
      description: Claim letter generated successfully
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenerateDocumentResponse'
          example:
            file_token: c91f8b81-68d7-5449-aa3b-fbf61e748372
            preview_url: https://s3.example.com/claim_letter.pdf?token=...
    ClaimLetterGenerationFailed:
      description: Claim letter generation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          examples:
            Invalid JSON:
              value:
                errors:
                  - code: bad_request
                    detail: Invalid JSON
                    title: Bad Request
                    status: 400
            Validation Error:
              value:
                errors:
                  - code: bad_request
                    detail: >-
                      Validation Error. Errors: [{'type': 'missing', 'loc':
                      ('ticket_category',), 'msg': 'Field required'}]
                    title: Bad Request
                    status: 400
            Generation Failed:
              value:
                errors:
                  - code: bad_request
                    detail: Claim letter generation failed.
                    title: Bad Request
                    status: 400
    RateLimitExceededResponse:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          example:
            errors:
              - code: hit_rate_limit
                detail: 'Rate limit exceeded: 30 per 1 minute'
                title: Rate limit exceeded
                status: 429
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic
    OAuth2ClientCreds:
      type: oauth2
      description: >-
        OAuth2 is a standardized protocol for authorization that allows users to
        share their private resources stored on one site with another site
        without having to provide their credentials. OAuth2 Client Credentials
        Grant workflow. This workflow is typically used for server-to-server
        interactions that require authorization to access specific resources.
      flows:
        clientCredentials:
          tokenUrl: https://account.sendcloud.com/oauth2/token/
          scopes:
            api: Default OAuth scope required to access Sendcloud API.

````