diff --git a/reference/admin.yaml b/reference/admin.yaml index b01a0171d..5e072d255 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6865,6 +6865,102 @@ components: description: > Determines whether this organization has been verified by a verifier. + suggest_out: + type: object + additionalProperties: false + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: stmpwownwrng + 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 + - 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 +7205,10 @@ tags: - name: Organisations description: | These APIs gives you access to manage organisations. + - name: Statement mappings + description: > + These APIs gives you access to add a mapping for the statement uploaded by + the user. paths: /admin/projects: get: @@ -10544,3 +10644,67 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /admin/statement_mappings/suggest: + post: + tags: + - Statement mappings + summary: Statement mapping suggestion + 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_suggest + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + statement_id: + type: string + description: | + The id of the uploaded statement. + required: + - statement_id + required: + - data + additionalProperties: false + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: object + items: + $ref: '#/components/schemas/suggest_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' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index 12ac834dd..dcf485f55 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 add a mapping for the statement uploaded by the user. # - 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/suggest: + $ref: paths/admin@statement_mappings@suggest.yaml \ No newline at end of file diff --git a/src/admin/paths/admin@statement_mappings@suggest.yaml b/src/admin/paths/admin@statement_mappings@suggest.yaml new file mode 100644 index 000000000..8ac3effa5 --- /dev/null +++ b/src/admin/paths/admin@statement_mappings@suggest.yaml @@ -0,0 +1,60 @@ +post: + tags: + - Statement mappings + summary: Statement mapping suggestion + 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_suggest + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + statement_id: + type: string + description: | + The id of the uploaded statement. + required: + - statement_id + required: + - data + additionalProperties: False + 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: object + items: + $ref: '../../components/schemas/statement_mappings.yaml#/suggest_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' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.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..9783e101e --- /dev/null +++ b/src/components/schemas/statement_mappings.yaml @@ -0,0 +1,87 @@ +suggest_out: + type: object + additionalProperties: False + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: stmpwownwrng + 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 + - 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