swagger: "2.0" info: version: 1.0.1 title: Collection System description: Collection Management System serves as revenue collection platform for all the billing systems through cash, cheque, dd, swipe machine. contact: name: eGovernments Foundation email: contact@egovernments.org schemes: - https basePath: '/receipts' x-common-path: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml' paths: /_search: post: summary: Get the receipt(s) info for the consumer code/status/receipt numbers and business details etc. description: This API returns list of receipts created for the given servicecode and list of billNumbers/instrument numbers/receipt numbers. parameters: - $ref: "https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/parameters/requestInfo" - $ref: "https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/parameters/tenantId" - $ref: "#/parameters/pageSize" - $ref: "#/parameters/pageNumber" - $ref: "#/parameters/sortReceipt" - name: consumerCode in: query required: false description: Consumer Code . type: array items: type: string - name: classification in: query required: false description: Classification of receipt. type: string enum: - BillBased - Miscelleneous - Challan - name: receiptNumbers in: query required: false description: List of receipt numbers. type: array items: type: string - name: fromDate in: query description: Receipt date, here search will happen as Receipt date is greater or equal to given fromDate. required: false type: string format: varchar - name: toDate in: query description: Receipt date, here search will happen as Receipt date is lesser or equal to given toDate. required: false type: string format: varchar - name: collectedBy in: query description: Search based on the User who created the Receipt. required: false type: string format: varchar - name: status in: query description: Search based on the status of the Receipt. required: false type: string format: varchar - name: paymentType in: query description: Search based on the Payment type such as cash, cheque, dd etc. required: false type: string format: varchar - name: businessCode in: query required: true description: The unique Business Service Details code. type: string minLength: 0 maxLength: 64 exclusiveMinimum: true exclusiveMaximum: false - name: transactionId in: query required: false description: Unique tansaction id for multiple receipts created in one transaction. This is 14 digit code with first 4 digit as city code and 10 digit random number. type: string minLength: 0 maxLength: 64 - name: manualReceiptNumbers in: query required: false description: List of manual receipt numbers to search legacy receipts. type: array items: type: string - name: billIds in: query required: false description: List of bill ids to search receipts.Business details code is mandatory for searching with this criteria. type: array items: type: string responses: 200: description: Successful response schema: type: array items: $ref: '#/definitions/ReceiptRes' '400': description: Invalid input. schema: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/definitions/ErrorRes' tags: - Receipt /_create: post: summary: Validate and persist receipt with receipt number. description: This API generates a receipt number and persists the receipt. The receipt information is then pushed to queue for further processing. parameters: - name: receipt in: body description: Receipt Creation Details passed with bill info and instrument info along with common request info. required: true schema: $ref: '#/definitions/ReceiptReq' tags: - Receipt responses: '201': description: Receipt created sucessfully. schema: $ref: '#/definitions/ReceiptRes' '400': description: Invalid input. definitions: ReceiptReq: type: object description: Receipt Request with Request Info. properties: tenantId: type: string description: Unique id of tenant. format: varchar requestInfo: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/definitions/RequestInfo' Receipt: $ref: '#/definitions/Receipt' ReceiptRes: type: object description: Receipt Request with Request Info. properties: tenantId: type: string description: Unique id of tenant. format: varchar responseInfo: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/definitions/ResponseInfo' receipt: $ref: '#/definitions/Receipt' BillInfo: type: object allOf: - $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/billingservice/contracts/v1-1.yml#/definitions/Bill' properties: paidBy: type: string description: Name of the Person who is making payment. billDetails: type: array items: $ref: '#/definitions/BillDetails' BillDetails: type: object allOf: - $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/billingservice/contracts/v1-1.yml#/definitions/BillDetail' properties: amountPaid: type: number format: double description: Amount paid by the citizen. receiptNumber: type: string description: Receipt Number generated in Collection system. receiptDate: type: string format: date description: Receipt Date. receiptType: description: Type of Receipt. items: type: string enum: - ADHOC - BILLBASED - CHALLAN channel: type: string description: To be used by third party applications, to send the channel name. voucherHeader: description: Voucher header need to refer from Finanicals. boundary: description: Boundary need to refer from Core services. items: type: string reasonForCancellation: description: Remarks to describe Reason For Cancellation. items: type: string manualReceiptNumber: type: string description: Manual Receipt Number for legacy reciepts. stateId: type: integer description: State id of receipt. Value is set while pushing to kafka from collection workflow and to read in collection services. billAccountDetails: type: array items: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/billingservice/contracts/v1-1.yml#/definitions/BillAccountDetail' Instrument: type: object properties: id: type: number description: id is the unique reference to Instrument Header entered in the system. readOnly: true transactionNumber: type: string description: transactionNumber unique number of the instrument. For cheque type this is cheque date. For DD type it is DD number minLength: 6 maxLength: 50 transactionDateInput: type: number format: int64 description : Transaction date as long comes from UI in case of cheque and DD accountDescription: type: string description : Account description to be printed on receipt. instrumentType: $ref: '#/definitions/InstrumentType' amount: type: number format: bigdecimal description: Amount is the instrument amount, for cheque type it is cheque amt branchName: type: string description: BranchName is the branch name entered in the collection Receipt. ifscCode: type: string description: IFSC Code of the bank branch transactionType: type: string description: transactionType are of two kinds -Debit and Credit. When its a receipt instrument it is Debit and in case of payment instrument its credit.. enum: - Debit - Credit instrumentStatus: type: string description: Status of the instrument enum: - NEW - DEPOSITED - CANCELLED - DISHONOURED - RECONCILED payee: type: string description: Payee is the entity who is making the payment via instrument maxLength: 50 drawer: type: string description: Drawer is the entity to which the payment is made. maxLength: 100 tenantId: type: string description: Tenant Id. auditDetails: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/definitions/AuditDetails' readOnly: true required: - instrumentType - transactionDateInput - amount InstrumentType: type: object description: workflow details related to connection properties: id: type: integer description: ID is the unique reference to instrument type entered in the system. readOnly: true name: type: string description: Type specifies the mode/type of transaction that can be made, Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS enum: - CASH - CHEQUE - DD - ONLINE - CARD description: type: string readOnly: true description: Description specifies details of the instrument type active: readOnly: true type: boolean description: active specifies whether the type is active for transacting. required: - name Receipt: type: object properties: tenantId: type: string description: Unique id of tenant. format: varchar transactionId: type: string description: Unique tansaction id for multiple receipts created in one transaction. This is 14 digit code with first 4 digit as city code and 10 digit random number. format: varchar id: type: string description: Receipt Header Id which needs to be set during search and the same will be used for update also. instrument: $ref: '#/definitions/Instrument' auditDetails: $ref: 'https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-0-0.yml#/definitions/AuditDetails' billInfo: $ref: '#/definitions/BillInfo' workflowDetails: $ref: '#/definitions/WorkflowDetails' WorkflowDetails: type: object description: workflow details related to connection properties: department: type: integer description: ID to define the Department . minLength: 1 maxLength: 100 designation: type: integer description: ID to define the Designation. minLength: 1 maxLength: 100 approver: type: integer description: ID to define the Approver ID. minLength: 1 maxLength: 100 initiatorPosition: type: integer description: ID of the User who initiates the workflow. minLength: 1 maxLength: 100 assignee: type: integer description: assignee of the Task minLength: 1 maxLength: 100 action: type: string description: action of the Task maxLength: 128 comments: type: string description: Notes that has been added by the clerk or engineer. minLength: 1 maxLength: 100 status: type: string description: Enumeration of Connection Request statuses. enum: - ACTIVE - INPROGRESS - DISCONNECTED - HOLDING - CLOSED - INACTIVE required: - department - designation - approver parameters: pageSize: name: pageSize in: query description: Number of records returned. type: integer minimum: 0 exclusiveMinimum: true maximum: 100 exclusiveMaximum: false multipleOf: 10 default: 20 pageNumber: name: pageNumber in: query description: Page number type: integer default: 1 sortReceipt: name: sort in: query description: Receipt results will be sorted by receiptnumber ascending by default. type: array uniqueItems: true minItems: 1 maxItems: 3 collectionFormat: pipes items: type: string pattern: '[-+](receiptNumber|receiptDate)' default: - +receiptNumber