openapi: 3.0.0
servers:
  - url: http://api.fungenerators.com
  - url: https://api.fungenerators.com
info:
  contact:
    name: Fun Generators
    url: http://fungenerators.com/api/barcode/
  description: |
    Generate Barcode images for a given barcode number. You can decode Barcode images and get the barcodes in a numberic form as well. Many industry standard barcode types are supported. The best and complete Barcode API on the cloud. [Click here to subscribe](http://fungenerators.com/api/barcode/) 
  termsOfService: https://fungenerators.com/terms
  title: Barcode API
  version: "1.5"
  x-apisguru-categories:
    - text
  x-origin:
    - format: openapi
      url: https://fungenerators.com/yaml/barcode.yaml
      version: "3.0"
  x-providerName: fungenerators.com
  x-serviceName: barcode
tags:
  - description: Barcode API
    externalDocs:
      description: Find out more
      url: http://fungenerators.com/api/barcode/
    name: Barcode
paths:
  /barcode/decode:
    post:
      description: Decode a Barcode image and return the cotents if successful
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                barimage:
                  description: Barcode image to decode and get the content value
                  format: binary
                  type: string
              required:
                - barimage
              type: object
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                      "success": {
                        "total": 1
                      },
                      "contents": [
                          {
                                   "value": 234567,
                                   "format": 'C39',
                                   "content_type": "number"
                          }
                      ]
                    }
          description: 200  response
        "401":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                        "error": {
                            "code": 401,
                            "message": "Unauthorized"
                        }
                    }              
          description: 401  response
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Barcode
  /barcode/decode/types:
    get:
      description: Get the supported barcode types for the decoding process.
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                      "success": {"total":28},
                      "contents": 
                      {
                         "types":
                         {
                           "C39":"Code 39",
                           "C39CKSUM":"Code 39 with Checksum",
                           "C39E":"Extended Code 39",
                           "C39ECKSUM":"Extended Code 39 With Checksum",
                           "C93":"Code 93",
                           "I25":"Interleaved 2 of 5",
                           "I25CKSUM":"Interleaved 2 of 5 with Checksum",
                           "C128":"Code 128 (Standard)",
                           "C128A":"Code 128-A",
                           "C128B":"Code 128-B",
                           "C128C":"Code 128-C",
                           "CODABAR":"CODABAR"
                           
                         }
                      }
                    }
          description: 200  response
        "401":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                        "error": {
                            "code": 401,
                            "message": "Unauthorized"
                        }
                    }                    
          description: 401  response
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Barcode
  /barcode/encode:
    get:
      description: Get a Bar Code image for the given barcode number
      parameters:
        - description: Barcode number
          in: query
          name: number
          required: true
          schema:
            format: string
            type: string
        - description: Barcode format default C39. Valid values are the keys to those returned from /barcode/encode/types.
          in: query
          name: barcodeformat
          required: false
          schema:
            format: string
            type: string
        - description: Output image format. Must be one of png/html/jpg/svg
          in: query
          name: outputformat
          required: false
          schema:
            format: string
            type: string
        - description: Width factor of the image
          in: query
          name: widthfactor
          required: false
          schema:
            format: integer
            type: integer
        - description: Total height of the image
          in: query
          name: totalheight
          required: false
          schema:
            format: integer
            type: integer
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                        "success": {
                            "total": 1
                        },
                        "contents": [
                            {
                                "encoding": "base64",
                                "format": "png",
                                "content": "",
                            }
                        ]
                    }
          description: 200  response
        "401":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                        "error": {
                            "code": 401,
                            "message": "Unauthorized"
                        }
                    }                    
          description: 401  response
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Barcode
  /barcode/encode/types:
    get:
      description: Get the supported barcode types for encoding / image generation.
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                      "success": {"total":28},
                      "contents": {"types":
                           {
                              "C39":"Code 39",
                              "C39CKSUM":"Code 39 with Checksum",
                              "C39E":"Extended Code 39",
                              "C39ECKSUM":"Extended Code 39 With Checksum",
                              "C93":"Code 93",
                              "S25":"Standard 2 of 5",
                              "S25CKSUM":"Standard 2 of 5 with Checksum",
                              "I25":"Interleaved 2 of 5",
                              "I25CKSUM":"Interleaved 2 of 5 with Checksum",
                              "UPCA":"UPC-A",
                              "UPCE":"UPC-E",
                              "C128":"Code 128 (Standard)",
                              "C128A":"Code 128-A",
                              "C128B":"Code 128-B",
                              "C128C":"Code 128-C",
                              "EAN8":"EAN-8",
                              "EAN13":"EAN-13",
                              "MSI":"MSI Plessey",
                              "MSICKSUM":"MSI with Checksum",
                              "POSTNET":"POSTNET",
                              "PLANET":"PLANET",
                              "RMS4CC":"RMS4CC \/ CBC",
                              "KIX":"KIX",
                              "IMB":"IMB",
                              "CODABAR":"CODABAR",
                              "CODE11":"Code 11",
                              "PHARMA":"Pharma One-Track",
                              "PHARMA2T":"Pharma Two-Track"
                           }
                      }
                    }
          description: 200  response
        "401":
          content:
            application/json:
              examples:
                response:
                  value: |-
                    {
                        "error": {
                            "code": 401,
                            "message": "Unauthorized"
                        }
                    }
          description: 401  response
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Barcode
components:
  securitySchemes:
    X-Fungenerators-Api-Secret:
      in: header
      name: X-Fungenerators-Api-Secret
      type: apiKey
