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

# Submit a draft

> Orders a draft. Paperjoy validates it like a new postcard, including card and envelope fit, uses one credit (live only), and sets `status` to `new` and `submitted_at`. If validation fails (`422`) or credits run out (`402`), the postcard stays a draft and nothing is charged.

Requires an `Idempotency-Key` header; a retry with the same key returns the original response and never charges twice. Counts toward the daily limit of 100 postcards. Requires the `postcards:write` ability.




## OpenAPI

````yaml /en/openapi.yaml post /api/postcards/{id}/submit
openapi: 3.1.0
info:
  title: Paperjoy API
  version: '2026-10-19'
  description: >-
    Create, preview, and track real handwritten postcards. The API key decides
    whether a request runs in test or live mode.
  termsOfService: https://paperjoy.co/regulamin
  license:
    name: Proprietary
    url: https://paperjoy.co/regulamin
servers:
  - url: https://paperjoy.co
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The authenticated account and its credit balance.
  - name: Postcards
    description: Create, preview, list, and retrieve postcards.
  - name: Signatures
    description: Custom handwritten signatures available to your organization.
paths:
  /api/postcards/{id}/submit:
    post:
      tags:
        - Postcards
      summary: Submit a draft
      description: >
        Orders a draft. Paperjoy validates it like a new postcard, including
        card and envelope fit, uses one credit (live only), and sets `status` to
        `new` and `submitted_at`. If validation fails (`422`) or credits run out
        (`402`), the postcard stays a draft and nothing is charged.


        Requires an `Idempotency-Key` header; a retry with the same key returns
        the original response and never charges twice. Counts toward the daily
        limit of 100 postcards. Requires the `postcards:write` ability.
      operationId: submitPostcard
      parameters:
        - $ref: '#/components/parameters/PostcardId'
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            A unique key for this submission. Paperjoy remembers successful
            responses for 7 days.
          schema:
            type: string
            maxLength: 255
          example: submit-order-1042
      responses:
        '200':
          description: The postcard was ordered.
          headers:
            Idempotency-Relayed:
              description: >-
                Present when the response replays an earlier response for the
                same `Idempotency-Key`.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostcardResponse'
        '400':
          $ref: '#/components/responses/MissingIdempotencyKey'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/NotDraft'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    PostcardId:
      name: id
      in: path
      required: true
      description: The postcard ID.
      schema:
        type: string
        examples:
          - pc_MXP7a4Ni0c
  schemas:
    PostcardResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Postcard'
    Postcard:
      type: object
      required:
        - id
        - test_mode
        - recipient
        - signature
        - signature_id
        - mistake
        - status
        - submitted_at
        - sent_at
        - created_at
        - updated_at
      properties:
        id:
          type: string
          examples:
            - pc_MXP7a4Ni0c
        test_mode:
          type: boolean
          description: >-
            `true` for a test postcard. Test postcards are free and are never
            written or mailed.
        address:
          description: The delivery address. Can be `null` only in a draft.
          oneOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        recipient:
          oneOf:
            - $ref: '#/components/schemas/Recipient'
            - type: 'null'
        content:
          type:
            - string
            - 'null'
          maxLength: 300
          description: The message. Can be `null` only in a draft.
        signature:
          type:
            - string
            - 'null'
          maxLength: 50
          description: >-
            The typed signature, or `null` when the postcard uses a custom
            signature.
        signature_id:
          type:
            - string
            - 'null'
          description: The custom signature used on the postcard, or `null`.
          examples:
            - sig_ZeXOkSQjTp
        font_id:
          description: The handwriting. Can be `null` only in a draft.
          oneOf:
            - $ref: '#/components/schemas/FontId'
            - type: 'null'
        mistake:
          type: boolean
          description: >-
            Whether one word is crossed out and rewritten to look naturally
            handwritten.
        status:
          $ref: '#/components/schemas/PostcardStatus'
        submitted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the postcard was ordered. `null` while it's a draft.
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the postcard was mailed. `null` until the status is `sent`.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationError:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    Address:
      type: object
      required:
        - line_1
        - postal_code
        - country
        - city
      properties:
        line_1:
          type: string
          maxLength: 255
          description: Street and building number.
          examples:
            - ul. Marszałkowska 10
        line_2:
          type:
            - string
            - 'null'
          maxLength: 255
          description: Apartment, floor, or other detail.
          examples:
            - m. 4
        postal_code:
          type: string
          pattern: ^\d{2}-\d{3}$
          examples:
            - 00-001
        country:
          type: string
          enum:
            - PL
        city:
          type: string
          maxLength: 255
          examples:
            - Warszawa
    Recipient:
      type: object
      description: Send `first_name`, `company_name`, or both.
      properties:
        prefix:
          type:
            - string
            - 'null'
          maxLength: 30
          examples:
            - Pani
        first_name:
          type:
            - string
            - 'null'
          maxLength: 255
        last_name:
          type:
            - string
            - 'null'
          maxLength: 255
        company_name:
          type:
            - string
            - 'null'
          maxLength: 255
    FontId:
      type: string
      enum:
        - font-1
        - font-2
      description: >-
        `font-1` is clear, rounded handwriting. `font-2` is a faster, joined-up
        cursive.
    PostcardStatus:
      type: string
      description: >-
        Where the postcard is in production. Treat unknown values as "in
        progress".
      enum:
        - draft
        - new
        - queued
        - rejected
        - pair_claimed
        - in_progress
        - pair_completed
        - sent
  responses:
    MissingIdempotencyKey:
      description: The `Idempotency-Key` header is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Idempotency-Key header is required to create or submit a postcard.
    Unauthorized:
      description: The API key is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Unauthenticated.
    PaymentRequired:
      description: The account has less than one credit. Only live mode checks the balance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: You need at least 1 credit to create a postcard.
    Forbidden:
      description: >-
        The API key lacks the required ability, or the resource belongs to
        someone else.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: This action is unauthorized.
    NotFound:
      description: The resource does not exist or belongs to the other mode.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Not found.
    NotDraft:
      description: >-
        The postcard is no longer a draft, or the `Idempotency-Key` was used
        with a different request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: >-
              Postcard pc_MXP7a4Ni0c has already been submitted (status: new).
              Only drafts can be changed, submitted, or deleted.
    ValidationError:
      description: >-
        A field is invalid, the text does not fit on the card or envelope, or
        the `Idempotency-Key` is longer than 255 characters.
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/Error'
          examples:
            field:
              summary: Invalid field
              value:
                message: The selected font id is invalid.
                errors:
                  font_id:
                    - The selected font id is invalid.
            card_fit:
              summary: Message does not fit on the card
              value:
                message: >-
                  The content does not fit on the postcard. Shorten it or remove
                  blank lines.
                errors:
                  content:
                    - >-
                      The content does not fit on the postcard. Shorten it or
                      remove blank lines.
            envelope_fit:
              summary: Address does not fit on the envelope
              value:
                message: The sender or recipient address does not fit on the envelope.
                errors:
                  address:
                    - >-
                      The sender or recipient address does not fit on the
                      envelope.
            draft_limit:
              summary: Too many open drafts
              value:
                message: >-
                  You already have 100 open drafts. Submit or delete some of
                  them before saving another draft.
                errors:
                  draft:
                    - >-
                      You already have 100 open drafts. Submit or delete some of
                      them before saving another draft.
            signature_unavailable:
              summary: Custom signature unavailable
              value:
                message: >-
                  The selected signature is unavailable or is not active for
                  your plan.
                errors:
                  signature_id:
                    - >-
                      The selected signature is unavailable or is not active for
                      your plan.
    TooManyRequests:
      description: A rate limit was exceeded. Wait before retrying.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Paperjoy API key. Keys starting with `pj_test_` use test mode; keys
        starting with `pj_live_` use live mode.

````

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