Skip to content

Latest commit

 

History

History
321 lines (253 loc) · 19 KB

README.md

File metadata and controls

321 lines (253 loc) · 19 KB

Taxrate

(Taxrate)

Available Operations

CreateAccountingTaxrate

Create a taxrate

Example Usage

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.CreateAccountingTaxrateRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.CreateAccountingTaxrate(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingTaxrate != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.CreateAccountingTaxrateRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CreateAccountingTaxrateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetAccountingTaxrate

Retrieve a taxrate

Example Usage

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.GetAccountingTaxrateRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.GetAccountingTaxrate(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingTaxrate != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetAccountingTaxrateRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetAccountingTaxrateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ListAccountingTaxrates

List all taxrates

Example Usage

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.ListAccountingTaxratesRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.ListAccountingTaxrates(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingTaxrates != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ListAccountingTaxratesRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListAccountingTaxratesResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

PatchAccountingTaxrate

Update a taxrate

Example Usage

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.PatchAccountingTaxrateRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.PatchAccountingTaxrate(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingTaxrate != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.PatchAccountingTaxrateRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.PatchAccountingTaxrateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

RemoveAccountingTaxrate

Remove a taxrate

Example Usage

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.RemoveAccountingTaxrateRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.RemoveAccountingTaxrate(ctx, request)
    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.
request operations.RemoveAccountingTaxrateRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.RemoveAccountingTaxrateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

UpdateAccountingTaxrate

Update a taxrate

Example Usage

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.UpdateAccountingTaxrateRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Taxrate.UpdateAccountingTaxrate(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingTaxrate != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.UpdateAccountingTaxrateRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.UpdateAccountingTaxrateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /