### Local Setup Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/overview Instructions for setting up Dynamo locally using Git, Cargo, and Redis. ```bash # Clone the repository git clone https://github.com/yourusername/dynamo.git cd dynamo # Configure Redis # Make sure Redis is running on localhost:6379 or update the config file # Build the core service cargo build --release # Run with development configuration ./target/release/dynamo ``` -------------------------------- ### 200 Response Source: https://api-reference.hyperswitch.io/locker-api-reference/cards/get-or-insert-the-card-fingerprint Example successful response when getting or inserting a data fingerprint. ```json { "fingerprint_id": "" } ``` -------------------------------- ### 200 OK Response Example Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/contract-routing/fetch-contract-scores-for-an-entity Example of a successful response (200 OK) when fetching contract scores. ```json { "labels_with_score": [ { "score": 0.95, "label": "stripe", "current_count": 500 } ] } ``` -------------------------------- ### Docker Compose Configuration for Admin API Key Source: https://api-reference.hyperswitch.io/essentials/authentication Example of how to set the admin API key in a docker_compose.toml file. ```toml # docker_compose.toml admin_api_key = "your_admin_key_here" ``` -------------------------------- ### cURL Request Source: https://api-reference.hyperswitch.io/locker-api-reference/cards/get-or-insert-the-card-fingerprint Example cURL request to get or insert a data fingerprint. ```bash curl --request POST \ --url https://api.example.com/data/fingerprint \ --header 'Content-Type: application/json' \ --data ' { "data": 4242424242424242, "key": "Hash1" } ' ``` -------------------------------- ### JWT Bearer Token Example Source: https://api-reference.hyperswitch.io/essentials/authentication Example of a JWT Bearer Token format for API authentication. ```http Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ``` -------------------------------- ### cURL Request Example Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/contract-routing/fetch-contract-scores-for-an-entity Example of how to make a POST request to fetch contract scores for an entity using cURL. ```curl curl --request POST \ --url https://api.example.com/contract_routing.ContractScoreCalculator/FetchContractScore \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --header 'x-profile-id: ' \ --header 'x-tenant-id: ' \ --data ' { "id": "merchant1", "params": "card", "labels": [ "stripe", "adyen" ], "config": { "constants": [ 0.7, 0.3 ], "time_scale": { "time_scale": "Day" } } ' ``` -------------------------------- ### Docker Setup Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/overview Instructions for setting up Dynamo using Docker, including building the image and running with default or custom configurations. ```bash # Clone the repository git clone https://github.com/yourusername/dynamo.git cd dynamo # Build the Docker image docker build -t dynamo:latest . # Run with default configuration docker run -p 8000:8000 -p 9000:9000 dynamo:latest # Run with custom configuration docker run -p 8000:8000 -p 9000:9000 -v $(pwd)/config:/app/config dynamo:latest ``` -------------------------------- ### Update Payment Results Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/overview Example of updating success rate data with payment results using grpcurl. ```bash # Update success rate data with payment results grpcurl -d '{"id": "merchant1", "params": "card", "labels_with_status": [{"label": "stripe", "status": true}], "config": {"max_aggregates_size": 10, "current_block_threshold": {"max_total_count": 5}}}' \ -plaintext localhost:8000 success_rate.SuccessRateCalculator/UpdateSuccessRateWindow ``` -------------------------------- ### Helm Chart Deployment Configuration for Admin API Key Source: https://api-reference.hyperswitch.io/essentials/authentication Example of how to set the admin API key in a values.yaml file for Helm chart deployments. ```yaml # values.yaml adminApiKey: your_admin_key_here ``` -------------------------------- ### Success Rate Based Routing Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/overview Example of making a routing decision based on success rates using grpcurl. ```bash # Make a routing decision based on success rates grpcurl -d '{"id": "merchant1", "params": "card", "labels": ["stripe", "adyen"], "config": {"min_aggregates_size": 5, "default_success_rate": 100}}' \ -plaintext localhost:8000 success_rate.SuccessRateCalculator/FetchSuccessRate ``` -------------------------------- ### OpenAPI Specification Source: https://api-reference.hyperswitch.io/locker-api-reference/locker-general-purpose-storage/get-or-insert-the-card-fingerprint OpenAPI 3.0 specification for the card locker, used by hyperswitch for storing card information securely. ```yaml openapi: 3.0.2 info: title: Tartarus - OpenAPI 3.0 description: >- This the the open API 3.0 specification for the card locker. This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for storing card information securely. version: '1.0' servers: [] security: [] tags: - name: Key Custodian description: API used to initialize the locker after deployment. - name: Data description: CRUD APIs to for working with data to be stored in the locker paths: /api/v2/vault/fingerprint: post: tags: - Data summary: Get or insert the data fingerprint description: Get or insert the data fingerprint parameters: - in: header name: x-tenant-id schema: type: string requestBody: description: Provide data number and hash key content: application/json: schema: $ref: '#/components/schemas/FingerprintReq' required: true responses: '200': description: Fingerprint Response content: application/json: schema: $ref: '#/components/schemas/FingerprintRes' components: schemas: FingerprintReq: type: object properties: data: type: string example: 4242424242424242 key: type: string example: Hash1 FingerprintRes: type: object description: >- Response received if the fingerprint insertion or retrieval was successful properties: fingerprint_id: type: string ``` -------------------------------- ### Fetch Eliminated Processor List (cURL) Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/elimination/fetch-eliminated-processor-list Example of how to call the Fetch Eliminated Processor List API using cURL. ```shell curl --request POST \ --url https://api.example.com/elimination.EliminationAnalyser/GetEliminationStatus \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --header 'x-profile-id: ' \ --header 'x-tenant-id: ' \ --data '{ "id": "merchant1", "params": "card", "labels": [ "stripe", "adyen" ], "config": { "bucket_size": 5, "bucket_leak_interval_in_secs": 10 } }' ``` -------------------------------- ### OpenAPI Specification for Get Health Source: https://api-reference.hyperswitch.io/locker-api-reference/locker-health/get-health This OpenAPI specification defines the GET /health endpoint for the card locker, used by hyperswitch for secure card information storage. ```yaml openapi: 3.0.2 info: title: Tartarus - OpenAPI 3.0 description: >- This is the OpenAPI 3.0 specification for the card locker. This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for storing card information securely. version: '1.0' servers: [] security: [] tags: - name: Key Custodian description: API used to initialize the locker after deployment. - name: Data description: CRUD APIs for working with data to be stored in the locker - name: Cards description: >- CRUD APIs for working with cards data to be stored in the locker (deprecated) paths: /health: get: summary: Get Health description: To check whether the application is up responses: '200': description: Health is good content: text/plain: schema: $ref: '#/components/schemas/Health' components: schemas: Health: title: Health type: string description: health is good example: health is good ``` -------------------------------- ### Create Routing Rule OpenAPI Specification Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/static-routing/create-a-routing-rule OpenAPI 3.0 specification for the POST /euclid.EuclidService/Create endpoint, detailing parameters, request body, and responses for creating a routing rule. ```yaml openapi: 3.0.0 info: title: Dynamic routing - OpenAPI 3.0 description: This the the open API 3.0 specification for the dynamic routing. version: 1.0.0 servers: [] security: [] paths: /euclid.EuclidService/Create: post: tags: - Static Routing summary: Create a routing Rule description: Creates a routing rule with the given parameters operationId: CreateRule parameters: - name: x-tenant-id in: header required: true schema: type: string example: public - name: x-profile-id in: header required: true schema: type: string example: pro_WX0giXQnzk2wQJjkKVBX - name: x-api-key in: header required: true schema: type: string example: dev_VLzQTxkPq3ALj2mlfiHL4mMtXca4uplOIOLaKEzmWAmNBXZjwsuv5bCLjnf0QYHm requestBody: content: application/json: schema: $ref: '#/components/schemas/RoutingRule' example: name: Test Routing Rule algorithm: globals: {} default_selection: priority: connectors: - stripe - adyen - checkout rules: - name: Card Rule routing_type: priority output: priority: connectors: - stripe - adyen statements: - condition: - lhs: payment_method comparison: equal value: enum_variant: card metadata: {} - lhs: amount comparison: greater_than value: number: 1000 metadata: {} metadata: {} responses: '200': description: Successful creation content: application/json: schema: $ref: '#/components/schemas/CreateResponse' example: algorithm_id: routing_ec1ac351-7944-440f-bdc7-6a500df1116f name: Test Routing Rule created_at: '2025-04-09 8:03:44.85588' modified_at: '2025-04-09 8:03:44.85588' '400': description: Invalid request parameters '500': description: Internal server error components: schemas: RoutingRule: type: object example: algorithm: globals: {} default_selection: priority: connectors: - stripe - adyen - checkout rules: - name: Card Rule routing_type: priority output: priority: connectors: - stripe - adyen statements: - condition: - lhs: payment_method comparison: equal value: enum_variant: card metadata: {} - lhs: amount comparison: greater_than value: number: 1000 metadata: {} metadata: {} properties: name: type: string example: Test Routing Rule algorithm: $ref: '#/components/schemas/Program' CreateResponse: type: object properties: algorithm_id: type: string description: Algorithm Id for the routing rule example: routing_ec1ac351-7944-440f-bdc7-6a500df1116f name: type: string description: name of the routing rule example: test routing rule created_at: type: string description: Timestamp for creation of routing rule example: '2025-04-09 8:03:44.85588' modified_at: type: string description: Timestamp for modification of routing rule example: '2025-04-09 8:03:44.85588' Program: type: object example: globals: {} default_selection: priority: connectors: - stripe - checkout rules: - name: High Amount Card routing_type: priority output: priority: connectors: - adyen statements: - condition: ``` -------------------------------- ### Fetch Eliminated Processor List Response Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/elimination/fetch-eliminated-processor-list Example of a successful response from the Fetch Eliminated Processor List API. ```json { "labelsWithStatus": [ { "label": "stripe", "eliminationInformation": { "entity": { "isEliminated": true, "bucketName": [ "processor_decline" ] }, "global": { "isEliminated": true, "bucketName": [ "processor_decline" ] } } } ] } ``` -------------------------------- ### OpenAPI Specification for Provide Key 1 Source: https://api-reference.hyperswitch.io/locker-api-reference/key-custodian/provide-key-1 This OpenAPI 3.0 specification defines the POST /custodian/key1 endpoint for providing the first key to unlock the locker. ```yaml openapi: 3.0.2 info: title: Tartarus - OpenAPI 3.0 description: >- This is the OpenAPI 3.0 specification for the card locker. This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for storing card information securely. version: '1.0' servers: [] security: [] tags: - name: Key Custodian description: API used to initialize the locker after deployment. - name: Data description: CRUD APIs for working with data to be stored in the locker - name: Cards description: >- CRUD APIs for working with cards data to be stored in the locker (deprecated) paths: /custodian/key1: post: tags: - Key Custodian summary: Provide Key 1 description: Provide the first key to unlock the locker operationId: setKey1 parameters: - in: header name: x-tenant-id schema: type: string requestBody: description: Provide key 1 to unlock the locker content: application/json: schema: $ref: '#/components/schemas/Key' required: true responses: '200': description: Key 1 provided content: text/plain: schema: $ref: '#/components/schemas/Key1Set' components: schemas: Key: type: object properties: key: type: string example: 801bb63c1bd51820acbc8ac20c674675 required: - key Key1Set: title: Key1Set type: string description: Received Key1 example: Received Key1 ``` -------------------------------- ### API Locking Error Message Source: https://api-reference.hyperswitch.io/essentials/rate_limit An example of the error message seen when API locking is triggered, distinct from rate limiting. ```text At this moment, access to this object is restricted due to ongoing utilization by another API request or an ongoing Hyperswitch process. Retry after some time if this error persists. ``` -------------------------------- ### OpenAPI Specification for UpdateEliminationBucket Source: https://api-reference.hyperswitch.io/intelligent-router-api-reference/elimination/update-elimination-bucket This OpenAPI 3.0 specification defines the endpoint for updating the elimination bucket, including request and response schemas, parameters, and examples. ```yaml openapi: 3.0.0 info: title: Dynamic routing - OpenAPI 3.0 description: This the the open API 3.0 specification for the dynamic routing. version: 1.0.0 servers: [] security: [] paths: /elimination.EliminationAnalyser/UpdateEliminationBucket: post: tags: - Elimination summary: Update elimination bucket description: >- Updates the failure records for specific processors, affecting future elimination decisions. operationId: UpdateEliminationBucket parameters: - name: x-tenant-id in: header required: true schema: type: string example: public - name: x-profile-id in: header required: true schema: type: string example: pro_WX0giXQnzk2wQJjkKVBX - name: x-api-key in: header required: true schema: type: string example: dev_VLzQTxkPq3ALj2mlfiHL4mMtXca4uplOIOLaKEzmWAmNBXZjwsuv5bCLjnf0QYHm requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateEliminationBucketRequest' example: id: merchant1 params: card labels_with_bucket_name: - label: stripe bucket_name: bucket1 config: bucket_size: 5 bucket_leak_interval_in_secs: 10 responses: '200': description: Bucket updated successfully content: application/json: schema: $ref: '#/components/schemas/UpdateEliminationBucketResponse' '400': description: Invalid request parameters '500': description: Internal server error components: schemas: UpdateEliminationBucketRequest: type: object properties: id: type: string example: merchant1 description: Entity identifier params: type: string description: Additional parameters example: card labels_with_bucket_name: type: array items: $ref: '#/components/schemas/LabelWithBucketName' example: - label: stripe bucket_name: processor_decline config: $ref: '#/components/schemas/EliminationBucketConfig' required: - id - labels_with_bucket_name - config UpdateEliminationBucketResponse: type: object properties: status: type: string description: Status of the update operation enum: - BUCKET_UPDATION_SUCCEEDED - BUCKET_UPDATION_FAILED required: - status LabelWithBucketName: type: object properties: label: type: string description: Processor identifier bucket_name: type: string description: Bucket to update (failure type) required: - label - bucket_name EliminationBucketConfig: type: object properties: bucket_size: type: integer format: uint64 example: 5 description: Maximum failures allowed before elimination bucket_leak_interval_in_secs: type: number format: uint64 example: 300 description: Time interval after which failures are "forgotten" required: - bucket_size - bucket_leak_interval_in_secs ```