diff --git a/reference/admin.yaml b/reference/admin.yaml index b01a0171d..da43dde97 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6865,6 +6865,153 @@ components: description: > Determines whether this organization has been verified by a verifier. + statements_out: + type: object + additionalProperties: false + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: stmtwownwrng + org_id: + $ref: '#/components/schemas/org_id' + creator_user_id: + $ref: '#/components/schemas/user_id' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + file_name: + type: string + description: | + Specifies the name of file uploaded by the user. + example: amex.csv + file_size: + type: number + description: > + Specifies the size of file uploaded by the user. (The size is + represented in bytes) + example: 21 + no_of_debit: + type: integer + description: | + Number of debit transactions in the statement uploaded by the user. + example: 3 + nullable: true + no_of_credit: + type: integer + description: | + Number of credit transactions in the statement uploaded by the user. + example: 3 + nullable: true + no_of_transactions: + type: integer + description: | + Number of transactions in the statement uploaded by the user. + example: 6 + all_statement_columns: + type: array + items: + type: string + description: | + This specifies headers of the statement uploaded by the user. + example: + - account_number + - amount + start_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + Start date of the statement period + nullable: true + end_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + End date of the statement period + nullable: true + has_duplicate_statements: + type: boolean + description: > + This specifies if the statement is complete duplicate of already + uploaded statement or not. + nullable: true + duplicate_statement_ids: + type: array + description: >- + Holds the list of statement_ids which are complete duplicate of the + current statement + items: + $ref: '#/components/schemas/id_string' + example: + - stmtge49ielgel + has_duplicate_statement_line_items: + type: boolean + description: > + Indicates whether there are any line items in this statement are + duplicates. + nullable: true + duplicate_statement_line_items: + type: array + items: + type: object + properties: + ids: + type: array + items: + $ref: '#/components/schemas/id_string' + example: + - stlige49ielgel + description: Ids of the current statement line items which are duplicates + duplicate_line_item_statement_id: + type: string + description: | + Id of the existing duplicate statement + example: + - stmpge49ielgel + nullable: true + unique_id: + type: string + description: | + Unique hash value that is used to identify the statement. + example: 74175aadf22675aa59df28b96d351cfb + file_id: + type: string + description: | + File id of the uploaded statement. + example: fiit3pX9gzzP + nullable: true + are_corporate_card_transactions_created: + type: boolean + description: > + Indicates whether the corporate card transactions are created out of + the statement. + statement_mappings_id: + type: string + example: stmpdfddfd + description: | + Id of the mapping used to extract transaction from the statement. + nullable: true + required: + - id + - org_id + - creator_user_id + - created_at + - updated_at + - file_name + - file_size + - no_of_debit + - no_of_credit + - no_of_transactions + - all_statement_columns + - start_date + - end_date + - has_duplicate_statements + - has_duplicate_statement_line_items + - duplicate_statement_ids + - duplicate_statement_line_items + - unique_id + - file_id + - are_corporate_card_transactions_created + - statement_mappings_id parameters: created_at: in: query @@ -7109,6 +7256,10 @@ tags: - name: Organisations description: | These APIs gives you access to manage organisations. + - name: Statements + description: > + These APIs gives you access to add / view a bank statement for + reconciliation. paths: /admin/projects: get: @@ -10544,3 +10695,48 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /admin/statements: + get: + tags: + - Statements + summary: List Statements + description: > + This API supports very rich filtering on all response fields and + pagination via query parameters. To understand how to use these + parameters, please see the [Guide to Data + APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: statements_list + parameters: + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/statements_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index 12ac834dd..d3cceb152 100644 --- a/src/admin/openapi.yaml +++ b/src/admin/openapi.yaml @@ -98,6 +98,9 @@ tags: - name: Organisations description: > These APIs gives you access to manage organisations. + - name: Statements + description: > + These APIs gives you access to add / view a bank statement for reconciliation. # - name: Suggestions # description: | # This API gives you access to Expense/Card Transactions Suggestions. @@ -239,3 +242,5 @@ paths: $ref: paths/admin@budget_usages.yaml /admin/orgs: $ref: paths/admin@orgs.yaml + /admin/statements: + $ref: paths/admin@statements.yaml \ No newline at end of file diff --git a/src/admin/paths/admin@statements.yaml b/src/admin/paths/admin@statements.yaml new file mode 100644 index 000000000..67ae9c7a9 --- /dev/null +++ b/src/admin/paths/admin@statements.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Statements + summary: List Statements + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: statements_list + parameters: + - $ref: '../../components/parameters/created_at.yaml' + - $ref: '../../components/parameters/updated_at.yaml' + - $ref: '../../components/parameters/order.yaml' + - $ref: '../../components/parameters/offset.yaml' + - $ref: '../../components/parameters/limit.yaml' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + $ref: '../../components/schemas/count.yaml' + offset: + $ref: '../../components/schemas/offset.yaml' + data: + type: array + items: + $ref: '../../components/schemas/statements.yaml#/statements_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' \ No newline at end of file diff --git a/src/components/schemas/statements.yaml b/src/components/schemas/statements.yaml new file mode 100644 index 000000000..6b10f58b0 --- /dev/null +++ b/src/components/schemas/statements.yaml @@ -0,0 +1,143 @@ +statements_out: + type: object + additionalProperties: False + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: stmtwownwrng + org_id: + $ref: './fields.yaml#/org_id' + creator_user_id: + $ref: './fields.yaml#/user_id' + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + file_name: + type: string + description: | + Specifies the name of file uploaded by the user. + example: amex.csv + file_size: + type: number + description: | + Specifies the size of file uploaded by the user. (The size is represented in bytes) + example: 21 + no_of_debit: + type: integer + description: | + Number of debit transactions in the statement uploaded by the user. + example: 3 + nullable: true + no_of_credit: + type: integer + description: | + Number of credit transactions in the statement uploaded by the user. + example: 3 + nullable: true + no_of_transactions: + type: integer + description: | + Number of transactions in the statement uploaded by the user. + example: 6 + all_statement_columns: + type: array + items: + type: string + description: > + This specifies headers of the statement uploaded by the user. + example: + - account_number + - amount + start_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + Start date of the statement period + nullable: true + end_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + End date of the statement period + nullable: true + has_duplicate_statements: + type: boolean + description: | + This specifies if the statement is complete duplicate of already uploaded statement or not. + nullable: true + duplicate_statement_ids: + type: array + description: + Holds the list of statement_ids which are complete duplicate of the current statement + items: + $ref: './fields.yaml#/id_string' + example: + - stmtge49ielgel + has_duplicate_statement_line_items: + type: boolean + description: | + Indicates whether there are any line items in this statement are duplicates. + nullable: true + duplicate_statement_line_items: + type: array + items: + type: object + properties: + ids: + type: array + items: + $ref: './fields.yaml#/id_string' + example: + - stlige49ielgel + description: + Ids of the current statement line items which are duplicates + duplicate_line_item_statement_id: + type: string + description: | + Id of the existing duplicate statement + example: + - stmpge49ielgel + nullable: true + unique_id: + type: string + description: | + Unique hash value that is used to identify the statement. + example: 74175aadf22675aa59df28b96d351cfb + file_id: + type: string + description: | + File id of the uploaded statement. + example: fiit3pX9gzzP + nullable: true + are_corporate_card_transactions_created: + type: boolean + description: | + Indicates whether the corporate card transactions are created out of the statement. + statement_mappings_id: + type: string + example: stmpdfddfd + description: | + Id of the mapping used to extract transaction from the statement. + nullable: true + required: + - id + - org_id + - creator_user_id + - created_at + - updated_at + - file_name + - file_size + - no_of_debit + - no_of_credit + - no_of_transactions + - all_statement_columns + - start_date + - end_date + - has_duplicate_statements + - has_duplicate_statement_line_items + - duplicate_statement_ids + - duplicate_statement_line_items + - unique_id + - file_id + - are_corporate_card_transactions_created + - statement_mappings_id \ No newline at end of file