From fa54088b25205860ad409581dc476e615396bf6c Mon Sep 17 00:00:00 2001 From: Arseni Date: Tue, 24 Feb 2026 21:26:31 +0300 Subject: [PATCH 1/2] added api docs --- ci/dev/Caddyfile.dev | 20 ++ ci/dev/frontend.dockerfile | 1 + ci/prod/compose/frontend.dockerfile | 1 + interface/api.yaml | 89 ++++++ interface/api/accounts/auth_login.yaml | 26 ++ interface/api/accounts/auth_refresh.yaml | 28 ++ interface/api/accounts/auth_rotate.yaml | 28 ++ interface/api/accounts/bodies/auth.yaml | 15 + interface/api/accounts/request/auth.yaml | 17 ++ interface/api/accounts/response/auth.yaml | 49 +++ interface/api/organizations/get.yaml | 28 ++ .../organizations/response/organization.yaml | 15 + interface/api/organizations/root.yaml | 26 ++ interface/api/parameters/archived.yaml | 8 + interface/api/parameters/cascade.yaml | 8 + interface/api/parameters/cursor.yaml | 8 + interface/api/parameters/destination_ref.yaml | 8 + interface/api/parameters/filter_states.yaml | 8 + interface/api/parameters/limit.yaml | 11 + interface/api/parameters/offset.yaml | 11 + interface/api/parameters/org_ref.yaml | 8 + .../api/parameters/organizations_ref.yaml | 8 + .../api/parameters/payment_methods_ref.yaml | 8 + interface/api/parameters/recipients_ref.yaml | 8 + interface/api/parameters/source_ref.yaml | 8 + interface/api/parameters/state.yaml | 8 + interface/api/parameters/states.yaml | 8 + interface/api/payment_methods/archive.yaml | 35 +++ .../bodies/payment_method.yaml | 8 + interface/api/payment_methods/create.yaml | 34 +++ interface/api/payment_methods/list.yaml | 34 +++ interface/api/payment_methods/object.yaml | 62 ++++ .../request/payment_method.yaml | 4 + .../response/payment_method.yaml | 15 + interface/api/payment_methods/update.yaml | 32 ++ interface/api/payments/bodies/payment.yaml | 29 ++ interface/api/payments/by_multiquote.yaml | 30 ++ interface/api/payments/by_quote.yaml | 41 +++ interface/api/payments/immediate.yaml | 41 +++ interface/api/payments/list.yaml | 50 ++++ interface/api/payments/multiquote.yaml | 30 ++ interface/api/payments/quote.yaml | 30 ++ interface/api/payments/request/payment.yaml | 104 +++++++ interface/api/payments/response/payment.yaml | 66 +++++ interface/api/recipients/archive.yaml | 35 +++ .../api/recipients/bodies/recipient.yaml | 8 + interface/api/recipients/create.yaml | 32 ++ interface/api/recipients/list.yaml | 32 ++ interface/api/recipients/object.yaml | 62 ++++ .../api/recipients/request/recipient.yaml | 4 + .../api/recipients/response/recipient.yaml | 15 + interface/api/recipients/update.yaml | 30 ++ interface/api/response/error.yaml | 19 ++ interface/api/response/operation.yaml | 78 +++++ interface/api/response/response.yaml | 47 +++ interface/api/response/status.yaml | 10 + .../api/verification/bodies/verification.yaml | 15 + interface/api/verification/create.yaml | 34 +++ .../verification/request/verification.yaml | 31 ++ interface/api/verification/resend.yaml | 34 +++ .../verification/response/verification.yaml | 26 ++ interface/api/verification/verify.yaml | 34 +++ interface/doc.html | 15 + interface/external/chain_network.yaml | 10 + interface/external/endpoint_type.yaml | 10 + interface/external/fx_side.yaml | 8 + interface/external/payment_kind.yaml | 9 + interface/external/payment_method_type.yaml | 12 + interface/external/payment_state.yaml | 12 + interface/external/settlement_mode.yaml | 8 + interface/models/account/account.yaml | 12 + interface/models/account/account_public.yaml | 26 ++ .../models/auth/client_refresh_token.yaml | 12 + interface/models/auth/login_data.yaml | 17 ++ interface/models/auth/session_identifier.yaml | 13 + interface/models/auth/token_data.yaml | 14 + interface/models/common/describable.yaml | 13 + interface/models/common/money.yaml | 16 + interface/models/common/pagination.yaml | 8 + interface/models/objectid.yaml | 7 + .../models/organization/organization.yaml | 32 ++ interface/models/payment/payment.yaml | 279 ++++++++++++++++++ .../models/payment_method/payment_method.yaml | 22 ++ interface/models/permission_bound.yaml | 18 ++ interface/models/recipient/recipient.yaml | 30 ++ interface/models/storable.yaml | 18 ++ interface/sw.html | 26 ++ 87 files changed, 2299 insertions(+) create mode 100644 interface/api.yaml create mode 100644 interface/api/accounts/auth_login.yaml create mode 100644 interface/api/accounts/auth_refresh.yaml create mode 100644 interface/api/accounts/auth_rotate.yaml create mode 100644 interface/api/accounts/bodies/auth.yaml create mode 100644 interface/api/accounts/request/auth.yaml create mode 100644 interface/api/accounts/response/auth.yaml create mode 100644 interface/api/organizations/get.yaml create mode 100644 interface/api/organizations/response/organization.yaml create mode 100644 interface/api/organizations/root.yaml create mode 100644 interface/api/parameters/archived.yaml create mode 100644 interface/api/parameters/cascade.yaml create mode 100644 interface/api/parameters/cursor.yaml create mode 100644 interface/api/parameters/destination_ref.yaml create mode 100644 interface/api/parameters/filter_states.yaml create mode 100644 interface/api/parameters/limit.yaml create mode 100644 interface/api/parameters/offset.yaml create mode 100644 interface/api/parameters/org_ref.yaml create mode 100644 interface/api/parameters/organizations_ref.yaml create mode 100644 interface/api/parameters/payment_methods_ref.yaml create mode 100644 interface/api/parameters/recipients_ref.yaml create mode 100644 interface/api/parameters/source_ref.yaml create mode 100644 interface/api/parameters/state.yaml create mode 100644 interface/api/parameters/states.yaml create mode 100644 interface/api/payment_methods/archive.yaml create mode 100644 interface/api/payment_methods/bodies/payment_method.yaml create mode 100644 interface/api/payment_methods/create.yaml create mode 100644 interface/api/payment_methods/list.yaml create mode 100644 interface/api/payment_methods/object.yaml create mode 100644 interface/api/payment_methods/request/payment_method.yaml create mode 100644 interface/api/payment_methods/response/payment_method.yaml create mode 100644 interface/api/payment_methods/update.yaml create mode 100644 interface/api/payments/bodies/payment.yaml create mode 100644 interface/api/payments/by_multiquote.yaml create mode 100644 interface/api/payments/by_quote.yaml create mode 100644 interface/api/payments/immediate.yaml create mode 100644 interface/api/payments/list.yaml create mode 100644 interface/api/payments/multiquote.yaml create mode 100644 interface/api/payments/quote.yaml create mode 100644 interface/api/payments/request/payment.yaml create mode 100644 interface/api/payments/response/payment.yaml create mode 100644 interface/api/recipients/archive.yaml create mode 100644 interface/api/recipients/bodies/recipient.yaml create mode 100644 interface/api/recipients/create.yaml create mode 100644 interface/api/recipients/list.yaml create mode 100644 interface/api/recipients/object.yaml create mode 100644 interface/api/recipients/request/recipient.yaml create mode 100644 interface/api/recipients/response/recipient.yaml create mode 100644 interface/api/recipients/update.yaml create mode 100644 interface/api/response/error.yaml create mode 100644 interface/api/response/operation.yaml create mode 100644 interface/api/response/response.yaml create mode 100644 interface/api/response/status.yaml create mode 100644 interface/api/verification/bodies/verification.yaml create mode 100644 interface/api/verification/create.yaml create mode 100644 interface/api/verification/request/verification.yaml create mode 100644 interface/api/verification/resend.yaml create mode 100644 interface/api/verification/response/verification.yaml create mode 100644 interface/api/verification/verify.yaml create mode 100644 interface/doc.html create mode 100644 interface/external/chain_network.yaml create mode 100644 interface/external/endpoint_type.yaml create mode 100644 interface/external/fx_side.yaml create mode 100644 interface/external/payment_kind.yaml create mode 100644 interface/external/payment_method_type.yaml create mode 100644 interface/external/payment_state.yaml create mode 100644 interface/external/settlement_mode.yaml create mode 100644 interface/models/account/account.yaml create mode 100644 interface/models/account/account_public.yaml create mode 100644 interface/models/auth/client_refresh_token.yaml create mode 100644 interface/models/auth/login_data.yaml create mode 100644 interface/models/auth/session_identifier.yaml create mode 100644 interface/models/auth/token_data.yaml create mode 100644 interface/models/common/describable.yaml create mode 100644 interface/models/common/money.yaml create mode 100644 interface/models/common/pagination.yaml create mode 100644 interface/models/objectid.yaml create mode 100644 interface/models/organization/organization.yaml create mode 100644 interface/models/payment/payment.yaml create mode 100644 interface/models/payment_method/payment_method.yaml create mode 100644 interface/models/permission_bound.yaml create mode 100644 interface/models/recipient/recipient.yaml create mode 100644 interface/models/storable.yaml create mode 100644 interface/sw.html diff --git a/ci/dev/Caddyfile.dev b/ci/dev/Caddyfile.dev index b32d5780..50ebe0c0 100644 --- a/ci/dev/Caddyfile.dev +++ b/ci/dev/Caddyfile.dev @@ -37,6 +37,26 @@ header Cache-Control "no-cache, no-store, must-revalidate" } + ######################################## + # API docs (ReDoc) + ######################################## + handle /docs { + redir * /docs/ 308 + } + + handle /docs/ { + root * {vars.static_root}/docs + rewrite * /doc.html + file_server + header Cache-Control "no-cache" + } + + handle_path /docs/* { + root * {vars.static_root}/docs + file_server + header Cache-Control "no-cache" + } + ######################################## # Static assets ######################################## diff --git a/ci/dev/frontend.dockerfile b/ci/dev/frontend.dockerfile index 21d61007..799c8f34 100644 --- a/ci/dev/frontend.dockerfile +++ b/ci/dev/frontend.dockerfile @@ -48,6 +48,7 @@ FROM caddy:alpine AS runtime WORKDIR /usr/share/pweb COPY --from=web_builder /home/flutteruser/app/pweb/build/web /usr/share/pweb +COPY interface /usr/share/pweb/docs # Copy Caddy config (will be mounted from host) # COPY frontend/pweb/caddy/Caddyfile /etc/caddy/Caddyfile diff --git a/ci/prod/compose/frontend.dockerfile b/ci/prod/compose/frontend.dockerfile index d48315b8..91ebe084 100644 --- a/ci/prod/compose/frontend.dockerfile +++ b/ci/prod/compose/frontend.dockerfile @@ -45,6 +45,7 @@ WORKDIR /usr/share/pweb COPY frontend/pweb/entrypoint.sh /entrypoint.sh COPY frontend/pweb/caddy/Caddyfile /etc/caddy/Caddyfile COPY --from=web_builder /home/flutteruser/app/pweb/build/web /usr/share/pweb +COPY interface /usr/share/pweb/docs RUN chmod +x /entrypoint.sh diff --git a/interface/api.yaml b/interface/api.yaml new file mode 100644 index 00000000..72dc6254 --- /dev/null +++ b/interface/api.yaml @@ -0,0 +1,89 @@ +openapi: 3.1.0 +info: + title: Sendico Payment API Contract + version: 1.0.0 + summary: Minimal client contract for payment execution flows via BFF. + description: | + OpenAPI 3.1 contract focused on flows required to perform payments: + authentication, verification, recipients, payment methods and payments. +servers: + - url: /api/v1 + description: Main HTTP API base path + +tags: + - name: Auth + description: Authentication and token lifecycle + - name: Accounts + description: Account auth responses used by login/verification + - name: Verification + description: Pending-account code verification + - name: Organizations + description: Organization selection for payment operations + - name: Recipients + description: Recipient CRUD and archive flows + - name: PaymentMethods + description: Payment method CRUD and archive flows + - name: Payments + description: Quotation and payment orchestration + +paths: + /accounts/login: + $ref: ./api/accounts/auth_login.yaml + /accounts/rotate: + $ref: ./api/accounts/auth_rotate.yaml + /accounts/refresh: + $ref: ./api/accounts/auth_refresh.yaml + + /verification: + $ref: ./api/verification/create.yaml + /verification/resend: + $ref: ./api/verification/resend.yaml + /verification/verify: + $ref: ./api/verification/verify.yaml + + /organizations: + $ref: ./api/organizations/root.yaml + /organizations/{org_ref}: + $ref: ./api/organizations/get.yaml + + /recipients/list/{org_ref}/{organizations_ref}: + $ref: ./api/recipients/list.yaml + /recipients/{org_ref}: + $ref: ./api/recipients/create.yaml + /recipients/{recipients_ref}: + $ref: ./api/recipients/object.yaml + /recipients: + $ref: ./api/recipients/update.yaml + /recipients/archive/{org_ref}/{recipients_ref}: + $ref: ./api/recipients/archive.yaml + + /payment_methods/list/{organizations_ref}/{recipients_ref}: + $ref: ./api/payment_methods/list.yaml + /payment_methods/{organizations_ref}: + $ref: ./api/payment_methods/create.yaml + /payment_methods/{payment_methods_ref}: + $ref: ./api/payment_methods/object.yaml + /payment_methods: + $ref: ./api/payment_methods/update.yaml + /payment_methods/archive/{organizations_ref}/{payment_methods_ref}: + $ref: ./api/payment_methods/archive.yaml + + /payments/quote/{organizations_ref}: + $ref: ./api/payments/quote.yaml + /payments/multiquote/{organizations_ref}: + $ref: ./api/payments/multiquote.yaml + /payments/immediate/{organizations_ref}: + $ref: ./api/payments/immediate.yaml + /payments/by-quote/{organizations_ref}: + $ref: ./api/payments/by_quote.yaml + /payments/by-multiquote/{organizations_ref}: + $ref: ./api/payments/by_multiquote.yaml + /payments/{organizations_ref}: + $ref: ./api/payments/list.yaml + +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/interface/api/accounts/auth_login.yaml b/interface/api/accounts/auth_login.yaml new file mode 100644 index 00000000..34a49f97 --- /dev/null +++ b/interface/api/accounts/auth_login.yaml @@ -0,0 +1,26 @@ +post: + tags: [Accounts, Auth] + summary: Login using email/password and receive pending verification token + operationId: accountsLogin + requestBody: + $ref: ./bodies/auth.yaml#/components/requestBodies/LoginBody + responses: + '202': + description: Pending verification token issued + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/auth.yaml#/components/schemas/PendingLoginData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/accounts/auth_refresh.yaml b/interface/api/accounts/auth_refresh.yaml new file mode 100644 index 00000000..7f573d17 --- /dev/null +++ b/interface/api/accounts/auth_refresh.yaml @@ -0,0 +1,28 @@ +post: + tags: [Accounts, Auth] + summary: Refresh access token by refresh token + operationId: accountsRefreshAccessToken + requestBody: + $ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody + responses: + '200': + description: Access token refreshed + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/auth.yaml#/components/schemas/AccountAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/accounts/auth_rotate.yaml b/interface/api/accounts/auth_rotate.yaml new file mode 100644 index 00000000..2cb6debc --- /dev/null +++ b/interface/api/accounts/auth_rotate.yaml @@ -0,0 +1,28 @@ +post: + tags: [Accounts, Auth] + summary: Rotate refresh token and issue new access/refresh tokens + operationId: accountsRotateRefreshToken + requestBody: + $ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody + responses: + '200': + description: New token pair issued + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/auth.yaml#/components/schemas/LoginData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/accounts/bodies/auth.yaml b/interface/api/accounts/bodies/auth.yaml new file mode 100644 index 00000000..44b94437 --- /dev/null +++ b/interface/api/accounts/bodies/auth.yaml @@ -0,0 +1,15 @@ +components: + requestBodies: + LoginBody: + required: true + content: + application/json: + schema: + $ref: ../request/auth.yaml#/components/schemas/LoginRequest + + RefreshTokenBody: + required: true + content: + application/json: + schema: + $ref: ../request/auth.yaml#/components/schemas/RefreshTokenRequest diff --git a/interface/api/accounts/request/auth.yaml b/interface/api/accounts/request/auth.yaml new file mode 100644 index 00000000..09c50395 --- /dev/null +++ b/interface/api/accounts/request/auth.yaml @@ -0,0 +1,17 @@ +components: + schemas: + LoginRequest: + type: object + additionalProperties: false + required: + - login + properties: + clientId: + type: string + deviceId: + type: string + login: + $ref: ../../../models/auth/login_data.yaml#/components/schemas/LoginData + + RefreshTokenRequest: + $ref: ../../../models/auth/client_refresh_token.yaml#/components/schemas/ClientRefreshToken diff --git a/interface/api/accounts/response/auth.yaml b/interface/api/accounts/response/auth.yaml new file mode 100644 index 00000000..9649a73e --- /dev/null +++ b/interface/api/accounts/response/auth.yaml @@ -0,0 +1,49 @@ +components: + schemas: + AccountAuthData: + type: object + additionalProperties: false + required: + - accessToken + - account + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + account: + $ref: ../../../models/account/account.yaml#/components/schemas/AccountData + + LoginData: + type: object + additionalProperties: false + required: + - accessToken + - account + - refreshToken + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + account: + $ref: ../../../models/account/account.yaml#/components/schemas/AccountData + refreshToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + + PendingLoginData: + type: object + additionalProperties: false + required: + - account + - pendingToken + - target + properties: + account: + type: object + additionalProperties: false + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + account: + $ref: ../../../models/account/account.yaml#/components/schemas/AccountData + pendingToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + target: + type: string diff --git a/interface/api/organizations/get.yaml b/interface/api/organizations/get.yaml new file mode 100644 index 00000000..02f57615 --- /dev/null +++ b/interface/api/organizations/get.yaml @@ -0,0 +1,28 @@ +get: + tags: [Organizations] + summary: Get organization by reference + operationId: organizationsGet + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/org_ref.yaml#/components/parameters/OrgRef + responses: + '200': + description: Organization details + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/organization.yaml#/components/schemas/OrganizationsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/organizations/response/organization.yaml b/interface/api/organizations/response/organization.yaml new file mode 100644 index 00000000..5ef7b813 --- /dev/null +++ b/interface/api/organizations/response/organization.yaml @@ -0,0 +1,15 @@ +components: + schemas: + OrganizationsAuthData: + type: object + additionalProperties: false + required: + - accessToken + - organizations + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + organizations: + type: array + items: + $ref: ../../../models/organization/organization.yaml#/components/schemas/Organization diff --git a/interface/api/organizations/root.yaml b/interface/api/organizations/root.yaml new file mode 100644 index 00000000..4329ae4d --- /dev/null +++ b/interface/api/organizations/root.yaml @@ -0,0 +1,26 @@ +get: + tags: [Organizations] + summary: List organizations of current account + operationId: organizationsList + security: + - bearerAuth: [] + responses: + '200': + description: Organizations list + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/organization.yaml#/components/schemas/OrganizationsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/parameters/archived.yaml b/interface/api/parameters/archived.yaml new file mode 100644 index 00000000..02c370ef --- /dev/null +++ b/interface/api/parameters/archived.yaml @@ -0,0 +1,8 @@ +components: + parameters: + Archived: + name: archived + in: query + required: false + schema: + type: boolean diff --git a/interface/api/parameters/cascade.yaml b/interface/api/parameters/cascade.yaml new file mode 100644 index 00000000..bdaf7858 --- /dev/null +++ b/interface/api/parameters/cascade.yaml @@ -0,0 +1,8 @@ +components: + parameters: + Cascade: + name: cascade + in: query + required: false + schema: + type: boolean diff --git a/interface/api/parameters/cursor.yaml b/interface/api/parameters/cursor.yaml new file mode 100644 index 00000000..f4f0f7b8 --- /dev/null +++ b/interface/api/parameters/cursor.yaml @@ -0,0 +1,8 @@ +components: + parameters: + Cursor: + name: cursor + in: query + required: false + schema: + type: string diff --git a/interface/api/parameters/destination_ref.yaml b/interface/api/parameters/destination_ref.yaml new file mode 100644 index 00000000..3d8cc267 --- /dev/null +++ b/interface/api/parameters/destination_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + DestinationRef: + name: destination_ref + in: query + required: false + schema: + type: string diff --git a/interface/api/parameters/filter_states.yaml b/interface/api/parameters/filter_states.yaml new file mode 100644 index 00000000..821b60cb --- /dev/null +++ b/interface/api/parameters/filter_states.yaml @@ -0,0 +1,8 @@ +components: + parameters: + FilterStates: + name: filter_states + in: query + required: false + schema: + type: string diff --git a/interface/api/parameters/limit.yaml b/interface/api/parameters/limit.yaml new file mode 100644 index 00000000..fe30c130 --- /dev/null +++ b/interface/api/parameters/limit.yaml @@ -0,0 +1,11 @@ +components: + parameters: + Limit: + name: limit + in: query + description: Max number of items to return. + required: false + schema: + type: integer + format: int32 + minimum: 0 diff --git a/interface/api/parameters/offset.yaml b/interface/api/parameters/offset.yaml new file mode 100644 index 00000000..f9d1bc60 --- /dev/null +++ b/interface/api/parameters/offset.yaml @@ -0,0 +1,11 @@ +components: + parameters: + Offset: + name: offset + in: query + description: Number of items to skip. + required: false + schema: + type: integer + format: int32 + minimum: 0 diff --git a/interface/api/parameters/org_ref.yaml b/interface/api/parameters/org_ref.yaml new file mode 100644 index 00000000..de524623 --- /dev/null +++ b/interface/api/parameters/org_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + OrgRef: + name: org_ref + in: path + required: true + schema: + $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/organizations_ref.yaml b/interface/api/parameters/organizations_ref.yaml new file mode 100644 index 00000000..7f2c7e6c --- /dev/null +++ b/interface/api/parameters/organizations_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + OrganizationsRef: + name: organizations_ref + in: path + required: true + schema: + $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/payment_methods_ref.yaml b/interface/api/parameters/payment_methods_ref.yaml new file mode 100644 index 00000000..f8707b45 --- /dev/null +++ b/interface/api/parameters/payment_methods_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + PaymentMethodsRef: + name: payment_methods_ref + in: path + required: true + schema: + $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/recipients_ref.yaml b/interface/api/parameters/recipients_ref.yaml new file mode 100644 index 00000000..8808f21e --- /dev/null +++ b/interface/api/parameters/recipients_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + RecipientsRef: + name: recipients_ref + in: path + required: true + schema: + $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/source_ref.yaml b/interface/api/parameters/source_ref.yaml new file mode 100644 index 00000000..a7f01187 --- /dev/null +++ b/interface/api/parameters/source_ref.yaml @@ -0,0 +1,8 @@ +components: + parameters: + SourceRef: + name: source_ref + in: query + required: false + schema: + type: string diff --git a/interface/api/parameters/state.yaml b/interface/api/parameters/state.yaml new file mode 100644 index 00000000..36e604fe --- /dev/null +++ b/interface/api/parameters/state.yaml @@ -0,0 +1,8 @@ +components: + parameters: + State: + name: state + in: query + required: false + schema: + type: string diff --git a/interface/api/parameters/states.yaml b/interface/api/parameters/states.yaml new file mode 100644 index 00000000..b85cfd82 --- /dev/null +++ b/interface/api/parameters/states.yaml @@ -0,0 +1,8 @@ +components: + parameters: + States: + name: states + in: query + required: false + schema: + type: string diff --git a/interface/api/payment_methods/archive.yaml b/interface/api/payment_methods/archive.yaml new file mode 100644 index 00000000..31a48580 --- /dev/null +++ b/interface/api/payment_methods/archive.yaml @@ -0,0 +1,35 @@ +get: + tags: [PaymentMethods] + summary: Archive/unarchive payment method + operationId: paymentMethodsArchive + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + - name: archived + in: query + required: true + schema: + type: boolean + - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade + responses: + '200': + description: Archive state updated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payment_methods/bodies/payment_method.yaml b/interface/api/payment_methods/bodies/payment_method.yaml new file mode 100644 index 00000000..090086de --- /dev/null +++ b/interface/api/payment_methods/bodies/payment_method.yaml @@ -0,0 +1,8 @@ +components: + requestBodies: + PaymentMethodBody: + required: true + content: + application/json: + schema: + $ref: ../request/payment_method.yaml#/components/schemas/PaymentMethodRequest diff --git a/interface/api/payment_methods/create.yaml b/interface/api/payment_methods/create.yaml new file mode 100644 index 00000000..f64dd384 --- /dev/null +++ b/interface/api/payment_methods/create.yaml @@ -0,0 +1,34 @@ +post: + tags: [PaymentMethods] + summary: Create payment method + operationId: paymentMethodsCreate + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + $ref: ./bodies/payment_method.yaml#/components/requestBodies/PaymentMethodBody + responses: + '201': + description: Payment method created + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payment_methods/list.yaml b/interface/api/payment_methods/list.yaml new file mode 100644 index 00000000..3f0e2ece --- /dev/null +++ b/interface/api/payment_methods/list.yaml @@ -0,0 +1,34 @@ +get: + tags: [PaymentMethods] + summary: List payment methods for recipient + operationId: paymentMethodsList + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + - $ref: ../parameters/recipients_ref.yaml#/components/parameters/RecipientsRef + - $ref: ../parameters/limit.yaml#/components/parameters/Limit + - $ref: ../parameters/offset.yaml#/components/parameters/Offset + - $ref: ../parameters/archived.yaml#/components/parameters/Archived + responses: + '200': + description: Payment methods list + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payment_methods/object.yaml b/interface/api/payment_methods/object.yaml new file mode 100644 index 00000000..6ae62feb --- /dev/null +++ b/interface/api/payment_methods/object.yaml @@ -0,0 +1,62 @@ +get: + tags: [PaymentMethods] + summary: Get payment method + operationId: paymentMethodsGet + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + responses: + '200': + description: Payment method data + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError + +delete: + tags: [PaymentMethods] + summary: Delete payment method + operationId: paymentMethodsDelete + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade + responses: + '200': + description: Payment method deleted + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payment_methods/request/payment_method.yaml b/interface/api/payment_methods/request/payment_method.yaml new file mode 100644 index 00000000..ed55b7f6 --- /dev/null +++ b/interface/api/payment_methods/request/payment_method.yaml @@ -0,0 +1,4 @@ +components: + schemas: + PaymentMethodRequest: + $ref: ../../../models/payment_method/payment_method.yaml#/components/schemas/PaymentMethod diff --git a/interface/api/payment_methods/response/payment_method.yaml b/interface/api/payment_methods/response/payment_method.yaml new file mode 100644 index 00000000..2389bcd4 --- /dev/null +++ b/interface/api/payment_methods/response/payment_method.yaml @@ -0,0 +1,15 @@ +components: + schemas: + PaymentMethodsAuthData: + type: object + additionalProperties: false + required: + - accessToken + - payment_methods + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + payment_methods: + type: array + items: + $ref: ../../../models/payment_method/payment_method.yaml#/components/schemas/PaymentMethod diff --git a/interface/api/payment_methods/update.yaml b/interface/api/payment_methods/update.yaml new file mode 100644 index 00000000..d7e0d70b --- /dev/null +++ b/interface/api/payment_methods/update.yaml @@ -0,0 +1,32 @@ +put: + tags: [PaymentMethods] + summary: Update payment method + operationId: paymentMethodsUpdate + security: + - bearerAuth: [] + requestBody: + $ref: ./bodies/payment_method.yaml#/components/requestBodies/PaymentMethodBody + responses: + '200': + description: Payment method updated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/bodies/payment.yaml b/interface/api/payments/bodies/payment.yaml new file mode 100644 index 00000000..bd772ddb --- /dev/null +++ b/interface/api/payments/bodies/payment.yaml @@ -0,0 +1,29 @@ +components: + requestBodies: + QuotePaymentBody: + required: true + content: + application/json: + schema: + $ref: ../request/payment.yaml#/components/schemas/QuotePaymentRequest + + QuotePaymentsBody: + required: true + content: + application/json: + schema: + $ref: ../request/payment.yaml#/components/schemas/QuotePaymentsRequest + + InitiatePaymentBody: + required: true + content: + application/json: + schema: + $ref: ../request/payment.yaml#/components/schemas/InitiatePaymentRequest + + InitiatePaymentsBody: + required: true + content: + application/json: + schema: + $ref: ../request/payment.yaml#/components/schemas/InitiatePaymentsRequest diff --git a/interface/api/payments/by_multiquote.yaml b/interface/api/payments/by_multiquote.yaml new file mode 100644 index 00000000..40e43035 --- /dev/null +++ b/interface/api/payments/by_multiquote.yaml @@ -0,0 +1,30 @@ +post: + tags: [Payments] + summary: Initiate payment batch by quote reference + operationId: paymentsInitiateBatchByQuote + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + $ref: ./bodies/payment.yaml#/components/requestBodies/InitiatePaymentsBody + responses: + '200': + description: Payment batch initiated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentsData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/by_quote.yaml b/interface/api/payments/by_quote.yaml new file mode 100644 index 00000000..7f6adc27 --- /dev/null +++ b/interface/api/payments/by_quote.yaml @@ -0,0 +1,41 @@ +post: + tags: [Payments] + summary: Initiate payment using quote reference + operationId: paymentsInitiateByQuote + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: ./request/payment.yaml#/components/schemas/InitiatePaymentRequest + - type: object + required: + - quoteRef + not: + required: + - intent + responses: + '200': + description: Payment initiated by quote + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/immediate.yaml b/interface/api/payments/immediate.yaml new file mode 100644 index 00000000..6952d188 --- /dev/null +++ b/interface/api/payments/immediate.yaml @@ -0,0 +1,41 @@ +post: + tags: [Payments] + summary: Initiate payment from immediate intent + operationId: paymentsInitiateImmediate + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: ./request/payment.yaml#/components/schemas/InitiatePaymentRequest + - type: object + required: + - intent + not: + required: + - quoteRef + responses: + '200': + description: Payment initiated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/list.yaml b/interface/api/payments/list.yaml new file mode 100644 index 00000000..5e30aa31 --- /dev/null +++ b/interface/api/payments/list.yaml @@ -0,0 +1,50 @@ +get: + tags: [Payments] + summary: List payments in organization + operationId: paymentsList + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + - $ref: ../parameters/cursor.yaml#/components/parameters/Cursor + - $ref: ../parameters/limit.yaml#/components/parameters/Limit + - name: quotation_ref + in: query + required: false + schema: + type: string + - name: created_from + in: query + required: false + schema: + type: string + format: date-time + - name: created_to + in: query + required: false + schema: + type: string + format: date-time + - $ref: ../parameters/state.yaml#/components/parameters/State + - $ref: ../parameters/states.yaml#/components/parameters/States + - $ref: ../parameters/filter_states.yaml#/components/parameters/FilterStates + responses: + '200': + description: Payments list + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentsData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/multiquote.yaml b/interface/api/payments/multiquote.yaml new file mode 100644 index 00000000..cfb7588a --- /dev/null +++ b/interface/api/payments/multiquote.yaml @@ -0,0 +1,30 @@ +post: + tags: [Payments] + summary: Quote multiple payment intents + operationId: paymentsMultiQuote + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + $ref: ./bodies/payment.yaml#/components/requestBodies/QuotePaymentsBody + responses: + '200': + description: Quotes generated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentQuotesData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/quote.yaml b/interface/api/payments/quote.yaml new file mode 100644 index 00000000..8fb5faaa --- /dev/null +++ b/interface/api/payments/quote.yaml @@ -0,0 +1,30 @@ +post: + tags: [Payments] + summary: Quote single payment intent + operationId: paymentsQuote + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + requestBody: + $ref: ./bodies/payment.yaml#/components/requestBodies/QuotePaymentBody + responses: + '200': + description: Quote generated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/payment.yaml#/components/schemas/PaymentQuoteData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/payments/request/payment.yaml b/interface/api/payments/request/payment.yaml new file mode 100644 index 00000000..1d4a9807 --- /dev/null +++ b/interface/api/payments/request/payment.yaml @@ -0,0 +1,104 @@ +components: + schemas: + PaymentBase: + type: object + additionalProperties: false + required: + - idempotencyKey + properties: + idempotencyKey: + type: string + metadata: + type: object + additionalProperties: + type: string + + QuotePaymentRequest: + type: object + additionalProperties: false + required: + - intent + properties: + idempotencyKey: + type: string + metadata: + type: object + additionalProperties: + type: string + intent: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentIntent + previewOnly: + type: boolean + allOf: + - if: + properties: + previewOnly: + const: true + required: + - previewOnly + then: + not: + required: + - idempotencyKey + else: + required: + - idempotencyKey + + QuotePaymentsRequest: + type: object + additionalProperties: false + required: + - intents + properties: + idempotencyKey: + type: string + metadata: + type: object + additionalProperties: + type: string + intents: + type: array + minItems: 1 + items: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentIntent + previewOnly: + type: boolean + allOf: + - if: + properties: + previewOnly: + const: true + required: + - previewOnly + then: + not: + required: + - idempotencyKey + else: + required: + - idempotencyKey + + InitiatePaymentRequest: + allOf: + - $ref: ./payment.yaml#/components/schemas/PaymentBase + - type: object + additionalProperties: false + oneOf: + - required: [intent] + - required: [quoteRef] + properties: + intent: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentIntent + quoteRef: + type: string + + InitiatePaymentsRequest: + allOf: + - $ref: ./payment.yaml#/components/schemas/PaymentBase + - type: object + additionalProperties: false + required: + - quoteRef + properties: + quoteRef: + type: string diff --git a/interface/api/payments/response/payment.yaml b/interface/api/payments/response/payment.yaml new file mode 100644 index 00000000..b07fd49c --- /dev/null +++ b/interface/api/payments/response/payment.yaml @@ -0,0 +1,66 @@ +components: + schemas: + PaymentQuoteData: + type: object + additionalProperties: false + required: + - accessToken + - quote + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + idempotencyKey: + type: string + quote: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentQuote + + PaymentQuotesData: + type: object + additionalProperties: false + required: + - accessToken + - quote + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + quote: + type: object + additionalProperties: false + properties: + idempotencyKey: + type: string + quoteRef: + type: string + aggregate: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentQuoteAggregate + quotes: + type: array + items: + $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentQuote + + PaymentsData: + type: object + additionalProperties: false + required: + - accessToken + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + payments: + type: array + items: + $ref: ../../../models/payment/payment.yaml#/components/schemas/Payment + page: + $ref: ../../../models/common/pagination.yaml#/components/schemas/CursorPageResponse + + PaymentData: + type: object + additionalProperties: false + required: + - accessToken + - payment + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + payment: + $ref: ../../../models/payment/payment.yaml#/components/schemas/Payment diff --git a/interface/api/recipients/archive.yaml b/interface/api/recipients/archive.yaml new file mode 100644 index 00000000..e1a29044 --- /dev/null +++ b/interface/api/recipients/archive.yaml @@ -0,0 +1,35 @@ +get: + tags: [Recipients] + summary: Archive/unarchive recipient + operationId: recipientsArchive + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/org_ref.yaml#/components/parameters/OrgRef + - $ref: ../parameters/recipients_ref.yaml#/components/parameters/RecipientsRef + - name: archived + in: query + required: true + schema: + type: boolean + - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade + responses: + '200': + description: Archive state updated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/recipients/bodies/recipient.yaml b/interface/api/recipients/bodies/recipient.yaml new file mode 100644 index 00000000..c4c6e152 --- /dev/null +++ b/interface/api/recipients/bodies/recipient.yaml @@ -0,0 +1,8 @@ +components: + requestBodies: + RecipientBody: + required: true + content: + application/json: + schema: + $ref: ../request/recipient.yaml#/components/schemas/RecipientRequest diff --git a/interface/api/recipients/create.yaml b/interface/api/recipients/create.yaml new file mode 100644 index 00000000..a68ab83b --- /dev/null +++ b/interface/api/recipients/create.yaml @@ -0,0 +1,32 @@ +post: + tags: [Recipients] + summary: Create recipient + operationId: recipientsCreate + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/org_ref.yaml#/components/parameters/OrgRef + requestBody: + $ref: ./bodies/recipient.yaml#/components/requestBodies/RecipientBody + responses: + '201': + description: Recipient created + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/recipients/list.yaml b/interface/api/recipients/list.yaml new file mode 100644 index 00000000..d9b4aacb --- /dev/null +++ b/interface/api/recipients/list.yaml @@ -0,0 +1,32 @@ +get: + tags: [Recipients] + summary: List recipients + operationId: recipientsList + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/org_ref.yaml#/components/parameters/OrgRef + - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef + - $ref: ../parameters/limit.yaml#/components/parameters/Limit + - $ref: ../parameters/offset.yaml#/components/parameters/Offset + - $ref: ../parameters/archived.yaml#/components/parameters/Archived + responses: + '200': + description: Recipient list + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/recipients/object.yaml b/interface/api/recipients/object.yaml new file mode 100644 index 00000000..329f642c --- /dev/null +++ b/interface/api/recipients/object.yaml @@ -0,0 +1,62 @@ +get: + tags: [Recipients] + summary: Get recipient by reference + operationId: recipientsGet + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/recipients_ref.yaml#/components/parameters/RecipientsRef + responses: + '200': + description: Recipient data + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError + +delete: + tags: [Recipients] + summary: Delete recipient + operationId: recipientsDelete + security: + - bearerAuth: [] + parameters: + - $ref: ../parameters/recipients_ref.yaml#/components/parameters/RecipientsRef + - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade + responses: + '200': + description: Recipient deleted + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/recipients/request/recipient.yaml b/interface/api/recipients/request/recipient.yaml new file mode 100644 index 00000000..7a96a78b --- /dev/null +++ b/interface/api/recipients/request/recipient.yaml @@ -0,0 +1,4 @@ +components: + schemas: + RecipientRequest: + $ref: ../../../models/recipient/recipient.yaml#/components/schemas/Recipient diff --git a/interface/api/recipients/response/recipient.yaml b/interface/api/recipients/response/recipient.yaml new file mode 100644 index 00000000..7b32cee2 --- /dev/null +++ b/interface/api/recipients/response/recipient.yaml @@ -0,0 +1,15 @@ +components: + schemas: + RecipientsAuthData: + type: object + additionalProperties: false + required: + - accessToken + - recipients + properties: + accessToken: + $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData + recipients: + type: array + items: + $ref: ../../../models/recipient/recipient.yaml#/components/schemas/Recipient diff --git a/interface/api/recipients/update.yaml b/interface/api/recipients/update.yaml new file mode 100644 index 00000000..7b877e20 --- /dev/null +++ b/interface/api/recipients/update.yaml @@ -0,0 +1,30 @@ +put: + tags: [Recipients] + summary: Update recipient + operationId: recipientsUpdate + security: + - bearerAuth: [] + requestBody: + $ref: ./bodies/recipient.yaml#/components/requestBodies/RecipientBody + responses: + '200': + description: Recipient updated + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/recipient.yaml#/components/schemas/RecipientsAuthData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/response/error.yaml b/interface/api/response/error.yaml new file mode 100644 index 00000000..7801100e --- /dev/null +++ b/interface/api/response/error.yaml @@ -0,0 +1,19 @@ +components: + schemas: + ApiError: + type: object + additionalProperties: false + required: + - code + - error + - source + properties: + code: + type: integer + format: int32 + error: + type: string + source: + type: string + details: + type: string diff --git a/interface/api/response/operation.yaml b/interface/api/response/operation.yaml new file mode 100644 index 00000000..f6cf6c58 --- /dev/null +++ b/interface/api/response/operation.yaml @@ -0,0 +1,78 @@ +components: + responses: + Ok: + description: Successful response + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/BaseResponse + + Created: + description: Resource created + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/BaseResponse + + Accepted: + description: Request accepted for processing + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/BaseResponse + + BadRequest: + description: Bad request payload or query/path parameter + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + Unauthorized: + description: Unauthorized + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + Forbidden: + description: Forbidden + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + NotFound: + description: Resource not found + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + Gone: + description: Resource is no longer available + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + Conflict: + description: Conflict + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + TooManyRequests: + description: Too many requests + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse + + InternalServerError: + description: Internal server error + content: + application/json: + schema: + $ref: ./response.yaml#/components/schemas/ErrorResponse diff --git a/interface/api/response/response.yaml b/interface/api/response/response.yaml new file mode 100644 index 00000000..89589e58 --- /dev/null +++ b/interface/api/response/response.yaml @@ -0,0 +1,47 @@ +components: + schemas: + BaseResponse: + type: object + additionalProperties: false + required: + - status + - data + properties: + status: + $ref: ./status.yaml#/components/schemas/ApiStatus + data: + description: Payload for success or error responses. + + ErrorResponse: + allOf: + - $ref: ./response.yaml#/components/schemas/BaseResponse + - type: object + properties: + status: + type: string + enum: + - error + data: + $ref: ./error.yaml#/components/schemas/ApiError + + SuccessResultData: + type: object + additionalProperties: false + required: + - result + properties: + result: + type: boolean + + SuccessResultResponse: + allOf: + - $ref: ./response.yaml#/components/schemas/BaseResponse + - type: object + properties: + status: + type: string + enum: + - success + - processed + data: + $ref: ./response.yaml#/components/schemas/SuccessResultData diff --git a/interface/api/response/status.yaml b/interface/api/response/status.yaml new file mode 100644 index 00000000..1a7e1236 --- /dev/null +++ b/interface/api/response/status.yaml @@ -0,0 +1,10 @@ +components: + schemas: + ApiStatus: + type: string + description: Unified response status used by backend wrappers. + enum: + - success + - processed + - error + - request diff --git a/interface/api/verification/bodies/verification.yaml b/interface/api/verification/bodies/verification.yaml new file mode 100644 index 00000000..79cc79f9 --- /dev/null +++ b/interface/api/verification/bodies/verification.yaml @@ -0,0 +1,15 @@ +components: + requestBodies: + VerificationCodeBody: + required: true + content: + application/json: + schema: + $ref: ../request/verification.yaml#/components/schemas/VerificationCodeRequest + + VerifyCodeBody: + required: true + content: + application/json: + schema: + $ref: ../request/verification.yaml#/components/schemas/CodeVerificationRequest diff --git a/interface/api/verification/create.yaml b/interface/api/verification/create.yaml new file mode 100644 index 00000000..ad7bda97 --- /dev/null +++ b/interface/api/verification/create.yaml @@ -0,0 +1,34 @@ +post: + tags: [Verification, Auth] + summary: Request verification code + operationId: verificationRequestCode + security: + - bearerAuth: [] + requestBody: + $ref: ./bodies/verification.yaml#/components/requestBodies/VerificationCodeBody + responses: + '202': + description: Verification code requested + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/verification.yaml#/components/schemas/VerificationResponseData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '429': + $ref: ../response/operation.yaml#/components/responses/TooManyRequests + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/verification/request/verification.yaml b/interface/api/verification/request/verification.yaml new file mode 100644 index 00000000..52cd1e94 --- /dev/null +++ b/interface/api/verification/request/verification.yaml @@ -0,0 +1,31 @@ +components: + schemas: + VerificationCodeRequest: + type: object + additionalProperties: false + required: + - purpose + - idempotencyKey + properties: + purpose: + type: string + description: Verification purpose, e.g. login. + target: + type: string + format: email + idempotencyKey: + type: string + + CodeVerificationRequest: + allOf: + - $ref: ./verification.yaml#/components/schemas/VerificationCodeRequest + - type: object + additionalProperties: false + required: + - code + - sessionIdentifier + properties: + code: + type: string + sessionIdentifier: + $ref: ../../../models/auth/session_identifier.yaml#/components/schemas/SessionIdentifier diff --git a/interface/api/verification/resend.yaml b/interface/api/verification/resend.yaml new file mode 100644 index 00000000..d2376d81 --- /dev/null +++ b/interface/api/verification/resend.yaml @@ -0,0 +1,34 @@ +post: + tags: [Verification, Auth] + summary: Resend verification code + operationId: verificationResendCode + security: + - bearerAuth: [] + requestBody: + $ref: ./bodies/verification.yaml#/components/requestBodies/VerificationCodeBody + responses: + '202': + description: Verification code resent + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/verification.yaml#/components/schemas/VerificationResponseData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '429': + $ref: ../response/operation.yaml#/components/responses/TooManyRequests + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/api/verification/response/verification.yaml b/interface/api/verification/response/verification.yaml new file mode 100644 index 00000000..121f51f7 --- /dev/null +++ b/interface/api/verification/response/verification.yaml @@ -0,0 +1,26 @@ +components: + schemas: + VerificationResponseData: + type: object + additionalProperties: false + required: + - idempotencyKey + - ttl_seconds + - cooldown_seconds + - target + properties: + idempotencyKey: + type: string + ttl_seconds: + type: integer + format: int32 + cooldown_seconds: + type: integer + format: int32 + target: + type: string + + VerifyResultData: + oneOf: + - $ref: ../../accounts/response/auth.yaml#/components/schemas/LoginData + - $ref: ../../response/response.yaml#/components/schemas/SuccessResultData diff --git a/interface/api/verification/verify.yaml b/interface/api/verification/verify.yaml new file mode 100644 index 00000000..92daba31 --- /dev/null +++ b/interface/api/verification/verify.yaml @@ -0,0 +1,34 @@ +post: + tags: [Verification, Auth] + summary: Verify code and complete pending flow + operationId: verificationVerifyCode + security: + - bearerAuth: [] + requestBody: + $ref: ./bodies/verification.yaml#/components/requestBodies/VerifyCodeBody + responses: + '200': + description: Verification successful + content: + application/json: + schema: + allOf: + - $ref: ../response/response.yaml#/components/schemas/BaseResponse + - type: object + properties: + data: + $ref: ./response/verification.yaml#/components/schemas/VerifyResultData + '400': + $ref: ../response/operation.yaml#/components/responses/BadRequest + '401': + $ref: ../response/operation.yaml#/components/responses/Unauthorized + '403': + $ref: ../response/operation.yaml#/components/responses/Forbidden + '404': + $ref: ../response/operation.yaml#/components/responses/NotFound + '410': + $ref: ../response/operation.yaml#/components/responses/Gone + '409': + $ref: ../response/operation.yaml#/components/responses/Conflict + '500': + $ref: ../response/operation.yaml#/components/responses/InternalServerError diff --git a/interface/doc.html b/interface/doc.html new file mode 100644 index 00000000..e57353d6 --- /dev/null +++ b/interface/doc.html @@ -0,0 +1,15 @@ + + + + + + Sendico API Docs (Redoc) + + + + + + + diff --git a/interface/external/chain_network.yaml b/interface/external/chain_network.yaml new file mode 100644 index 00000000..c5770115 --- /dev/null +++ b/interface/external/chain_network.yaml @@ -0,0 +1,10 @@ +components: + schemas: + ChainNetwork: + type: string + enum: + - unspecified + - ethereum_mainnet + - arbitrum_one + - tron_mainnet + - tron_nile diff --git a/interface/external/endpoint_type.yaml b/interface/external/endpoint_type.yaml new file mode 100644 index 00000000..2d291924 --- /dev/null +++ b/interface/external/endpoint_type.yaml @@ -0,0 +1,10 @@ +components: + schemas: + EndpointType: + type: string + enum: + - ledger + - managedWallet + - cryptoAddress + - card + - cardToken diff --git a/interface/external/fx_side.yaml b/interface/external/fx_side.yaml new file mode 100644 index 00000000..62f90f34 --- /dev/null +++ b/interface/external/fx_side.yaml @@ -0,0 +1,8 @@ +components: + schemas: + FxSide: + type: string + enum: + - unspecified + - buy_base_sell_quote + - sell_base_buy_quote diff --git a/interface/external/payment_kind.yaml b/interface/external/payment_kind.yaml new file mode 100644 index 00000000..ff38cecc --- /dev/null +++ b/interface/external/payment_kind.yaml @@ -0,0 +1,9 @@ +components: + schemas: + PaymentKind: + type: string + enum: + - unspecified + - payout + - internal_transfer + - fx_conversion diff --git a/interface/external/payment_method_type.yaml b/interface/external/payment_method_type.yaml new file mode 100644 index 00000000..c8c4e84b --- /dev/null +++ b/interface/external/payment_method_type.yaml @@ -0,0 +1,12 @@ +components: + schemas: + PaymentMethodType: + type: string + enum: + - iban + - card + - cardToken + - bankAccount + - wallet + - cryptoAddress + - ledger diff --git a/interface/external/payment_state.yaml b/interface/external/payment_state.yaml new file mode 100644 index 00000000..0c298cdb --- /dev/null +++ b/interface/external/payment_state.yaml @@ -0,0 +1,12 @@ +components: + schemas: + PaymentState: + type: string + enum: + - payment_state_unspecified + - payment_state_accepted + - payment_state_funds_reserved + - payment_state_submitted + - payment_state_settled + - payment_state_failed + - payment_state_cancelled diff --git a/interface/external/settlement_mode.yaml b/interface/external/settlement_mode.yaml new file mode 100644 index 00000000..e5531c92 --- /dev/null +++ b/interface/external/settlement_mode.yaml @@ -0,0 +1,8 @@ +components: + schemas: + SettlementMode: + type: string + enum: + - unspecified + - fix_source + - fix_received diff --git a/interface/models/account/account.yaml b/interface/models/account/account.yaml new file mode 100644 index 00000000..33b0d001 --- /dev/null +++ b/interface/models/account/account.yaml @@ -0,0 +1,12 @@ +components: + schemas: + AccountData: + allOf: + - $ref: ./account_public.yaml#/components/schemas/AccountPublic + - type: object + additionalProperties: false + required: + - isAnonymous + properties: + isAnonymous: + type: boolean diff --git a/interface/models/account/account_public.yaml b/interface/models/account/account_public.yaml new file mode 100644 index 00000000..1e98a6c3 --- /dev/null +++ b/interface/models/account/account_public.yaml @@ -0,0 +1,26 @@ +components: + schemas: + AccountPublic: + allOf: + - $ref: ../storable.yaml#/components/schemas/Storable + - $ref: ../common/describable.yaml#/components/schemas/Describable + - type: object + additionalProperties: false + required: + - login + - locale + - lastName + - isArchived + properties: + login: + type: string + format: email + locale: + type: string + lastName: + type: string + avatarUrl: + type: string + nullable: true + isArchived: + type: boolean diff --git a/interface/models/auth/client_refresh_token.yaml b/interface/models/auth/client_refresh_token.yaml new file mode 100644 index 00000000..34bd14a1 --- /dev/null +++ b/interface/models/auth/client_refresh_token.yaml @@ -0,0 +1,12 @@ +components: + schemas: + ClientRefreshToken: + allOf: + - $ref: ./session_identifier.yaml#/components/schemas/SessionIdentifier + - type: object + additionalProperties: false + required: + - token + properties: + token: + type: string diff --git a/interface/models/auth/login_data.yaml b/interface/models/auth/login_data.yaml new file mode 100644 index 00000000..5123b778 --- /dev/null +++ b/interface/models/auth/login_data.yaml @@ -0,0 +1,17 @@ +components: + schemas: + LoginData: + type: object + additionalProperties: false + required: + - login + - password + properties: + login: + type: string + format: email + password: + type: string + format: password + locale: + type: string diff --git a/interface/models/auth/session_identifier.yaml b/interface/models/auth/session_identifier.yaml new file mode 100644 index 00000000..1b0f0ebd --- /dev/null +++ b/interface/models/auth/session_identifier.yaml @@ -0,0 +1,13 @@ +components: + schemas: + SessionIdentifier: + type: object + additionalProperties: false + required: + - clientId + - deviceId + properties: + clientId: + type: string + deviceId: + type: string diff --git a/interface/models/auth/token_data.yaml b/interface/models/auth/token_data.yaml new file mode 100644 index 00000000..4cdd414e --- /dev/null +++ b/interface/models/auth/token_data.yaml @@ -0,0 +1,14 @@ +components: + schemas: + TokenData: + type: object + additionalProperties: false + required: + - token + - expiration + properties: + token: + type: string + expiration: + type: string + format: date-time diff --git a/interface/models/common/describable.yaml b/interface/models/common/describable.yaml new file mode 100644 index 00000000..30a7dabd --- /dev/null +++ b/interface/models/common/describable.yaml @@ -0,0 +1,13 @@ +components: + schemas: + Describable: + type: object + additionalProperties: false + required: + - name + properties: + name: + type: string + description: + type: string + nullable: true diff --git a/interface/models/common/money.yaml b/interface/models/common/money.yaml new file mode 100644 index 00000000..379433d8 --- /dev/null +++ b/interface/models/common/money.yaml @@ -0,0 +1,16 @@ +components: + schemas: + Money: + type: object + additionalProperties: false + required: + - amount + - currency + properties: + amount: + type: string + description: Decimal string amount. + example: '125.50' + currency: + type: string + example: USD diff --git a/interface/models/common/pagination.yaml b/interface/models/common/pagination.yaml new file mode 100644 index 00000000..bd6e8b04 --- /dev/null +++ b/interface/models/common/pagination.yaml @@ -0,0 +1,8 @@ +components: + schemas: + CursorPageResponse: + type: object + additionalProperties: false + properties: + next_cursor: + type: string diff --git a/interface/models/objectid.yaml b/interface/models/objectid.yaml new file mode 100644 index 00000000..4ec8dd47 --- /dev/null +++ b/interface/models/objectid.yaml @@ -0,0 +1,7 @@ +components: + schemas: + ObjectId: + type: string + pattern: '^[a-fA-F0-9]{24}$' + examples: + - 64f85f5f4c7dbf7cfb8f3f10 diff --git a/interface/models/organization/organization.yaml b/interface/models/organization/organization.yaml new file mode 100644 index 00000000..6bd6f12b --- /dev/null +++ b/interface/models/organization/organization.yaml @@ -0,0 +1,32 @@ +components: + schemas: + OrganizationBase: + allOf: + - $ref: ../permission_bound.yaml#/components/schemas/PermissionBound + - $ref: ../common/describable.yaml#/components/schemas/Describable + - type: object + additionalProperties: false + required: + - tenantRef + - timeZone + properties: + tenantRef: + $ref: ../objectid.yaml#/components/schemas/ObjectId + timeZone: + type: string + logoUrl: + type: string + nullable: true + + Organization: + allOf: + - $ref: ./organization.yaml#/components/schemas/OrganizationBase + - type: object + additionalProperties: false + required: + - members + properties: + members: + type: array + items: + $ref: ../objectid.yaml#/components/schemas/ObjectId diff --git a/interface/models/payment/payment.yaml b/interface/models/payment/payment.yaml new file mode 100644 index 00000000..c9a6c764 --- /dev/null +++ b/interface/models/payment/payment.yaml @@ -0,0 +1,279 @@ +components: + schemas: + Asset: + type: object + additionalProperties: false + properties: + chain: + $ref: ../../external/chain_network.yaml#/components/schemas/ChainNetwork + token_symbol: + type: string + contract_address: + type: string + + LedgerEndpoint: + type: object + properties: + ledger_account_ref: + type: string + contra_ledger_account_ref: + type: string + + ManagedWalletEndpoint: + type: object + properties: + managed_wallet_ref: + type: string + asset: + $ref: ./payment.yaml#/components/schemas/Asset + + ExternalChainEndpoint: + type: object + properties: + asset: + $ref: ./payment.yaml#/components/schemas/Asset + address: + type: string + memo: + type: string + + CardEndpoint: + type: object + properties: + pan: + type: string + firstName: + type: string + lastName: + type: string + exp_month: + type: integer + format: int32 + exp_year: + type: integer + format: int32 + country: + type: string + + CardTokenEndpoint: + type: object + properties: + token: + type: string + masked_pan: + type: string + + Endpoint: + type: object + additionalProperties: false + required: + - type + - data + properties: + type: + $ref: ../../external/endpoint_type.yaml#/components/schemas/EndpointType + data: + type: object + additionalProperties: true + metadata: + type: object + additionalProperties: + type: string + + Customer: + type: object + additionalProperties: false + properties: + id: + type: string + first_name: + type: string + middle_name: + type: string + last_name: + type: string + ip: + type: string + zip: + type: string + country: + type: string + state: + type: string + city: + type: string + address: + type: string + + CurrencyPair: + type: object + additionalProperties: false + required: + - base + - quote + properties: + base: + type: string + quote: + type: string + + FxIntent: + type: object + additionalProperties: false + required: + - side + properties: + pair: + $ref: ./payment.yaml#/components/schemas/CurrencyPair + side: + $ref: ../../external/fx_side.yaml#/components/schemas/FxSide + firm: + type: boolean + ttl_ms: + type: integer + format: int64 + preferred_provider: + type: string + max_age_ms: + type: integer + format: int32 + + PaymentIntent: + type: object + additionalProperties: false + required: + - kind + - source + - destination + - amount + properties: + kind: + $ref: ../../external/payment_kind.yaml#/components/schemas/PaymentKind + source: + $ref: ./payment.yaml#/components/schemas/Endpoint + destination: + $ref: ./payment.yaml#/components/schemas/Endpoint + amount: + $ref: ../common/money.yaml#/components/schemas/Money + fx: + $ref: ./payment.yaml#/components/schemas/FxIntent + settlement_mode: + $ref: ../../external/settlement_mode.yaml#/components/schemas/SettlementMode + settlement_currency: + type: string + attributes: + type: object + additionalProperties: + type: string + customer: + $ref: ./payment.yaml#/components/schemas/Customer + + PaymentQuote: + type: object + additionalProperties: false + properties: + quoteRef: + type: string + debitAmount: + $ref: ../common/money.yaml#/components/schemas/Money + debitSettlementAmount: + $ref: ../common/money.yaml#/components/schemas/Money + expectedSettlementAmount: + $ref: ../common/money.yaml#/components/schemas/Money + expectedFeeTotal: + $ref: ../common/money.yaml#/components/schemas/Money + feeLines: + type: array + items: + $ref: ./payment.yaml#/components/schemas/FeeLine + fxQuote: + $ref: ./payment.yaml#/components/schemas/FxQuote + + FeeLine: + type: object + additionalProperties: false + properties: + ledgerAccountRef: + type: string + amount: + $ref: ../common/money.yaml#/components/schemas/Money + lineType: + type: string + side: + type: string + meta: + type: object + additionalProperties: + type: string + + FxQuote: + type: object + additionalProperties: false + properties: + quoteRef: + type: string + baseCurrency: + type: string + quoteCurrency: + type: string + side: + type: string + price: + type: string + baseAmount: + $ref: ../common/money.yaml#/components/schemas/Money + quoteAmount: + $ref: ../common/money.yaml#/components/schemas/Money + expiresAtUnixMs: + type: integer + format: int64 + pricedAtUnixMs: + type: integer + format: int64 + provider: + type: string + rateRef: + type: string + firm: + type: boolean + + PaymentQuoteAggregate: + type: object + additionalProperties: false + properties: + debitAmounts: + type: array + items: + $ref: ../common/money.yaml#/components/schemas/Money + expectedSettlementAmounts: + type: array + items: + $ref: ../common/money.yaml#/components/schemas/Money + expectedFeeTotals: + type: array + items: + $ref: ../common/money.yaml#/components/schemas/Money + + Payment: + type: object + additionalProperties: false + properties: + paymentRef: + type: string + idempotencyKey: + type: string + state: + $ref: ../../external/payment_state.yaml#/components/schemas/PaymentState + failureCode: + type: string + failureReason: + type: string + lastQuote: + $ref: ./payment.yaml#/components/schemas/PaymentQuote + createdAt: + type: string + format: date-time + meta: + type: object + additionalProperties: + type: string diff --git a/interface/models/payment_method/payment_method.yaml b/interface/models/payment_method/payment_method.yaml new file mode 100644 index 00000000..f1640f85 --- /dev/null +++ b/interface/models/payment_method/payment_method.yaml @@ -0,0 +1,22 @@ +components: + schemas: + PaymentMethod: + allOf: + - $ref: ../permission_bound.yaml#/components/schemas/PermissionBound + - $ref: ../common/describable.yaml#/components/schemas/Describable + - type: object + additionalProperties: false + required: + - recipientRef + - type + - isMain + properties: + recipientRef: + $ref: ../objectid.yaml#/components/schemas/ObjectId + type: + $ref: ../../external/payment_method_type.yaml#/components/schemas/PaymentMethodType + data: + type: object + additionalProperties: true + isMain: + type: boolean diff --git a/interface/models/permission_bound.yaml b/interface/models/permission_bound.yaml new file mode 100644 index 00000000..5a889b22 --- /dev/null +++ b/interface/models/permission_bound.yaml @@ -0,0 +1,18 @@ +components: + schemas: + PermissionBound: + allOf: + - $ref: ./storable.yaml#/components/schemas/Storable + - type: object + additionalProperties: false + required: + - organizationRef + - permissionRef + - isArchived + properties: + organizationRef: + $ref: ./objectid.yaml#/components/schemas/ObjectId + permissionRef: + $ref: ./objectid.yaml#/components/schemas/ObjectId + isArchived: + type: boolean diff --git a/interface/models/recipient/recipient.yaml b/interface/models/recipient/recipient.yaml new file mode 100644 index 00000000..5ab3d564 --- /dev/null +++ b/interface/models/recipient/recipient.yaml @@ -0,0 +1,30 @@ +components: + schemas: + Recipient: + allOf: + - $ref: ../permission_bound.yaml#/components/schemas/PermissionBound + - $ref: ../common/describable.yaml#/components/schemas/Describable + - type: object + additionalProperties: false + required: + - email + - status + - type + properties: + email: + type: string + format: email + avatarUrl: + type: string + nullable: true + status: + type: string + enum: + - ready + - registered + - notRegistered + type: + type: string + enum: + - internal + - external diff --git a/interface/models/storable.yaml b/interface/models/storable.yaml new file mode 100644 index 00000000..cf2e4966 --- /dev/null +++ b/interface/models/storable.yaml @@ -0,0 +1,18 @@ +components: + schemas: + Storable: + type: object + additionalProperties: false + required: + - id + - createdAt + - updatedAt + properties: + id: + $ref: ./objectid.yaml#/components/schemas/ObjectId + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time diff --git a/interface/sw.html b/interface/sw.html new file mode 100644 index 00000000..5a1f9895 --- /dev/null +++ b/interface/sw.html @@ -0,0 +1,26 @@ + + + + + + Sendico API Docs (Swagger UI) + + + + +
+ + + + -- 2.49.1 From d70d9e84c932f152fc275e6ba96a0fb81ac48546 Mon Sep 17 00:00:00 2001 From: Arseni Date: Wed, 25 Feb 2026 01:01:28 +0300 Subject: [PATCH 2/2] small fixes --- ci/dev/Caddyfile.dev | 5 +++-- ci/dev/frontend.dockerfile | 2 +- interface/sw.html | 26 -------------------------- 3 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 interface/sw.html diff --git a/ci/dev/Caddyfile.dev b/ci/dev/Caddyfile.dev index 50ebe0c0..badf1f47 100644 --- a/ci/dev/Caddyfile.dev +++ b/ci/dev/Caddyfile.dev @@ -8,6 +8,7 @@ :80 { vars static_root /usr/share/pweb + vars docs_root /usr/share/docs encode zstd gzip @@ -45,14 +46,14 @@ } handle /docs/ { - root * {vars.static_root}/docs + root * {vars.docs_root} rewrite * /doc.html file_server header Cache-Control "no-cache" } handle_path /docs/* { - root * {vars.static_root}/docs + root * {vars.docs_root} file_server header Cache-Control "no-cache" } diff --git a/ci/dev/frontend.dockerfile b/ci/dev/frontend.dockerfile index 799c8f34..17322432 100644 --- a/ci/dev/frontend.dockerfile +++ b/ci/dev/frontend.dockerfile @@ -48,7 +48,7 @@ FROM caddy:alpine AS runtime WORKDIR /usr/share/pweb COPY --from=web_builder /home/flutteruser/app/pweb/build/web /usr/share/pweb -COPY interface /usr/share/pweb/docs +COPY interface /usr/share/docs # Copy Caddy config (will be mounted from host) # COPY frontend/pweb/caddy/Caddyfile /etc/caddy/Caddyfile diff --git a/interface/sw.html b/interface/sw.html deleted file mode 100644 index 5a1f9895..00000000 --- a/interface/sw.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - Sendico API Docs (Swagger UI) - - - - -
- - - - -- 2.49.1