From e63cad2efb84ad283d540067e1b754bb6aee325d Mon Sep 17 00:00:00 2001 From: Siva Date: Thu, 5 Dec 2024 19:04:41 +0000 Subject: [PATCH] Auto generate API docs --- reference/spender.yaml | 127 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/reference/spender.yaml b/reference/spender.yaml index e6e15d661..07077a4a4 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -4722,6 +4722,78 @@ components: - last_user_matched_at - is_exported - metadata + corporate_card_transactions_expenses_stats_in: + type: object + required: + - data + properties: + query_params: + type: string + description: | + Query param string for filtering corporate card transactions. Response data is grouped by card number + and expense state. + nullable: false + example: created_at=gt.2024-01-01 + corporate_card_transactions_expenses_stats_out: + type: array + description: | + Array containing stats objects grouped by corporate card numbers and expense state. Returns an empty array if no + transactions are found matching the criteria. + items: + type: object + required: + - card_number + - bank_name + - state + - count + - total_amount + properties: + card_number: + type: string + nullable: false + description: | + Masked card number (showing first 6 and last 4 digits). + example: 411111******1111 + bank_name: + type: string + nullable: false + description: | + Name of the bank that issued the card. + example: VISA_BANK + state: + type: string + nullable: false + description: | + State of the corporate card transactions. + example: COMPLETE + count: + type: integer + nullable: false + description: | + Number of transactions for this card number. + example: 7 + total_amount: + type: number + nullable: false + description: | + Sum of transaction amounts for this card number. + example: 500.86 + example: + - state: COMPLETE + bank_name: VISA_BANK + card_number: 411111******1111 + count: 7 + total_amount: 500.86 + - state: COMPLETE + bank_name: MASTERCARD_BANK + card_number: 422222******2222 + count: 3 + total_amount: 3209.98 + - state: DRAFT + bank_name: VISA_BANK + card_number: 444444******4444 + count: 3 + total_amount: 336.81 corporate_card_transaction_id_in: type: object properties: @@ -10815,6 +10887,61 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /spender/corporate_card_transactions/expenses/stats: + post: + tags: + - Corporate Card Transactions + summary: Get corporate card transactions expenses stats + description: | + Get stats of corporate card transaction expenses grouped by card number and expense state. + operationId: corporate_card_transactions_expenses_stats + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_transactions_expenses_stats_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/corporate_card_transactions_expenses_stats_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' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /spender/corporate_card_transactions/mark_personal: post: tags: