diff --git a/interface/api.yaml b/interface/api.yaml index 72dc6254..3ff5ffe7 100644 --- a/interface/api.yaml +++ b/interface/api.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: Sendico Payment API Contract - version: 1.0.0 + version: 3.0.0 summary: Minimal client contract for payment execution flows via BFF. description: | OpenAPI 3.1 contract focused on flows required to perform payments: @@ -21,7 +21,7 @@ tags: description: Organization selection for payment operations - name: Recipients description: Recipient CRUD and archive flows - - name: PaymentMethods + - name: Payment Methods description: Payment method CRUD and archive flows - name: Payments description: Quotation and payment orchestration diff --git a/interface/api/accounts/auth_login.yaml b/interface/api/accounts/auth_login.yaml index 34a49f97..ede85916 100644 --- a/interface/api/accounts/auth_login.yaml +++ b/interface/api/accounts/auth_login.yaml @@ -1,6 +1,9 @@ post: tags: [Accounts, Auth] summary: Login using email/password and receive pending verification token + description: | + Validates account credentials and returns a short-lived `pendingToken`. + This endpoint does not return final access/refresh tokens; complete verification flow via `/verification/verify`. operationId: accountsLogin requestBody: $ref: ./bodies/auth.yaml#/components/requestBodies/LoginBody diff --git a/interface/api/accounts/auth_refresh.yaml b/interface/api/accounts/auth_refresh.yaml index 7f573d17..2822daaa 100644 --- a/interface/api/accounts/auth_refresh.yaml +++ b/interface/api/accounts/auth_refresh.yaml @@ -1,6 +1,9 @@ post: tags: [Accounts, Auth] summary: Refresh access token by refresh token + description: | + Validates refresh token + session identifiers and issues a new access token. + Use this endpoint when refresh token stays the same. operationId: accountsRefreshAccessToken requestBody: $ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody diff --git a/interface/api/accounts/auth_rotate.yaml b/interface/api/accounts/auth_rotate.yaml index 2cb6debc..9515e4dd 100644 --- a/interface/api/accounts/auth_rotate.yaml +++ b/interface/api/accounts/auth_rotate.yaml @@ -1,6 +1,9 @@ post: tags: [Accounts, Auth] summary: Rotate refresh token and issue new access/refresh tokens + description: | + Validates refresh token + session identifiers and returns a new token pair. + Use this endpoint when replacing both access and refresh tokens. operationId: accountsRotateRefreshToken requestBody: $ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody diff --git a/interface/api/organizations/get.yaml b/interface/api/organizations/get.yaml index 02f57615..c93ed7a4 100644 --- a/interface/api/organizations/get.yaml +++ b/interface/api/organizations/get.yaml @@ -1,6 +1,7 @@ get: tags: [Organizations] summary: Get organization by reference + description: Fetches a single organization available to the authenticated account. operationId: organizationsGet security: - bearerAuth: [] diff --git a/interface/api/organizations/root.yaml b/interface/api/organizations/root.yaml index 4329ae4d..7a00d19c 100644 --- a/interface/api/organizations/root.yaml +++ b/interface/api/organizations/root.yaml @@ -1,6 +1,7 @@ get: tags: [Organizations] summary: List organizations of current account + description: Returns organizations the authenticated account can access. operationId: organizationsList security: - bearerAuth: [] diff --git a/interface/api/parameters/archived.yaml b/interface/api/parameters/archived.yaml index 02c370ef..fb8af8ca 100644 --- a/interface/api/parameters/archived.yaml +++ b/interface/api/parameters/archived.yaml @@ -4,5 +4,6 @@ components: name: archived in: query required: false + description: Filter by archive flag. `true` returns archived records, `false` returns active records. schema: type: boolean diff --git a/interface/api/parameters/cascade.yaml b/interface/api/parameters/cascade.yaml index bdaf7858..4077d851 100644 --- a/interface/api/parameters/cascade.yaml +++ b/interface/api/parameters/cascade.yaml @@ -4,5 +4,6 @@ components: name: cascade in: query required: false + description: If `true`, apply operation to dependent objects where cascade is supported. schema: type: boolean diff --git a/interface/api/parameters/cursor.yaml b/interface/api/parameters/cursor.yaml index f4f0f7b8..15252a1a 100644 --- a/interface/api/parameters/cursor.yaml +++ b/interface/api/parameters/cursor.yaml @@ -4,5 +4,6 @@ components: name: cursor in: query required: false + description: Opaque cursor from a previous page response (`page.next_cursor`). schema: type: string diff --git a/interface/api/parameters/destination_ref.yaml b/interface/api/parameters/destination_ref.yaml index 3d8cc267..82a00a81 100644 --- a/interface/api/parameters/destination_ref.yaml +++ b/interface/api/parameters/destination_ref.yaml @@ -4,5 +4,6 @@ components: name: destination_ref in: query required: false + description: Optional destination endpoint reference filter (service-specific usage). schema: type: string diff --git a/interface/api/parameters/filter_states.yaml b/interface/api/parameters/filter_states.yaml index 821b60cb..1c1d34fd 100644 --- a/interface/api/parameters/filter_states.yaml +++ b/interface/api/parameters/filter_states.yaml @@ -4,5 +4,8 @@ components: name: filter_states in: query required: false + description: | + Additional payment state filter. Accepts one value or comma-separated values. + Same semantics as `state`/`states`. schema: type: string diff --git a/interface/api/parameters/limit.yaml b/interface/api/parameters/limit.yaml index fe30c130..71fa974f 100644 --- a/interface/api/parameters/limit.yaml +++ b/interface/api/parameters/limit.yaml @@ -3,9 +3,9 @@ components: Limit: name: limit in: query - description: Max number of items to return. + description: Max number of items to return. Parsed as non-negative int64. required: false schema: type: integer - format: int32 + format: int64 minimum: 0 diff --git a/interface/api/parameters/offset.yaml b/interface/api/parameters/offset.yaml index f9d1bc60..03b8b7cb 100644 --- a/interface/api/parameters/offset.yaml +++ b/interface/api/parameters/offset.yaml @@ -3,9 +3,9 @@ components: Offset: name: offset in: query - description: Number of items to skip. + description: Number of items to skip. Parsed as non-negative int64. required: false schema: type: integer - format: int32 + format: int64 minimum: 0 diff --git a/interface/api/parameters/org_ref.yaml b/interface/api/parameters/org_ref.yaml index de524623..289630b9 100644 --- a/interface/api/parameters/org_ref.yaml +++ b/interface/api/parameters/org_ref.yaml @@ -4,5 +4,6 @@ components: name: org_ref in: path required: true + description: Organization reference in BFF route format (Mongo ObjectId, 24 hex chars). schema: $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/organizations_ref.yaml b/interface/api/parameters/organizations_ref.yaml index 7f2c7e6c..668d3223 100644 --- a/interface/api/parameters/organizations_ref.yaml +++ b/interface/api/parameters/organizations_ref.yaml @@ -4,5 +4,6 @@ components: name: organizations_ref in: path required: true + description: Organization reference used by payments/payment-methods/recipients routes. 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 index f8707b45..38ded8fa 100644 --- a/interface/api/parameters/payment_methods_ref.yaml +++ b/interface/api/parameters/payment_methods_ref.yaml @@ -1,8 +1,9 @@ components: parameters: - PaymentMethodsRef: + Payment MethodsRef: name: payment_methods_ref in: path required: true + description: Payment method reference (Mongo ObjectId, 24 hex chars). schema: $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/recipients_ref.yaml b/interface/api/parameters/recipients_ref.yaml index 8808f21e..a679b628 100644 --- a/interface/api/parameters/recipients_ref.yaml +++ b/interface/api/parameters/recipients_ref.yaml @@ -4,5 +4,6 @@ components: name: recipients_ref in: path required: true + description: Recipient reference (Mongo ObjectId, 24 hex chars). schema: $ref: ../../models/objectid.yaml#/components/schemas/ObjectId diff --git a/interface/api/parameters/source_ref.yaml b/interface/api/parameters/source_ref.yaml index a7f01187..4d2c8d43 100644 --- a/interface/api/parameters/source_ref.yaml +++ b/interface/api/parameters/source_ref.yaml @@ -4,5 +4,6 @@ components: name: source_ref in: query required: false + description: Optional source endpoint reference filter (service-specific usage). schema: type: string diff --git a/interface/api/parameters/state.yaml b/interface/api/parameters/state.yaml index 36e604fe..cb05776d 100644 --- a/interface/api/parameters/state.yaml +++ b/interface/api/parameters/state.yaml @@ -4,5 +4,8 @@ components: name: state in: query required: false + description: | + Payment state filter. Accepts aliases like `accepted`, `settled`, `failed` + or canonical values like `orchestration_state_created`. schema: type: string diff --git a/interface/api/parameters/states.yaml b/interface/api/parameters/states.yaml index b85cfd82..96d672d3 100644 --- a/interface/api/parameters/states.yaml +++ b/interface/api/parameters/states.yaml @@ -4,5 +4,7 @@ components: name: states in: query required: false + description: | + Multi-state filter. Provide a comma-separated list with same accepted values as `state`. schema: type: string diff --git a/interface/api/payment_methods/archive.yaml b/interface/api/payment_methods/archive.yaml index 31a48580..d89b6fce 100644 --- a/interface/api/payment_methods/archive.yaml +++ b/interface/api/payment_methods/archive.yaml @@ -1,15 +1,17 @@ get: - tags: [PaymentMethods] + tags: [Payment Methods] summary: Archive/unarchive payment method + description: Sets payment method archive state by `payment_methods_ref` and required `archived` query parameter. operationId: paymentMethodsArchive security: - bearerAuth: [] parameters: - $ref: ../parameters/organizations_ref.yaml#/components/parameters/OrganizationsRef - - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/Payment MethodsRef - name: archived in: query required: true + description: Target archive value to set on the payment method. schema: type: boolean - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade @@ -24,7 +26,7 @@ get: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': diff --git a/interface/api/payment_methods/create.yaml b/interface/api/payment_methods/create.yaml index f64dd384..660cebe2 100644 --- a/interface/api/payment_methods/create.yaml +++ b/interface/api/payment_methods/create.yaml @@ -1,6 +1,7 @@ post: - tags: [PaymentMethods] + tags: [Payment Methods] summary: Create payment method + description: Creates a payment method in the organization identified by `organizations_ref`. operationId: paymentMethodsCreate security: - bearerAuth: [] @@ -19,7 +20,7 @@ post: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': diff --git a/interface/api/payment_methods/list.yaml b/interface/api/payment_methods/list.yaml index 3f0e2ece..2abbb7f0 100644 --- a/interface/api/payment_methods/list.yaml +++ b/interface/api/payment_methods/list.yaml @@ -1,6 +1,9 @@ get: - tags: [PaymentMethods] + tags: [Payment Methods] summary: List payment methods for recipient + description: | + Returns payment methods available for `recipients_ref` within `organizations_ref`. + Supports offset pagination and optional archive filtering. operationId: paymentMethodsList security: - bearerAuth: [] @@ -21,7 +24,7 @@ get: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': diff --git a/interface/api/payment_methods/object.yaml b/interface/api/payment_methods/object.yaml index 6ae62feb..5d357c99 100644 --- a/interface/api/payment_methods/object.yaml +++ b/interface/api/payment_methods/object.yaml @@ -1,11 +1,12 @@ get: - tags: [PaymentMethods] + tags: [Payment Methods] summary: Get payment method + description: Returns payment method by `payment_methods_ref`. operationId: paymentMethodsGet security: - bearerAuth: [] parameters: - - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/Payment MethodsRef responses: '200': description: Payment method data @@ -17,7 +18,7 @@ get: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': @@ -30,13 +31,14 @@ get: $ref: ../response/operation.yaml#/components/responses/InternalServerError delete: - tags: [PaymentMethods] + tags: [Payment Methods] summary: Delete payment method + description: Deletes payment method by reference. Use `cascade=true` to remove dependent objects when supported. operationId: paymentMethodsDelete security: - bearerAuth: [] parameters: - - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/PaymentMethodsRef + - $ref: ../parameters/payment_methods_ref.yaml#/components/parameters/Payment MethodsRef - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade responses: '200': @@ -49,7 +51,7 @@ delete: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': diff --git a/interface/api/payment_methods/response/payment_method.yaml b/interface/api/payment_methods/response/payment_method.yaml index 2389bcd4..fbf9c235 100644 --- a/interface/api/payment_methods/response/payment_method.yaml +++ b/interface/api/payment_methods/response/payment_method.yaml @@ -1,6 +1,6 @@ components: schemas: - PaymentMethodsAuthData: + Payment MethodsAuthData: type: object additionalProperties: false required: diff --git a/interface/api/payment_methods/update.yaml b/interface/api/payment_methods/update.yaml index d7e0d70b..d9a846bc 100644 --- a/interface/api/payment_methods/update.yaml +++ b/interface/api/payment_methods/update.yaml @@ -1,6 +1,7 @@ put: - tags: [PaymentMethods] + tags: [Payment Methods] summary: Update payment method + description: Updates payment method fields from request payload. operationId: paymentMethodsUpdate security: - bearerAuth: [] @@ -17,7 +18,7 @@ put: - type: object properties: data: - $ref: ./response/payment_method.yaml#/components/schemas/PaymentMethodsAuthData + $ref: ./response/payment_method.yaml#/components/schemas/Payment MethodsAuthData '400': $ref: ../response/operation.yaml#/components/responses/BadRequest '401': diff --git a/interface/api/payments/by_multiquote.yaml b/interface/api/payments/by_multiquote.yaml index 40e43035..32bd189f 100644 --- a/interface/api/payments/by_multiquote.yaml +++ b/interface/api/payments/by_multiquote.yaml @@ -1,6 +1,7 @@ post: tags: [Payments] summary: Initiate payment batch by quote reference + description: Executes batch payment from a previously created multi-quote reference. operationId: paymentsInitiateBatchByQuote security: - bearerAuth: [] diff --git a/interface/api/payments/by_quote.yaml b/interface/api/payments/by_quote.yaml index 7f6adc27..e779215e 100644 --- a/interface/api/payments/by_quote.yaml +++ b/interface/api/payments/by_quote.yaml @@ -1,6 +1,7 @@ post: tags: [Payments] summary: Initiate payment using quote reference + description: Executes one payment from an existing quote reference (`quoteRef` required, `intent` forbidden). operationId: paymentsInitiateByQuote security: - bearerAuth: [] diff --git a/interface/api/payments/immediate.yaml b/interface/api/payments/immediate.yaml index 6952d188..cbffd4d5 100644 --- a/interface/api/payments/immediate.yaml +++ b/interface/api/payments/immediate.yaml @@ -1,6 +1,7 @@ post: tags: [Payments] summary: Initiate payment from immediate intent + description: Creates quote and executes a single payment in one call (request must include `intent`). operationId: paymentsInitiateImmediate security: - bearerAuth: [] diff --git a/interface/api/payments/list.yaml b/interface/api/payments/list.yaml index 5e30aa31..3a26d51d 100644 --- a/interface/api/payments/list.yaml +++ b/interface/api/payments/list.yaml @@ -1,6 +1,9 @@ get: tags: [Payments] summary: List payments in organization + description: | + Returns organization payments with cursor pagination and optional filters. + State filters accept aliases (`accepted`, `settled`, `failed`, etc.) or canonical orchestration states. operationId: paymentsList security: - bearerAuth: [] @@ -11,17 +14,20 @@ get: - name: quotation_ref in: query required: false + description: Filter by quotation reference used for execution. schema: type: string - name: created_from in: query required: false + description: Include payments created at or after this RFC3339 timestamp. schema: type: string format: date-time - name: created_to in: query required: false + description: Include payments created before this RFC3339 timestamp (must be after `created_from`). schema: type: string format: date-time diff --git a/interface/api/payments/multiquote.yaml b/interface/api/payments/multiquote.yaml index cfb7588a..53081856 100644 --- a/interface/api/payments/multiquote.yaml +++ b/interface/api/payments/multiquote.yaml @@ -1,6 +1,7 @@ post: tags: [Payments] summary: Quote multiple payment intents + description: Calculates a batch quote for multiple payment intents in one request. operationId: paymentsMultiQuote security: - bearerAuth: [] diff --git a/interface/api/payments/quote.yaml b/interface/api/payments/quote.yaml index 8fb5faaa..115be823 100644 --- a/interface/api/payments/quote.yaml +++ b/interface/api/payments/quote.yaml @@ -1,6 +1,7 @@ post: tags: [Payments] summary: Quote single payment intent + description: Calculates quote for one payment intent without executing payment. operationId: paymentsQuote security: - bearerAuth: [] diff --git a/interface/api/payments/response/payment.yaml b/interface/api/payments/response/payment.yaml index b07fd49c..a1e4d7e8 100644 --- a/interface/api/payments/response/payment.yaml +++ b/interface/api/payments/response/payment.yaml @@ -31,9 +31,7 @@ components: type: string quoteRef: type: string - aggregate: - $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentQuoteAggregate - quotes: + items: type: array items: $ref: ../../../models/payment/payment.yaml#/components/schemas/PaymentQuote @@ -43,6 +41,7 @@ components: additionalProperties: false required: - accessToken + - payments properties: accessToken: $ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData diff --git a/interface/api/recipients/archive.yaml b/interface/api/recipients/archive.yaml index e1a29044..4d3cb3f3 100644 --- a/interface/api/recipients/archive.yaml +++ b/interface/api/recipients/archive.yaml @@ -1,6 +1,7 @@ get: tags: [Recipients] summary: Archive/unarchive recipient + description: Sets recipient archive state by `recipients_ref` and required `archived` query parameter. operationId: recipientsArchive security: - bearerAuth: [] @@ -10,6 +11,7 @@ get: - name: archived in: query required: true + description: Target archive value to set on the recipient. schema: type: boolean - $ref: ../parameters/cascade.yaml#/components/parameters/Cascade diff --git a/interface/api/recipients/create.yaml b/interface/api/recipients/create.yaml index a68ab83b..ada49a3b 100644 --- a/interface/api/recipients/create.yaml +++ b/interface/api/recipients/create.yaml @@ -1,6 +1,7 @@ post: tags: [Recipients] summary: Create recipient + description: Creates a recipient inside the organization identified by `org_ref`. operationId: recipientsCreate security: - bearerAuth: [] diff --git a/interface/api/recipients/list.yaml b/interface/api/recipients/list.yaml index d9b4aacb..c71325cd 100644 --- a/interface/api/recipients/list.yaml +++ b/interface/api/recipients/list.yaml @@ -1,6 +1,9 @@ get: tags: [Recipients] summary: List recipients + description: | + Returns recipients for the specified organization context. + Supports offset pagination and optional archive filtering. operationId: recipientsList security: - bearerAuth: [] diff --git a/interface/api/recipients/object.yaml b/interface/api/recipients/object.yaml index 329f642c..091e5c7c 100644 --- a/interface/api/recipients/object.yaml +++ b/interface/api/recipients/object.yaml @@ -1,6 +1,7 @@ get: tags: [Recipients] summary: Get recipient by reference + description: Returns a recipient by `recipients_ref`. operationId: recipientsGet security: - bearerAuth: [] @@ -32,6 +33,7 @@ get: delete: tags: [Recipients] summary: Delete recipient + description: Deletes recipient by reference. Use `cascade=true` to remove dependent objects when supported. operationId: recipientsDelete security: - bearerAuth: [] diff --git a/interface/api/recipients/update.yaml b/interface/api/recipients/update.yaml index 7b877e20..53ef62ae 100644 --- a/interface/api/recipients/update.yaml +++ b/interface/api/recipients/update.yaml @@ -1,6 +1,7 @@ put: tags: [Recipients] summary: Update recipient + description: Updates recipient fields from request payload. operationId: recipientsUpdate security: - bearerAuth: [] diff --git a/interface/api/verification/create.yaml b/interface/api/verification/create.yaml index ad7bda97..9dd4e979 100644 --- a/interface/api/verification/create.yaml +++ b/interface/api/verification/create.yaml @@ -1,6 +1,9 @@ post: tags: [Verification, Auth] summary: Request verification code + description: | + Creates a verification challenge for the specified purpose/target. + For `purpose=login`, request must be authorized with a pending account token. operationId: verificationRequestCode security: - bearerAuth: [] diff --git a/interface/api/verification/request/verification.yaml b/interface/api/verification/request/verification.yaml index 52cd1e94..7dcb84f4 100644 --- a/interface/api/verification/request/verification.yaml +++ b/interface/api/verification/request/verification.yaml @@ -5,7 +5,6 @@ components: additionalProperties: false required: - purpose - - idempotencyKey properties: purpose: type: string diff --git a/interface/api/verification/resend.yaml b/interface/api/verification/resend.yaml index d2376d81..d2ee0fc1 100644 --- a/interface/api/verification/resend.yaml +++ b/interface/api/verification/resend.yaml @@ -1,6 +1,9 @@ post: tags: [Verification, Auth] summary: Resend verification code + description: | + Re-issues a verification challenge using the same request shape as `/verification`. + Cooldown and retry limits are enforced by backend verification storage policy. operationId: verificationResendCode security: - bearerAuth: [] diff --git a/interface/api/verification/verify.yaml b/interface/api/verification/verify.yaml index 92daba31..cf26d7b3 100644 --- a/interface/api/verification/verify.yaml +++ b/interface/api/verification/verify.yaml @@ -1,6 +1,9 @@ post: tags: [Verification, Auth] summary: Verify code and complete pending flow + description: | + Verifies submitted code and consumes verification token. + For login purpose, returns full auth payload (access + refresh tokens); for other purposes returns operation result. operationId: verificationVerifyCode security: - bearerAuth: [] diff --git a/interface/external/endpoint_type.yaml b/interface/external/endpoint_type.yaml index 2d291924..6e26825b 100644 --- a/interface/external/endpoint_type.yaml +++ b/interface/external/endpoint_type.yaml @@ -8,3 +8,4 @@ components: - cryptoAddress - card - cardToken + - wallet diff --git a/interface/external/fx_side.yaml b/interface/external/fx_side.yaml index 62f90f34..639e6f28 100644 --- a/interface/external/fx_side.yaml +++ b/interface/external/fx_side.yaml @@ -3,6 +3,5 @@ components: 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 index ff38cecc..06f68ef2 100644 --- a/interface/external/payment_kind.yaml +++ b/interface/external/payment_kind.yaml @@ -3,7 +3,6 @@ components: PaymentKind: type: string enum: - - unspecified - payout - internal_transfer - fx_conversion diff --git a/interface/external/payment_state.yaml b/interface/external/payment_state.yaml index 0c298cdb..9685cd8e 100644 --- a/interface/external/payment_state.yaml +++ b/interface/external/payment_state.yaml @@ -3,10 +3,9 @@ components: 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 + - orchestration_state_unspecified + - orchestration_state_created + - orchestration_state_executing + - orchestration_state_needs_attention + - orchestration_state_settled + - orchestration_state_failed diff --git a/interface/models/payment/payment.yaml b/interface/models/payment/payment.yaml index c9a6c764..0044b9cc 100644 --- a/interface/models/payment/payment.yaml +++ b/interface/models/payment/payment.yaml @@ -13,6 +13,9 @@ components: LedgerEndpoint: type: object + additionalProperties: false + required: + - ledger_account_ref properties: ledger_account_ref: type: string @@ -21,6 +24,9 @@ components: ManagedWalletEndpoint: type: object + additionalProperties: false + required: + - managed_wallet_ref properties: managed_wallet_ref: type: string @@ -29,6 +35,10 @@ components: ExternalChainEndpoint: type: object + additionalProperties: false + required: + - asset + - address properties: asset: $ref: ./payment.yaml#/components/schemas/Asset @@ -39,6 +49,9 @@ components: CardEndpoint: type: object + additionalProperties: false + required: + - pan properties: pan: type: string @@ -49,20 +62,34 @@ components: exp_month: type: integer format: int32 + minimum: 0 exp_year: type: integer format: int32 + minimum: 0 country: type: string CardTokenEndpoint: type: object + additionalProperties: false + required: + - token properties: token: type: string masked_pan: type: string + WalletEndpoint: + type: object + additionalProperties: false + required: + - walletId + properties: + walletId: + type: string + Endpoint: type: object additionalProperties: false @@ -73,8 +100,13 @@ components: type: $ref: ../../external/endpoint_type.yaml#/components/schemas/EndpointType data: - type: object - additionalProperties: true + oneOf: + - $ref: ./payment.yaml#/components/schemas/LedgerEndpoint + - $ref: ./payment.yaml#/components/schemas/ManagedWalletEndpoint + - $ref: ./payment.yaml#/components/schemas/ExternalChainEndpoint + - $ref: ./payment.yaml#/components/schemas/CardEndpoint + - $ref: ./payment.yaml#/components/schemas/CardTokenEndpoint + - $ref: ./payment.yaml#/components/schemas/WalletEndpoint metadata: type: object additionalProperties: @@ -121,6 +153,7 @@ components: type: object additionalProperties: false required: + - pair - side properties: pair: @@ -159,8 +192,12 @@ components: $ref: ./payment.yaml#/components/schemas/FxIntent settlement_mode: $ref: ../../external/settlement_mode.yaml#/components/schemas/SettlementMode - settlement_currency: + fee_treatment: type: string + enum: + - unspecified + - add_to_source + - deduct_from_destination attributes: type: object additionalProperties: @@ -168,27 +205,6 @@ components: 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 @@ -206,6 +222,26 @@ components: additionalProperties: type: string + QuoteFees: + type: object + additionalProperties: false + properties: + lines: + type: array + items: + $ref: ./payment.yaml#/components/schemas/FeeLine + + QuoteAmounts: + type: object + additionalProperties: false + properties: + sourcePrincipal: + $ref: ../common/money.yaml#/components/schemas/Money + sourceDebitTotal: + $ref: ../common/money.yaml#/components/schemas/Money + destinationSettlement: + $ref: ../common/money.yaml#/components/schemas/Money + FxQuote: type: object additionalProperties: false @@ -237,22 +273,43 @@ components: firm: type: boolean - PaymentQuoteAggregate: + PaymentQuote: 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 + quoteRef: + type: string + intentRef: + type: string + amounts: + $ref: ./payment.yaml#/components/schemas/QuoteAmounts + fees: + $ref: ./payment.yaml#/components/schemas/QuoteFees + fxQuote: + $ref: ./payment.yaml#/components/schemas/FxQuote + + PaymentOperation: + type: object + additionalProperties: false + properties: + stepRef: + type: string + code: + type: string + state: + type: string + label: + type: string + failureCode: + type: string + failureReason: + type: string + startedAt: + type: string + format: date-time + completedAt: + type: string + format: date-time Payment: type: object @@ -268,6 +325,10 @@ components: type: string failureReason: type: string + operations: + type: array + items: + $ref: ./payment.yaml#/components/schemas/PaymentOperation lastQuote: $ref: ./payment.yaml#/components/schemas/PaymentQuote createdAt: