diff --git a/reference/admin.yaml b/reference/admin.yaml index b01a0171d..f6362511e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6865,6 +6865,111 @@ components: description: > Determines whether this organization has been verified by a verifier. + statement_mappings_out: + type: object + additionalProperties: false + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: stmpwownwrng + org_id: + $ref: '#/components/schemas/org_id' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + bank_name: + type: string + description: | + Specifies the bank name of the statement. + example: American Express + is_debit_positive: + type: boolean + description: > + Specifies the representation of the the amount in the statement, if + true then the amount represented by + + positive sign are debits, and if false then the amount represented + by negative sign are debits. + example: true + transaction_date_column: + type: string + description: > + Specifies the header name of the transaction date column in the + statement. + example: spent date + vendor_column: + type: string + description: | + Specifies the header name of the vendor column in the statement. + example: merchant + transaction_id_column: + type: string + description: > + Specifies the header name of the transaction id / unique id column + in the statement. + nullable: true + example: reference number + amount_column: + type: string + description: | + Specifies the header name of the amount column in the statement. + example: amount + name: + type: string + description: | + Specifies the mapping name. + example: amex_mapping + card_number_column: + type: string + description: > + Specifies the header name of the card number column in the + statement. + example: account number + foreign_amount_column: + type: string + description: > + Specifies the header name of the foreign amount column in the + statement. + nullable: true + example: foreign amount + foreign_currency_column: + type: string + description: > + Specifies the header name of the foreign currency column in the + statement. + nullable: true + example: foreign currency + description_column: + type: string + description: > + Specifies the header name of the description column in the + statement. + nullable: true + example: description + is_auto_created: + type: boolean + description: | + Helps to identify if a statement mapping got auto created or not + example: true + required: + - id + - org_id + - created_at + - updated_at + - bank_name + - is_debit_positive + - transaction_date_column + - transaction_id_column + - amount_column + - name + - card_number_column + - vendor_column + - foreign_amount_column + - foreign_currency_column + - description_column + - is_auto_created parameters: created_at: in: query @@ -7109,6 +7214,10 @@ tags: - name: Organisations description: | These APIs gives you access to manage organisations. + - name: Statement mappings + description: > + These APIs gives you access to manage statement mappings which is used for + statement uploads. paths: /admin/projects: get: @@ -10544,3 +10653,48 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /admin/statement_mappings: + get: + tags: + - Statement mappings + summary: List of statement mappings + 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: statement_mappings_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/statement_mappings_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..653ef8c6d 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: Statement mappings + description: > + These APIs gives you access to manage statement mappings which is used for statement uploads. # - 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/statement_mappings: + $ref: paths/admin@statement_mappings.yaml \ No newline at end of file diff --git a/src/admin/paths/admin@statement_mappings.yaml b/src/admin/paths/admin@statement_mappings.yaml new file mode 100644 index 000000000..8fa4605fa --- /dev/null +++ b/src/admin/paths/admin@statement_mappings.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Statement mappings + summary: List of statement mappings + 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: statement_mappings_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/statement_mappings.yaml#/statement_mappings_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/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml new file mode 100644 index 000000000..1d8d967ce --- /dev/null +++ b/src/components/schemas/statement_mappings.yaml @@ -0,0 +1,96 @@ +statement_mappings_out: + type: object + additionalProperties: False + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: stmpwownwrng + org_id: + $ref: './fields.yaml#/org_id' + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + bank_name: + type: string + description: | + Specifies the bank name of the statement. + example: American Express + is_debit_positive: + type: boolean + description: | + Specifies the representation of the the amount in the statement, if true then the amount represented by + positive sign are debits, and if false then the amount represented by negative sign are debits. + example: true + transaction_date_column: + type: string + description: | + Specifies the header name of the transaction date column in the statement. + example: spent date + vendor_column: + type: string + description: | + Specifies the header name of the vendor column in the statement. + example: merchant + transaction_id_column: + type: string + description: | + Specifies the header name of the transaction id / unique id column in the statement. + nullable: true + example: reference number + amount_column: + type: string + description: | + Specifies the header name of the amount column in the statement. + example: amount + name: + type: string + description: | + Specifies the mapping name. + example: amex_mapping + card_number_column: + type: string + description: | + Specifies the header name of the card number column in the statement. + example: account number + foreign_amount_column: + type: string + description: | + Specifies the header name of the foreign amount column in the statement. + nullable: true + example: foreign amount + foreign_currency_column: + type: string + description: | + Specifies the header name of the foreign currency column in the statement. + nullable: true + example: foreign currency + description_column: + type: string + description: | + Specifies the header name of the description column in the statement. + nullable: true + example: description + is_auto_created: + type: boolean + description: | + Helps to identify if a statement mapping got auto created or not + example: true + required: + - id + - org_id + - created_at + - updated_at + - bank_name + - is_debit_positive + - transaction_date_column + - transaction_id_column + - amount_column + - name + - card_number_column + - vendor_column + - foreign_amount_column + - foreign_currency_column + - description_column + - is_auto_created \ No newline at end of file