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

# Generate

> Generate a valid test message from options, or from a description with an LLM.



## OpenAPI

````yaml /rest/openapi.json post /generate
openapi: 3.1.0
info:
  description: >-
    Parse, build, validate, explain, generate and convert ISO 8583 messages.
    Intended for testing: there is no authentication. Only use test card
    numbers.
  title: ISO8583 Simulator API
  version: '1'
servers:
  - description: Public demo (LLM features off)
    url: https://api.iso8583sim.com
  - description: Local server (iso8583sim web)
    url: http://127.0.0.1:8000
security: []
paths:
  /generate:
    post:
      tags:
        - Messages
      summary: Generate
      description: >-
        Generate a valid test message from options, or from a description with
        an LLM.
      operationId: generate_generate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    GenerateRequest:
      properties:
        amount_minor_units:
          default: 1000
          maximum: 999999999999
          minimum: 0
          title: Amount Minor Units
          type: integer
        currency:
          default: '840'
          pattern: ^\d{3}$
          title: Currency
          type: string
        description:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          description: >-
            Describe the message in plain English and let an LLM build it.
            Overrides the other fields.
          title: Description
        message_type:
          default: auth
          enum:
            - auth
            - financial
            - echo
          title: Message Type
          type: string
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        network:
          anyOf:
            - $ref: '#/components/schemas/CardNetwork'
            - type: 'null'
        pan:
          anyOf:
            - pattern: ^\d{12,19}$
              type: string
            - type: 'null'
          title: Pan
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        stan:
          default: '123456'
          pattern: ^\d{6}$
          title: Stan
          type: string
      title: GenerateRequest
      type: object
    GenerateResponse:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/FieldValue'
          title: Fields
          type: array
        message:
          title: Message
          type: string
        mti:
          title: Mti
          type: string
        network:
          anyOf:
            - $ref: '#/components/schemas/CardNetwork'
            - type: 'null'
        source:
          title: Source
          type: string
      required:
        - message
        - mti
        - network
        - fields
        - source
      title: GenerateResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CardNetwork:
      description: Card network identifiers
      enum:
        - VISA
        - MASTERCARD
        - AMEX
        - DISCOVER
        - JCB
        - UNIONPAY
      title: CardNetwork
      type: string
    FieldValue:
      properties:
        name:
          title: Name
          type: string
        number:
          title: Number
          type: integer
        value:
          title: Value
          type: string
      required:
        - number
        - name
        - value
      title: FieldValue
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````

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