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

# Gsm - Create

> Creates a GSM (Global Status Mapping) Rule. A GSM rule is used to map a connector's error message/error code combination during a particular payments flow/sub-flow to Hyperswitch's unified status/error code/error message combination. It is also used to decide the next action in the flow - retry/requeue/do_default



## OpenAPI

````yaml post /gsm
openapi: 3.0.3
info:
  title: Hyperswitch - API Documentation
  description: >

    ## Get started


    Hyperswitch provides a collection of APIs that enable you to process and
    manage payments.

    Our APIs accept and return JSON in the HTTP body, and return standard HTTP
    response codes.


    You can consume the APIs directly using your favorite HTTP/REST library.


    We have a testing environment referred to "sandbox", which you can setup to
    test API calls without

    affecting production data.

    Currently, our sandbox environment is live while our production environment
    is under development

    and will be available soon.

    You can sign up on our Dashboard to get API keys to access Hyperswitch API.


    ### Environment


    Use the following base URLs when making requests to the APIs:


    | Environment   |  Base URL                          |

    |---------------|------------------------------------|

    | Sandbox       | <https://sandbox.hyperswitch.io>   |

    | Production    | <https://api.hyperswitch.io>       |


    ## Authentication


    When you sign up on our [dashboard](https://app.hyperswitch.io) and create a
    merchant

    account, you are given a secret key (also referred as api-key) and a
    publishable key.

    You may authenticate all API requests with Hyperswitch server by providing
    the appropriate key in

    the request Authorization header.


    | Key             | 
    Description                                                                                 
    |

    |-----------------|-----------------------------------------------------------------------------------------------|

    | api-key         | Private key. Used to authenticate all API requests from
    your merchant server                  |

    | publishable key | Unique identifier for your account. Used to authenticate
    API requests from your app's client  |


    Never share your secret api keys. Keep them guarded and secure.
  contact:
    name: Hyperswitch Support
    url: https://hyperswitch.io
    email: support.global@juspay.io
  license:
    name: Apache-2.0
  version: 0.1.0
servers:
  - url: https://sandbox.hyperswitch.io
    description: Sandbox Environment
security: []
tags:
  - name: Merchant Account
    description: Create and manage merchant accounts
  - name: Profile
    description: Create and manage profiles
  - name: Merchant Connector Account
    description: Create and manage merchant connector accounts
  - name: Payments
    description: Create and manage one-time payments, recurring payments and mandates
  - name: Refunds
    description: Create and manage refunds for successful payments
  - name: Mandates
    description: Manage mandates
  - name: Customers
    description: Create and manage customers
  - name: Payment Methods
    description: Create and manage payment methods of customers
  - name: Disputes
    description: Manage disputes
  - name: API Key
    description: Create and manage API Keys
  - name: Payouts
    description: Create and manage payouts
  - name: payment link
    description: Create payment link
  - name: Routing
    description: Create and manage routing configurations
  - name: Event
    description: Manage events
  - name: Authentication
    description: Create and manage authentication
  - name: Subscriptions
    description: Subscription management and billing endpoints
  - name: Card Issuer
    description: Create and manage card issuers
paths:
  /gsm:
    post:
      tags:
        - Gsm
      summary: Gsm - Create
      description: >-
        Creates a GSM (Global Status Mapping) Rule. A GSM rule is used to map a
        connector's error message/error code combination during a particular
        payments flow/sub-flow to Hyperswitch's unified status/error code/error
        message combination. It is also used to decide the next action in the
        flow - retry/requeue/do_default
      operationId: Create Gsm Rule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GsmCreateRequest'
        required: true
      responses:
        '200':
          description: Gsm created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GsmResponse'
        '400':
          description: Missing Mandatory fields
      security:
        - admin_api_key: []
components:
  schemas:
    GsmCreateRequest:
      type: object
      required:
        - connector
        - flow
        - sub_flow
        - code
        - message
        - status
        - decision
        - step_up_possible
        - clear_pan_possible
      properties:
        connector:
          $ref: '#/components/schemas/Connector'
        flow:
          type: string
          description: The flow in which the code and message occurred for a connector
        sub_flow:
          type: string
          description: The sub_flow in which the code and message occurred  for a connector
        code:
          type: string
          description: code received from the connector
        message:
          type: string
          description: message received from the connector
        status:
          type: string
          description: status provided by the router
        router_error:
          type: string
          description: optional error provided by the router
          nullable: true
        decision:
          $ref: '#/components/schemas/GsmDecision'
        step_up_possible:
          type: boolean
          description: >-
            indicates if step_up retry is possible

            **Deprecated**: This field is now included as part of `feature_data`
            under the `Retry` variant.
          deprecated: true
        unified_code:
          type: string
          description: error code unified across the connectors
          nullable: true
        unified_message:
          type: string
          description: error message unified across the connectors
          nullable: true
        error_category:
          allOf:
            - $ref: '#/components/schemas/ErrorCategory'
          nullable: true
        clear_pan_possible:
          type: boolean
          description: >-
            indicates if retry with pan is possible

            **Deprecated**: This field is now included as part of `feature_data`
            under the `Retry` variant.
          deprecated: true
        feature:
          allOf:
            - $ref: '#/components/schemas/GsmFeature'
          nullable: true
        feature_data:
          allOf:
            - $ref: '#/components/schemas/GsmFeatureData'
          nullable: true
        standardised_code:
          allOf:
            - $ref: '#/components/schemas/StandardisedCode'
          nullable: true
        description:
          type: string
          description: >-
            A detailed description of the error intended for debugging,
            analytics, and support teams.
          nullable: true
        user_guidance_message:
          type: string
          description: >-
            A user-friendly message that can be safely displayed to the
            customer.

            This message provides guidance on what the user should do to

            resolve the issue.
          nullable: true
    GsmResponse:
      type: object
      required:
        - connector
        - flow
        - sub_flow
        - code
        - message
        - status
        - decision
        - step_up_possible
        - clear_pan_possible
        - feature
        - feature_data
      properties:
        connector:
          type: string
          description: The connector through which payment has gone through
        flow:
          type: string
          description: The flow in which the code and message occurred for a connector
        sub_flow:
          type: string
          description: The sub_flow in which the code and message occurred  for a connector
        code:
          type: string
          description: code received from the connector
        message:
          type: string
          description: message received from the connector
        status:
          type: string
          description: status provided by the router
        router_error:
          type: string
          description: optional error provided by the router
          nullable: true
        decision:
          $ref: '#/components/schemas/GsmDecision'
        step_up_possible:
          type: boolean
          description: >-
            indicates if step_up retry is possible

            **Deprecated**: This field is now included as part of `feature_data`
            under the `Retry` variant.
          deprecated: true
        unified_code:
          type: string
          description: error code unified across the connectors
          nullable: true
        unified_message:
          type: string
          description: error message unified across the connectors
          nullable: true
        error_category:
          allOf:
            - $ref: '#/components/schemas/ErrorCategory'
          nullable: true
        clear_pan_possible:
          type: boolean
          description: >-
            indicates if retry with pan is possible

            **Deprecated**: This field is now included as part of `feature_data`
            under the `Retry` variant.
          deprecated: true
        feature:
          $ref: '#/components/schemas/GsmFeature'
        feature_data:
          $ref: '#/components/schemas/GsmFeatureData'
        standardised_code:
          allOf:
            - $ref: '#/components/schemas/StandardisedCode'
          nullable: true
        description:
          type: string
          description: >-
            A detailed description of the error intended for debugging,
            analytics, and support teams.
          nullable: true
        user_guidance_message:
          type: string
          description: >-
            A user-friendly message that can be safely displayed to the
            customer.

            This message provides guidance on what the user should do to

            resolve the issue.
          nullable: true
    Connector:
      type: string
      enum:
        - authipay
        - adyenplatform
        - stripe_billing_test
        - phonypay
        - fauxpay
        - pretendpay
        - stripe_test
        - adyen_test
        - checkout_test
        - paypal_test
        - aci
        - adyen
        - affirm
        - airwallex
        - amazonpay
        - archipel
        - authorizedotnet
        - bambora
        - bamboraapac
        - bankofamerica
        - barclaycard
        - billwerk
        - bitpay
        - bluesnap
        - blackhawknetwork
        - calida
        - boku
        - braintree
        - breadpay
        - cardinal
        - cashtocode
        - celero
        - chargebee
        - checkbook
        - checkout
        - coinbase
        - coingate
        - custombilling
        - cryptopay
        - ctp_mastercard
        - ctp_visa
        - cybersource
        - cybersourcedecisionmanager
        - datatrans
        - deutschebank
        - digitalvirgo
        - dlocal
        - dwolla
        - ebanx
        - envoy
        - elavon
        - facilitapay
        - finix
        - fiserv
        - fiservemea
        - fiservcommercehub
        - fiuu
        - flexiti
        - forte
        - getnet
        - gigadat
        - globalpay
        - globepay
        - gocardless
        - gpayments
        - hipay
        - helcim
        - hyperpg
        - hyperswitch_vault
        - interpayments
        - inespay
        - iatapay
        - imerchantsolutions
        - itaubank
        - jpmorgan
        - juspaythreedsserver
        - klarna
        - loonio
        - mifinity
        - mollie
        - moneris
        - multisafepay
        - netcetera
        - nexinets
        - nexixpay
        - nmi
        - nomupay
        - noon
        - nordea
        - novalnet
        - nuvei
        - opennode
        - paybox
        - payload
        - payme
        - payone
        - paypal
        - paysafe
        - paystack
        - paytm
        - payu
        - peachpayments
        - payjustnow
        - payjustnowinstore
        - phonepe
        - placetopay
        - powertranz
        - prophetpay
        - rapyd
        - razorpay
        - recurly
        - redsys
        - revolv3
        - sanlam
        - santander
        - shift4
        - silverflow
        - square
        - stax
        - stripe
        - stripebilling
        - taxjar
        - threedsecureio
        - tesouro
        - tokenex
        - tokenio
        - trustly
        - truelayer
        - trustpay
        - trustpayments
        - tsys
        - vgs
        - volt
        - wellsfargo
        - wise
        - worldline
        - worldpay
        - worldpayvantiv
        - worldpayxml
        - worldpaymodular
        - signifyd
        - plaid
        - riskified
        - xendit
        - zen
        - zift
        - zsl
    GsmDecision:
      type: string
      enum:
        - retry
        - do_default
    ErrorCategory:
      type: string
      enum:
        - frm_decline
        - processor_downtime
        - processor_decline_unauthorized
        - issue_with_payment_method
        - processor_decline_incorrect_data
        - hard_decline
        - soft_decline
    GsmFeature:
      type: string
      enum:
        - retry
    GsmFeatureData:
      oneOf:
        - type: object
          required:
            - retry
          properties:
            retry:
              $ref: '#/components/schemas/RetryFeatureData'
      description: >-
        Contains the data relevant to the specified GSM feature, if applicable.

        For example, if the `feature` is `Retry`, this will include
        configuration

        details specific to the retry behavior.
    StandardisedCode:
      type: string
      enum:
        - account_closed_or_invalid
        - authentication_failed
        - authentication_required
        - authorization_missing_or_revoked
        - card_lost_or_stolen
        - card_not_supported_restricted
        - cfg_pm_not_enabled_or_misconfigured
        - compliance_or_sanctions_restriction
        - configuration_issue
        - credit_limit_exceeded
        - currency_or_corridor_not_enabled
        - do_not_honor
        - downstream_technical_issue
        - duplicate_request
        - generic_unknown_error
        - incorrect_authentication_code
        - insufficient_funds
        - integ_cryptographic_issue
        - integration_issue
        - invalid_card_number
        - invalid_credentials
        - invalid_cvv
        - invalid_expiry_date
        - invalid_state
        - issuer_unavailable
        - merchant_inactive
        - missing_or_invalid_param
        - operation_not_allowed
        - payment_cancelled_by_user
        - payment_method_issue
        - payment_session_timeout
        - pm_address_mismatch
        - psp_acquirer_error
        - psp_fraud_engine_decline
        - rate_limit
        - stored_credential_or_mit_not_enabled
        - subscription_plan_inactive
        - suspected_fraud
        - three_ds_authentication_service_issue
        - three_ds_configuration_issue
        - three_ds_data_or_protocol_invalid
        - transaction_not_permitted
        - transaction_timed_out
        - velocity_limit_exceeded
        - wallet_or_token_config_issue
    RetryFeatureData:
      type: object
      description: Represents the data associated with a retry feature in GSM.
      required:
        - step_up_possible
        - clear_pan_possible
        - alternate_network_possible
        - decision
      properties:
        step_up_possible:
          type: boolean
          description: indicates if step_up retry is possible
        clear_pan_possible:
          type: boolean
          description: indicates if retry with pan is possible
        alternate_network_possible:
          type: boolean
          description: indicates if retry with alternate network possible
        decision:
          $ref: '#/components/schemas/GsmDecision'
  securitySchemes:
    admin_api_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Admin API keys allow you to perform some privileged actions such as
        creating a merchant account and Merchant Connector account.

````