(Account)
- CreateAccountingAccount - Create an account
- GetAccountingAccount - Retrieve an account
- ListAccountingAccounts - List all accounts
- PatchAccountingAccount - Update an account
- RemoveAccountingAccount - Remove an account
- UpdateAccountingAccount - Update an account
Create an account
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.CreateAccountingAccountRequest{
ConnectionID: "<value>",
}
ctx := context.Background()
res, err := s.Account.CreateAccountingAccount(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.AccountingAccount != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateAccountingAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateAccountingAccountResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Retrieve an account
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.GetAccountingAccountRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Account.GetAccountingAccount(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.AccountingAccount != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetAccountingAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetAccountingAccountResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
List all accounts
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.ListAccountingAccountsRequest{
ConnectionID: "<value>",
}
ctx := context.Background()
res, err := s.Account.ListAccountingAccounts(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.AccountingAccounts != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListAccountingAccountsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListAccountingAccountsResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update an account
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.PatchAccountingAccountRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Account.PatchAccountingAccount(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.AccountingAccount != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.PatchAccountingAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PatchAccountingAccountResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Remove an account
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.RemoveAccountingAccountRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Account.RemoveAccountingAccount(ctx, request)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.RemoveAccountingAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RemoveAccountingAccountResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update an account
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.UpdateAccountingAccountRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Account.UpdateAccountingAccount(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.AccountingAccount != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.UpdateAccountingAccountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.UpdateAccountingAccountResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |