{
 "openapi": "3.1.0",
 "info": {
  "title": "China Certified Translation: order links",
  "version": "1.0.0",
  "description": "Read the catalogue, then build a link that opens an order with the documents chosen. The customer opens the link, uploads photos and pays. No key is needed. The customer types the e-mail or account for the PDF on the page. Keep names, passport numbers and document text out of the link."
 },
 "servers": [
  {
   "url": "https://chinacertifiedtranslation.com"
  }
 ],
 "paths": {
  "/agents/catalog.json": {
   "get": {
    "operationId": "getCatalog",
    "summary": "Documents, options, prices in CNY, offices and what they ask for",
    "responses": {
     "200": {
      "description": "The catalogue",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Catalog"
        }
       }
      }
     }
    }
   }
  },
  "/order/": {
   "get": {
    "operationId": "openOrderLink",
    "summary": "The order link. Give this URL to the customer; do not fetch it for them",
    "parameters": [
     {
      "name": "item",
      "in": "query",
      "required": true,
      "description": "Document id from the catalogue, with optional ,opt= ,pages= ,copies=. Repeat for more documents",
      "schema": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "minItems": 1,
       "maxItems": 20
      },
      "style": "form",
      "explode": true
     },
     {
      "name": "office",
      "in": "query",
      "required": false,
      "description": "Office the translation is for",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "city",
      "in": "query",
      "required": false,
      "description": "City of the office",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "note",
      "in": "query",
      "required": false,
      "description": "Note to the translator",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "paper",
      "in": "query",
      "required": false,
      "description": "1 adds the printed, stamped copy, 0 leaves it out",
      "schema": {
       "type": "string",
       "enum": [
        "0",
        "1"
       ]
      }
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the order page",
      "schema": {
       "type": "string",
       "enum": [
        "en",
        "ar",
        "de",
        "es",
        "fa",
        "fr",
        "hi",
        "hu",
        "id",
        "it",
        "ja",
        "ko",
        "my",
        "pt",
        "ru",
        "th",
        "tr",
        "vi"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The order page with the documents chosen",
      "content": {
       "text/html": {}
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Catalog": {
    "type": "object",
    "required": [
     "currency",
     "documents",
     "situations"
    ],
    "properties": {
     "currency": {
      "type": "string"
     },
     "turnaround": {
      "type": "string"
     },
     "paper_copy": {
      "type": "object"
     },
     "documents": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "original_languages": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "price": {
         "type": "number"
        },
        "unit": {
         "type": "string",
         "enum": [
          "document",
          "page"
         ]
        },
        "paper_included": {
         "type": "boolean"
        },
        "paper_default": {
         "type": "boolean"
        },
        "options": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "value": {
            "type": "string"
           },
           "name": {
            "type": "string"
           },
           "price": {
            "type": "number"
           }
          }
         }
        },
        "order_url": {
         "type": "string"
        }
       }
      }
     },
     "situations": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "title": {
         "type": "string"
        },
        "office": {
         "type": "string"
        },
        "asks_for": {
         "type": "string"
        },
        "before_ordering": {
         "type": "string"
        },
        "documents": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "url": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}