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

# Create inquiry

> Create a new inquiry for card metadata based on either a PAN, an existing PCI token, or a network token.



## OpenAPI

````yaml /products/guardian/openapi.yaml post /api/metadata/inquiries
openapi: 3.1.0
info:
  title: Guardian API
  version: '1.0'
  contact:
    name: Starfish GmbH & Co. KG
    email: hello@starfish.team
    url: https://hellgate.io/cpa/guardian
  license:
    name: Hellgate API Terms
    url: https://hellgate.io/terms-and-conditions
servers:
  - url: https://{cluster_id}.on-hellgate.cloud
    description: Guardian service instance
    variables:
      cluster_id:
        default: my-cluster-id
        description: |
          Guardian is a service of the Hellgate Cloud Platform.
          The unique cluster-id is used to connect to your instance.
security: []
tags:
  - name: pci
    description: Management of card payment credentials under the ruling of PCI DSS.
  - name: network
    description: Management of network tokens and cryptograms for secure transactions.
  - name: generic
    description: Management of generic tokens and their schemas for various use cases.
  - name: metadata
    description: Inquiries for card metadata based on PAN, PCI tokens, or network tokens.
  - name: apikey
    description: Management of API keys for service access.
  - name: webhook
    description: Management of webhooks for event notifications.
  - name: types
    description: Management of types for generic token schemas.
paths:
  /api/metadata/inquiries:
    post:
      tags:
        - metadata
      summary: Create inquiry
      description: >-
        Create a new inquiry for card metadata based on either a PAN, an
        existing PCI token, or a network token.
      operationId: inquiry_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inquiry_request'
            examples:
              inquiry_from_pan:
                summary: Inquiry from PAN (SAQ D+)
                value:
                  source:
                    type: pan
                    account_number: '4111111111111111'
              inquiry_from_pci_token:
                summary: Inquiry from PCI token (SAQ A+)
                value:
                  source:
                    type: pci_token
                    pci_token_id: 123e4567-e89b-12d3-a456-426614174000
              inquiry_from_network_token:
                summary: Inquiry from network token (SAQ A+)
                value:
                  source:
                    type: network_token
                    network_token_id: 123e4567-e89b-12d3-a456-426614174001
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inquiry_response'
        '401':
          $ref: '#/components/responses/401_UnauthorizedError'
        '403':
          $ref: '#/components/responses/403_ForbiddenError'
        '409':
          $ref: '#/components/responses/409_ConflictError'
        '422':
          $ref: '#/components/responses/422_ValidationError'
      security:
        - APIKey: []
        - AdminToken: []
components:
  schemas:
    inquiry_request:
      type: object
      properties:
        source:
          oneOf:
            - $ref: '#/components/schemas/inquiry_from_pan_source'
            - $ref: '#/components/schemas/from_pci_token_source'
            - $ref: '#/components/schemas/from_network_token_source'
      required:
        - source
    inquiry_response:
      type: object
      properties:
        bin:
          type: string
          description: The bank identification number.
        schemes:
          type: array
          description: >
            Scheme defines the brand of the card. A co-branded card will return
            multiple schemes.
          items:
            type: string
            enum:
              - visa
              - mastercard
              - american express
              - discover
              - diners club
              - jcb
              - unionpay
              - cartes bancaires
              - airplus
        type:
          type: string
          description: The funding type of the card.
          enum:
            - credit
            - debit
            - prepaid
            - charge
            - deferred
            - unknown
        segment:
          type: string
          description: The segment or category of the card.
          enum:
            - consumer
            - commercial
        currency_code:
          type: string
          description: >-
            The three letter currency code of the card. See:
            [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
          minLength: 3
          maxLength: 3
        issuer_name:
          type: string
          description: The name of the issuing bank.
        issuer_country_code:
          type: string
          description: >
            A two-letter country code of the issuer (ISO 3166-1 alpha-2).

            [ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
          minLength: 2
          maxLength: 2
      required:
        - bin
        - schemes
      example:
        bin: '411111'
        schemes:
          - visa
        type: credit
        segment: consumer
        currency_code: EUR
        issuer_name: Starfish Bank
        issuer_country_code: DE
    inquiry_from_pan_source:
      title: From PAN
      type: object
      properties:
        type:
          type: string
          enum:
            - pan
        account_number:
          type: string
          description: The card number (without separators)
          example: '4111111111111111'
    from_pci_token_source:
      title: From PCI Token
      type: object
      properties:
        type:
          type: string
          enum:
            - pci_token
        pci_token_id:
          type: string
          format: uuid
      required:
        - type
        - pci_token_id
    from_network_token_source:
      title: From Network Token
      type: object
      properties:
        type:
          type: string
          enum:
            - network_token
        network_token_id:
          type: string
          format: uuid
      required:
        - type
        - network_token_id
    ErrorGeneric:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorStatusCode'
        classifier:
          $ref: '#/components/schemas/ErrorClassifier'
        message:
          $ref: '#/components/schemas/ErrorMessage'
    ErrorValidation:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorStatusCode'
        classifier:
          $ref: '#/components/schemas/ErrorClassifier'
        message:
          $ref: '#/components/schemas/ErrorMessage'
        validation_errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: Json-path in the request which points to the validation error
              message:
                type: string
                description: Human readable validation message
    ErrorStatusCode:
      type: integer
      description: The corresponding HTTP status code for the error
    ErrorClassifier:
      type: string
      description: Technical code that helps to identify the error
    ErrorMessage:
      type: string
      description: Human readable representation of the error
  responses:
    401_UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 401
            message: No valid means of authentication was provided
            classifier: UNAUTHORIZED
    403_ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 403
            message: Not allowed to access this resource or feature
            classifier: FORBIDDEN
    409_ConflictError:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 409
            message: Conflict
            classifier: CONFLICT
    422_ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorValidation'
          example:
            code: 422
            classifier: VALIDATION_ERROR
            message: Validation error
            validation_errors:
              - path: json-path
                message: human readable error message
  securitySchemes:
    APIKey:
      type: apiKey
      name: x-api-key
      in: header
    AdminToken:
      type: apiKey
      name: x-admin-token
      in: header

````