{"openapi":"3.0.0","info":{"version":"1.0.0","title":"2PAY public API","description":"This is the API Documentation of the \"2PAY\" Business Model","contact":{"name":"Marie-Therese Beckmann - 2PAY","url":"https://www.2pay.com","email":"m.beckmann@zeppelin-university.net"}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/MT_Beckmann/2PAY/1.0.0"}],"paths":{"/users":{"get":{"description":"This call returns a list of all userids belonging to the system. Every  userid is guaranteed to be unique. Use this userid to access more  information about a specific user. Add `taxConsultancy` parameter to  filter the users by tax consultancies.\n","summary":"Returns an array of all registered user IDs.\n","tags":["users"],"operationId":"getUsers","responses":{"200":{"description":"Returns all user IDs.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"example":["ttaxman123","xXmtbProAPIDesignerXx"]}}}},"204":{"description":"No content."},"403":{"description":"Forbidden, please login as admin."},"500":{"description":"Internal server error."}},"parameters":[{"name":"taxConsultancy","in":"query","description":"taxConsultancy name.","required":false,"schema":{"$ref":"#/components/schemas/user/properties/userCategory/properties/taxAffiliation"}}]},"put":{"description":"The call adds a new user to the system by uploading its user information. The user information must follow the *user* schema. Any provided user ID will be ignored as a new one will be generated by the server. Any request containing documents will be rejected. As a result of sucessful operation, the response contains the *Destination* header attribute with the URI of the new user.\n","summary":"Adds a new user and uploads its information.","tags":["users"],"operationId":"addUser","requestBody":{"description":"User to be uploaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/user"}}}},"responses":{"200":{"description":"New user added and information successfully uploaded.","headers":{"Location":{"description":"The URI of the added user.","style":"simple","explode":false,"schema":{"type":"string"}}}},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, please login as admin."},"500":{"description":"Internal server error."}}}},"/users/{userid}":{"get":{"description":"The call returns the user behind the selected ID from the system. Every userid is guaranteed to be unique. Use this userid to access more information about a specific user.","summary":"Reads the user behind a selected and specific ID.","tags":["/users/{userid}"],"operationId":"getUserbyID","parameters":[{"name":"userid","in":"path","description":"ID of the user to read.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the user information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/user"}}}},"204":{"description":"No content."},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}},"post":{"description":"The call updates the user behind a specific user ID. Every userid is guaranteed to be unique. This call is necessary should a change in the userid be needed and logical.","summary":"Updates the user behind the ID.","tags":["/users/{userid}"],"operationId":"updateUserbyID","parameters":[{"name":"userid","in":"path","description":"ID of the user to update.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Information to update the user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/user"}}},"required":true},"responses":{"200":{"description":"Updates the user information."},"204":{"description":"No content."},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}},"delete":{"description":"Deletes the user behind the ID.","tags":["/users/{userid}"],"operationId":"deleteUserbyID","parameters":[{"name":"userid","in":"path","description":"ID of the user you want to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User deleted."},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}}},"/users/{userid}/documents":{"get":{"description":"The call returns the document IDs assigned to the userid within the system. Every userid is guaranteed to be unique. The call is escpecially relevant for the tax consultancies.","summary":"Returns the document IDs assigned to the userid.","tags":["/users/{userid}/documents"],"operationId":"getDocumentsforUserID","parameters":[{"name":"userid","in":"path","description":"ID of the user whose documents you want to read.","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","description":"status of the documents.","required":false,"schema":{"$ref":"#/components/schemas/document/properties/documentStatus"}}],"responses":{"200":{"description":"Document IDs returned.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"example":["qrt60yu2","56lpXw3_"]}}}},"204":{"description":"No content."},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}},"put":{"description":"The call creates a document for that specific user. The document is then allocated to the user by the userid.","summary":"Creates a document for that specific user.","tags":["/users/{userid}/documents"],"operationId":"createDocumentforUserID","parameters":[{"name":"userid","in":"path","description":"ID of the user whose document you want to post.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Information to create the document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/document"}}},"required":true},"responses":{"200":{"description":"Created the document."},"400":{"description":"Bad input parameter."},"403":{"description":"Forbidden, too little access rights."},"413":{"description":"Payload too large. Please upload smaller image."},"500":{"description":"Internal server error."}}}},"/users/{userid}/documents/{documentid}":{"get":{"description":"This call reads the documents assigned to the user ID and the document ID.","summary":"Reads the documents assigned to the user ID and the document ID.","tags":["/users/{userid}/documents/{documentid}"],"operationId":"getDocumentByID","parameters":[{"name":"documentid","in":"path","description":"ID of the document you want to read.","required":true,"schema":{"type":"string"}},{"name":"userid","in":"path","description":"ID of the user whose documents you want to read.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returned the document successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/document"}}}},"400":{"description":"Bad input parameters."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}},"post":{"description":"This call updates a document for that specific user and document. Users can only update documents from pending to submitted and from completed to archived. Users logged in in their function as employees from tax consultancies can only change the document status from submitted to completed. Any other call will automatically be rejected.","summary":"Updates a document for that specific user and document.","tags":["/users/{userid}/documents/{documentid}"],"operationId":"updateDocumentByID","parameters":[{"name":"documentid","in":"path","description":"ID of the document you want to update.","required":true,"schema":{"type":"string"}},{"name":"userid","in":"path","description":"ID of the user whose documents you want to update.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Information to update the document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/document"}}},"required":true},"responses":{"200":{"description":"Updated the document successfully."},"400":{"description":"Bad input parameters."},"403":{"description":"Forbidden, too little access rights."},"413":{"description":"Payload too large. Please upload smaller image."},"500":{"description":"Internal server error."}}},"delete":{"description":"This call deletes a document assigned to that specific user and document. Because of the nature of the call, extended access rights have to be in place in order to be allowed to delete documents. Documents is stage submitted can not be deleted as they are being used by other parties.","summary":"Deletes a document assigned to that specific user and document.","tags":["/users/{userid}/documents/{documentid}"],"operationId":"deleteDocumentByID","parameters":[{"name":"documentid","in":"path","description":"ID of the document you want to delete.","required":true,"schema":{"type":"string"}},{"name":"userid","in":"path","description":"ID of the user whose documents you want to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted the document successfully."},"400":{"description":"Bad input parameters."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}}},"/users/{userid}/address":{"get":{"description":"The call reads the address associated to the specific user. Addresses have been classified as sensitive content, therefore more extended authentification is needed in order to retrieve the information from the system.","summary":"Reads the address associated to the specific user.","tags":["/users/{userid}/address"],"operationId":"getAddressByUserID","parameters":[{"name":"userid","in":"path","description":"ID of the user whose address you want to read.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Reads the address succesfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/address"}}}},"400":{"description":"Bad input parameters."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}},"post":{"description":"This call updates the address associated to the specific user. As a change in address is changing the main database, more detailled access rights have to be in place in order to conduct the call.","summary":"Updates the address associated to the specific user.","tags":["/users/{userid}/address"],"operationId":"updateAddressByUserID","parameters":[{"name":"userid","in":"path","description":"ID of the user whose address you want to update.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Information to update the address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/address"}}},"required":true},"responses":{"200":{"description":"Updates the address succesfully."},"400":{"description":"Bad input parameters."},"403":{"description":"Forbidden, too little access rights."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"user":{"required":["username","userID","userCategory","userIban","userBic","userAddress","userDocuments"],"type":"object","properties":{"username":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","example":"Tax"},"lastName":{"type":"string","example":"Taxman"}}},"userID":{"type":"string","example":"ttaxman123"},"userCategory":{"type":"object","required":["customerType"],"properties":{"customerType":{"type":"string","enum":["endCustomer","taxConsultancyCustomer"]},"taxAffiliation":{"type":"string","enum":["KPMG","EY","Deloitte"]}}},"userIban":{"$ref":"#/components/schemas/iban"},"userBic":{"$ref":"#/components/schemas/bic"},"userAddress":{"$ref":"#/components/schemas/address"},"userDocuments":{"type":"array","items":{"type":"string","example":"1b34gcdx"}}}},"iban":{"type":"string","example":"DE00 0000 0000 0000 0000 00"},"bic":{"type":"string","example":"DABAIE2D"},"address":{"required":["streetName","houseNumber","zipCode","city","country"],"type":"object","properties":{"streetName":{"type":"string","example":"Tax Boulevard"},"houseNumber":{"type":"string","example":"123b"},"zipCode":{"type":"string","example":"CA94040"},"city":{"type":"string","example":"Mountain View"},"country":{"type":"string","enum":["Germany","USA"]}}},"document":{"required":["documentID","documentName","documentType","documentContent","documentTaxRelevance","documentStatus"],"type":"object","properties":{"documentID":{"type":"string","example":"1b34gcdx"},"documentName":{"type":"string","example":"Credit Card Bill April 2020"},"documentTaxRelevance":{"type":"boolean","example":false},"documentType":{"type":"string","enum":["invoice","bills","other"]},"documentStatus":{"type":"string","enum":["pending","submitted","completed","archived"]},"documentContent":{"type":"string","format":"binary","example":"1212124eda1298076509125412124eda12980765091212124eda129807650b00c91212124eda1232980765091212bb124eda129238076509121cc2124eda12980765091212124eda1298076509"}}}}}}