{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thanks-io/json-schema/thanks-io-send-mailer-order-response-schema.json",
  "title": "Send Mailer Order Submitted Response",
  "description": "Response when an Order is successfully submitted to Send Mailer",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thanks-io-openapi.json#/components/schemas/send-mailer-order-response",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique identifier for the order"
    },
    "user_id": {
      "type": "integer",
      "description": "User ID for the order"
    },
    "sub_account": {
      "description": "Sub-account Info For Order.  Can be null",
      "allOf": [
        {
          "$ref": "#/$defs/sub-account"
        }
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "sub_account_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Sub account ID for the order"
    },
    "total_estimated_recipients": {
      "type": "integer",
      "description": "Total estimated recipients for the order"
    },
    "authorization_total": {
      "type": "integer",
      "description": "Total authorization amount for the order in cents"
    },
    "leads_fee": {
      "type": "integer",
      "description": "Total leads fee for the order in cents"
    },
    "mailing_list_ids_used": {
      "type": "string",
      "description": "Mailing lists used for the order.  Can be null if recipients or radius search is used."
    },
    "recipients": {
      "type": "array",
      "description": "List of recipients for the order",
      "items": {
        "$ref": "#/$defs/recipient-no-mailinglist"
      }
    },
    "front_image": {
      "type": "string",
      "description": "Front image URL for the order"
    },
    "image_template_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Image template ID for the order"
    },
    "custom_background_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Custom background URL for the order. Only valid for postcard backs and the interior background of notecards and giftcards."
    },
    "message": {
      "type": "string",
      "description": "Message content for the order"
    },
    "message_template_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Message template ID for the order"
    },
    "handwriting_color": {
      "type": "string",
      "description": "Handwriting color to use"
    },
    "font_size": {
      "type": "string",
      "description": "Font size for the order",
      "enum": [
        "auto",
        "small",
        "medium",
        "large"
      ]
    },
    "style": {
      "type": "integer",
      "description": "Handwriting style ID for the order"
    },
    "append_or_current_resident": {
      "type": "boolean",
      "description": "Appended \"Or Current Resident\" for the order.  This is helpful if you want to ensure delivery."
    },
    "return_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return name for the order"
    },
    "return_address": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return address line 1 for the order"
    },
    "return_address2": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return address line 2 for the order"
    },
    "return_city": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return city for the order"
    },
    "return_province": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return state/province for the order"
    },
    "return_postal_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return postal code for the order"
    },
    "type": {
      "type": "string",
      "description": "Type of the order",
      "enum": [
        "postcard",
        "postcard6x9",
        "postcard6x11",
        "letter",
        "notecard",
        "giftcard",
        "windowlessletter"
      ]
    },
    "size": {
      "type": "string",
      "description": "Size of the order (valid for postcards only)",
      "enum": [
        "4x6",
        "6x9",
        "6x11"
      ]
    },
    "method": {
      "type": "string",
      "description": "Method for the order",
      "enum": [
        "api",
        "cardbuilder",
        "drip",
        "email",
        "zapier"
      ]
    },
    "status": {
      "type": "string",
      "description": "Status of the order",
      "enum": [
        "reviewing",
        "processing",
        "fulfilled",
        "cancelled",
        "printed",
        "shipped",
        "paused",
        "delivered"
      ]
    },
    "display_status": {
      "type": "string",
      "description": "Display status for the order"
    },
    "display_trigger": {
      "type": "string",
      "description": "Display trigger for the order"
    },
    "display_type": {
      "type": "string",
      "description": "Display type for the order"
    },
    "addons": {
      "type": [
        "object",
        "null"
      ],
      "description": "Add-ons for the order",
      "properties": {
        "standardmail": {
          "type": "string",
          "description": "Standard mail add-on status",
          "enum": [
            "on",
            "off"
          ]
        }
      }
    },
    "qrcode_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "QR code URL for the order"
    },
    "giftcard_brand": {
      "type": [
        "string",
        "null"
      ],
      "description": "Gift card brand for the order (valid for Giftcard orders only)"
    },
    "giftcard_image": {
      "type": [
        "string",
        "null"
      ],
      "description": "Gift card image URL for the order (valid for Giftcard orders only)"
    },
    "giftcard_amount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Gift card amount for the order in cents (valid for Giftcard orders only)"
    },
    "giftcard_brand_longname": {
      "type": "string",
      "description": "Gift card brand long name for the order (valid for Giftcard orders only)"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "The metadata object submitted with the order, returned exactly as it was sent. Null when the order was created without metadata.",
      "additionalProperties": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last updated timestamp for the order"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Creation timestamp for the order"
    }
  },
  "$defs": {
    "recipient-no-mailinglist": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "company": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "province": {
          "type": "string",
          "description": "State or Province"
        },
        "postal_code": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "dob": {
          "type": "string",
          "description": "Date of Birth in ISO 8601 format (YYYY-MM-DD) or null if not set. If provided as MM/DD/YYYY in requests, it will be converted to ISO 8601 format."
        },
        "anniversary": {
          "type": "string",
          "description": "Can be used for house purchase anniversaries, move-in dates, or any recurring annual milestone.  Anniversary date in ISO 8601 format (YYYY-MM-DD) or null if not set. If provided as MM/DD/YYYY in requests, it will be converted to ISO 8601 format."
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "custom1": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom2": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom3": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom4": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom5": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom6": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom7": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom8": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom9": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "custom10": {
          "type": "string",
          "description": "Custom field for additional information about the recipient"
        },
        "absentee_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "The property (absentee) address the absentee image template and message variables use. Present only on recipients sent with an absentee address. Mail is delivered to `address`, not here."
        }
      }
    },
    "sub-account": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "return_name": {
          "type": "string"
        },
        "return_address": {
          "type": "string"
        },
        "return_address2": {
          "type": "string"
        },
        "return_city": {
          "type": "string"
        },
        "return_state": {
          "type": "string"
        },
        "return_postal_code": {
          "type": "string"
        }
      }
    }
  }
}