{
  "openapi": "3.1.0",
  "info": {
    "title": "Fraud Deflect Customer Service Agent",
    "version": "1.0.0",
    "description": "Free, keyless tools for personal agents."
  },
  "servers": [
    {
      "url": "https://agents.frauddeflect.com"
    }
  ],
  "paths": {
    "/agent": {
      "get": {
        "operationId": "lookupCardCharge",
        "summary": "Which brand is behind this card charge",
        "parameters": [
          {
            "name": "charge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches"
          }
        }
      }
    },
    "/return": {
      "post": {
        "operationId": "startReturnRequest",
        "summary": "Start a return or refund",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "brand_domain",
                  "name",
                  "contact"
                ],
                "properties": {
                  "brand_domain": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "contact": {
                    "type": "string"
                  },
                  "order_number": {
                    "type": "string"
                  },
                  "card_last4": {
                    "type": "string"
                  },
                  "date": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  },
                  "message": {
                    "type": "string"
                  },
                  "agent_id": {
                    "type": "string"
                  },
                  "protocol": {
                    "type": "string"
                  },
                  "approval_proof": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "request_id and status_url"
          }
        }
      }
    },
    "/status": {
      "get": {
        "operationId": "getReturnStatus",
        "summary": "Status of a request",
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      }
    }
  }
}