{"openapi":"3.0.3","info":{"version":"0.1","title":"ABB v0.1 REST API","license":{"name":"MIT","url":"https://spdx.org/licenses/MIT"},"termsOfService":"https://docs.ibar.az/articles/abb-terms-of-service","contact":{"name":"Support","url":"https://support.ibar.az/contact"}},"tags":[{"name":"edv","description":"Endpoints to manage EDV using the REST API."}],"servers":[{"url":"https://api.ibar.az","description":"Production URL"},{"url":"http://localhost:8080","description":"Local URL"}],"externalDocs":{"description":"ABB v0.1 REST API","url":"https://docs.ibar.az/rest"},"paths":{"/edv/info":{"get":{"summary":"Get current information of edv","security":[{"openId":["edv_info_read"]}],"description":"This returns the total counts and amounts by authendticated-user","tags":["edv"],"operationId":"getEdvInfo","externalDocs":{"description":"API method documentation","url":"https://docs.ibar.az/rest/reference/edv/#get-users-edv-info"},"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdvInfo"}}}},"304":{"description":"Not modified"},"401":{"description":"Requires authentication","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}}}}},"/edv/receipts":{"post":{"summary":"Add a receipt","security":[{"openId":["receipts_write"]}],"description":"Allows you to add a new receipt.\n\n**Note:** Notes for receipt adding.","operationId":"addReceipt","tags":["edv"],"externalDocs":{"description":"API method documentation","url":"https://docs.ibar.az/rest/reference/edv/#add-a-receipt"},"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"fiscalId":{"description":"uid for receipt","example":"321321231231","pattern":"^[a-zA-Z0-9]{12}$","type":"string"}},"type":"object"}}}},"responses":{"201":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"}}}},"401":{"description":"Requires authentication","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"title":"Validation Error","description":"Validation Error","type":"object","required":["message","documentation_url"],"properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["code"],"properties":{"resource":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"index":{"type":"integer"},"value":{"type":"string"}}}}}}}}}}}},"/edv/receipts/{fiscalId}":{"get":{"summary":"Check a receipt","security":[{"openId":["check_receipt"]}],"description":"Allows you to check an inserted receipt from ekassa.\n\n**Note:** Notes for receipt checking.","operationId":"checkReceipt","tags":["edv"],"externalDocs":{"description":"API method documentation","url":"https://docs.ibar.az/rest/reference/edv/#check-a-receipt"},"parameters":[{"in":"path","name":"fiscalId","schema":{"type":"string"},"required":true,"description":"Fiscal id of receipt.","example":"A3k6R9dLytSa"}],"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckReceipt"}}}},"401":{"description":"Requires authentication","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"title":"Validation Error","description":"Validation Error","type":"object","required":["message","documentation_url"],"properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["code"],"properties":{"resource":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"index":{"type":"integer"},"value":{"type":"string"}}}}}}}}}}}},"/edv/receipt/status":{"get":{"summary":"Check a receipt status","security":[{"openId":["receipt_status"]}],"description":"Allows you to check status of inserted receipt.\n\n**Note:** Notes for receipt status.","operationId":"receiptStatus","tags":["edv"],"externalDocs":{"description":"API method documentation","url":"https://docs.ibar.az/rest/reference/edv/#receipt-status"},"parameters":[{"in":"query","name":"fiscalId","schema":{"type":"string"},"required":true,"description":"Fiscal id of receipt.","example":"A3k6R9dLytSa"}],"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptStatus"}}}},"401":{"description":"Requires authentication","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"title":"Basic Error","description":"Basic Error","type":"object","properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"title":"Validation Error","description":"Validation Error","type":"object","required":["message","documentation_url"],"properties":{"message":{"type":"string"},"documentation_url":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["code"],"properties":{"resource":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"index":{"type":"integer"},"value":{"type":"string"}}}}}}}}}}}}},"components":{"schemas":{"Receipt":{"title":"Receipt","description":"Simple receipt object","type":"object","properties":{"id":{"type":"integer"},"fiscalId":{"type":"string","description":"Scanned/entered fiscal id of receipt"},"status":{"type":"string","description":"Current status of added receipt","enum":["WAITING","PREPAY","PREPAID","REFUNDING","REFUNDED","CANCELED","SCANNING"]},"transactionDate":{"type":"string","format":"date-time","description":"Transaction date of receipt"},"amount":{"type":"number","format":"decimal","description":"Payment amount of receipt"},"returnAmount":{"type":"number","format":"decimal"},"storeName":{"type":"string"},"storeAddress":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"Uploading date of receipt to the system"},"vatAmount":{"type":"number","format":"decimal","description":"VAT amount of receipt"}}},"CheckReceipt":{"title":"CheckReceipt","description":"Simple check receipt object","type":"object","properties":{"fiscalId":{"type":"string","description":"Scanned/entered fiscal id of receipt"},"buyAmount":{"type":"number","description":"Buy amount of entered Receipt","example":1.5},"createDate":{"type":"string","description":"Transaction date of receipt"},"returnedAmount":{"type":"number","format":"decimal"},"vatAmount":{"type":"number","format":"decimal","example":0.23},"storeName":{"type":"string","description":"Store name where receipt is created"},"storeAddress":{"type":"string","description":"Store address where receipt is created"}}},"UserReceiptSummary":{"title":"UserReceiptSummary","description":"User's receipt summary with status counts","type":"object","properties":{"totalWaitingCount":{"type":"integer","description":"Total waiting receipt count of authenticated user","example":10},"totalRefundedCount":{"type":"integer","description":"Total refunded receipt count of authenticated user"},"totalCancelledCount":{"type":"integer","description":"Total cancelled receipt count of authenticated user"}}},"ReceiptStatus":{"title":"ReceiptStatus","description":"It checks staus of Receipts","type":"object","properties":{"fiscalId":{"type":"string","description":"Scanned/entered fiscal id of receipt"},"status":{"type":"string","description":"It shows current status of the receipt","example":"WAITING"},"createDate":{"type":"string","description":"If receipt has been cancelled it shows why it has been cancelled"},"cancelledCode":{"type":"string"},"cancelledReason":{"type":"string","description":"It shows the cancel reson if the receipt has been cancelled"}}},"EdvInfo":{"allOf":[{"$ref":"#/components/schemas/UserReceiptSummary"},{"type":"object","title":"EdvInfo","properties":{"totalWaitingAmount":{"type":"number","format":"decimal"},"totalRefundedAmount":{"type":"number","format":"decimal"},"totalCancelledAmount":{"type":"number","format":"decimal"},"balance":{"type":"number","format":"decimal"}}}]},"WebhookReceiptPayload":{"title":"Webhook Receipt Payload","type":"object","properties":{"id":{"type":"string","description":"Receipt Id"},"fiscalId":{"type":"string","description":"Scanned/entered fiscal id of receipt"},"status":{"type":"string","description":"Status of Receipt","enum":["REFUNDED","CANCELLED","WAITING"]},"amount":{"description":"Receipt amount","type":"number","format":"decimal"},"returnAmount":{"description":"Return edv amount","type":"number","format":"decimal"},"cancelledReason":{"type":"string","description":"Receipt cancellation reason"},"userId":{"type":"string","description":"Authenticated User Id"},"storeName":{"type":"string","description":"Store name where receipt is created"},"storeAddress":{"type":"string","description":"Store address where receipt is created"}}}},"securitySchemes":{"openId":{"type":"openIdConnect","openIdConnectUrl":"/auth/realms/iba-open-banking/.well-known/openid-configuration"}}}}