Remit Buddy GPT™️

Remit Buddy GPT™️ · GPT Actions

Currency Exchange API

API for retrieving forex rates and currency exchange quotes from multiple providers.

  • GET /forex-ratesGet forex rate

    Get the current exchange rate between two currencies

  • GET /quotesGet currency exchange service quotes from all possible providers

    Get quotes from multiple providers for a specific currency exchange

原始 API 定义
{
  "openapi": "3.1.0",
  "info": {
    "title": "Currency Exchange API",
    "description": "API for retrieving forex rates and currency exchange quotes from multiple providers.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://server.huanhui.xyz/sites/huanhui/api/v1"
    }
  ],
  "paths": {
    "/forex-rates": {
      "get": {
        "summary": "Get forex rate",
        "description": "Get the current exchange rate between two currencies",
        "operationId": "getForexRate",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "The ISO currency code of the base currency",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The ISO currency code of the target currency",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForexRate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid currency codes"
          },
          "404": {
            "description": "Not found - Exchange rate not available"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/quotes": {
      "get": {
        "summary": "Get currency exchange service quotes from all possible providers",
        "description": "Get quotes from multiple providers for a specific currency exchange",
        "operationId": "getQuotes",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "The ISO currency code of the source currency",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The ISO currency code of the target currency",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "description": "The amount to exchange",
            "required": true,
            "schema": {
              "type": "number",
              "format": "float",
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProviderQuote"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ForexRate": {
        "type": "object",
        "properties": {
          "rate": {
            "type": "number",
            "format": "float",
            "description": "The exchange rate"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the rate in ISO 8601 format"
          }
        },
        "required": [
          "rate",
          "timestamp"
        ]
      },
      "ProviderQuote": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "The name of the exchange provider"
          },
          "status": {
            "type": "string",
            "enum": [
              "SUCCESS",
              "FAILURE"
            ],
            "description": "The status of the quote request"
          },
          "quotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Quote"
            },
            "description": "List of quotes from the provider"
          }
        },
        "required": [
          "provider",
          "status",
          "quotes"
        ]
      },
      "Quote": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The source currency code"
          },
          "to": {
            "type": "string",
            "description": "The target currency code"
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "The amount to exchange"
          },
          "provider": {
            "type": "string",
            "description": "The name of the exchange provider"
          },
          "timestampMs": {
            "type": "integer",
            "format": "int64",
            "description": "The timestamp of the quote in milliseconds"
          },
          "estimatedReceivedAmount": {
            "type": "number",
            "format": "float",
            "description": "The estimated amount to be received after exchange"
          },
          "exchangeRate": {
            "type": "number",
            "format": "float",
            "description": "The exchange rate"
          },
          "fee": {
            "type": "number",
            "format": "float",
            "description": "The fee for the exchange"
          },
          "paymentMethod": {
            "type": "string",
            "enum": [
              "BANK_ACH",
              "DEBIT_CARD",
              "CREDIT_CARD",
              "APPLE_PAY",
              "GOOGLE_PAY",
              "PAYPAL",
              "OTHER"
            ],
            "description": "The payment method for the exchange. Noting this enum list is growing on the backend."
          }
        },
        "required": [
          "from",
          "to",
          "amount",
          "provider",
          "timestampMs",
          "estimatedReceivedAmount",
          "exchangeRate",
          "fee",
          "paymentMethod"
        ]
      }
    }
  }
}