diff --git a/openapi/stellar-disbursement-platform/main.yml b/openapi/stellar-disbursement-platform/main.yml index 061eb20d9..36ed0d535 100644 --- a/openapi/stellar-disbursement-platform/main.yml +++ b/openapi/stellar-disbursement-platform/main.yml @@ -64,7 +64,7 @@ paths: password: type: string example: - username: reece + username: johndoe@mail.com password: mysecret produces: - application/json @@ -121,40 +121,123 @@ paths: produces: - application/json security: - - oauth2: [] - /disbursements: - get: + - BearerAuth: [] + /mfa: + post: + summary: Multi-factor authentication endpoint + operationId: authenticateMFA + tags: + - Authentication + parameters: + - in: body + name: body + description: MFA request data + required: true + schema: + type: object + properties: + mfa_code: + type: string + description: Multi-factor authentication code + remember_me: + type: boolean + description: Boolean flag to remember the user + recaptcha_token: + type: string + description: Token for reCAPTCHA validation + required: + - mfa_code + - in: header + name: Device-ID + type: string + required: false + description: Identifier of the device responses: '200': - description: OK - headers: {} - examples: {} + description: Successful authentication + schema: + type: object + properties: + token: + type: string + description: Authentication token + '400': + $ref: '#/responses/BadRequestResponse' '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/responses/UnauthorizedResponse' + produces: + - application/json + /forgot-password: + post: + summary: Forgot password endpoint + operationId: forgotPassword + tags: + - Authentication + parameters: + - in: body + name: body + description: Forgot password request data + required: true schema: type: object properties: - error: + email: type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + format: email + description: Email of the user + recaptcha_token: + type: string + description: Token for reCAPTCHA validation + required: + - email + responses: + '200': + description: Forgot password email sent successfully + schema: + $ref: '#/definitions/MessageResponse' + '400': + $ref: '#/responses/BadRequestResponse' + /reset-password: + post: + summary: Reset password endpoint + operationId: resetPassword + tags: + - Authentication + parameters: + - in: body + name: body + description: Reset password request data + required: true + schema: + type: object + properties: + password: + type: string + description: New password for the user + reset_token: + type: string + description: Token used to identify a valid password reset request + required: + - password + - reset_token + responses: + '200': + description: Password reset successfully + '400': + $ref: '#/responses/BadRequestResponse' + produces: + - application/json + /disbursements: + get: + responses: + '200': + description: "A list of Disbursement details" + schema: + $ref: '#/definitions/DisbursementPagination' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' summary: List All Disbursements operationId: List All Disbursements description: '' @@ -227,161 +310,13 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] post: responses: '201': - description: Created - headers: {} - examples: - application/json: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 0 - total_payments_sent: 0 - total_payments_remaining: 0 - total_payments_failed: 0 - amount_disbursed: '0.0000000' - total_amount: '0.0000000' - average_amount: '0.0000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - status: DRAFT - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' + description: "A new disbursement" schema: - type: object - properties: - id: - type: string - name: - type: string - upload_by: - type: object - properties: - id: - type: string - name: - type: string - total_payments: - type: number - total_payments_sent: - type: number - total_payments_remaining: - type: number - total_payments_failed: - type: number - amount_disbursed: - type: string - total_amount: - type: string - average_amount: - type: string - country: - type: object - properties: - code: - type: string - name: - type: string - language: - type: string - created_at: - type: string - updated_at: - type: string - wallet: - type: object - properties: - id: - type: string - name: - type: string - homepage: - type: string - asset: - type: object - properties: - id: - type: string - code: - type: string - issuer: - type: string - name: - type: string - status: - type: string - status_history: - type: array - items: - type: object - properties: - user_id: - type: string - status: - type: string - timestamp: - type: string - created_at: - type: string - updated_at: - type: string - example: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 0 - total_payments_sent: 0 - total_payments_remaining: 0 - total_payments_failed: 0 - amount_disbursed: '0.0000000' - total_amount: '0.0000000' - average_amount: '0.0000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - status: DRAFT - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' + $ref: '#/definitions/Disbursement' '400': description: Bad Request headers: {} @@ -409,44 +344,9 @@ paths: status: 400 message: Invalid country code provided '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/responses/UnauthorizedResponse' '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden + $ref: '#/responses/ForbiddenResponse' summary: Create Disbursements operationId: Create Disbursements description: '' @@ -474,268 +374,18 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /disbursements/{id}: get: responses: '200': - description: OK - headers: {} - examples: - application/json: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 2 - total_payments_sent: 1 - total_payments_remaining: 1 - total_payments_failed: 0 - amount_disbursed: '75.000000' - total_amount: '150.0000000' - average_amount: '75.00000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - beneficiaries: - - id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - phone_number: '+380441234567' - payment_id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - amount: '75.0000000' - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_transaction_id: >- - 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - status: SUCCESS - - payment_id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - phone_number: '+380441234567' - amount: '75.0000000' - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_transaction_id: >- - 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - status: READY - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: null - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - - user_id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - status: READY - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T11:45:51.000Z' + description: "Disbursement details" schema: - type: object - properties: - id: - type: string - name: - type: string - upload_by: - type: object - properties: - id: - type: string - name: - type: string - total_payments: - type: number - total_payments_sent: - type: number - total_payments_remaining: - type: number - total_payments_failed: - type: number - amount_disbursed: - type: string - total_amount: - type: string - average_amount: - type: string - country: - type: object - properties: - code: - type: string - name: - type: string - language: - type: string - created_at: - type: string - updated_at: - type: string - wallet: - type: object - properties: - id: - type: string - name: - type: string - homepage: - type: string - asset: - type: object - properties: - id: - type: string - code: - type: string - issuer: - type: string - name: - type: string - beneficiaries: - type: array - items: - type: object - properties: - id: - type: string - phone_number: - type: string - payment_id: - type: string - amount: - type: string - stellar_address: - type: string - stellar_transaction_id: - type: string - status: - type: string - required: - - payment_id - - phone_number - - amount - - stellar_address - - stellar_transaction_id - - status - status_history: - type: array - items: - type: object - properties: - user_id: - type: string - status: - type: string - timestamp: - type: string - required: - - user_id - - status - - timestamp - status: - type: string - created_at: - type: string - updated_at: - type: string - example: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 2 - total_payments_sent: 1 - total_payments_remaining: 1 - total_payments_failed: 0 - amount_disbursed: '75.000000' - total_amount: '150.0000000' - average_amount: '75.00000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - beneficiaries: - - id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - phone_number: '+380441234567' - payment_id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - amount: '75.0000000' - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_transaction_id: >- - 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - status: SUCCESS - - payment_id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - phone_number: '+380441234567' - amount: '75.0000000' - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_transaction_id: >- - 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - status: READY - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: null - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - - user_id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - status: READY - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T11:45:51.000Z' + $ref: '#/definitions/Disbursement' '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -768,8 +418,7 @@ paths: tags: - Disbursements parameters: - - &ref_0 - name: id + - name: id in: path description: ID of the `Disbursement`. required: true @@ -777,538 +426,18 @@ paths: produces: - application/json security: - - oauth2: [] - patch: - responses: - '200': - description: OK - headers: {} - examples: - application/json: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 20 - total_payments_sent: 0 - total_payments_remaining: 20 - total_payments_failed: 0 - amount_disbursed: '0.000000' - total_amount: '0.0000000' - average_amount: '0.00000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - status: DRAFT - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: null - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T11:45:51.000Z' - schema: - type: object - properties: - id: - type: string - name: - type: string - upload_by: - type: object - properties: - id: - type: string - name: - type: string - total_payments: - type: number - total_payments_sent: - type: number - total_payments_remaining: - type: number - total_payments_failed: - type: number - amount_disbursed: - type: string - total_amount: - type: string - average_amount: - type: string - country: - type: object - properties: - code: - type: string - name: - type: string - language: - type: string - created_at: - type: string - updated_at: - type: string - wallet: - type: object - properties: - id: - type: string - name: - type: string - homepage: - type: string - asset: - type: object - properties: - id: - type: string - code: - type: string - issuer: - type: string - name: - type: string - status: - type: string - status_history: - type: array - items: - type: object - properties: - user_id: - type: string - status: - type: string - timestamp: - type: string - required: - - user_id - - status - - timestamp - created_at: - type: string - updated_at: - type: string - example: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - upload_by: - id: 88b0ad24-8bab-4f19-903f-cb2da90108a2 - name: Marcelo - total_payments: 20 - total_payments_sent: 0 - total_payments_remaining: 20 - total_payments_failed: 0 - amount_disbursed: '0.000000' - total_amount: '0.0000000' - average_amount: '0.00000000' - country: - code: ua - name: Ukraine - language: uk - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - wallet: - id: e2de8544-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - homepage: https://vibrantapp.com - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - name: USD Coin - status: DRAFT - status_history: - - user_id: null - status: DRAFT - timestamp: '2023-02-03T10:45:51.000Z' - - user_id: null - status: READY - timestamp: '2023-02-03T11:45:51.000Z' - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T11:45:51.000Z' - '400': - description: Bad Request - headers: {} - examples: - application/json: - error: Bad request - extras: - status: 400 - message: Invalid country code provided - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Bad request - extras: - status: 400 - message: Invalid country code provided - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized - '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden - '404': - description: Not Found - headers: {} - examples: - application/json: - error: Not found - extras: - status: 404 - message: Disbursement not found - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not found - extras: - status: 404 - message: Disbursement not found - summary: Update a Disbursement - operationId: Update a Disbursement - description: '' - tags: - - Disbursements - parameters: - - *ref_0 - produces: - - application/json - security: - - oauth2: [] - delete: - responses: - '204': - description: No Content - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized - '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden - '404': - description: Not Found - headers: {} - examples: - application/json: - error: Not found - extras: - status: 404 - message: Disbursement not found - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not found - extras: - status: 404 - message: Disbursement not found - summary: Delete a Disbursement - operationId: Delete a Disbursement - description: '' - tags: - - Disbursements - parameters: - - *ref_0 - produces: - - application/json - security: - - oauth2: [] + - BearerAuth: [] /disbursements/{id}/receivers: get: responses: '200': - description: OK - headers: {} - examples: - application/json: - pagination: - prev: >- - /disbursements/2e15759b-8ffd-43de-b661-87a80fd70241/receivers?page=1 - next: >- - /disbursements/2e15759b-8ffd-43de-b661-87a80fd70241/receivers?page=3 - pages: 3 - total: 44 - data: - - id: 5e7a7f60-1284-4a0b-8be1-1df17ef4d7fd - phone_number: '+380507770770' - external_id: '1357' - receiver_wallet: - id: 87dae0ca-0819-4361-9af4-1760a1463dba - receiver: - id: 5e7a7f60-1284-4a0b-8be1-1df17ef4d7fd - wallet: - id: 402bf417-11bd-4903-b310-0ce5da11e029 - name: Vibrant - status: DRAFT - created_at: '2023-04-17T22:53:49.827645Z' - updated_at: '2023-04-17T22:53:49.827645Z' - payment: - id: 320828bb-3987-4bd4-aa07-037743183af0 - amount: '91.8600000' - stellar_transaction_id: '' - stellar_operation_id: '' - status: DRAFT - asset: - id: ef271bfe-1b56-4f55-8579-ae194889e745 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - created_at: '2023-04-18T16:24:16.710071Z' - updated_at: '2023-04-18T16:24:16.710071Z' - created_at: '2023-04-17T22:53:49.827645Z' - updated_at: '2023-04-17T22:53:49.827645Z' - schema: - type: object - properties: - pagination: - type: object - properties: - prev: - type: string - next: - type: string - pages: - type: number - total: - type: number - data: - type: array - items: - type: object - properties: - id: - type: string - phone_number: - type: string - external_id: - type: string - receiver_wallet: - type: object - properties: - id: - type: string - receiver: - type: object - properties: - id: - type: string - wallet: - type: object - properties: - id: - type: string - name: - type: string - status: - type: string - created_at: - type: string - updated_at: - type: string - payment: - type: object - properties: - id: - type: string - amount: - type: string - stellar_transaction_id: - type: string - stellar_operation_id: - type: string - status: - type: string - asset: - type: object - properties: - id: - type: string - code: - type: string - issuer: - type: string - created_at: - type: string - updated_at: - type: string - created_at: - type: string - updated_at: - type: string - example: - pagination: - prev: >- - /disbursements/2e15759b-8ffd-43de-b661-87a80fd70241/receivers?page=1 - next: >- - /disbursements/2e15759b-8ffd-43de-b661-87a80fd70241/receivers?page=3 - pages: 3 - total: 44 - data: - - id: 5e7a7f60-1284-4a0b-8be1-1df17ef4d7fd - phone_number: '+380507770770' - external_id: '1357' - receiver_wallet: - id: 87dae0ca-0819-4361-9af4-1760a1463dba - receiver: - id: 5e7a7f60-1284-4a0b-8be1-1df17ef4d7fd - wallet: - id: 402bf417-11bd-4903-b310-0ce5da11e029 - name: Vibrant - status: DRAFT - created_at: '2023-04-17T22:53:49.827645Z' - updated_at: '2023-04-17T22:53:49.827645Z' - payment: - id: 320828bb-3987-4bd4-aa07-037743183af0 - amount: '91.8600000' - stellar_transaction_id: '' - stellar_operation_id: '' - status: DRAFT - asset: - id: ef271bfe-1b56-4f55-8579-ae194889e745 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - created_at: '2023-04-18T16:24:16.710071Z' - updated_at: '2023-04-18T16:24:16.710071Z' - created_at: '2023-04-17T22:53:49.827645Z' - updated_at: '2023-04-17T22:53:49.827645Z' - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized + description: "A list of Disbursement Receivers" schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/definitions/DisbursementReceiverPagination' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -1359,7 +488,7 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /disbursements/{id}/instructions: post: responses: @@ -1403,22 +532,9 @@ paths: foo: bar message: Not authorized '401': - description: Unauthorized - headers: {} - examples: {} + $ref: '#/responses/UnauthorizedResponse' '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -1447,27 +563,37 @@ paths: message: Disbursement not found summary: Upload Disbursement Instructions operationId: Upload Disbursement Instructions - description: '' + description: Upload a CSV file with disbursement instructions. + consumes: + - multipart/form-data tags: - Disbursements parameters: - - &ref_1 - name: id + - name: id in: path description: ID of the Disbursement required: true type: string + - name: "file" + in: "formData" + description: "Disbursement instructions file to upload. The CSV file should be in the following format: `phone,id,amount,verification`" + required: true + type: "file" produces: - application/json security: - - oauth2: [] + - BearerAuth: [] get: responses: '200': - description: OK + description: "Disbursement CSV file" headers: Content-Disposition: type: string + description: "The filename of the returned CSV file." + Content-Type: + type: string + description: "text/csv" examples: text/csv: '' '400': @@ -1497,13 +623,9 @@ paths: foo: bar message: Invalid request parameters '401': - description: Unauthorized - headers: {} - examples: {} + $ref: '#/responses/UnauthorizedResponse' '403': - description: Forbidden - headers: {} - examples: {} + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -1536,28 +658,25 @@ paths: tags: - Disbursements parameters: - - *ref_1 + - name: id + in: path + description: ID of the Disbursement + required: true + type: string produces: - text/csv - - application/json security: - - oauth2: [] + - BearerAuth: [] /disbursements/{id}/status: patch: responses: '200': - description: OK - headers: {} + description: "Message Response" + schema: + $ref: '#/definitions/MessageResponse' examples: application/json: message: Disbursement started - schema: - type: object - properties: - message: - type: string - example: - message: Disbursement started '400': description: Bad Request headers: {} @@ -1585,44 +704,9 @@ paths: status: 400 message: Disbursement is not ready to be started '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/responses/UnauthorizedResponse' '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -1663,40 +747,18 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /payments: get: responses: '200': - description: OK - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized + description: "A paginated list of payments" schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/definitions/PaymentPagination' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' summary: List All Payments operationId: List All Payments description: '' @@ -1770,199 +832,18 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /payments/{id}: get: responses: '200': - description: OK - headers: {} - examples: - application/json: - id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - amount: '100.000000' - stellar_transaction_id: 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - stellar_operation_id: '192334871807819777' - status: DRAFT - status_history: - - status: DRAFT - status_message: Some Message - timestamp: '2023-02-03T14:33:50.000Z' - - status: READY - status_message: Some Message - timestamp: '2023-02-03T14:45:50.000Z' - disbursement: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - status: DRAFT - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - receiver_wallet: - id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - receiver: - id: e7431183-01e4-486a-8a4d-3489bdc07a4e - wallet: - id: 25923001-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_memo: some-memo - stellar_memo_type: text - status: REGISTERED - created_at: '2023-02-03T14:33:50.000Z' - updated_at: '2023-02-03T14:45:50.000Z' - created_at: '2023-02-03T14:33:50.000Z' - updated_at: '2023-02-03T14:33:50.000Z' + description: "Payment details" schema: - type: object - properties: - id: - type: string - amount: - type: string - stellar_transaction_id: - type: string - stellar_operation_id: - type: string - status: - type: string - status_history: - type: array - items: - type: object - properties: - status: - type: string - status_message: - type: string - timestamp: - type: string - required: - - status - - status_message - - timestamp - disbursement: - type: object - properties: - id: - type: string - name: - type: string - status: - type: string - created_at: - type: string - updated_at: - type: string - asset: - type: object - properties: - id: - type: string - code: - type: string - issuer: - type: string - receiver_wallet: - type: object - properties: - id: - type: string - receiver: - type: object - properties: - id: - type: string - wallet: - type: object - properties: - id: - type: string - name: - type: string - stellar_address: - type: string - stellar_memo: - type: string - stellar_memo_type: - type: string - status: - type: string - created_at: - type: string - updated_at: - type: string - created_at: - type: string - updated_at: - type: string - example: - id: b6b667ad-6cc2-46cf-9be7-561daace7d48 - amount: '100.000000' - stellar_transaction_id: 614942ad90df7f8b47f8a7dfa5d8bb34e577802c7d687edd067437202959d0ef - stellar_operation_id: '192334871807819777' - status: DRAFT - status_history: - - status: DRAFT - status_message: Some Message - timestamp: '2023-02-03T14:33:50.000Z' - - status: READY - status_message: Some Message - timestamp: '2023-02-03T14:45:50.000Z' - disbursement: - id: 619da857-8725-4c58-933d-c120a458e0f5 - name: Disbursement Name - status: DRAFT - created_at: '2023-02-03T10:45:51.000Z' - updated_at: '2023-02-03T10:45:51.000Z' - asset: - id: 25923001-508a-4629-9186-c41211b2a3d0 - code: USDC - issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN - receiver_wallet: - id: 2ec7f1f9-add3-4e6d-9d14-bd8ac5e88872 - receiver: - id: e7431183-01e4-486a-8a4d-3489bdc07a4e - wallet: - id: 25923001-b7e2-40a9-ad40-411f70d5c4bf - name: Vibrant - stellar_address: GAUETA6XCPFIZNJQLETG5JR3GGNTJIXXRDIIY4D5QYU2JR6RPUFEUCVZ - stellar_memo: some-memo - stellar_memo_type: text - status: REGISTERED - created_at: '2023-02-03T14:33:50.000Z' - updated_at: '2023-02-03T14:45:50.000Z' - created_at: '2023-02-03T14:33:50.000Z' - updated_at: '2023-02-03T14:33:50.000Z' + $ref: '#/definitions/Payment' '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' '404': description: Not Found headers: {} @@ -2003,40 +884,18 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /receivers: get: responses: '200': - description: OK - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized + description: "A paginated list of Receiver details" schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/definitions/ReceiverPagination' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' summary: List All Receivers operationId: List All Receivers description: '' @@ -2109,192 +968,101 @@ paths: produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /receivers/{id}: get: responses: '200': - description: OK - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - extras: - status: 401 - message: Not authorized + description: "Receiver Details" schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not authorized - extras: - status: 401 - message: Not authorized + $ref: '#/definitions/Receiver' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' '404': - description: Not Found - headers: {} - examples: - application/json: - error: Not found - extras: - status: 404 - message: Receiver not found - schema: - type: object - properties: - error: - type: string - extras: - type: object - properties: - status: - type: number - message: - type: string - example: - error: Not found - extras: - status: 404 - message: Receiver not found + $ref: '#/responses/NotFoundResponse' + summary: Retrieve a Receiver operationId: Retrieve a Receiver description: '' tags: - Receivers parameters: - - &ref_2 - name: id + - name: id in: path description: ID of the `Receiver`. required: true type: string produces: - application/json - security: - - oauth2: [] - patch: - responses: - '200': - description: OK - headers: {} - examples: {} - '400': - description: Bad Request - headers: {} - examples: - application/json: - error: Invalid verification value. + security: + - BearerAuth: [] + patch: + responses: + '200': + description: "Updated Receiver Details" schema: - type: object - properties: - error: - type: string - example: - error: Invalid verification value. + $ref: '#/definitions/Receiver' + '400': + $ref: '#/responses/BadRequestResponse' '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized - schema: - type: object - properties: - error: - type: string - example: - error: Not authorized + $ref: '#/responses/UnauthorizedResponse' '403': - description: Forbidden - headers: {} - examples: - application/json: - error: Forbidden - schema: - type: object - properties: - error: - type: string - example: - error: Forbidden + $ref: '#/responses/ForbiddenResponse' '404': - description: Not Found - headers: {} - examples: {} + $ref: '#/responses/NotFoundResponse' summary: Update the Receiver operationId: Update the Receiver description: '' tags: - Receivers parameters: - - *ref_2 + - name: id + in: path + description: ID of the `Receiver`. + required: true + type: string + - name: body + in: body + description: List of fields to patch for the receiver + required: true + schema: + $ref: '#/definitions/PatchReceiverRequest' produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /statistics: get: responses: '200': - description: OK - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized + description: 'General Statistics response' schema: - type: object - properties: - error: - type: string - example: - error: Not authorized + $ref: '#/definitions/GeneralStatistics' + '401': + $ref: '#/responses/UnauthorizedResponse' summary: Retrieve all Statistics operationId: Retrieve all Statistics - description: '' + description: 'All statistics, including disbursement and receiver wallet data' tags: - Statistics parameters: [] produces: - application/json security: - - oauth2: [] + - BearerAuth: [] /statistics/disbursements/{id}: get: responses: '200': - description: OK - headers: {} - examples: {} - '401': - description: Unauthorized - headers: {} - examples: - application/json: - error: Not authorized + description: 'Returns statistics for disbursement' schema: - type: object - properties: - error: - type: string - example: - error: Not authorized + $ref: '#/definitions/DisbursementsStatistics' + '401': + $ref: '#/responses/UnauthorizedResponse' + '403': + $ref: '#/responses/ForbiddenResponse' summary: Retrieve Disbursement-specific Statistics operationId: Retrieve Disbursement-specific Statistics description: '' @@ -2309,156 +1077,83 @@ paths: produces: - application/json security: - - oauth2: [] - /registration/receiver/{token}: + - BearerAuth: [] + /wallet-registration/start: get: - responses: - '200': - description: Token is valid and the webpage will be loaded normally. - headers: {} - examples: - text/html: > -