Linkit
SDK Reference

Go SDK

Go client for the Linkit public API.

Go SDK

Runtime: Go 1.22 or later. The client uses the Go standard library.

Download the SDK and extract its linkit directory to vendor/linkit.

Reference the extracted module from your application's go.mod:

require github.com/linkit-sa/linkit-go-sdk v0.4.0
replace github.com/linkit-sa/linkit-go-sdk => ./vendor/linkit

Every operation accepts a context for cancellation and deadlines. PublicAPI() returns JSON for all published routes; Orders offers typed reads and cursor polling.

Connect

package main

import (
    "context"
    "fmt"
    "log"
    "os"

    linkit "github.com/linkit-sa/linkit-go-sdk"
)

func main() {
    client, err := linkit.QuickSetup("https://linkit.works", os.Getenv("LINKIT_TOKEN"))
    if err != nil {
        log.Fatal(err)
    }
    orders, err := client.PublicAPI().GetV1Orders(context.Background(), nil)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(string(orders))
}

API use

Use the server origin, such as https://linkit.works, as the base URL. Pass IDs as stored; the SDK adds /api/v1 and escapes path parameters. A branch's iv_id, its record id, a product ID and a SKU's iv_id are different identifiers.

Create branches and products before the SKUs that refer to them. Create orders with existing tenant records and a stable source identity. Order reads return snapshot envelopes; canonical reads normalize channel, status, amounts and lines. Persist the change-feed cursor after processing a page. A 304 means no changes; a 410 requires a new snapshot and cursor.

The generated public API service covers all 136 published operations. It also exposes customer addresses and groups, catalog metadata, offers, payment flows, queue status, analytics and webhook subscription management. Consult the API reference for each request body's fields. A method's route coverage does not grant permission to call it.

POST and PATCH are sent once. GET, HEAD, OPTIONS, PUT and DELETE may be retried after transient failures. Confirm the result of an uncertain write before repeating it. Health and ping omit bearer authentication; system health requires it.

Branch creation uses the dashboard's wallet rules. Trial and grace accounts are exempt; later, a shortfall returns BILLING_INSUFFICIENT_WALLET_BALANCE with the required and available SAR amounts. Only successfully inserted new branches incur activation fees.

Order deletion

The existing raw DeleteOrdersBulk method has no body argument, so it cannot supply the order_ids required by bulk deletion. For individual deletes, call client.PublicAPI().DeleteV1Orders(ctx, id) for each order and check each result; separate deletes are not an atomic batch.

API reference · Route coverage · All downloads