* Add method to fetch latest balance from storage * Add functionality to fetch latest pool balance if at value is current time * Add new API endpoint for fetching latest pool balances * Generate openapi specs for new latest balances endpoint * Add e2e test for new pool balances endpoint
V3
(Payments.V3)
Overview
Available Operations
-
CreateAccount - Create a formance account object. This object will not be forwarded to the connector. It is only used for internal purposes.
-
ListAccounts - List all accounts
-
GetAccount - Get an account by ID
-
GetAccountBalances - Get account balances
-
CreateBankAccount - Create a formance bank account object. This object will not be forwarded to the connector until you called the forwardBankAccount method.
-
ListBankAccounts - List all bank accounts
-
GetBankAccount - Get a Bank Account by ID
-
UpdateBankAccountMetadata - Update a bank account's metadata
-
ForwardBankAccount - Forward a Bank Account to a PSP for creation
-
ListConnectors - List all connectors
-
InstallConnector - Install a connector
-
ListConnectorConfigs - List all connector configurations
-
UninstallConnector - Uninstall a connector
-
GetConnectorConfig - Get a connector configuration by ID
-
V3UpdateConnectorConfig - Update the config of a connector
-
ResetConnector - Reset a connector. Be aware that this will delete all data and stop all existing tasks like payment initiations and bank account creations.
-
ListConnectorSchedules - List all connector schedules
-
GetConnectorSchedule - Get a connector schedule by ID
-
ListConnectorScheduleInstances - List all connector schedule instances
-
CreatePayment - Create a formance payment object. This object will not be forwarded to the connector. It is only used for internal purposes.
-
ListPayments - List all payments
-
GetPayment - Get a payment by ID
-
UpdatePaymentMetadata - Update a payment's metadata
-
InitiatePayment - Initiate a payment
-
ListPaymentInitiations - List all payment initiations
-
DeletePaymentInitiation - Delete a payment initiation by ID
-
GetPaymentInitiation - Get a payment initiation by ID
-
RetryPaymentInitiation - Retry a payment initiation
-
ApprovePaymentInitiation - Approve a payment initiation
-
RejectPaymentInitiation - Reject a payment initiation
-
ReversePaymentInitiation - Reverse a payment initiation
-
ListPaymentInitiationAdjustments - List all payment initiation adjustments
-
ListPaymentInitiationRelatedPayments - List all payments related to a payment initiation
-
CreatePaymentServiceUser - Create a formance payment service user object
-
ListPaymentServiceUsers - List all payment service users
-
GetPaymentServiceUser - Get a payment service user by ID
-
AddBankAccountToPaymentServiceUser - Add a bank account to a payment service user
-
ForwardPaymentServiceUserBankAccount - Forward a payment service user's bank account to a connector
-
CreatePool - Create a formance pool object
-
ListPools - List all pools
-
GetPool - Get a pool by ID
-
DeletePool - Delete a pool by ID
-
GetPoolBalances - Get historical pool balances from a particular point in time
-
GetPoolBalancesLatest - Get latest pool balances
-
AddAccountToPool - Add an account to a pool
-
RemoveAccountFromPool - Remove an account from a pool
-
GetTask - Get a task and its result by ID
CreateAccount
Create a formance account object. This object will not be forwarded to the connector. It is only used for internal purposes.
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.CreateAccount(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.V3CreateAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3CreateAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3CreateAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListAccounts
List all accounts
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListAccounts(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3AccountsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListAccountsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetAccount
Get an account by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetAccount(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
accountID |
string | ✔️ | The account ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetAccountBalances
Get account balances
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"github.com/formancehq/payments/pkg/client/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetAccountBalances(ctx, operations.V3GetAccountBalancesRequest{
AccountID: "<id>",
PageSize: client.Int64(100),
Cursor: client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="),
})
if err != nil {
log.Fatal(err)
}
if res.V3BalancesCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V3GetAccountBalancesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetAccountBalancesResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
CreateBankAccount
Create a formance bank account object. This object will not be forwarded to the connector until you called the forwardBankAccount method.
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.CreateBankAccount(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.V3CreateBankAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3CreateBankAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3CreateBankAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListBankAccounts
List all bank accounts
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListBankAccounts(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3BankAccountsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListBankAccountsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetBankAccount
Get a Bank Account by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetBankAccount(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetBankAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
bankAccountID |
string | ✔️ | The bank account ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetBankAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
UpdateBankAccountMetadata
Update a bank account's metadata
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.UpdateBankAccountMetadata(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
bankAccountID |
string | ✔️ | The bank account ID |
v3UpdateBankAccountMetadataRequest |
*components.V3UpdateBankAccountMetadataRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3UpdateBankAccountMetadataResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ForwardBankAccount
Forward a Bank Account to a PSP for creation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ForwardBankAccount(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.V3ForwardBankAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
bankAccountID |
string | ✔️ | The bank account ID |
v3ForwardBankAccountRequest |
*components.V3ForwardBankAccountRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ForwardBankAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListConnectors
List all connectors
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListConnectors(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3ConnectorsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListConnectorsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
InstallConnector
Install a connector
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.InstallConnector(ctx, "<value>", nil)
if err != nil {
log.Fatal(err)
}
if res.V3InstallConnectorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connector |
string | ✔️ | The connector to filter by |
v3InstallConnectorRequest |
*components.V3InstallConnectorRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3InstallConnectorResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListConnectorConfigs
List all connector configurations
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListConnectorConfigs(ctx)
if err != nil {
log.Fatal(err)
}
if res.V3ConnectorConfigsResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListConnectorConfigsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
UninstallConnector
Uninstall a connector
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.UninstallConnector(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3UninstallConnectorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connectorID |
string | ✔️ | The connector ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3UninstallConnectorResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetConnectorConfig
Get a connector configuration by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetConnectorConfig(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetConnectorConfigResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connectorID |
string | ✔️ | The connector ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetConnectorConfigResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
V3UpdateConnectorConfig
Update connector config
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.V3UpdateConnectorConfig(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connectorID |
string | ✔️ | The connector ID |
v3UpdateConnectorRequest |
*components.V3UpdateConnectorRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3UpdateConnectorConfigResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ResetConnector
Reset a connector. Be aware that this will delete all data and stop all existing tasks like payment initiations and bank account creations.
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ResetConnector(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3ResetConnectorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connectorID |
string | ✔️ | The connector ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ResetConnectorResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListConnectorSchedules
List all connector schedules
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListConnectorSchedules(ctx, "<id>", client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3ConnectorSchedulesCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
connectorID |
string | ✔️ | The connector ID | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListConnectorSchedulesResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetConnectorSchedule
Get a connector schedule by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetConnectorSchedule(ctx, "<id>", "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3ConnectorScheduleResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
connectorID |
string | ✔️ | The connector ID |
scheduleID |
string | ✔️ | The schedule ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetConnectorScheduleResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListConnectorScheduleInstances
List all connector schedule instances
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListConnectorScheduleInstances(ctx, "<id>", "<id>", client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="))
if err != nil {
log.Fatal(err)
}
if res.V3ConnectorScheduleInstancesCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
connectorID |
string | ✔️ | The connector ID | |
scheduleID |
string | ✔️ | The schedule ID | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListConnectorScheduleInstancesResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
CreatePayment
Create a formance payment object. This object will not be forwarded to the connector. It is only used for internal purposes.
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.CreatePayment(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.V3CreatePaymentResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3CreatePaymentRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3CreatePaymentResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPayments
List all payments
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPayments(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PaymentsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPaymentsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPayment
Get a payment by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPayment(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetPaymentResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentID |
string | ✔️ | The payment ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPaymentResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
UpdatePaymentMetadata
Update a payment's metadata
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.UpdatePaymentMetadata(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentID |
string | ✔️ | The payment ID |
v3UpdatePaymentMetadataRequest |
*components.V3UpdatePaymentMetadataRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3UpdatePaymentMetadataResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
InitiatePayment
Initiate a payment
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.InitiatePayment(ctx, nil, nil)
if err != nil {
log.Fatal(err)
}
if res.V3InitiatePaymentResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
noValidation |
*bool | ➖ | If set to true, the request will not have to be validated. This is useful if we want to directly forward the request to the PSP. |
v3InitiatePaymentRequest |
*components.V3InitiatePaymentRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3InitiatePaymentResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPaymentInitiations
List all payment initiations
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPaymentInitiations(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PaymentInitiationsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPaymentInitiationsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
DeletePaymentInitiation
Delete a payment initiation by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.DeletePaymentInitiation(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3DeletePaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPaymentInitiation
Get a payment initiation by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPaymentInitiation(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetPaymentInitiationResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
RetryPaymentInitiation
Retry a payment initiation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.RetryPaymentInitiation(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3RetryPaymentInitiationResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3RetryPaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ApprovePaymentInitiation
Approve a payment initiation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ApprovePaymentInitiation(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3ApprovePaymentInitiationResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ApprovePaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
RejectPaymentInitiation
Reject a payment initiation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.RejectPaymentInitiation(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3RejectPaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ReversePaymentInitiation
Reverse a payment initiation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ReversePaymentInitiation(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.V3ReversePaymentInitiationResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentInitiationID |
string | ✔️ | The payment initiation ID |
v3ReversePaymentInitiationRequest |
*components.V3ReversePaymentInitiationRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ReversePaymentInitiationResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPaymentInitiationAdjustments
List all payment initiation adjustments
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPaymentInitiationAdjustments(ctx, "<id>", client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PaymentInitiationAdjustmentsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
paymentInitiationID |
string | ✔️ | The payment initiation ID | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPaymentInitiationAdjustmentsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPaymentInitiationRelatedPayments
List all payments related to a payment initiation
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPaymentInitiationRelatedPayments(ctx, "<id>", client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PaymentInitiationRelatedPaymentsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
paymentInitiationID |
string | ✔️ | The payment initiation ID | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPaymentInitiationRelatedPaymentsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
CreatePaymentServiceUser
Create a formance payment service user object
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.CreatePaymentServiceUser(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.V3CreatePaymentServiceUserResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3CreatePaymentServiceUserRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3CreatePaymentServiceUserResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPaymentServiceUsers
List all payment service users
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPaymentServiceUsers(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PaymentServiceUsersCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPaymentServiceUsersResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPaymentServiceUser
Get a payment service user by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPaymentServiceUser(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetPaymentServiceUserResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentServiceUserID |
string | ✔️ | The payment service user ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPaymentServiceUserResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
AddBankAccountToPaymentServiceUser
Add a bank account to a payment service user
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.AddBankAccountToPaymentServiceUser(ctx, "<id>", "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentServiceUserID |
string | ✔️ | The payment service user ID |
bankAccountID |
string | ✔️ | The bank account ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3AddBankAccountToPaymentServiceUserResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ForwardPaymentServiceUserBankAccount
Forward a payment service user's bank account to a connector
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ForwardPaymentServiceUserBankAccount(ctx, "<id>", "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.V3ForwardPaymentServiceUserBankAccountResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
paymentServiceUserID |
string | ✔️ | The payment service user ID |
bankAccountID |
string | ✔️ | The bank account ID |
v3ForwardPaymentServiceUserBankAccountRequest |
*components.V3ForwardPaymentServiceUserBankAccountRequest | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ForwardPaymentServiceUserBankAccountResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
CreatePool
Create a formance pool object
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.CreatePool(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.V3CreatePoolResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3CreatePoolRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3CreatePoolResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
ListPools
List all pools
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.ListPools(ctx, client.Int64(100), client.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), nil)
if err != nil {
log.Fatal(err)
}
if res.V3PoolsCursorResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
pageSize |
*int64 | ➖ | The number of items to return | 100 |
cursor |
*string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
requestBody |
map[string]any | ➖ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3ListPoolsResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPool
Get a pool by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPool(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetPoolResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPoolResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
DeletePool
Delete a pool by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.DeletePool(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3DeletePoolResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPoolBalances
Get historical pool balances from a particular point in time
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPoolBalances(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.V3PoolBalancesResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
at |
*time.Time | ➖ | The time to filter by |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPoolBalancesResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetPoolBalancesLatest
Get latest pool balances
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetPoolBalancesLatest(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3PoolBalancesResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetPoolBalancesLatestResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
AddAccountToPool
Add an account to a pool
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.AddAccountToPool(ctx, "<id>", "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
accountID |
string | ✔️ | The account ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3AddAccountToPoolResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
RemoveAccountFromPool
Remove an account from a pool
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.RemoveAccountFromPool(ctx, "<id>", "<id>")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
poolID |
string | ✔️ | The pool ID |
accountID |
string | ✔️ | The account ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3RemoveAccountFromPoolResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
GetTask
Get a task and its result by ID
Example Usage
package main
import(
"context"
"github.com/formancehq/payments/pkg/client"
"os"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
"https://api.example.com",
client.WithSecurity(os.Getenv("FORMANCE_AUTHORIZATION")),
)
res, err := s.Payments.V3.GetTask(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.V3GetTaskResponse != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
taskID |
string | ✔️ | The task ID |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.V3GetTaskResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |