- go.mod module path + all self-imports: github.com/formancehq/payments -> github.com/hanzo-fi/payments (1590 .go files / 3152 refs; 20 modules: root, pkg/client, pkg/domain, 18 ce/plugins). External dep kept: formancehq/go-libs. - plugins: each ce/plugins/* consumed a *published* pkg/domain; added local 'replace .../pkg/domain => ../../../pkg/domain' (consistent with root) so every standalone plugin module builds in-monorepo. compile-plugin.sh MOD var rebranded too. - branding: README, LICENSE (dual MIT+EE; upstream copyright retained + Hanzo added), goreleaser (release images -> registry.hanzo.ai/hanzo-fi, OCI labels, homepage), proto go_package, renovate, speakeasy gen.yaml, connector-template *.gotpl. - CI: removed Numary/Formance workflows + composite action; added canonical hanzo.yml + cicd.yml (hanzoai/ci, gated HANZO_CI_ENABLED) + secretless ci.yml (go build/vet). - kept as data/compat keys: wire capability enums ALLOW_FORMANCE_*, generated SDK type client.Formance, domain field FormanceRedirectURL, OTEL_SERVICE_NAME, upstream base image. - verified: go build ./... (default + -tags ee) + all 20 nested modules green.
6.8 KiB
\DefaultApi
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| GetAccountBalances | Get /accounts/{accountId}/balances | Get account balance |
| GetAccounts | Get /accounts | Get all accounts |
| GetBeneficiaries | Get /beneficiaries | Get all beneficiaries |
| GetTransactions | Get /transactions | Get all transactions |
| CreatePayout | Post /payouts | Create payout |
| CreateTransfer | Post /transfers | Create transfer |
GetAccountBalances
Balances GetAccountBalances(ctx, accountId).Execute()
Get account balance
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzo-fi/payments/genericclient"
)
func main() {
accountId := "accountId_example"
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultApi.GetAccountBalances(context.Background(), accountId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetAccountBalances``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetAccountBalances`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| accountId | string |
Return type
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAccounts
[]Account GetAccounts(ctx).PageSize(pageSize).Page(page).Sort(sort).CreatedAtFrom(createdAtFrom).Execute()
Get all accounts
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | int64 | Number of items per page | [default to 100] |
| page | int64 | Page number | [default to 1] |
| sort | string | Sort order | |
| createdAtFrom | time.Time | Filter by created at date |
Return type
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBeneficiaries
[]Beneficiary GetBeneficiaries(ctx).PageSize(pageSize).Page(page).Sort(sort).CreatedAtFrom(createdAtFrom).Execute()
Get all beneficiaries (external accounts)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | int64 | Number of items per page | [default to 100] |
| page | int64 | Page number | [default to 1] |
| sort | string | Sort order | |
| createdAtFrom | time.Time | Filter by created at date |
Return type
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetTransactions
[]Transaction GetTransactions(ctx).PageSize(pageSize).Page(page).Sort(sort).UpdatedAtFrom(updatedAtFrom).Execute()
Get all transactions
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | int64 | Number of items per page | [default to 100] |
| page | int64 | Page number | [default to 1] |
| sort | string | Sort order | |
| updatedAtFrom | time.Time | Filter by updated at date |
Return type
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreatePayout
Payout CreatePayout(ctx).PayoutRequest(payoutRequest).Execute()
Create payout
Create an outgoing payment to an external beneficiary account.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzo-fi/payments/genericclient"
)
func main() {
payoutRequest := *openapiclient.NewPayoutRequest(
"payout-123",
"10000",
"USD/2",
"acc_source_001",
"ben_dest_002",
)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultApi.CreatePayout(context.Background()).PayoutRequest(payoutRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreatePayout``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreatePayout`: %v\n", resp)
}
Request Body
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateTransfer
Transfer CreateTransfer(ctx).TransferRequest(transferRequest).Execute()
Create transfer
Create an internal transfer between two accounts within the PSP.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzo-fi/payments/genericclient"
)
func main() {
transferRequest := *openapiclient.NewTransferRequest(
"transfer-456",
"50000",
"EUR/2",
"acc_main_001",
"acc_savings_002",
)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultApi.CreateTransfer(context.Background()).TransferRequest(transferRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateTransfer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateTransfer`: %v\n", resp)
}
Request Body
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]