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

# PDF to E-Invoice (API Tester)

> Submit a PDF and invoice XML for asynchronous embedding and validation.

> [!NOTE]
>
> **Full reference:** [PDF to E-Invoice](https://developer.pdf.co/api/pdf-to-e-invoice.md) covers supported profiles, validation, warnings and limits. This operation starts a background job. Use [Background Job Check](https://developer.pdf.co/api/job-check.md) for the final result.

> [!NOTE]
>
> Error examples summarize shared response-code meanings; actual message text varies by failure.


## OpenAPI

````yaml /openapi.json post /v1/pdf/convert/to/e-invoice
openapi: 3.0.1
info:
  title: PDF.co API
  description: ''
  version: '1.0'
servers:
  - url: https://api.pdf.co
security:
  - ApiKeyAuth: []
tags:
  - name: Extraction
  - name: Editing
  - name: PDF Conversion
  - name: Excel Conversion
  - name: PDF Merging & Splitting
  - name: Forms
  - name: Find & Search
  - name: Document, File & System
  - name: Pages
  - name: Barcodes
paths:
  /v1/pdf/convert/to/e-invoice:
    post:
      tags:
        - PDF Conversion
      summary: PDF to E-Invoice
      description: >-
        Embed customer-provided Factur-X or ZUGFeRD XML into PDF/A-3 and
        validate with veraPDF, Mustang and attachment checks. Asynchronous only.
        Charges 100 processing credits per submission; job-check polling is
        billed separately. Non-compliant results fail and refund the processing
        debit once. Does not generate XML or compare business values between PDF
        and XML.
      operationId: post_v1_pdf_convert_to_e_invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - xml_url
                - profile
              properties:
                url:
                  type: string
                  format: uri
                  description: >-
                    Source PDF URL accessible to PDF.co. Encrypted and digitally
                    signed PDFs are not supported.
                xml_url:
                  type: string
                  format: uri
                  description: >-
                    Supported invoice XML formats: `Factur-X` or `ZUGFeRD`.


                    Provide the URL of your XML file as the value. Use a public
                    or temporary presigned XML URL. The source PDF HTTP
                    credentials do not apply to this URL. XML is limited to 5
                    MiB and must be a supported CrossIndustryInvoice document
                    without DTD or entity declarations. Malformed XML, missing
                    or duplicate guideline identifiers, and unsupported profiles
                    are rejected. The XML determines the detailed profile,
                    conformance level, and canonical embedded filename.
                profile:
                  type: string
                  enum:
                    - facturx
                    - zugferd
                  description: >-
                    `profile` selects the invoice family. It is distinct from
                    the [`profiles` configuration parameter](/api/profiles) used
                    by other endpoints.


                    Expected invoice family. Detailed conformance and embedded
                    filename are derived from supported XML guideline
                    identifiers.
                httpusername:
                  type: string
                  description: >-
                    HTTP authentication username for the source PDF URL only.
                    Does not unlock PDF encryption.
                httppassword:
                  type: string
                  description: >-
                    HTTP authentication password for the source PDF URL only.
                    Does not apply to xml_url.
                callback:
                  type: string
                  format: uri
                  description: Callback URL for the asynchronous terminal result.
                name:
                  type: string
                  description: >-
                    Output file name. The endpoint appends `.pdf` when needed.
                    If omitted, it derives the name from `url` when possible.
                expiration:
                  type: integer
                  default: 60
                  description: >-
                    Number of minutes before the temporary output URL expires.
                    After this period, generated files are deleted from [PDF.co
                    Temporary Files Storage](/api/file-upload/overview). The
                    maximum retention depends on your subscription plan. To
                    store permanent input files (e.g. re-usable images, pdf
                    templates, documents) consider using [PDF.co Built-In Files
                    Storage](https://app.pdf.co/tools/files).
            example:
              url: >-
                https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-e-invoice/sample.pdf
              xml_url: >-
                https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-e-invoice/sample-document-services-invoice.xml
              profile: facturx
      responses:
        '200':
          description: >-
            Job accepted. No converted PDF or report URL is available yet. Poll
            /v1/job/check or use a callback.
          content:
            application/json:
              schema:
                type: object
                properties:
                  pageCount:
                    type: integer
                    description: >-
                      Always 1 in the submission response, even for multi-page
                      PDFs. This value is a submission placeholder and does not
                      represent the actual number of pages in the output PDF.
                      The actual output page count is returned in the final
                      job-check or callback result.
                  error:
                    type: boolean
                  status:
                    type: integer
                    description: >-
                      Numeric submission HTTP status, not the string background
                      job status.
                  duration:
                    type: integer
                  name:
                    type: string
                  validationReportName:
                    type: string
                  jobId:
                    type: string
                    description: Use as jobid in POST /v1/job/check.
                  credits:
                    type: integer
                    description: >-
                      100 processing credits for the asynchronous submission,
                      regardless of page count.
                  remainingCredits:
                    type: integer
              example:
                pageCount: 1
                error: false
                status: 200
                duration: 120
                jobId: EXAMPLEJOBID0123456789ABCDEFGHIJ--167-300
                credits: 100
                remainingCredits: 9900
        '400':
          description: >-
            Bad request. Typically due to bad input parameters or unreachable
            input URLs (e.g., access restrictions like login or password).
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                errorCode: 400
                error: true
                message: >-
                  Bad request. Typically due to bad input parameters or
                  unreachable input URLs (e.g., access restrictions like login
                  or password).
        '401':
          description: >-
            Unauthorized. Authentication is required and has failed or has not
            yet been provided.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                status: error
                errorCode: 401
                error: true
                message: >-
                  Unauthorized. Authentication is required and has failed or has
                  not yet been provided.
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                status: error
                errorCode: 402
                error: true
                message: Not enough credits.
        '403':
          description: >-
            Access forbidden for input URL. This endpoint can also deny access
            because of subscription restrictions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                status: error
                errorCode: 403
                error: true
                message: Access forbidden for input URL.
        '404':
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                errorCode: 404
                error: true
                message: The requested resource could not be found.
        '429':
          description: Too many requests in a given time period.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                error: true
                message: Too many requests in a given time period.
        '500':
          description: Something went wrong. Please try again or contact support.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorCode:
                    type: integer
                  error:
                    type: boolean
                  message:
                    type: string
              example:
                errorCode: 500
                error: true
                message: Something went wrong. Please try again or contact support.
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.