{"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/v0.1","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/payments/mobile/azercell":{"post":{"summary":"Pay to azercell mobile","security":[{"openId":["edv_pay_azercell_write"]}],"description":"Pay to azercell mobile with given amount and phone prefix, the payment occurs from edv balance","tags":["edv"],"operationId":"payToAzercell","externalDocs":{"description":"API method documentation","url":"https://docs.ibar.az/rest/reference/edv/#pay-to-azercell"},"parameters":[{"in":"header","name":"X-Idempotency-Key","description":"make payment idempotent with client-generated X-Idempotency-Key value","schema":{"type":"string","format":"uuid"},"required":true},{"in":"header","name":"x-abb-async-after","description":"add payment request to queue after x-abb-async-after time. It accepts time unit in seconds","schema":{"type":"integer"},"required":false}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AzercellPayment"}}}},"responses":{"201":{"description":"Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for payment operation"},"status":{"type":"string","description":"Current status of the payment operation","enum":["QUEUED","CANCELLED","COMPLETED"]},"cancelledReason":{"type":"string","description":"Receipt cancellation reason"}}}}}},"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"}}},"AzercellPayment":{"type":"object","title":"AzercellPayment","properties":{"phone":{"description":"Sink details for payment","type":"object","properties":{"prefix":{"type":"string","description":"Phone prefix","enum":["050","053","054"]},"no":{"type":"string"}}},"amount":{"description":"Amount to pay to azercell mobile","type":"number","format":"decimal"}}},"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"}}},"WebhookPaymentPayload":{"title":"Webhook AzercellPayment Payload","type":"object","properties":{"id":{"type":"string","description":"Payment id"},"status":{"type":"string","description":"Current status of the payment operation","enum":["CANCELLED","COMPLETED"]},"cancelledReason":{"type":"string","description":"Receipt cancellation reason"},"phone":{"description":"Sink details for payment","type":"object","properties":{"prefix":{"type":"string","description":"Phone prefix","enum":["050","053","054"]},"no":{"type":"string"}}},"amount":{"description":"Amount to pay to azercell mobile","type":"number","format":"decimal"},"userId":{"type":"string","description":"Authenticated User Id"}}}},"securitySchemes":{"openId":{"type":"openIdConnect","openIdConnectUrl":"/auth/realms/iba-open-banking/.well-known/openid-configuration"}}}}