diff --git a/.gitignore b/.gitignore index ea160f8f81..ff0401f7c7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ worktrees # Ignore SDKS sdks -.DS_Store \ No newline at end of file +.DS_Store +openapi/node_modules \ No newline at end of file diff --git a/components/ledger/libs/otlp/http_client.go b/components/ledger/libs/otlp/http_client.go index e69c2bd3d2..32a8b14ace 100644 --- a/components/ledger/libs/otlp/http_client.go +++ b/components/ledger/libs/otlp/http_client.go @@ -21,7 +21,7 @@ func (t WithBodiesTracingHTTPTransport) RoundTrip(req *http.Request) (*http.Resp } rsp, err := t.underlying.RoundTrip(req) - if t.debug || rsp.StatusCode >= 400 { + if t.debug || err != nil || rsp.StatusCode >= 400 { span := trace.SpanFromContext(req.Context()) span.SetAttributes(attribute.String("raw-request", string(rawRequest))) if err != nil { diff --git a/components/operator/internal/modules/module.go b/components/operator/internal/modules/module.go index 51fcc19c5d..057fc94d1e 100644 --- a/components/operator/internal/modules/module.go +++ b/components/operator/internal/modules/module.go @@ -5,13 +5,11 @@ import ( "fmt" "sort" - "golang.org/x/mod/semver" - appsv1 "k8s.io/api/apps/v1" - - "github.com/pkg/errors" - "github.com/formancehq/operator/apis/stack/v1beta3" "github.com/formancehq/stack/libs/go-libs/collectionutils" + "github.com/pkg/errors" + "golang.org/x/mod/semver" + appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -27,7 +25,6 @@ type Cron struct { type DatabaseMigration struct { // optional, will be the commit hash if empty in the kube object - Name string Shutdown bool Command []string AdditionalEnv func(config ReconciliationConfig) []EnvVar @@ -359,10 +356,13 @@ func (r *moduleReconciler) runPreUpgradeMigration(ctx context.Context, module Mo func (r *moduleReconciler) runDatabaseMigration(ctx context.Context, version string, migration DatabaseMigration, postgresConfig v1beta3.PostgresConfig) (bool, error) { logger := log.FromContext(ctx) - name := fmt.Sprintf("%s-%s-db-migration", r.module.Name(), version) - if migration.Name != "" { - name = fmt.Sprintf("%s-%s-db-migration", r.module.Name(), migration.Name) + if !semver.IsValid(version) { + // Commit hash + if len(version) > 7 { + version = version[:7] + } } + name := fmt.Sprintf("%s-%s-db-migration", r.module.Name(), version) return r.RunJob(ctx, name, func() error { if migration.Shutdown { diff --git a/components/operator/internal/modules/reconciliation/handler.go b/components/operator/internal/modules/reconciliation/handler.go index eac1fd4a7c..1ce4123728 100644 --- a/components/operator/internal/modules/reconciliation/handler.go +++ b/components/operator/internal/modules/reconciliation/handler.go @@ -24,7 +24,6 @@ func (o module) Versions() map[string]modules.Version { return map[string]modules.Version{ "v0.0.0": { DatabaseMigration: &modules.DatabaseMigration{ - Name: "v0.0.0", Shutdown: false, Command: []string{"migrate", "up"}, AdditionalEnv: func(config modules.ReconciliationConfig) []modules.EnvVar { diff --git a/ee/reconciliation/internal/api/reconciliation.go b/ee/reconciliation/internal/api/reconciliation.go index 3022b41803..f0b57f5c25 100644 --- a/ee/reconciliation/internal/api/reconciliation.go +++ b/ee/reconciliation/internal/api/reconciliation.go @@ -17,14 +17,15 @@ import ( ) type reconciliationResponse struct { - ID string `json:"id"` - PolicyID string `json:"policyID"` - CreatedAt time.Time `json:"createdAt"` - ReconciledAt time.Time `json:"reconciledAt"` - Status string `json:"status"` - PaymentsBalances map[string]*big.Int `json:"paymentsBalances"` - LedgerBalances map[string]*big.Int `json:"ledgerBalances"` - Error string `json:"error"` + ID string `json:"id"` + PolicyID string `json:"policyID"` + CreatedAt time.Time `json:"createdAt"` + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `json:"reconciledAtPayments"` + Status string `json:"status"` + PaymentsBalances map[string]*big.Int `json:"paymentsBalances"` + LedgerBalances map[string]*big.Int `json:"ledgerBalances"` + Error string `json:"error"` } func reconciliationHandler(b backend.Backend) http.HandlerFunc { @@ -54,14 +55,15 @@ func reconciliationHandler(b backend.Backend) http.HandlerFunc { } data := &reconciliationResponse{ - ID: res.ID.String(), - PolicyID: policyID, - CreatedAt: res.CreatedAt, - ReconciledAt: res.ReconciledAt, - Status: res.Status.String(), - PaymentsBalances: res.PaymentsBalances, - LedgerBalances: res.LedgerBalances, - Error: res.Error, + ID: res.ID.String(), + PolicyID: policyID, + CreatedAt: res.CreatedAt, + ReconciledAtLedger: res.ReconciledAtLedger, + ReconciledAtPayments: res.ReconciledAtPayments, + Status: res.Status.String(), + PaymentsBalances: res.PaymentsBalances, + LedgerBalances: res.LedgerBalances, + Error: res.Error, } api.Ok(w, data) @@ -79,14 +81,15 @@ func getReconciliationHandler(b backend.Backend) http.HandlerFunc { } data := &reconciliationResponse{ - ID: res.ID.String(), - PolicyID: res.PolicyID.String(), - CreatedAt: res.CreatedAt, - ReconciledAt: res.ReconciledAt, - Status: res.Status.String(), - PaymentsBalances: res.PaymentsBalances, - LedgerBalances: res.LedgerBalances, - Error: res.Error, + ID: res.ID.String(), + PolicyID: res.PolicyID.String(), + CreatedAt: res.CreatedAt, + ReconciledAtLedger: res.ReconciledAtLedger, + ReconciledAtPayments: res.ReconciledAtPayments, + Status: res.Status.String(), + PaymentsBalances: res.PaymentsBalances, + LedgerBalances: res.LedgerBalances, + Error: res.Error, } api.Ok(w, data) diff --git a/ee/reconciliation/internal/api/reconciliation_test.go b/ee/reconciliation/internal/api/reconciliation_test.go index df9d278d2f..2c784871af 100644 --- a/ee/reconciliation/internal/api/reconciliation_test.go +++ b/ee/reconciliation/internal/api/reconciliation_test.go @@ -40,31 +40,34 @@ func TestReconciliation(t *testing.T) { name: "nominal", policyID: policyID.String(), req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, }, { name: "missing body", policyID: policyID.String(), res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, expectedStatusCode: http.StatusBadRequest, expectedErrorCode: ErrMissingOrInvalidBody, @@ -73,54 +76,100 @@ func TestReconciliation(t *testing.T) { name: "invalid body", policyID: policyID.String(), req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, invalidBody: true, expectedStatusCode: http.StatusBadRequest, expectedErrorCode: ErrMissingOrInvalidBody, }, { - name: "missing at", + name: "missing at ledger", policyID: policyID.String(), - req: &service.ReconciliationRequest{}, + req: &service.ReconciliationRequest{ + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + }, + res: &models.Reconciliation{ + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", + }, + expectedStatusCode: http.StatusBadRequest, + expectedErrorCode: ErrValidation, + }, + { + name: "zero time.Time ledger", + policyID: policyID.String(), + req: &service.ReconciliationRequest{ + ReconciledAtLedger: time.Time{}, + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + }, + res: &models.Reconciliation{ + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Time{}, + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", + }, + expectedStatusCode: http.StatusBadRequest, + expectedErrorCode: ErrValidation, + }, + { + name: "missing at payments", + policyID: policyID.String(), + req: &service.ReconciliationRequest{ + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, expectedStatusCode: http.StatusBadRequest, expectedErrorCode: ErrValidation, }, { - name: "zero time.Time", + name: "zero time.Time ledger", policyID: policyID.String(), req: &service.ReconciliationRequest{ - At: time.Time{}, + ReconciledAtLedger: time.Time{}, + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Time{}, + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, expectedStatusCode: http.StatusBadRequest, expectedErrorCode: ErrValidation, @@ -129,17 +178,19 @@ func TestReconciliation(t *testing.T) { name: "service error validation", policyID: policyID.String(), req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, serviceError: service.ErrValidation, expectedStatusCode: http.StatusBadRequest, @@ -149,17 +200,19 @@ func TestReconciliation(t *testing.T) { name: "service error invalid id", policyID: "invalid", req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, serviceError: service.ErrInvalidID, expectedStatusCode: http.StatusBadRequest, @@ -169,17 +222,19 @@ func TestReconciliation(t *testing.T) { name: "service error invalid ID", policyID: "invalid", req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, serviceError: service.ErrInvalidID, expectedStatusCode: http.StatusBadRequest, @@ -189,17 +244,19 @@ func TestReconciliation(t *testing.T) { name: "storage error not found", policyID: "invalid", req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, serviceError: storage.ErrNotFound, expectedStatusCode: http.StatusNotFound, @@ -209,17 +266,19 @@ func TestReconciliation(t *testing.T) { name: "service error other error", policyID: policyID.String(), req: &service.ReconciliationRequest{ - At: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), }, res: &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policyID, - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, - PaymentsBalances: map[string]*big.Int{}, - LedgerBalances: map[string]*big.Int{}, - Error: "", + ID: uuid.New(), + PolicyID: policyID, + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, + PaymentsBalances: map[string]*big.Int{}, + LedgerBalances: map[string]*big.Int{}, + Error: "", }, serviceError: errors.New("some error"), expectedStatusCode: http.StatusInternalServerError, @@ -237,14 +296,15 @@ func TestReconciliation(t *testing.T) { } expectedReconciliationResponse := &reconciliationResponse{ - ID: testCase.res.ID.String(), - PolicyID: testCase.res.PolicyID.String(), - CreatedAt: testCase.res.CreatedAt, - ReconciledAt: testCase.res.ReconciledAt, - Status: testCase.res.Status.String(), - PaymentsBalances: testCase.res.PaymentsBalances, - LedgerBalances: testCase.res.LedgerBalances, - Error: testCase.res.Error, + ID: testCase.res.ID.String(), + PolicyID: testCase.res.PolicyID.String(), + CreatedAt: testCase.res.CreatedAt, + ReconciledAtLedger: testCase.res.ReconciledAtLedger, + ReconciledAtPayments: testCase.res.ReconciledAtPayments, + Status: testCase.res.Status.String(), + PaymentsBalances: testCase.res.PaymentsBalances, + LedgerBalances: testCase.res.LedgerBalances, + Error: testCase.res.Error, } backend, mockService := newTestingBackend(t) @@ -343,11 +403,12 @@ func TestGetReconciliation(t *testing.T) { } getReconciliationResponse := &models.Reconciliation{ - ID: testCase.id, - PolicyID: uuid.New(), - CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - ReconciledAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - Status: models.ReconciliationOK, + ID: testCase.id, + PolicyID: uuid.New(), + CreatedAt: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtLedger: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + ReconciledAtPayments: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + Status: models.ReconciliationOK, LedgerBalances: map[string]*big.Int{ "USD/2": big.NewInt(100), "EUR/2": big.NewInt(200), @@ -360,14 +421,15 @@ func TestGetReconciliation(t *testing.T) { } expectedReconciliationResponse := &reconciliationResponse{ - ID: getReconciliationResponse.ID.String(), - PolicyID: getReconciliationResponse.PolicyID.String(), - CreatedAt: getReconciliationResponse.CreatedAt, - ReconciledAt: getReconciliationResponse.ReconciledAt, - Status: getReconciliationResponse.Status.String(), - PaymentsBalances: getReconciliationResponse.PaymentsBalances, - LedgerBalances: getReconciliationResponse.LedgerBalances, - Error: getReconciliationResponse.Error, + ID: getReconciliationResponse.ID.String(), + PolicyID: getReconciliationResponse.PolicyID.String(), + CreatedAt: getReconciliationResponse.CreatedAt, + ReconciledAtLedger: getReconciliationResponse.ReconciledAtLedger, + ReconciledAtPayments: getReconciliationResponse.ReconciledAtPayments, + Status: getReconciliationResponse.Status.String(), + PaymentsBalances: getReconciliationResponse.PaymentsBalances, + LedgerBalances: getReconciliationResponse.LedgerBalances, + Error: getReconciliationResponse.Error, } backend, mockService := newTestingBackend(t) diff --git a/ee/reconciliation/internal/api/service/reconciliation.go b/ee/reconciliation/internal/api/service/reconciliation.go index 22985538cb..85e24e51a1 100644 --- a/ee/reconciliation/internal/api/service/reconciliation.go +++ b/ee/reconciliation/internal/api/service/reconciliation.go @@ -3,6 +3,7 @@ package service import ( "context" "fmt" + "io" "math/big" "time" @@ -16,16 +17,25 @@ import ( ) type ReconciliationRequest struct { - At time.Time `json:"at"` + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `json:"reconciledAtPayment"` } func (r *ReconciliationRequest) Validate() error { - if r.At.IsZero() { - return errors.New("missing at") + if r.ReconciledAtLedger.IsZero() { + return errors.New("missing reconciledAtLedger") } - if r.At.After(time.Now()) { - return errors.New("at must be in the past") + if r.ReconciledAtLedger.After(time.Now()) { + return errors.New("reconciledAtLedger must be in the past") + } + + if r.ReconciledAtPayments.IsZero() { + return errors.New("missing reconciledAtPayments") + } + + if r.ReconciledAtPayments.After(time.Now()) { + return errors.New("ReconciledAtPayments must be in the past") } return nil @@ -46,14 +56,14 @@ func (s *Service) Reconciliation(ctx context.Context, policyID string, req *Reco var paymentBalance map[string]*big.Int eg.Go(func() error { var err error - paymentBalance, err = s.getPaymentPoolBalance(ctxGroup, policy.PaymentsPoolID.String(), req.At) + paymentBalance, err = s.getPaymentPoolBalance(ctxGroup, policy.PaymentsPoolID.String(), req.ReconciledAtPayments) return err }) var ledgerBalance map[string]*big.Int eg.Go(func() error { var err error - ledgerBalance, err = s.getAccountsAggregatedBalance(ctxGroup, policy.LedgerName, policy.LedgerQuery, req.At) + ledgerBalance, err = s.getAccountsAggregatedBalance(ctxGroup, policy.LedgerName, policy.LedgerQuery, req.ReconciledAtLedger) return err }) @@ -62,13 +72,14 @@ func (s *Service) Reconciliation(ctx context.Context, policyID string, req *Reco } res := &models.Reconciliation{ - ID: uuid.New(), - PolicyID: policy.ID, - CreatedAt: time.Now().UTC(), - ReconciledAt: req.At, - Status: models.ReconciliationOK, - PaymentsBalances: paymentBalance, - LedgerBalances: ledgerBalance, + ID: uuid.New(), + PolicyID: policy.ID, + CreatedAt: time.Now().UTC(), + ReconciledAtLedger: req.ReconciledAtLedger, + ReconciledAtPayments: req.ReconciledAtPayments, + Status: models.ReconciliationOK, + PaymentsBalances: paymentBalance, + LedgerBalances: ledgerBalance, } var reconciliationError bool @@ -145,6 +156,9 @@ func (s *Service) getPaymentPoolBalance(ctx context.Context, paymentPoolID strin } if balances.StatusCode != 200 { + fmt.Println(err) + body, _ := io.ReadAll(balances.RawResponse.Body) + fmt.Println(string(body)) return nil, errors.New("failed to get pool balances") } diff --git a/ee/reconciliation/internal/models/reconciliation.go b/ee/reconciliation/internal/models/reconciliation.go index 5b681f944b..d9c42b3d08 100644 --- a/ee/reconciliation/internal/models/reconciliation.go +++ b/ee/reconciliation/internal/models/reconciliation.go @@ -22,12 +22,13 @@ func (r ReconciliationStatus) String() string { type Reconciliation struct { bun.BaseModel `bun:"reconciliations.reconciliation" json:"-"` - ID uuid.UUID `bun:",pk,nullzero" json:"id"` - PolicyID uuid.UUID `bun:",nullzero" json:"policyID"` - CreatedAt time.Time `bun:",nullzero" json:"createdAt"` - ReconciledAt time.Time `bun:",nullzero" json:"reconciledAt"` - Status ReconciliationStatus `json:"status"` - LedgerBalances map[string]*big.Int `bun:",jsonb" json:"ledgerBalances" ` - PaymentsBalances map[string]*big.Int `bun:",jsonb" json:"paymentsBalances" ` - Error string `json:"error"` + ID uuid.UUID `bun:",pk,nullzero" json:"id"` + PolicyID uuid.UUID `bun:",nullzero" json:"policyID"` + CreatedAt time.Time `bun:",nullzero" json:"createdAt"` + ReconciledAtLedger time.Time `bun:",nullzero" json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `bun:",nullzero" json:"reconciledAtPayments"` + Status ReconciliationStatus `json:"status"` + LedgerBalances map[string]*big.Int `bun:",jsonb" json:"ledgerBalances"` + PaymentsBalances map[string]*big.Int `bun:",jsonb" json:"paymentsBalances"` + Error string `json:"error"` } diff --git a/ee/reconciliation/internal/storage/migrations/migrations.go b/ee/reconciliation/internal/storage/migrations/migrations.go index bc89618989..672f8ebbe4 100644 --- a/ee/reconciliation/internal/storage/migrations/migrations.go +++ b/ee/reconciliation/internal/storage/migrations/migrations.go @@ -57,5 +57,14 @@ func registerMigrations(migrator *migrations.Migrator) { return err }, }, + migrations.Migration{ + Up: func(tx bun.Tx) error { + _, err := tx.Exec(` + ALTER TABLE reconciliations.reconciliation RENAME COLUMN reconciled_at TO reconciled_at_ledger; + ALTER TABLE reconciliations.reconciliation ADD COLUMN reconciled_at_payments timestamp with time zone; + `) + return err + }, + }, ) } diff --git a/ee/reconciliation/openapi.yaml b/ee/reconciliation/openapi.yaml index 42c913ba5e..36012c819e 100644 --- a/ee/reconciliation/openapi.yaml +++ b/ee/reconciliation/openapi.yaml @@ -319,9 +319,14 @@ components: ReconciliationRequest: type: object required: - - at + - reconciledAtLedger + - reconciledAtPayment properties: - at: + reconciledAtLedger: + type: string + format: date-time + example: "2021-01-01T00:00:00.000Z" + reconciledAtPayment: type: string format: date-time example: "2021-01-01T00:00:00.000Z" @@ -367,7 +372,8 @@ components: - id - policyID - createdAt - - reconciledAt + - reconciledAtLedger + - reconciledAtPayments - status - paymentsBalances - ledgerBalances @@ -382,7 +388,11 @@ components: type: string format: date-time example: "2021-01-01T00:00:00.000Z" - reconciledAt: + reconciledAtLedger: + type: string + format: date-time + example: "2021-01-01T00:00:00.000Z" + reconciledAtPayments: type: string format: date-time example: "2021-01-01T00:00:00.000Z" diff --git a/libs/clients/go/README.md b/libs/clients/go/README.md index f19722e6f1..b4036c137f 100755 --- a/libs/clients/go/README.md +++ b/libs/clients/go/README.md @@ -13,7 +13,7 @@ It has been generated successfully based on your OpenAPI spec. However, it is no - [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks) - [ ] ✨ When ready to productionize, delete this section from the README -# SDK Installation +## SDK Installation ```bash go get github.com/formancehq/formance-sdk-go @@ -22,8 +22,6 @@ go get github.com/formancehq/formance-sdk-go ## SDK Example Usage - - ```go package main @@ -51,14 +49,14 @@ func main() { -# Available Resources and Operations +## Available Resources and Operations -## [Formance SDK](docs/sdks/formance/README.md) +### [Formance SDK](docs/sdks/formance/README.md) * [GetVersions](docs/sdks/formance/README.md#getversions) - Show stack version information * [GetAPIAuthWellKnownOpenidConfiguration](docs/sdks/formance/README.md#getapiauthwellknownopenidconfiguration) -## [Auth](docs/sdks/auth/README.md) +### [Auth](docs/sdks/auth/README.md) * [CreateClient](docs/sdks/auth/README.md#createclient) - Create client * [CreateSecret](docs/sdks/auth/README.md#createsecret) - Add a secret to a client @@ -71,13 +69,13 @@ func main() { * [ReadUser](docs/sdks/auth/README.md#readuser) - Read user * [UpdateClient](docs/sdks/auth/README.md#updateclient) - Update client -## [Ledger](docs/sdks/ledger/README.md) +### [Ledger](docs/sdks/ledger/README.md) * [CreateLedger](docs/sdks/ledger/README.md#createledger) - Create a ledger * [GetLedger](docs/sdks/ledger/README.md#getledger) - Get a ledger * [ListLedgers](docs/sdks/ledger/README.md#listledgers) - List ledgers -## [Ledger.V2](docs/sdks/ledgerv2/README.md) +### [Ledger.V2](docs/sdks/ledgerv2/README.md) * [AddMetadataOnTransaction](docs/sdks/ledgerv2/README.md#addmetadataontransaction) - Set the metadata of a transaction by its ID * [AddMetadataToAccount](docs/sdks/ledgerv2/README.md#addmetadatatoaccount) - Add metadata to an account @@ -98,7 +96,7 @@ func main() { * [ReadStats](docs/sdks/ledgerv2/README.md#readstats) - Get statistics from a ledger * [RevertTransaction](docs/sdks/ledgerv2/README.md#reverttransaction) - Revert a ledger transaction by its ID -## [Orchestration](docs/sdks/orchestration/README.md) +### [Orchestration](docs/sdks/orchestration/README.md) * [CancelEvent](docs/sdks/orchestration/README.md#cancelevent) - Cancel a running workflow * [CreateTrigger](docs/sdks/orchestration/README.md#createtrigger) - Create trigger @@ -118,7 +116,7 @@ func main() { * [RunWorkflow](docs/sdks/orchestration/README.md#runworkflow) - Run workflow * [SendEvent](docs/sdks/orchestration/README.md#sendevent) - Send an event to a running workflow -## [Payments](docs/sdks/payments/README.md) +### [Payments](docs/sdks/payments/README.md) * [AddAccountToPool](docs/sdks/payments/README.md#addaccounttopool) - Add an account to a pool * [ConnectorsTransfer](docs/sdks/payments/README.md#connectorstransfer) - Transfer funds between Connector accounts @@ -159,7 +157,7 @@ func main() { * [UninstallConnectorV1](docs/sdks/payments/README.md#uninstallconnectorv1) - Uninstall a connector * [UpdateMetadata](docs/sdks/payments/README.md#updatemetadata) - Update metadata -## [Reconciliation](docs/sdks/reconciliation/README.md) +### [Reconciliation](docs/sdks/reconciliation/README.md) * [CreatePolicy](docs/sdks/reconciliation/README.md#createpolicy) - Create a policy * [DeletePolicy](docs/sdks/reconciliation/README.md#deletepolicy) - Delete a policy @@ -170,12 +168,12 @@ func main() { * [Reconcile](docs/sdks/reconciliation/README.md#reconcile) - Reconcile using a policy * [ReconciliationgetServerInfo](docs/sdks/reconciliation/README.md#reconciliationgetserverinfo) - Get server info -## [Search](docs/sdks/search/README.md) +### [Search](docs/sdks/search/README.md) * [Search](docs/sdks/search/README.md#search) - Search * [SearchgetServerInfo](docs/sdks/search/README.md#searchgetserverinfo) - Get server info -## [Wallets](docs/sdks/wallets/README.md) +### [Wallets](docs/sdks/wallets/README.md) * [ConfirmHold](docs/sdks/wallets/README.md#confirmhold) - Confirm a hold * [CreateBalance](docs/sdks/wallets/README.md#createbalance) - Create a balance @@ -194,7 +192,7 @@ func main() { * [VoidHold](docs/sdks/wallets/README.md#voidhold) - Cancel a hold * [WalletsgetServerInfo](docs/sdks/wallets/README.md#walletsgetserverinfo) - Get server info -## [Webhooks](docs/sdks/webhooks/README.md) +### [Webhooks](docs/sdks/webhooks/README.md) * [ActivateConfig](docs/sdks/webhooks/README.md#activateconfig) - Activate one config * [ChangeConfigSecret](docs/sdks/webhooks/README.md#changeconfigsecret) - Change the signing secret of a config @@ -207,16 +205,12 @@ func main() { - - # Error Handling Handling errors in your SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass. - - diff --git a/libs/clients/go/docs/models/shared/reconciliation.md b/libs/clients/go/docs/models/shared/reconciliation.md index 7e028794ea..0944f1cfaf 100755 --- a/libs/clients/go/docs/models/shared/reconciliation.md +++ b/libs/clients/go/docs/models/shared/reconciliation.md @@ -11,5 +11,6 @@ | `LedgerBalances` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | | `PaymentsBalances` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | | `PolicyID` | *string* | :heavy_check_mark: | N/A | XXX | -| `ReconciledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ReconciledAtLedger` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ReconciledAtPayments` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | | `Status` | *string* | :heavy_check_mark: | N/A | COMPLETED | \ No newline at end of file diff --git a/libs/clients/go/docs/models/shared/reconciliationrequest.md b/libs/clients/go/docs/models/shared/reconciliationrequest.md index 51f32e3c6f..8173ed470c 100755 --- a/libs/clients/go/docs/models/shared/reconciliationrequest.md +++ b/libs/clients/go/docs/models/shared/reconciliationrequest.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| `At` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | \ No newline at end of file +| `ReconciledAtLedger` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ReconciledAtPayment` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | \ No newline at end of file diff --git a/libs/clients/go/pkg/models/shared/reconciliation.go b/libs/clients/go/pkg/models/shared/reconciliation.go index 510aebe8fe..97057d466d 100755 --- a/libs/clients/go/pkg/models/shared/reconciliation.go +++ b/libs/clients/go/pkg/models/shared/reconciliation.go @@ -9,14 +9,15 @@ import ( ) type Reconciliation struct { - CreatedAt time.Time `json:"createdAt"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - LedgerBalances map[string]*big.Int `json:"ledgerBalances"` - PaymentsBalances map[string]*big.Int `json:"paymentsBalances"` - PolicyID string `json:"policyID"` - ReconciledAt time.Time `json:"reconciledAt"` - Status string `json:"status"` + CreatedAt time.Time `json:"createdAt"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + LedgerBalances map[string]*big.Int `json:"ledgerBalances"` + PaymentsBalances map[string]*big.Int `json:"paymentsBalances"` + PolicyID string `json:"policyID"` + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `json:"reconciledAtPayments"` + Status string `json:"status"` } func (r Reconciliation) MarshalJSON() ([]byte, error) { @@ -72,11 +73,18 @@ func (o *Reconciliation) GetPolicyID() string { return o.PolicyID } -func (o *Reconciliation) GetReconciledAt() time.Time { +func (o *Reconciliation) GetReconciledAtLedger() time.Time { if o == nil { return time.Time{} } - return o.ReconciledAt + return o.ReconciledAtLedger +} + +func (o *Reconciliation) GetReconciledAtPayments() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtPayments } func (o *Reconciliation) GetStatus() string { diff --git a/libs/clients/go/pkg/models/shared/reconciliationrequest.go b/libs/clients/go/pkg/models/shared/reconciliationrequest.go index 81a8d79018..12009e6e0b 100755 --- a/libs/clients/go/pkg/models/shared/reconciliationrequest.go +++ b/libs/clients/go/pkg/models/shared/reconciliationrequest.go @@ -8,7 +8,8 @@ import ( ) type ReconciliationRequest struct { - At time.Time `json:"at"` + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayment time.Time `json:"reconciledAtPayment"` } func (r ReconciliationRequest) MarshalJSON() ([]byte, error) { @@ -22,9 +23,16 @@ func (r *ReconciliationRequest) UnmarshalJSON(data []byte) error { return nil } -func (o *ReconciliationRequest) GetAt() time.Time { +func (o *ReconciliationRequest) GetReconciledAtLedger() time.Time { if o == nil { return time.Time{} } - return o.At + return o.ReconciledAtLedger +} + +func (o *ReconciliationRequest) GetReconciledAtPayment() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtPayment } diff --git a/libs/go-libs/otlp/http_client.go b/libs/go-libs/otlp/http_client.go index e69c2bd3d2..32a8b14ace 100644 --- a/libs/go-libs/otlp/http_client.go +++ b/libs/go-libs/otlp/http_client.go @@ -21,7 +21,7 @@ func (t WithBodiesTracingHTTPTransport) RoundTrip(req *http.Request) (*http.Resp } rsp, err := t.underlying.RoundTrip(req) - if t.debug || rsp.StatusCode >= 400 { + if t.debug || err != nil || rsp.StatusCode >= 400 { span := trace.SpanFromContext(req.Context()) span.SetAttributes(attribute.String("raw-request", string(rawRequest))) if err != nil { diff --git a/openapi/build/generate.json b/openapi/build/generate.json new file mode 100644 index 0000000000..97072ed80d --- /dev/null +++ b/openapi/build/generate.json @@ -0,0 +1,10525 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Formance Stack API", + "description": "Open, modular foundation for unique payments flows\n\n# Introduction\nThis API is documented in **OpenAPI format**.\n\n# Authentication\nFormance Stack offers one forms of authentication:\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n\n", + "contact": { + "name": "Formance", + "url": "https://www.formance.com", + "email": "support@formance.com" + }, + "x-logo": { + "url": "https://avatars.githubusercontent.com/u/84325077?s=200&v=4", + "altText": "Formance" + }, + "version": "v1.0.${VERSION}" + }, + "servers": [ + { + "url": "http://localhost", + "description": "local server" + } + ], + "paths": { + "/versions": { + "get": { + "summary": "Show stack version information", + "operationId": "getVersions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetVersionsResponse" + } + } + } + } + } + } + }, + "/api/auth/.well-known/openid-configuration": { + "get": { + "responses": { + "200": { + "description": "OpenID provider configuration.\nSee https://swagger.io/docs/specification/authentication/openid-connect-discovery/ for details\n" + } + } + } + }, + "/api/auth/_info": { + "get": { + "summary": "Get server info", + "operationId": "getServerInfo", + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + } + } + } + }, + "/api/auth/clients": { + "get": { + "summary": "List clients", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "listClients", + "responses": { + "200": { + "description": "List of clients", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListClientsResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "createClient", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateClientRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Client created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateClientResponse" + } + } + } + } + } + } + }, + "/api/auth/clients/{clientId}": { + "get": { + "summary": "Read client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "readClient", + "parameters": [ + { + "description": "Client ID", + "in": "path", + "name": "clientId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved client", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadClientResponse" + } + } + } + } + } + }, + "put": { + "summary": "Update client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "updateClient", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateClientRequest" + } + } + } + }, + "parameters": [ + { + "description": "Client ID", + "in": "path", + "name": "clientId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Updated client", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateClientResponse" + } + } + } + } + } + }, + "delete": { + "summary": "Delete client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "deleteClient", + "parameters": [ + { + "description": "Client ID", + "in": "path", + "name": "clientId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Client deleted" + } + } + } + }, + "/api/auth/clients/{clientId}/secrets": { + "post": { + "summary": "Add a secret to a client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "createSecret", + "parameters": [ + { + "description": "Client ID", + "in": "path", + "name": "clientId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSecretRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Created secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSecretResponse" + } + } + } + } + } + } + }, + "/api/auth/clients/{clientId}/secrets/{secretId}": { + "delete": { + "summary": "Delete a secret from a client", + "tags": [ + "Auth", + "Clients" + ], + "operationId": "deleteSecret", + "parameters": [ + { + "description": "Client ID", + "in": "path", + "name": "clientId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Secret ID", + "in": "path", + "name": "secretId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Secret deleted" + } + } + } + }, + "/api/auth/users": { + "get": { + "summary": "List users", + "tags": [ + "Auth", + "Users" + ], + "description": "List users", + "operationId": "listUsers", + "responses": { + "200": { + "description": "List of users", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListUsersResponse" + } + } + } + } + } + } + }, + "/api/auth/users/{userId}": { + "get": { + "summary": "Read user", + "tags": [ + "Auth", + "Users" + ], + "description": "Read user", + "operationId": "readUser", + "parameters": [ + { + "description": "User ID", + "in": "path", + "name": "userId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved user", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadUserResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/_info": { + "get": { + "tags": [ + "Ledger.V2" + ], + "summary": "Show server information", + "operationId": "getInfo", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigInfoResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2": { + "get": { + "summary": "List ledgers", + "operationId": "listLedgers", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "tags": [ + "Ledger" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LedgerListResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}": { + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + } + ], + "get": { + "summary": "Get a ledger", + "operationId": "getLedger", + "tags": [ + "Ledger" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ledger" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create a ledger", + "operationId": "createLedger", + "tags": [ + "Ledger" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLedgerRequest" + } + } + } + }, + "responses": { + "204": { + "description": "OK" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/_info": { + "get": { + "summary": "Get information about a ledger", + "operationId": "getLedgerInfo", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LedgerInfoResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/_bulk": { + "post": { + "summary": "Bulk request", + "operationId": "createBulk", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkResponse" + } + } + } + }, + "400": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/accounts": { + "head": { + "summary": "Count the accounts from a ledger", + "operationId": "countAccounts", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "204": { + "description": "OK", + "headers": { + "Count": { + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0 + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "get": { + "summary": "List accounts from a ledger", + "description": "List accounts from a ledger, sorted by address in descending order.", + "operationId": "listAccounts", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountsCursorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/accounts/{address}": { + "get": { + "summary": "Get account by its address", + "operationId": "getAccount", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n", + "required": true, + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/accounts/{address}/metadata": { + "post": { + "summary": "Add metadata to an account", + "operationId": "addMetadataToAccount", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n", + "required": true, + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ledgerMetadata" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content", + "content": {} + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}": { + "delete": { + "description": "Delete metadata by key", + "operationId": "deleteAccountMetadata", + "tags": [ + "Ledger.V2" + ], + "summary": "Delete metadata by key", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Account address", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "path", + "description": "The key to remove.", + "required": true, + "schema": { + "type": "string", + "example": "foo" + } + } + ], + "responses": { + "2XX": { + "description": "Key deleted", + "content": {} + } + } + } + }, + "/api/ledger/v2/{ledger}/stats": { + "get": { + "tags": [ + "Ledger.V2" + ], + "operationId": "readStats", + "summary": "Get statistics from a ledger", + "description": "Get statistics from a ledger. (aggregate metrics on accounts and transactions)\n", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "name of the ledger", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/transactions": { + "head": { + "tags": [ + "Ledger.V2" + ], + "summary": "Count the transactions from a ledger", + "operationId": "countTransactions", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "204": { + "description": "OK", + "headers": { + "Count": { + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Ledger.V2" + ], + "summary": "List transactions from a ledger", + "description": "List transactions from a ledger, sorted by id in descending order.", + "operationId": "listTransactions", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionsCursorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Ledger.V2" + ], + "summary": "Create a new transaction to a ledger", + "operationId": "createTransaction", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "description": "The request body must contain at least one of the following objects:\n - `postings`: suitable for simple transactions\n - `script`: enabling more complex transactions with Numscript\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTransaction" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTransactionResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/transactions/{id}": { + "get": { + "tags": [ + "Ledger.V2" + ], + "summary": "Get transaction from a ledger by its ID", + "operationId": "getTransaction", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTransactionResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/transactions/{id}/metadata": { + "post": { + "tags": [ + "Ledger.V2" + ], + "summary": "Set the metadata of a transaction by its ID", + "operationId": "addMetadataOnTransaction", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ledgerMetadata" + } + } + } + }, + "responses": { + "204": { + "description": "No Content", + "content": {} + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}": { + "delete": { + "description": "Delete metadata by key", + "operationId": "deleteTransactionMetadata", + "summary": "Delete metadata by key", + "tags": [ + "Ledger.V2" + ], + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "key", + "in": "path", + "required": true, + "description": "The key to remove.", + "schema": { + "type": "string", + "example": "foo" + } + } + ], + "responses": { + "2XX": { + "description": "Key deleted", + "content": {} + } + } + } + }, + "/api/ledger/v2/{ledger}/transactions/{id}/revert": { + "post": { + "tags": [ + "Ledger.V2" + ], + "operationId": "revertTransaction", + "summary": "Revert a ledger transaction by its ID", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "force", + "in": "query", + "description": "Force revert", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevertTransactionResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/aggregate/balances": { + "get": { + "tags": [ + "Ledger.V2" + ], + "summary": "Get the aggregated balances from selected accounts", + "operationId": "getBalancesAggregated", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AggregateBalancesResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/v2/{ledger}/logs": { + "get": { + "tags": [ + "Ledger.V2" + ], + "summary": "List the logs from a ledger", + "description": "List the logs from a ledger, sorted by ID in descending order.", + "operationId": "listLogs", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LogsCursorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/payments/_info": { + "get": { + "summary": "Get server info", + "operationId": "paymentsgetServerInfo", + "tags": [ + "Payments" + ], + "responses": { + "200": { + "$ref": "#/components/responses/ServerInfo" + } + } + } + }, + "/api/payments/payments": { + "post": { + "summary": "Create a payment", + "tags": [ + "Payments" + ], + "operationId": "createPayment", + "description": "Create a payment", + "requestBody": { + "$ref": "#/components/requestBodies/Payment" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Payment" + } + } + }, + "get": { + "summary": "List payments", + "operationId": "listPayments", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Payments" + } + } + } + }, + "/api/payments/payments/{paymentId}": { + "get": { + "summary": "Get a payment", + "tags": [ + "Payments" + ], + "operationId": "getPayment", + "parameters": [ + { + "$ref": "#/components/parameters/PaymentId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Payment" + } + } + } + }, + "/api/payments/payments/{paymentId}/metadata": { + "patch": { + "summary": "Update metadata", + "tags": [ + "Payments" + ], + "operationId": "updateMetadata", + "parameters": [ + { + "$ref": "#/components/parameters/PaymentId" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/UpdateMetadata" + }, + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/transfer-initiations": { + "get": { + "summary": "List Transfer Initiations", + "operationId": "listTransferInitiations", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + }, + { + "$ref": "#/components/parameters/Query" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/TransferInitiations" + } + } + }, + "post": { + "summary": "Create a TransferInitiation", + "tags": [ + "Payments" + ], + "operationId": "createTransferInitiation", + "description": "Create a transfer initiation", + "requestBody": { + "$ref": "#/components/requestBodies/TransferInitiation" + }, + "responses": { + "200": { + "$ref": "#/components/responses/TransferInitiation" + } + } + } + }, + "/api/payments/transfer-initiations/{transferId}": { + "get": { + "summary": "Get a transfer initiation", + "tags": [ + "Payments" + ], + "operationId": "getTransferInitiation", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/TransferInitiation" + } + } + }, + "delete": { + "summary": "Delete a transfer initiation", + "operationId": "deleteTransferInitiation", + "tags": [ + "Payments" + ], + "description": "Delete a transfer initiation by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/transfer-initiations/{transferId}/status": { + "post": { + "summary": "Update the status of a transfer initiation", + "tags": [ + "Payments" + ], + "operationId": "udpateTransferInitiationStatus", + "description": "Update a transfer initiation status", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/UpdateTransferInitiationStatus" + }, + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/transfer-initiations/{transferId}/retry": { + "post": { + "summary": "Retry a failed transfer initiation", + "tags": [ + "Payments" + ], + "operationId": "retryTransferInitiation", + "description": "Retry a failed transfer initiation", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/pools": { + "get": { + "summary": "List Pools", + "operationId": "listPools", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + }, + { + "$ref": "#/components/parameters/Query" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Pools" + } + } + }, + "post": { + "summary": "Create a Pool", + "tags": [ + "Payments" + ], + "operationId": "createPool", + "description": "Create a Pool", + "requestBody": { + "$ref": "#/components/requestBodies/Pool" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Pool" + } + } + } + }, + "/api/payments/pools/{poolId}": { + "get": { + "summary": "Get a Pool", + "tags": [ + "Payments" + ], + "operationId": "getPool", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Pool" + } + } + }, + "delete": { + "summary": "Delete a Pool", + "operationId": "deletePool", + "tags": [ + "Payments" + ], + "description": "Delete a pool by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/pools/{poolId}/accounts": { + "post": { + "summary": "Add an account to a pool", + "tags": [ + "Payments" + ], + "operationId": "addAccountToPool", + "description": "Add an account to a pool", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/AddAccountToPool" + }, + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/pools/{poolId}/accounts/{accountId}": { + "delete": { + "summary": "Remove an account from a pool", + "operationId": "removeAccountFromPool", + "tags": [ + "Payments" + ], + "description": "Remove an account from a pool by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + }, + { + "$ref": "#/components/parameters/AccountId" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/pools/{poolId}/balances": { + "get": { + "summary": "Get pool balances", + "operationId": "getPoolBalances", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + }, + { + "name": "at", + "in": "query", + "description": "Filter balances by date.\n", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/PoolBalances" + } + } + } + }, + "/api/payments/accounts": { + "get": { + "summary": "List accounts", + "operationId": "paymentslistAccounts", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Accounts" + } + } + } + }, + "/api/payments/accounts/{accountId}": { + "get": { + "summary": "Get an account", + "tags": [ + "Payments" + ], + "operationId": "paymentsgetAccount", + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Account" + } + } + } + }, + "/api/payments/accounts/{accountId}/balances": { + "get": { + "summary": "Get account balances", + "operationId": "getAccountBalances", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + }, + { + "name": "limit", + "in": "query", + "description": "The maximum number of results to return per page.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "asset", + "in": "query", + "description": "Filter balances by currency.\nIf not specified, all account's balances will be returned.\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "from", + "in": "query", + "description": "Filter balances by date.\nIf not specified, all account's balances will be returned.\n", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "description": "Filter balances by date.\nIf not specified, default will be set to now.\n", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/AccountBalances" + } + } + } + }, + "/api/payments/bank-accounts": { + "post": { + "summary": "Create a BankAccount in Payments and on the PSP", + "tags": [ + "Payments" + ], + "operationId": "createBankAccount", + "description": "Create a bank account in Payments and on the PSP.", + "requestBody": { + "$ref": "#/components/requestBodies/BankAccount" + }, + "responses": { + "200": { + "$ref": "#/components/responses/BankAccount" + } + } + }, + "get": { + "summary": "List bank accounts created by user on Formance", + "operationId": "listBankAccounts", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + } + ], + "description": "List all bank accounts created by user on Formance.", + "responses": { + "200": { + "$ref": "#/components/responses/BankAccounts" + } + } + } + }, + "/api/payments/bank-accounts/{bankAccountId}": { + "get": { + "summary": "Get a bank account created by user on Formance", + "tags": [ + "Payments" + ], + "operationId": "getBankAccount", + "parameters": [ + { + "$ref": "#/components/parameters/BankAccountId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/BankAccount" + } + } + } + }, + "/api/payments/connectors": { + "get": { + "summary": "List all installed connectors", + "operationId": "listAllConnectors", + "tags": [ + "Payments" + ], + "description": "List all installed connectors.", + "responses": { + "200": { + "$ref": "#/components/responses/Connectors" + } + } + } + }, + "/api/payments/connectors/configs": { + "get": { + "summary": "List the configs of each available connector", + "operationId": "listConfigsAvailableConnectors", + "tags": [ + "Payments" + ], + "description": "List the configs of each available connector.", + "responses": { + "200": { + "$ref": "#/components/responses/ConnectorsConfigs" + } + } + } + }, + "/api/payments/connectors/{connector}": { + "post": { + "summary": "Install a connector", + "tags": [ + "Payments" + ], + "operationId": "installConnector", + "description": "Install a connector by its name and config.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/ConnectorConfig" + }, + "responses": { + "201": { + "$ref": "#/components/responses/ConnectorInstalled" + } + } + }, + "delete": { + "summary": "Uninstall a connector", + "deprecated": true, + "operationId": "uninstallConnector", + "tags": [ + "Payments" + ], + "description": "Uninstall a connector by its name.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}": { + "delete": { + "summary": "Uninstall a connector", + "operationId": "uninstallConnectorV1", + "tags": [ + "Payments" + ], + "description": "Uninstall a connector by its name.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/connectors/{connector}/config": { + "get": { + "summary": "Read the config of a connector", + "deprecated": true, + "operationId": "readConnectorConfig", + "tags": [ + "Payments" + ], + "description": "Read connector config", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/ConnectorConfig" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/config": { + "get": { + "summary": "Read the config of a connector", + "operationId": "readConnectorConfigV1", + "tags": [ + "Payments" + ], + "description": "Read connector config", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/ConnectorConfig" + } + } + } + }, + "/api/payments/connectors/{connector}/reset": { + "post": { + "summary": "Reset a connector", + "deprecated": true, + "operationId": "resetConnector", + "tags": [ + "Payments" + ], + "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/reset": { + "post": { + "summary": "Reset a connector", + "operationId": "resetConnectorV1", + "tags": [ + "Payments" + ], + "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/connectors/{connector}/tasks": { + "get": { + "summary": "List tasks from a connector", + "deprecated": true, + "tags": [ + "Payments" + ], + "operationId": "listConnectorTasks", + "description": "List all tasks associated with this connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Tasks" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/tasks": { + "get": { + "summary": "List tasks from a connector", + "tags": [ + "Payments" + ], + "operationId": "listConnectorTasksV1", + "description": "List all tasks associated with this connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + }, + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Tasks" + } + } + } + }, + "/api/payments/connectors/{connector}/tasks/{taskId}": { + "get": { + "summary": "Read a specific task of the connector", + "deprecated": true, + "tags": [ + "Payments" + ], + "operationId": "getConnectorTask", + "description": "Get a specific task associated to the connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/TaskId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Task" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/tasks/{taskId}": { + "get": { + "summary": "Read a specific task of the connector", + "tags": [ + "Payments" + ], + "operationId": "getConnectorTaskV1", + "description": "Get a specific task associated to the connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + }, + { + "$ref": "#/components/parameters/TaskId" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Task" + } + } + } + }, + "/api/payments/connectors/{connector}/transfers": { + "post": { + "summary": "Transfer funds between Connector accounts", + "tags": [ + "Payments" + ], + "operationId": "connectorsTransfer", + "description": "Execute a transfer between two accounts.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/Transfer" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Transfer" + } + } + } + }, + "/api/search/_info": { + "get": { + "summary": "Get server info", + "operationId": "searchgetServerInfo", + "tags": [ + "Search" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + } + } + } + }, + "/api/search/": { + "post": { + "summary": "Search", + "tags": [ + "Search" + ], + "operationId": "search", + "description": "ElasticSearch query engine", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Query" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + }, + "default": { + "description": "Error", + "content": {} + } + } + } + }, + "/api/webhooks/configs": { + "get": { + "summary": "Get many configs", + "description": "Sorted by updated date descending", + "operationId": "getManyConfigs", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Optional filter by Config ID", + "required": false, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + }, + { + "name": "endpoint", + "in": "query", + "description": "Optional filter by endpoint URL", + "required": false, + "schema": { + "type": "string", + "example": "https://example.com" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + }, + "post": { + "summary": "Insert a new config", + "description": "Insert a new webhooks config.\n\nThe endpoint should be a valid https URL and be unique.\n\nThe secret is the endpoint's verification secret.\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n\nAll eventTypes are converted to lower-case when inserted.\n", + "operationId": "insertConfig", + "tags": [ + "Webhooks" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigUser" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Config created successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/webhooks/configs/{id}": { + "delete": { + "summary": "Delete one config", + "description": "Delete a webhooks config by ID.", + "operationId": "deleteConfig", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully deleted." + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/webhooks/configs/{id}/test": { + "get": { + "summary": "Test one config", + "description": "Test a config by sending a webhook to its endpoint.", + "operationId": "testConfig", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttemptResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/webhooks/configs/{id}/activate": { + "put": { + "summary": "Activate one config", + "description": "Activate a webhooks config by ID, to start receiving webhooks to its endpoint.", + "operationId": "activateConfig", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully activated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/webhooks/configs/{id}/deactivate": { + "put": { + "summary": "Deactivate one config", + "description": "Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.", + "operationId": "deactivateConfig", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully deactivated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/webhooks/configs/{id}/secret/change": { + "put": { + "summary": "Change the signing secret of a config", + "description": "Change the signing secret of the endpoint of a webhooks config.\n\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n", + "operationId": "changeConfigSecret", + "tags": [ + "Webhooks" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigChangeSecret" + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Secret successfully changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/_info": { + "get": { + "summary": "Get server info", + "operationId": "walletsgetServerInfo", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/transactions": { + "get": { + "operationId": "getTransactions", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } + }, + { + "name": "walletID", + "in": "query", + "description": "A wallet ID to filter on", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when the cursor is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTransactionsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets": { + "get": { + "summary": "List all wallets", + "operationId": "listWallets", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Filter on wallet name", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "metadata", + "in": "query", + "description": "Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + } + }, + "example": { + "admin": "true" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when the pagination token is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWalletsResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create a new wallet", + "operationId": "createWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWalletRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Wallet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWalletResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get a wallet", + "operationId": "getWallet", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Wallet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWalletResponse" + } + } + } + }, + "404": { + "description": "Wallet not found" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + }, + "patch": { + "summary": "Update a wallet", + "operationId": "updateWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "description": "Custom metadata to attach to this wallet.", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Wallet successfully updated" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/summary": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get wallet summary", + "operationId": "getWalletSummary", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Wallet summary", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWalletSummaryResponse" + } + } + } + }, + "404": { + "description": "Wallet not found" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/balances": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "List balances of a wallet", + "operationId": "listBalances", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Balances list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBalancesResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create a balance", + "operationId": "createBalance", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBalanceRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created balance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBalanceResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/balances/{balanceName}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "balanceName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "summary": "Get detailed balance", + "operationId": "getBalance", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Balance summary", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBalanceResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/debit": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Debit a wallet", + "operationId": "debitWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebitWalletRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Wallet successfully debited as a pending hold", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebitWalletResponse" + } + } + } + }, + "204": { + "description": "Wallet successfully debited" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/credit": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Credit a wallet", + "operationId": "creditWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditWalletRequest" + } + } + } + }, + "responses": { + "204": { + "description": "Wallet successfully credited" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds": { + "get": { + "summary": "Get all holds for a wallet", + "tags": [ + "Wallets" + ], + "operationId": "getHolds", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } + }, + { + "name": "walletID", + "in": "query", + "description": "The wallet to filter on", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "metadata", + "in": "query", + "description": "Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "schema": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + } + }, + "example": { + "admin": "true" + } + }, + { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when the pagination token is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "responses": { + "200": { + "description": "Holds", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetHoldsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{holdID}": { + "get": { + "summary": "Get a hold", + "tags": [ + "Wallets" + ], + "operationId": "getHold", + "parameters": [ + { + "name": "holdID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The hold ID" + } + ], + "responses": { + "200": { + "description": "Holds", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetHoldResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{hold_id}/confirm": { + "post": { + "parameters": [ + { + "name": "hold_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfirmHoldRequest" + } + } + } + }, + "summary": "Confirm a hold", + "tags": [ + "Wallets" + ], + "operationId": "confirmHold", + "responses": { + "204": { + "description": "Hold successfully confirmed, funds moved back to initial destination" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{hold_id}/void": { + "parameters": [ + { + "name": "hold_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Cancel a hold", + "operationId": "voidHold", + "tags": [ + "Wallets" + ], + "responses": { + "204": { + "description": "Hold successfully cancelled, funds returned to wallet" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/orchestration/_info": { + "get": { + "summary": "Get server info", + "operationId": "orchestrationgetServerInfo", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers": { + "get": { + "summary": "List triggers", + "operationId": "listTriggers", + "description": "List triggers", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTriggersResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "post": { + "summary": "Create trigger", + "operationId": "createTrigger", + "description": "Create trigger", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerData" + } + } + } + }, + "responses": { + "201": { + "description": "Created trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers/{triggerID}": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "Read trigger", + "operationId": "readTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "A specific trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete trigger", + "operationId": "deleteTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "Trigger deleted" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers/{triggerID}/occurrences": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "List triggers occurrences", + "operationId": "listTriggersOccurrences", + "description": "List triggers occurrences", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers occurrences", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTriggersOccurrencesResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows": { + "get": { + "summary": "List registered workflows", + "operationId": "listWorkflows", + "description": "List registered workflows", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflows", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWorkflowsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "post": { + "summary": "Create workflow", + "operationId": "createWorkflow", + "description": "Create a workflow", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows/{flowId}": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "flowId", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Get a flow by id", + "operationId": "getWorkflow", + "responses": { + "200": { + "description": "The workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Delete a flow by id", + "operationId": "deleteWorkflow", + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows/{workflowID}/instances": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "description": "Run workflow", + "summary": "Run workflow", + "operationId": "runWorkflow", + "parameters": [ + { + "in": "query", + "name": "wait", + "required": false, + "description": "Wait end of the workflow before return", + "schema": { + "type": "boolean" + } + } + ], + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances": { + "get": { + "description": "List instances of a workflow", + "summary": "List instances of a workflow", + "operationId": "listInstances", + "parameters": [ + { + "in": "query", + "description": "A workflow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": false + }, + { + "in": "query", + "description": "Filter running instances", + "name": "running", + "schema": { + "type": "boolean" + }, + "example": true, + "required": false + } + ], + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflow instances", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRunsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance by id", + "description": "Get a workflow instance by id", + "operationId": "getInstance", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/events": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "summary": "Send an event to a running workflow", + "description": "Send an event to a running workflow", + "operationId": "sendEvent", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/abort": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "put": { + "summary": "Cancel a running workflow", + "description": "Cancel a running workflow", + "operationId": "cancelEvent", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance history by id", + "description": "Get a workflow instance history by id", + "operationId": "getInstanceHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceHistoryResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/stages/{number}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + }, + { + "in": "path", + "description": "The stage number", + "name": "number", + "schema": { + "type": "integer" + }, + "example": 0, + "required": true + } + ], + "get": { + "summary": "Get a workflow instance stage history", + "description": "Get a workflow instance stage history", + "operationId": "getInstanceStageHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance stage history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceHistoryStageResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/reconciliation/_info": { + "get": { + "summary": "Get server info", + "operationId": "reconciliationgetServerInfo", + "tags": [ + "Reconciliation" + ], + "responses": { + "200": { + "$ref": "#/components/responses/ServerInfo" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies": { + "post": { + "summary": "Create a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "createPolicy", + "description": "Create a policy", + "requestBody": { + "$ref": "#/components/requestBodies/Policy" + }, + "responses": { + "201": { + "$ref": "#/components/responses/Policy" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + }, + "get": { + "summary": "List policies", + "operationId": "listPolicies", + "tags": [ + "Reconciliation" + ], + "parameters": [ + { + "$ref": "#/components/parameters/reconciliationPageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Policies" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies/{policyID}": { + "delete": { + "summary": "Delete a policy", + "operationId": "deletePolicy", + "tags": [ + "Reconciliation" + ], + "description": "Delete a policy by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + }, + "get": { + "summary": "Get a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "getPolicy", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Policy" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies/{policyID}/reconciliation": { + "post": { + "summary": "Reconcile using a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "reconcile", + "description": "Reconcile using a policy", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/Reconciliation" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliation" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/reconciliations": { + "get": { + "summary": "List reconciliations", + "operationId": "listReconciliations", + "tags": [ + "Reconciliation" + ], + "parameters": [ + { + "$ref": "#/components/parameters/reconciliationPageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliations" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/reconciliations/{reconciliationID}": { + "get": { + "summary": "Get a reconciliation", + "tags": [ + "Reconciliation" + ], + "operationId": "getReconciliation", + "parameters": [ + { + "$ref": "#/components/parameters/ReconciliationID" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliation" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + } + }, + "components": { + "schemas": { + "Version": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "health": { + "type": "boolean" + } + }, + "required": [ + "name", + "version", + "health" + ] + }, + "GetVersionsResponse": { + "type": "object", + "properties": { + "region": { + "type": "string" + }, + "env": { + "type": "string" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Version" + } + } + }, + "required": [ + "region", + "env", + "versions" + ] + }, + "Metadata": { + "type": "object", + "additionalProperties": {} + }, + "ClientOptions": { + "type": "object", + "properties": { + "public": { + "type": "boolean" + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "trusted": { + "type": "boolean" + }, + "postLogoutRedirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, + "ClientSecret": { + "type": "object", + "properties": { + "lastDigits": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "id", + "lastDigits", + "name" + ] + }, + "Client": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "secrets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClientSecret" + } + } + }, + "required": [ + "id" + ] + } + ] + }, + "ScopeOptions": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "label" + ] + }, + "Scope": { + "allOf": [ + { + "$ref": "#/components/schemas/ScopeOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "transient": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + } + ] + }, + "SecretOptions": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "name" + ] + }, + "Secret": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "lastDigits": { + "type": "string" + }, + "clear": { + "type": "string" + } + }, + "required": [ + "id", + "lastDigits", + "clear" + ] + } + ] + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "3bb03708-312f-48a0-821a-e765837dc2c4" + }, + "subject": { + "type": "string", + "example": "Jane Doe" + }, + "email": { + "type": "string", + "example": "user1@orga1.com" + } + } + }, + "CreateClientRequest": { + "$ref": "#/components/schemas/ClientOptions" + }, + "CreateClientResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Client" + } + } + }, + "ListClientsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "UpdateClientRequest": { + "$ref": "#/components/schemas/ClientOptions" + }, + "UpdateClientResponse": { + "$ref": "#/components/schemas/CreateClientResponse" + }, + "ReadClientResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Client" + } + } + }, + "ListScopesResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Scope" + } + } + } + }, + "CreateScopeRequest": { + "$ref": "#/components/schemas/ScopeOptions" + }, + "CreateScopeResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Scope" + } + } + }, + "ReadScopeResponse": { + "$ref": "#/components/schemas/CreateScopeResponse" + }, + "UpdateScopeRequest": { + "$ref": "#/components/schemas/ScopeOptions" + }, + "UpdateScopeResponse": { + "$ref": "#/components/schemas/CreateScopeResponse" + }, + "CreateSecretRequest": { + "$ref": "#/components/schemas/SecretOptions" + }, + "CreateSecretResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Secret" + } + } + }, + "ReadUserResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + } + } + }, + "ListUsersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "ServerInfo": { + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "string" + } + } + }, + "AccountsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + } + } + } + } + }, + "BalancesCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountsBalances" + } + } + } + } + } + }, + "TransactionsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExpandedTransaction" + } + } + } + } + } + }, + "LogsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Log" + } + } + } + } + } + }, + "AccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Account" + } + } + }, + "AggregateBalancesResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/AssetsBalances" + } + } + }, + "ledgerMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "ConfigInfo": { + "type": "object", + "properties": { + "server": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "config", + "server", + "version" + ] + }, + "Account": { + "type": "object", + "required": [ + "address", + "metadata" + ], + "properties": { + "address": { + "type": "string", + "example": "users:001" + }, + "metadata": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "volumes": { + "$ref": "#/components/schemas/Volumes" + }, + "effectiveVolumes": { + "$ref": "#/components/schemas/Volumes" + } + } + }, + "AccountsBalances": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AssetsBalances" + }, + "example": { + "account1": { + "USD": 100, + "EUR": 23 + }, + "account2": { + "CAD": 20, + "JPY": 21 + } + } + }, + "AssetsBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + }, + "example": { + "USD": 100, + "EUR": 12 + } + }, + "Posting": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "COIN" + }, + "destination": { + "type": "string", + "example": "users:002" + }, + "source": { + "type": "string", + "example": "users:001" + } + }, + "required": [ + "amount", + "asset", + "destination", + "source" + ] + }, + "Script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "properties": {}, + "additionalProperties": true, + "example": { + "user": "users:042" + } + }, + "reference": { + "type": "string", + "example": "order_1234", + "description": "Reference to attach to the generated transaction" + }, + "metadata": { + "$ref": "#/components/schemas/ledgerMetadata" + } + }, + "required": [ + "plain" + ] + }, + "Transaction": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/orchestrationMetadata" + }, + "id": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "reverted": { + "type": "boolean" + } + }, + "required": [ + "postings", + "timestamp", + "id", + "metadata", + "reverted" + ] + }, + "ExpandedTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/Transaction" + }, + { + "type": "object", + "properties": { + "preCommitVolumes": { + "$ref": "#/components/schemas/AggregatedVolumes" + }, + "postCommitVolumes": { + "$ref": "#/components/schemas/AggregatedVolumes" + } + } + } + ] + }, + "PostTransaction": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "properties": {}, + "additionalProperties": true, + "example": { + "user": "users:042" + } + } + }, + "required": [ + "plain" + ] + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/orchestrationMetadata" + } + } + }, + "Stats": { + "type": "object", + "properties": { + "accounts": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "transactions": { + "type": "integer", + "format": "bigint", + "minimum": 0 + } + }, + "required": [ + "accounts", + "transactions" + ] + }, + "Log": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + }, + "type": { + "type": "string", + "enum": [ + "NEW_TRANSACTION", + "SET_METADATA", + "REVERTED_TRANSACTION" + ] + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": true + }, + "hash": { + "type": "string", + "example": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e" + }, + "date": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "type", + "data", + "hash", + "date" + ] + }, + "CreateTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Transaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "RevertTransactionResponse": { + "$ref": "#/components/schemas/orchestrationCreateTransactionResponse" + }, + "GetTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ExpandedTransaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "StatsResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Stats" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "ConfigInfoResponse": { + "$ref": "#/components/schemas/ConfigInfo" + }, + "Volume": { + "type": "object", + "properties": { + "input": { + "type": "integer", + "format": "bigint" + }, + "output": { + "type": "integer", + "format": "bigint" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + }, + "required": [ + "input", + "output" + ], + "example": { + "input": 100, + "output": 20, + "balance": 80 + } + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Volume" + }, + "example": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "AggregatedVolumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Volumes" + }, + "example": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "$ref": "#/components/schemas/ErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "[VALIDATION] invalid 'cursor' query param" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + } + } + }, + "ErrorsEnum": { + "type": "string", + "enum": [ + "INTERNAL", + "INSUFFICIENT_FUND", + "VALIDATION", + "CONFLICT", + "COMPILATION_FAILED", + "METADATA_OVERRIDE", + "NOT_FOUND", + "REVERT_OCCURRING", + "ALREADY_REVERT", + "NO_POSTINGS" + ], + "example": "VALIDATION" + }, + "LedgerInfoResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/LedgerInfo" + } + } + }, + "LedgerInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "ledger001" + }, + "storage": { + "type": "object", + "properties": { + "migrations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MigrationInfo" + } + } + } + } + } + }, + "MigrationInfo": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 11 + }, + "name": { + "type": "string", + "example": "migrations:001" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string", + "enum": [ + "to do", + "done" + ] + } + } + }, + "Bulk": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BulkElement" + } + }, + "BaseBulkElement": { + "type": "object", + "required": [ + "action" + ], + "properties": { + "action": { + "type": "string" + }, + "ik": { + "type": "string" + } + } + }, + "BulkElement": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/BulkElementCreateTransaction" + }, + { + "$ref": "#/components/schemas/BulkElementAddMetadata" + }, + { + "$ref": "#/components/schemas/BulkElementRevertTransaction" + }, + { + "$ref": "#/components/schemas/BulkElementDeleteMetadata" + } + ], + "discriminator": { + "propertyName": "action", + "mapping": { + "CREATE_TRANSACTION": "#/components/schemas/BulkElementCreateTransaction", + "ADD_METADATA": "#/components/schemas/BulkElementAddMetadata", + "REVERT_TRANSACTION": "#/components/schemas/BulkElementRevertTransaction", + "DELETE_METADATA": "#/components/schemas/BulkElementDeleteMetadata" + } + } + }, + "BulkElementCreateTransaction": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/PostTransaction" + } + } + } + ] + }, + "TargetId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "bigint" + } + ] + }, + "TargetType": { + "type": "string", + "enum": [ + "TRANSACTION", + "ACCOUNT" + ] + }, + "BulkElementAddMetadata": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "targetId": { + "$ref": "#/components/schemas/TargetId" + }, + "targetType": { + "$ref": "#/components/schemas/TargetType" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "targetId", + "targetType", + "metadata" + ] + } + } + } + ] + }, + "BulkElementRevertTransaction": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "properties": { + "id": { + "type": "integer", + "format": "bigint" + }, + "force": { + "type": "boolean" + } + }, + "required": [ + "id" + ] + } + } + } + ] + }, + "BulkElementDeleteMetadata": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "properties": { + "targetId": { + "$ref": "#/components/schemas/TargetId" + }, + "targetType": { + "$ref": "#/components/schemas/TargetType" + }, + "key": { + "type": "string" + } + }, + "required": [ + "targetId", + "targetType", + "key" + ] + } + } + } + ] + }, + "BulkResponse": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BulkElementResult" + } + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "BulkElementResult": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/BulkElementResultCreateTransaction" + }, + { + "$ref": "#/components/schemas/BulkElementResultAddMetadata" + }, + { + "$ref": "#/components/schemas/BulkElementResultRevertTransaction" + }, + { + "$ref": "#/components/schemas/BulkElementResultDeleteMetadata" + }, + { + "$ref": "#/components/schemas/BulkElementResultError" + } + ], + "discriminator": { + "propertyName": "responseType", + "mapping": { + "CREATE_TRANSACTION": "#/components/schemas/BulkElementResultCreateTransaction", + "ADD_METADATA": "#/components/schemas/BulkElementResultAddMetadata", + "REVERT_TRANSACTION": "#/components/schemas/BulkElementResultRevertTransaction", + "DELETE_METADATA": "#/components/schemas/BulkElementResultDeleteMetadata", + "ERROR": "#/components/schemas/BulkElementResultError" + } + } + }, + "BaseBulkElementResult": { + "type": "object", + "properties": { + "responseType": { + "type": "string" + } + }, + "required": [ + "responseType" + ] + }, + "BulkElementResultCreateTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Transaction" + } + }, + "required": [ + "data" + ] + } + ] + }, + "BulkElementResultAddMetadata": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElementResult" + } + ] + }, + "BulkElementResultRevertTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Transaction" + } + }, + "required": [ + "data" + ] + } + ] + }, + "BulkElementResultDeleteMetadata": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElementResult" + } + ] + }, + "BulkElementResultError": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "errorCode": { + "type": "string" + }, + "errorDescription": { + "type": "string" + }, + "errorDetails": { + "type": "string" + } + }, + "required": [ + "errorCode", + "errorDescription" + ] + } + ] + }, + "CreateLedgerRequest": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + } + } + }, + "Ledger": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "addedAt": { + "type": "string", + "format": "date-time" + }, + "bucket": { + "type": "string" + } + }, + "required": [ + "name", + "addedAt", + "bucket" + ] + }, + "LedgerListResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Ledger" + } + } + } + } + } + }, + "CursorBase": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + } + } + }, + "PaymentsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + } + } + } + ] + } + } + }, + "PoolsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pool" + } + } + } + } + ] + } + } + }, + "TransferInitiationsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferInitiation" + } + } + } + } + ] + } + } + }, + "BankAccountsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BankAccount" + } + } + } + } + ] + } + } + }, + "AccountsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/paymentsAccount" + } + } + } + } + ] + } + } + }, + "BalancesCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountBalance" + } + } + } + } + ] + } + } + }, + "TasksCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TaskStripe" + }, + { + "$ref": "#/components/schemas/TaskWise" + }, + { + "$ref": "#/components/schemas/TaskCurrencyCloud" + }, + { + "$ref": "#/components/schemas/TaskDummyPay" + }, + { + "$ref": "#/components/schemas/TaskModulr" + }, + { + "$ref": "#/components/schemas/TaskBankingCircle" + }, + { + "$ref": "#/components/schemas/TaskMangoPay" + }, + { + "$ref": "#/components/schemas/TaskMoneycorp" + } + ] + } + } + } + } + ] + } + } + }, + "ConnectorConfigResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ConnectorConfig" + } + } + }, + "PaymentResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Payment" + } + } + }, + "PoolBalancesResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/PoolBalances" + } + } + }, + "PoolResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Pool" + } + } + }, + "TransferInitiationResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/TransferInitiation" + } + } + }, + "paymentsAccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/paymentsAccount" + } + } + }, + "ConnectorResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "connectorID" + ], + "properties": { + "connectorID": { + "type": "string" + } + } + } + } + }, + "ConnectorsResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "required": [ + "provider", + "name", + "connectorID" + ], + "properties": { + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "name": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + } + } + } + } + }, + "BankAccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/BankAccount" + } + } + }, + "ConnectorsConfigsResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "connector" + ], + "properties": { + "connector": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "object", + "required": [ + "dataType", + "required" + ], + "properties": { + "dataType": { + "type": "string" + }, + "required": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "TaskResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "oneOf": [ + { + "$ref": "#/components/schemas/TaskStripe" + }, + { + "$ref": "#/components/schemas/TaskWise" + }, + { + "$ref": "#/components/schemas/TaskCurrencyCloud" + }, + { + "$ref": "#/components/schemas/TaskDummyPay" + }, + { + "$ref": "#/components/schemas/TaskModulr" + }, + { + "$ref": "#/components/schemas/TaskBankingCircle" + }, + { + "$ref": "#/components/schemas/TaskMangoPay" + }, + { + "$ref": "#/components/schemas/TaskMoneycorp" + } + ] + } + } + }, + "TransferResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "TransfersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "asset": { + "type": "string" + }, + "destination": { + "type": "string" + }, + "source": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "status": { + "type": "string" + }, + "error": { + "type": "string" + } + } + } + } + } + }, + "Connector": { + "type": "string", + "enum": [ + "STRIPE", + "DUMMY-PAY", + "WISE", + "MODULR", + "CURRENCY-CLOUD", + "BANKING-CIRCLE", + "MANGOPAY", + "MONEYCORP", + "ATLAR" + ] + }, + "TransferInitiationStatus": { + "type": "string", + "enum": [ + "WAITING_FOR_VALIDATION", + "PROCESSING", + "PROCESSED", + "FAILED", + "REJECTED", + "VALIDATED" + ] + }, + "ConnectorConfig": { + "anyOf": [ + { + "$ref": "#/components/schemas/StripeConfig" + }, + { + "$ref": "#/components/schemas/DummyPayConfig" + }, + { + "$ref": "#/components/schemas/WiseConfig" + }, + { + "$ref": "#/components/schemas/ModulrConfig" + }, + { + "$ref": "#/components/schemas/CurrencyCloudConfig" + }, + { + "$ref": "#/components/schemas/BankingCircleConfig" + }, + { + "$ref": "#/components/schemas/MangoPayConfig" + }, + { + "$ref": "#/components/schemas/MoneycorpConfig" + }, + { + "$ref": "#/components/schemas/AtlarConfig" + } + ] + }, + "StripeConfig": { + "type": "object", + "required": [ + "name", + "apiKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Stripe Account" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.\n", + "default": "120s" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "Number of BalanceTransaction to fetch at each polling interval.\n", + "default": 10, + "example": 50 + } + } + }, + "DummyPayConfig": { + "type": "object", + "required": [ + "name", + "directory" + ], + "properties": { + "name": { + "type": "string", + "example": "My DummyPay Account" + }, + "filePollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new payment objects from the directory", + "default": "10s" + }, + "fileGenerationPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will create new payment objects in the directory", + "default": "10s" + }, + "directory": { + "type": "string", + "example": "/tmp/dummypay" + } + } + }, + "WiseConfig": { + "type": "object", + "required": [ + "name", + "apiKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Wise Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Wise API.\n", + "default": "120s" + } + } + }, + "ModulrConfig": { + "type": "object", + "required": [ + "name", + "apiKey", + "apiSecret" + ], + "properties": { + "name": { + "type": "string", + "example": "My Modulr Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "apiSecret": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Modulr API.\n", + "default": "120s" + } + } + }, + "BankingCircleConfig": { + "type": "object", + "required": [ + "name", + "username", + "password", + "endpoint", + "authorizationEndpoint", + "userCertificate", + "userCertificateKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Banking Circle Account" + }, + "username": { + "type": "string", + "example": "XXX" + }, + "password": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "authorizationEndpoint": { + "type": "string", + "example": "XXX" + }, + "userCertificate": { + "type": "string", + "example": "XXX" + }, + "userCertificateKey": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Banking Circle API.\n", + "default": "120s" + } + } + }, + "MangoPayConfig": { + "type": "object", + "required": [ + "name", + "clientID", + "apiKey", + "endpoint" + ], + "properties": { + "name": { + "type": "string", + "example": "My MangoPay Account" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MangoPay API.\n", + "default": "120s" + }, + "clientID": { + "type": "string", + "example": "XXX" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + } + } + }, + "MoneycorpConfig": { + "type": "object", + "required": [ + "name", + "clientID", + "apiKey", + "endpoint" + ], + "properties": { + "name": { + "type": "string", + "example": "My Moneycorp Account" + }, + "clientID": { + "type": "string", + "example": "XXX" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MoneyCorp API.\n", + "default": "120s" + } + } + }, + "CurrencyCloudConfig": { + "type": "object", + "required": [ + "name", + "apiKey", + "loginID" + ], + "properties": { + "name": { + "type": "string", + "example": "My CurrencyCloud Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "loginID": { + "type": "string", + "example": "XXX", + "description": "Username of the API Key holder" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will fetch transactions", + "default": "120s" + }, + "endpoint": { + "type": "string", + "example": "XXX", + "description": "The endpoint to use for the API. Defaults to https://devapi.currencycloud.com" + } + } + }, + "AtlarConfig": { + "type": "object", + "required": [ + "name", + "accessKey", + "secret" + ], + "properties": { + "name": { + "type": "string", + "example": "My Atlar Account" + }, + "baseUrl": { + "type": "string", + "example": "https://api.example.com", + "default": "https://api.atlar.com", + "description": "The base URL the client uses for making requests towards the Atlar API.\n" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector tries to fetch new Transaction objects from the Atlar API.\n", + "default": "120s" + }, + "accessKey": { + "type": "string", + "example": "XXX", + "description": "The access key used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated secret from the Atlar dashboard.\n" + }, + "secret": { + "type": "string", + "example": "XXX", + "description": "The secret used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated access key from the Atlar dashboard.\n" + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "Number of items to fetch when querying paginated APIs.\n", + "default": 25, + "example": 50 + } + } + }, + "TransferInitiation": { + "type": "object", + "required": [ + "id", + "createdAt", + "updatedAt", + "scheduledAt", + "description", + "sourceAccountID", + "destinationAccountID", + "connectorID", + "type", + "amount", + "asset", + "status", + "error" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "scheduledAt": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "TRANSFER", + "PAYOUT" + ] + }, + "amount": { + "type": "integer", + "format": "bigint" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "status": { + "$ref": "#/components/schemas/TransferInitiationStatus" + }, + "error": { + "type": "string" + }, + "relatedPayments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferInitiationPayments" + } + } + } + }, + "TransferInitiationPayments": { + "type": "object", + "required": [ + "paymentID", + "createdAt", + "status", + "error" + ], + "properties": { + "paymentID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "error": { + "type": "string" + } + } + }, + "BankAccount": { + "type": "object", + "required": [ + "id", + "createdAt", + "country", + "connectorID" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "country": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "iban": { + "type": "string" + }, + "accountNumber": { + "type": "string" + }, + "swiftBicCode": { + "type": "string" + } + } + }, + "Payment": { + "type": "object", + "required": [ + "id", + "reference", + "connectorID", + "sourceAccountID", + "destinationAccountID", + "type", + "status", + "initialAmount", + "scheme", + "asset", + "createdAt", + "raw", + "adjustments", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "reference": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "type": { + "$ref": "#/components/schemas/PaymentType" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "initialAmount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "scheme": { + "$ref": "#/components/schemas/PaymentScheme" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object", + "nullable": true + }, + "adjustments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentAdjustment" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaymentMetadata" + } + } + }, + "PaymentAdjustment": { + "type": "object", + "required": [ + "status", + "amount", + "date", + "raw", + "absolute" + ], + "properties": { + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "date": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object" + }, + "absolute": { + "type": "boolean" + } + } + }, + "PaymentMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "AccountMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "Pool": { + "type": "object", + "required": [ + "id", + "name", + "accounts" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "accounts": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PoolBalances": { + "type": "object", + "required": [ + "balances" + ], + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PoolBalance" + } + } + } + }, + "PoolBalance": { + "type": "object", + "required": [ + "amount", + "asset" + ], + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "USD" + } + } + }, + "paymentsAccount": { + "type": "object", + "required": [ + "id", + "createdAt", + "reference", + "connectorID", + "defaultCurrency", + "defaultAsset", + "accountName", + "type", + "metadata", + "raw" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "reference": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "defaultCurrency": { + "type": "string", + "deprecated": true + }, + "defaultAsset": { + "type": "string" + }, + "accountName": { + "type": "string" + }, + "type": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/AccountMetadata" + }, + "raw": { + "type": "object", + "nullable": true + } + } + }, + "AccountBalance": { + "type": "object", + "required": [ + "accountId", + "createdAt", + "lastUpdatedAt", + "currency", + "asset", + "balance" + ], + "properties": { + "accountId": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "lastUpdatedAt": { + "type": "string", + "format": "date-time" + }, + "currency": { + "type": "string", + "deprecated": true + }, + "asset": { + "type": "string" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + } + }, + "TaskBase": { + "type": "object", + "required": [ + "id", + "connectorID", + "createdAt", + "updatedAt", + "descriptor", + "status", + "state" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "connectorID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "state": { + "type": "object" + }, + "error": { + "type": "string" + } + } + }, + "TaskStripe": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "required": [ + "name", + "account" + ], + "properties": { + "name": { + "type": "string" + }, + "main": { + "type": "boolean" + }, + "account": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskWise": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "profileID": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + } + } + } + ] + }, + "TaskModulr": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "accountID": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskDummyPay": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "fileName": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskCurrencyCloud": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskBankingCircle": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskMangoPay": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskMoneycorp": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "accountID": { + "type": "string" + } + } + } + } + } + ] + }, + "TransferRequest": { + "type": "object", + "required": [ + "asset", + "amount", + "destination" + ], + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "USD" + }, + "destination": { + "type": "string", + "example": "acct_1Gqj58KZcSIg2N2q" + }, + "source": { + "type": "string", + "example": "acct_1Gqj58KZcSIg2N2q" + } + } + }, + "BankAccountRequest": { + "type": "object", + "required": [ + "country", + "connectorID", + "name" + ], + "properties": { + "country": { + "type": "string", + "example": "GB" + }, + "connectorID": { + "type": "string" + }, + "name": { + "type": "string", + "example": "My account" + }, + "accountNumber": { + "type": "string" + }, + "iban": { + "type": "string" + }, + "swiftBicCode": { + "type": "string" + } + } + }, + "AddAccountToPoolRequest": { + "type": "object", + "required": [ + "accountID" + ], + "properties": { + "accountID": { + "type": "string" + } + } + }, + "PoolRequest": { + "type": "object", + "required": [ + "name", + "accountIDs" + ], + "properties": { + "name": { + "type": "string" + }, + "accountIDs": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PaymentRequest": { + "type": "object", + "required": [ + "reference", + "connectorID", + "createdAt", + "amount", + "type", + "status", + "scheme", + "asset" + ], + "properties": { + "reference": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "type": { + "$ref": "#/components/schemas/PaymentType" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "scheme": { + "$ref": "#/components/schemas/PaymentScheme" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + } + } + }, + "TransferInitiationRequest": { + "type": "object", + "required": [ + "reference", + "scheduledAt", + "description", + "sourceAccountID", + "destinationAccountID", + "type", + "amount", + "asset", + "validated" + ], + "properties": { + "reference": { + "type": "string", + "example": "XXX" + }, + "scheduledAt": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "type": { + "type": "string", + "enum": [ + "TRANSFER", + "PAYOUT" + ] + }, + "amount": { + "type": "integer", + "format": "bigint" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "validated": { + "type": "boolean" + } + } + }, + "UpdateTransferInitiationStatusRequest": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "WAITING_FOR_VALIDATION", + "PROCESSING", + "PROCESSED", + "FAILED", + "REJECTED", + "VALIDATED" + ] + } + } + }, + "PaymentType": { + "type": "string", + "enum": [ + "PAY-IN", + "PAYOUT", + "TRANSFER", + "OTHER" + ] + }, + "PaymentScheme": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "diners", + "discover", + "jcb", + "unionpay", + "sepa debit", + "sepa credit", + "sepa", + "apple pay", + "google pay", + "a2a", + "ach debit", + "ach", + "rtp", + "unknown", + "other" + ] + }, + "PaymentStatus": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "TERMINATED", + "FAILED", + "SUCCEEDED", + "CANCELLED" + ] + }, + "Query": { + "type": "object", + "properties": { + "ledgers": { + "type": "array", + "items": { + "type": "string", + "example": "quickstart" + } + }, + "after": { + "type": "array", + "items": { + "type": "string", + "example": "users:002" + } + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "terms": { + "type": "array", + "items": { + "type": "string", + "example": "destination=central_bank1" + } + }, + "sort": { + "type": "string", + "example": "id:asc" + }, + "policy": { + "type": "string", + "example": "OR" + }, + "target": { + "type": "string" + }, + "cursor": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "raw": { + "type": "object", + "example": { + "query": { + "match_all": {} + } + } + } + } + }, + "Response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "The payload", + "additionalProperties": true + }, + "cursor": { + "title": "cursor", + "type": "object", + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "hasMore": { + "type": "boolean" + }, + "total": { + "title": "total", + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 1 + }, + "relation": { + "type": "string", + "example": "eq" + } + } + }, + "next": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "data": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": true + } + ] + } + } + } + } + } + }, + "ConfigUser": { + "type": "object", + "required": [ + "endpoint", + "eventTypes" + ], + "properties": { + "endpoint": { + "type": "string", + "example": "https://example.com" + }, + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + }, + "eventTypes": { + "type": "array", + "items": { + "type": "string", + "example": "TYPE1" + }, + "example": [ + "TYPE1", + "TYPE2" + ] + } + } + }, + "ConfigsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/Cursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/WebhooksConfig" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "Cursor": { + "type": "object", + "required": [ + "hasMore", + "data" + ], + "properties": { + "hasMore": { + "type": "boolean", + "example": false + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhooksConfig" + } + } + } + }, + "ConfigResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WebhooksConfig" + } + } + }, + "WebhooksConfig": { + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "endpoint": { + "type": "string", + "example": "https://example.com" + }, + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + }, + "eventTypes": { + "type": "array", + "items": { + "type": "string", + "example": "TYPE1" + }, + "example": [ + "TYPE1", + "TYPE2" + ] + }, + "active": { + "type": "boolean", + "example": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "endpoint", + "secret", + "eventTypes", + "active", + "createdAt", + "updatedAt" + ] + }, + "ConfigChangeSecret": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + } + }, + "required": [ + "secret" + ] + }, + "AttemptResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Attempt" + } + } + }, + "Attempt": { + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "webhookID": { + "type": "string", + "format": "uuid" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "config": { + "$ref": "#/components/schemas/WebhooksConfig" + }, + "payload": { + "type": "string", + "example": "{\"data\":\"test\"}" + }, + "statusCode": { + "type": "integer", + "example": 200 + }, + "retryAttempt": { + "type": "integer", + "example": 1 + }, + "status": { + "type": "string", + "example": "success" + }, + "nextRetryAfter": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "webhookID", + "createdAt", + "updatedAt", + "config", + "payload", + "statusCode", + "retryAttempt", + "status" + ] + }, + "webhooksErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "$ref": "#/components/schemas/webhooksErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "[VALIDATION] invalid 'cursor' query param" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + } + } + }, + "webhooksErrorsEnum": { + "type": "string", + "enum": [ + "INTERNAL", + "VALIDATION", + "NOT_FOUND" + ], + "example": "VALIDATION" + }, + "Monetary": { + "type": "object", + "required": [ + "asset", + "amount" + ], + "properties": { + "asset": { + "type": "string", + "description": "The asset of the monetary value." + }, + "amount": { + "type": "integer", + "format": "bigint", + "description": "The amount of the monetary value." + } + } + }, + "Wallet": { + "type": "object", + "required": [ + "name", + "id", + "metadata", + "createdAt", + "ledger" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "name": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "ledger": { + "type": "string" + } + } + }, + "WalletWithBalances": { + "type": "object", + "required": [ + "name", + "id", + "metadata", + "createdAt", + "balances", + "ledger" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." + }, + "metadata": { + "type": "object", + "description": "Metadata associated with the wallet.", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "balances": { + "type": "object", + "required": [ + "main" + ], + "properties": { + "main": { + "$ref": "#/components/schemas/AssetHolder" + } + } + }, + "ledger": { + "type": "string" + } + } + }, + "Hold": { + "type": "object", + "required": [ + "id", + "walletID", + "metadata", + "description" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the hold." + }, + "walletID": { + "type": "string", + "description": "The ID of the wallet the hold is associated with." + }, + "metadata": { + "type": "object", + "description": "Metadata associated with the hold.", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "destination": { + "$ref": "#/components/schemas/Subject" + } + } + }, + "ExpandedDebitHold": { + "allOf": [ + { + "$ref": "#/components/schemas/Hold" + }, + { + "type": "object", + "required": [ + "remaining", + "originalAmount" + ], + "properties": { + "remaining": { + "type": "integer", + "description": "Remaining amount on hold", + "example": 10, + "format": "bigint" + }, + "originalAmount": { + "type": "integer", + "description": "Original amount on hold", + "example": 100, + "format": "bigint" + } + } + } + ] + }, + "ListWalletsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Wallet" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "CreateWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Wallet" + } + } + }, + "GetWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WalletWithBalances" + } + } + }, + "DebitWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Hold" + } + } + }, + "walletsAggregatedVolumes": { + "type": "object", + "x-go-type": { + "type": "AggregatedVolumes" + }, + "additionalProperties": { + "$ref": "#/components/schemas/walletsVolumes" + } + }, + "walletsTransaction": { + "type": "object", + "properties": { + "ledger": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "id": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "preCommitVolumes": { + "$ref": "#/components/schemas/walletsAggregatedVolumes" + }, + "postCommitVolumes": { + "$ref": "#/components/schemas/walletsAggregatedVolumes" + } + }, + "required": [ + "postings", + "timestamp", + "ix", + "metadata" + ] + }, + "walletsCursor": { + "type": "object", + "required": [ + "pageSize" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + } + } + }, + "GetTransactionsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/walletsTransaction" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetHoldsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Hold" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetHoldResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ExpandedDebitHold" + } + } + }, + "CreateWalletRequest": { + "type": "object", + "required": [ + "name", + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "description": "Custom metadata to attach to this wallet.", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, + "walletsVolume": { + "type": "object", + "properties": { + "input": { + "type": "integer", + "format": "bigint" + }, + "output": { + "type": "integer", + "format": "bigint" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + }, + "required": [ + "input", + "output", + "balance" + ], + "example": { + "input": 100, + "output": 20, + "balance": 80 + } + }, + "walletsVolumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/walletsVolume" + }, + "example": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "ConfirmHoldRequest": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "example": 100, + "description": "Define the amount to transfer." + }, + "final": { + "type": "boolean", + "example": true, + "description": "Define a final confirmation. Remaining funds will be returned to the wallet." + } + } + }, + "LedgerAccountSubject": { + "type": "object", + "required": [ + "type", + "identifier" + ], + "properties": { + "type": { + "type": "string" + }, + "identifier": { + "type": "string" + } + } + }, + "WalletSubject": { + "type": "object", + "required": [ + "type", + "identifier" + ], + "properties": { + "type": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "balance": { + "type": "string" + } + } + }, + "Subject": { + "discriminator": { + "propertyName": "type", + "mapping": { + "ACCOUNT": "#/components/schemas/LedgerAccountSubject", + "WALLET": "#/components/schemas/WalletSubject" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/LedgerAccountSubject" + }, + { + "$ref": "#/components/schemas/WalletSubject" + } + ] + }, + "CreditWalletRequest": { + "type": "object", + "required": [ + "amount", + "sources", + "metadata" + ], + "properties": { + "amount": { + "$ref": "#/components/schemas/Monetary" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "reference": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Subject" + } + }, + "balance": { + "type": "string", + "description": "The balance to credit" + } + }, + "example": { + "amount": { + "asset": "USD/2", + "amount": 100 + }, + "metadata": { + "key": "" + }, + "sources": [] + } + }, + "DebitWalletRequest": { + "type": "object", + "required": [ + "amount", + "metadata" + ], + "properties": { + "amount": { + "$ref": "#/components/schemas/Monetary" + }, + "pending": { + "type": "boolean", + "description": "Set to true to create a pending hold. If false, the wallet will be debited immediately." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "description": { + "type": "string" + }, + "destination": { + "$ref": "#/components/schemas/Subject" + }, + "balances": { + "type": "array", + "items": { + "type": "string", + "description": "A targeted balance (use '*' for all)" + } + } + }, + "example": { + "amount": { + "asset": "USD/2", + "amount": 100 + }, + "metadata": { + "key": "" + }, + "pending": true + } + }, + "AssetHolder": { + "type": "object", + "required": [ + "assets" + ], + "properties": { + "assets": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + } + } + }, + "Balance": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "format": "date-time" + }, + "priority": { + "type": "integer", + "format": "bigint" + } + } + }, + "BalanceWithAssets": { + "allOf": [ + { + "$ref": "#/components/schemas/Balance" + }, + { + "$ref": "#/components/schemas/AssetHolder" + } + ] + }, + "GetWalletSummaryResponse": { + "type": "object", + "required": [ + "balances", + "availableFunds", + "expiredFunds", + "expirableFunds", + "holdFunds" + ], + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceWithAssets" + } + }, + "availableFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "expiredFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "expirableFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "holdFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + } + } + }, + "ListBalancesResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Balance" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetBalanceResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/BalanceWithAssets" + } + } + }, + "CreateBalanceRequest": { + "$ref": "#/components/schemas/Balance" + }, + "CreateBalanceResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Balance" + } + } + }, + "walletsErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "type": "string", + "enum": [ + "VALIDATION", + "INTERNAL_ERROR", + "INSUFFICIENT_FUND", + "HOLD_CLOSED" + ] + }, + "errorMessage": { + "type": "string" + } + } + }, + "Error": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "type": "string", + "enum": [ + "VALIDATION", + "NOT_FOUND" + ] + }, + "errorMessage": { + "type": "string" + } + } + }, + "WorkflowConfig": { + "type": "object", + "required": [ + "stages" + ], + "properties": { + "name": { + "type": "string" + }, + "stages": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "Workflow": { + "type": "object", + "required": [ + "config", + "createdAt", + "updatedAt", + "id" + ], + "properties": { + "config": { + "$ref": "#/components/schemas/WorkflowConfig" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + } + } + }, + "StageStatus": { + "type": "object", + "required": [ + "stage", + "instanceID", + "startedAt" + ], + "properties": { + "stage": { + "type": "number" + }, + "instanceID": { + "type": "string" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" + } + } + }, + "WorkflowInstance": { + "type": "object", + "required": [ + "workflowID", + "id", + "createdAt", + "updatedAt", + "terminated" + ], + "properties": { + "workflowID": { + "type": "string" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StageStatus" + } + }, + "terminated": { + "type": "boolean" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" + } + } + }, + "WorkflowInstanceHistoryStage": { + "type": "object", + "required": [ + "name", + "input", + "startedAt", + "terminated", + "attempt" + ], + "properties": { + "name": { + "type": "string" + }, + "input": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageInput" + }, + "output": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageOutput" + }, + "error": { + "type": "string" + }, + "terminated": { + "type": "boolean" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "lastFailure": { + "type": "string" + }, + "attempt": { + "type": "integer" + }, + "nextExecution": { + "type": "string", + "format": "date-time" + } + } + }, + "WorkflowInstanceHistory": { + "type": "object", + "required": [ + "name", + "input", + "terminated", + "startedAt" + ], + "properties": { + "name": { + "type": "string" + }, + "input": { + "$ref": "#/components/schemas/Stage" + }, + "error": { + "type": "string" + }, + "terminated": { + "type": "boolean" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "WorkflowInstanceHistoryList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowInstanceHistory" + } + }, + "WorkflowInstanceHistoryStageList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStage" + } + }, + "ListWorkflowsResponse": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Workflow" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "TriggerData": { + "type": "object", + "required": [ + "event", + "workflowID" + ], + "properties": { + "event": { + "type": "string" + }, + "workflowID": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "vars": { + "type": "object", + "additionalProperties": true + } + } + }, + "Trigger": { + "allOf": [ + { + "$ref": "#/components/schemas/TriggerData" + }, + { + "type": "object", + "required": [ + "id", + "createdAt" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + ] + }, + "TriggerOccurrence": { + "type": "object", + "required": [ + "triggerID", + "workflowInstanceID", + "date" + ], + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "workflowInstanceID": { + "type": "string" + }, + "triggerID": { + "type": "string" + } + } + }, + "ListTriggersOccurrencesResponse": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/TriggerOccurrence" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "ListTriggersResponse": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Trigger" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "ReadWorkflowResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Workflow" + } + } + }, + "CreateWorkflowRequest": { + "$ref": "#/components/schemas/WorkflowConfig" + }, + "CreateWorkflowResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Workflow" + } + } + }, + "CreateTriggerResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Trigger" + } + } + }, + "RunWorkflowRequest": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "RunWorkflowResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowInstance" + } + } + }, + "ListRunsResponse": { + "required": [ + "data" + ], + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/WorkflowInstance" + }, + "type": "array" + } + } + }, + "GetWorkflowResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Workflow" + } + } + }, + "GetWorkflowInstanceResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowInstance" + } + } + }, + "GetWorkflowInstanceHistoryResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryList" + } + } + }, + "GetWorkflowInstanceHistoryStageResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageList" + } + } + }, + "StageSendSourceWallet": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "balance": { + "type": "string" + } + } + }, + "StageSendDestinationWallet": { + "$ref": "#/components/schemas/StageSendSourceWallet" + }, + "StageSendSourceAccount": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "ledger": { + "type": "string" + } + } + }, + "StageSendDestinationAccount": { + "$ref": "#/components/schemas/StageSendSourceAccount" + }, + "StageSendSourcePayment": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "StageSendDestinationPayment": { + "type": "object", + "required": [ + "psp" + ], + "properties": { + "psp": { + "type": "string" + } + } + }, + "StageSendSource": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/components/schemas/StageSendSourceWallet" + }, + "account": { + "$ref": "#/components/schemas/StageSendSourceAccount" + }, + "payment": { + "$ref": "#/components/schemas/StageSendSourcePayment" + } + } + }, + "StageSendDestination": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/components/schemas/StageSendDestinationWallet" + }, + "account": { + "$ref": "#/components/schemas/StageSendDestinationAccount" + }, + "payment": { + "$ref": "#/components/schemas/StageSendDestinationPayment" + } + } + }, + "StageSend": { + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/Monetary" + }, + "destination": { + "$ref": "#/components/schemas/StageSendDestination" + }, + "source": { + "$ref": "#/components/schemas/StageSendSource" + } + } + }, + "StageDelay": { + "type": "object", + "properties": { + "until": { + "type": "string", + "format": "date-time" + }, + "duration": { + "type": "string" + } + } + }, + "StageWaitEvent": { + "type": "object", + "required": [ + "event" + ], + "properties": { + "event": { + "type": "string" + } + } + }, + "Stage": { + "anyOf": [ + { + "$ref": "#/components/schemas/StageSend" + }, + { + "$ref": "#/components/schemas/StageDelay" + }, + { + "$ref": "#/components/schemas/StageWaitEvent" + } + ] + }, + "StripeTransferRequest": { + "type": "object", + "properties": { + "connectorID": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "USD" + }, + "destination": { + "type": "string", + "example": "acct_1Gqj58KZcSIg2N2q" + }, + "waitingValidation": { + "type": "boolean", + "example": false, + "default": false + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a transfer object.\nIt can be useful for storing additional information about the transfer in a structured format.\n", + "example": { + "order_id": "6735" + } + } + } + }, + "ActivityStripeTransfer": { + "$ref": "#/components/schemas/StripeTransferRequest" + }, + "ActivityGetAccount": { + "type": "object", + "required": [ + "id", + "ledger" + ], + "properties": { + "id": { + "type": "string" + }, + "ledger": { + "type": "string" + } + } + }, + "ActivityCreateTransaction": { + "type": "object", + "properties": { + "ledger": { + "type": "string" + }, + "data": { + "$ref": "#/components/schemas/PostTransaction" + } + } + }, + "ActivityRevertTransaction": { + "type": "object", + "required": [ + "id", + "ledger" + ], + "properties": { + "ledger": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "ActivityGetPayment": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "ActivityConfirmHold": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "ActivityCreditWallet": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "$ref": "#/components/schemas/CreditWalletRequest" + } + } + }, + "ActivityDebitWallet": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "$ref": "#/components/schemas/DebitWalletRequest" + } + } + }, + "ActivityGetWallet": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "ActivityVoidHold": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "ActivityGetAccountOutput": { + "$ref": "#/components/schemas/AccountResponse" + }, + "ActivityCreateTransactionOutput": { + "$ref": "#/components/schemas/orchestrationCreateTransactionResponse" + }, + "orchestrationCreateTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Transaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "ActivityRevertTransactionOutput": { + "$ref": "#/components/schemas/RevertTransactionResponse" + }, + "ActivityGetPaymentOutput": { + "$ref": "#/components/schemas/orchestrationPaymentResponse" + }, + "orchestrationPaymentResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/orchestrationPayment" + } + } + }, + "orchestrationPayment": { + "type": "object", + "required": [ + "id", + "reference", + "connectorID", + "sourceAccountID", + "destinationAccountID", + "type", + "status", + "initialAmount", + "scheme", + "asset", + "createdAt", + "raw", + "adjustments", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "reference": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/orchestrationConnector" + }, + "type": { + "type": "string", + "enum": [ + "PAY-IN", + "PAYOUT", + "TRANSFER", + "OTHER" + ] + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "initialAmount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "scheme": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "diners", + "discover", + "jcb", + "unionpay", + "sepa debit", + "sepa credit", + "sepa", + "apple pay", + "google pay", + "a2a", + "ach debit", + "ach", + "rtp", + "unknown", + "other" + ] + }, + "asset": { + "type": "string", + "example": "USD" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object", + "nullable": true + }, + "adjustments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentAdjustment" + } + }, + "metadata": { + "$ref": "#/components/schemas/orchestrationPaymentMetadata" + } + } + }, + "orchestrationConnector": { + "type": "string", + "enum": [ + "STRIPE", + "DUMMY-PAY", + "WISE", + "MODULR", + "CURRENCY-CLOUD", + "BANKING-CIRCLE", + "MANGOPAY", + "MONEYCORP" + ] + }, + "orchestrationPaymentMetadata": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "nullable": true + }, + "ActivityDebitWalletOutput": { + "$ref": "#/components/schemas/DebitWalletResponse" + }, + "ActivityGetWalletOutput": { + "$ref": "#/components/schemas/GetWalletResponse" + }, + "WorkflowInstanceHistoryStageInput": { + "type": "object", + "properties": { + "GetAccount": { + "$ref": "#/components/schemas/ActivityGetAccount" + }, + "CreateTransaction": { + "$ref": "#/components/schemas/ActivityCreateTransaction" + }, + "RevertTransaction": { + "$ref": "#/components/schemas/ActivityRevertTransaction" + }, + "StripeTransfer": { + "$ref": "#/components/schemas/ActivityStripeTransfer" + }, + "GetPayment": { + "$ref": "#/components/schemas/ActivityGetPayment" + }, + "ConfirmHold": { + "$ref": "#/components/schemas/ActivityConfirmHold" + }, + "CreditWallet": { + "$ref": "#/components/schemas/ActivityCreditWallet" + }, + "DebitWallet": { + "$ref": "#/components/schemas/ActivityDebitWallet" + }, + "GetWallet": { + "$ref": "#/components/schemas/ActivityGetWallet" + }, + "VoidHold": { + "$ref": "#/components/schemas/ActivityVoidHold" + } + } + }, + "WorkflowInstanceHistoryStageOutput": { + "type": "object", + "properties": { + "GetAccount": { + "$ref": "#/components/schemas/ActivityGetAccountOutput" + }, + "CreateTransaction": { + "$ref": "#/components/schemas/ActivityCreateTransactionOutput" + }, + "RevertTransaction": { + "$ref": "#/components/schemas/ActivityRevertTransactionOutput" + }, + "GetPayment": { + "$ref": "#/components/schemas/ActivityGetPaymentOutput" + }, + "DebitWallet": { + "$ref": "#/components/schemas/ActivityDebitWalletOutput" + }, + "GetWallet": { + "$ref": "#/components/schemas/ActivityGetWalletOutput" + } + } + }, + "orchestrationMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "ReadTriggerResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Trigger" + } + } + }, + "PoliciesCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + }, + "ReconciliationsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Reconciliation" + } + } + } + } + } + }, + "PolicyRequest": { + "type": "object", + "required": [ + "name", + "ledgerName", + "ledgerQuery", + "paymentsPoolID" + ], + "properties": { + "name": { + "type": "string", + "example": "XXX" + }, + "ledgerName": { + "type": "string", + "example": "default" + }, + "ledgerQuery": { + "type": "string", + "example": "{\"$match\": {\"metadata[reconciliation]\": \"pool:main\"}}" + }, + "paymentsPoolID": { + "type": "string", + "example": "XXX" + } + } + }, + "PolicyResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "policy": { + "$ref": "#/components/schemas/Policy" + } + } + }, + "ReconciliationRequest": { + "type": "object", + "required": [ + "reconciledAtLedger", + "reconciledAtPayment" + ], + "properties": { + "reconciledAtLedger": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "reconciledAtPayment": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + } + } + }, + "ReconciliationResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "reconciliation": { + "$ref": "#/components/schemas/Reconciliation" + } + } + }, + "Policy": { + "type": "object", + "required": [ + "id", + "name", + "createdAt", + "ledgerName", + "ledgerQuery", + "paymentsPoolID" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "name": { + "type": "string", + "example": "XXX" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "ledgerName": { + "type": "string", + "example": "default" + }, + "ledgerQuery": { + "type": "string", + "example": "{\"$match\": {\"metadata[reconciliation]\": \"pool:main\"}}" + }, + "paymentsPoolID": { + "type": "string", + "example": "XXX" + } + } + }, + "Reconciliation": { + "type": "object", + "required": [ + "id", + "policyID", + "createdAt", + "reconciledAtLedger", + "reconciledAtPayments", + "status", + "paymentsBalances", + "ledgerBalances" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "policyID": { + "type": "string", + "example": "XXX" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "reconciledAtLedger": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "reconciledAtPayments": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "status": { + "type": "string", + "example": "COMPLETED" + }, + "paymentsBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "ledgerBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "error": { + "type": "string" + } + } + }, + "reconciliationErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "type": "string", + "example": "VALIDATION" + }, + "errorMessage": { + "type": "string" + }, + "details": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "Authorization": { + "type": "oauth2", + "flows": { + "clientCredentials": { + "tokenUrl": "https://localhost/api/auth/oauth/token", + "refreshUrl": "https://localhost/api/auth/oauth/token", + "scopes": {} + } + } + } + }, + "responses": { + "NoContent": { + "description": "No content" + }, + "ServerInfo": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + }, + "Payments": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCursor" + } + } + } + }, + "Payment": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentResponse" + } + } + } + }, + "Pools": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolsCursor" + } + } + } + }, + "Pool": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolResponse" + } + } + } + }, + "PoolBalances": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolBalancesResponse" + } + } + } + }, + "TransferInitiations": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferInitiationsCursor" + } + } + } + }, + "TransferInitiation": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferInitiationResponse" + } + } + } + }, + "Accounts": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountsCursor" + } + } + } + }, + "Account": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/paymentsAccountResponse" + } + } + } + }, + "AccountBalances": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BalancesCursor" + } + } + } + }, + "ConnectorInstalled": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorResponse" + } + } + } + }, + "Connectors": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorsResponse" + } + } + } + }, + "BankAccounts": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankAccountsCursor" + } + } + } + }, + "BankAccount": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankAccountResponse" + } + } + } + }, + "ConnectorsConfigs": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorsConfigsResponse" + } + } + } + }, + "ConnectorConfig": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorConfigResponse" + } + } + } + }, + "Tasks": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TasksCursor" + } + } + } + }, + "Task": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskResponse" + } + } + } + }, + "Transfer": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferResponse" + } + } + } + }, + "Transfers": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransfersResponse" + } + } + } + }, + "ErrorResponse": { + "description": "General error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Policies": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoliciesCursorResponse" + } + } + } + }, + "Policy": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResponse" + } + } + } + }, + "Reconciliations": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationsCursorResponse" + } + } + } + }, + "Reconciliation": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationResponse" + } + } + } + }, + "reconciliationErrorResponse": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/reconciliationErrorResponse" + } + } + } + } + }, + "parameters": { + "Query": { + "name": "query", + "in": "query", + "required": false, + "description": "Filters used to filter resources.\n", + "schema": { + "type": "string" + } + }, + "PageSize": { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "default": 15 + } + }, + "Cursor": { + "name": "cursor", + "in": "query", + "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + "Sort": { + "name": "sort", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Fields used to sort payments (default is date:desc).", + "example": [ + "date:asc", + "status:desc" + ] + }, + "PaymentId": { + "name": "paymentId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The payment ID.", + "example": "XXX", + "required": true + }, + "AccountId": { + "name": "accountId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The account ID.", + "example": "XXX", + "required": true + }, + "ConnectorID": { + "name": "connectorId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The connector ID.", + "example": "XXX", + "required": true + }, + "PoolId": { + "name": "poolId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The pool ID.", + "example": "XXX", + "required": true + }, + "TransferId": { + "name": "transferId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The transfer ID.", + "example": "XXX", + "required": true + }, + "BankAccountId": { + "name": "bankAccountId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The bank account ID.", + "example": "XXX", + "required": true + }, + "Connector": { + "name": "connector", + "description": "The name of the connector.", + "in": "path", + "schema": { + "$ref": "#/components/schemas/Connector" + }, + "required": true + }, + "TaskId": { + "name": "taskId", + "description": "The task ID.", + "example": "task1", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + "reconciliationPageSize": { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + "PolicyID": { + "name": "policyID", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The policy ID.", + "example": "XXX", + "required": true + }, + "ReconciliationID": { + "name": "reconciliationID", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The reconciliation ID.", + "example": "XXX", + "required": true + } + }, + "requestBodies": { + "ConnectorConfig": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorConfig" + } + } + } + }, + "UpdateMetadata": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentMetadata" + } + } + } + }, + "Payment": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentRequest" + } + } + } + }, + "Pool": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolRequest" + } + } + } + }, + "AddAccountToPool": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddAccountToPoolRequest" + } + } + } + }, + "TransferInitiation": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferInitiationRequest" + } + } + } + }, + "BankAccount": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankAccountRequest" + } + } + } + }, + "UpdateTransferInitiationStatus": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTransferInitiationStatusRequest" + } + } + } + }, + "Transfer": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferRequest" + } + } + } + }, + "Policy": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyRequest" + } + } + } + }, + "Reconciliation": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationRequest" + } + } + } + } + } + }, + "x-tagGroups": [ + { + "name": "Auth", + "tags": [ + "Clients", + "Scopes", + "Users", + "Auth" + ] + }, + { + "name": "Ledger", + "tags": [ + "Ledger", + "Server", + "Accounts", + "Mapping", + "Script", + "Stats", + "Transactions", + "Balances", + "server", + "accounts", + "mapping", + "script", + "stats", + "transactions", + "balances" + ] + }, + { + "name": "Payments", + "tags": [ + "Payments" + ] + }, + { + "name": "Search", + "tags": [ + "Search" + ] + }, + { + "name": "Wallets", + "tags": [ + "Wallets" + ] + }, + { + "name": "Webhooks", + "tags": [ + "Webhooks" + ] + }, + { + "name": "Flows", + "tags": [ + "Orchestration" + ] + } + ] +}