einvoice

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 20 Imported by: 0

README

einvoice-go

Official Go SDK for the Yona e-invoicing API. It covers exactly what an API key may call: invoicing, submissions to the tax authority, output and share links, items, reference data, buyers, the read-only seller, received invoices and issued history, invoice settings, the tax connection, the organisation (read), billing reads and webhooks (read, test, redeliver).

The same surface as @useyona/einvoice-js, module for module, with the same names in Go's PascalCase.

Features

  • One key, nothing else to configure. sk_test_… is the sandbox, sk_live_… is live, on the same host.
  • Typed. Every request and response shape is a struct generated from the API's OpenAPI (types_gen.go).
  • Safe retries. GET, PUT, DELETE and writes carrying an Idempotency-Key are retried on network errors, timeouts, 408, 429 and 5xx, honouring Retry-After. The SDK generates the key on the routes that accept one, so its own retry is never charged twice.
  • Typed errors. *ValidationError, *NotFoundError, *RateLimitError… all unwrap to *APIError with Status, ErrorCode, Errors, RequestID and RetryAfter; narrow with errors.As.
  • Webhooks. VerifyWebhook checks the Yona-Signature over the raw body in constant time.
  • Light. Standard library only. Go 1.22+.

Installation

go get github.com/elyonar/einvoice-go

Quick start

package main

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

	"github.com/elyonar/einvoice-go"
)

func main() {
	ctx := context.Background()
	client, err := einvoice.New(os.Getenv("YONA_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(client.Mode()) // einvoice.ModeSandbox for sk_test_… keys, einvoice.ModeLive for sk_live_… keys

	// 1. A buyer
	buyer, err := client.Buyers.Create(ctx, &einvoice.CreateBuyerBody{
		Name:      "Acme Nigeria Ltd",
		TaxID:     einvoice.Ptr("12345678-0001"),
		Email:     einvoice.Ptr("accounts@acme.ng"),
		PartyType: einvoice.Ptr(einvoice.CreateBuyerDtoPartyTypeCompany),
		Address:   &einvoice.BuyerAddressDto{Line1: "1 Marina", City: "Lagos", Country: "NG"},
	})
	if err != nil {
		log.Fatal(err)
	}

	// 2. A saved item (optional: a line can also carry its own description, unit code and codes)
	item, err := client.Items.Create(ctx, &einvoice.CreateItemBody{
		Name:            "Laptop",
		ItemType:        einvoice.CreateItemDtoItemTypeGoods,
		HSNCode:         einvoice.Ptr("8471.30"),
		ProductCategory: "Machinery",
		UnitCode:        "EA",
		UnitPriceMinor:  "45000000",
		Currency:        "NGN",
		TaxCategory:     "STANDARD_VAT",
	})
	if err != nil {
		log.Fatal(err)
	}

	// 3. A draft invoice: InvoiceKind and TaxCategory, never a tax percent
	invoice, err := client.Invoices.Create(ctx, &einvoice.CreateInvoiceBody{
		InvoiceKind: "B2B",
		InvoiceDate: "2026-10-05",
		Currency:    "NGN",
		BuyerID:     einvoice.Ptr(buyer.ID),
		LineItems:   []einvoice.InvoiceLineItemDto{{ItemID: einvoice.Ptr(item.ID), Quantity: einvoice.AmountNumber(2)}},
	})
	if err != nil {
		log.Fatal(err)
	}

	// 4. Finalise and report it to the tax authority
	if _, err := client.Invoices.Finalise(ctx, invoice.ID); err != nil {
		log.Fatal(err)
	}
	if _, err := client.Submissions.Submit(ctx, invoice.ID, nil); err != nil { // 202: queued
		log.Fatal(err)
	}
	status, err := client.Submissions.GetStatus(ctx, invoice.ID)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(status.Status)
}

That is all the configuration an integration needs: the key. The SDK talks to the production gateway for both modes; the key's prefix decides whether you are in the sandbox or live.

To fail fast when a deployment is given the wrong key:

client, err := einvoice.New(key, einvoice.WithAssertMode(einvoice.ModeLive)) // *ConfigError for an sk_test_ key

A malformed key is refused by New with a *ConfigError (the key is never echoed).

Every method takes a context.Context first: cancel it or give it a deadline and the request stops; a cancelled context is never retried and comes back as ctx.Err().

Guides

The recipes in examples/ are the developer guides of the Yona portal (Developers, Overview): your first invoice, webhooks, errors and retries, sandbox and live, received invoices. Each runs end to end against a sandbox key (YONA_API_KEY=sk_test_… make examples).

Verifying your setup

YONA_API_KEY=sk_test_… make smoke-remote

runs free reads across every module and then the first-invoice example against the real API, with your own sandbox key, and prints a table method → OK/FAIL with the error code and request id of any failure. It refuses a live key and never prints the key. The example creates sandbox data in your organisation: a buyer, an item and an invoice submitted to the tax authority's sandbox.

Responses and pagination

Methods return a pointer to the API's data as a struct with the wire names in its json tags (invoice.InvoiceNumber). Optional and nullable fields are pointers; einvoice.Ptr(v) makes one when building a request. List methods return a *Page[T]:

page, err := client.Buyers.List(ctx, &einvoice.ListBuyersQuery{Limit: einvoice.Ptr(50.0)})
page.Data       // []einvoice.BuyerViewDto
page.Pagination // Total, Page, PageSize, TotalPages, HasNext, HasPrevious
page.RequestID

Paginate walks every page for you; Collect gathers them into one slice:

query := &einvoice.ListBuyersQuery{Limit: einvoice.Ptr(100.0)}
err := einvoice.Paginate(ctx, func(ctx context.Context, page int64) (*einvoice.Page[einvoice.BuyerViewDto], error) {
	query.Page = einvoice.Ptr(float64(page))
	return client.Buyers.List(ctx, query)
}, func(buyer einvoice.BuyerViewDto) error {
	fmt.Println(buyer.Name)
	return nil
})

Received invoices and issued history answer an object with Items, so they return a *Paginated[D]: res.Data.Items and res.Pagination (a pointer; nil when the answer carried none).

PDF downloads return a *BinaryResponse: Data (bytes), ContentType, FileName, RequestID.

A few answers are one of two shapes (IssueCreditNoteData, IssueDebitNoteData): they keep the JSON and decode on demand with AsCreditNotePreviewAnswerDto() / AsCreditNoteIssuedDto(). Values the API types as string | number (quantities, unit prices) are einvoice.Amount: String() keeps the exact text, Float64() parses it; build one with AmountString or AmountNumber.

Errors

Every refusal of the API is a typed wrapper chosen by status, each unwrapping to *APIError:

Status Type Typical ErrorCode
400, 422 *ValidationError VAL…
401 *AuthenticationError AUTH… (a revoked, expired or malformed key)
402 *InsufficientCreditsError BIZ001
403 *PermissionError AUTH019 (capability), AUTH018 (user-only route)
404 *NotFoundError RES001
409 *ConflictError BIZ… (state), RES002 (duplicate)
429 *RateLimitError SYS005, with RetryAfter
5xx *ServerError SYS001
_, err := client.Invoices.Create(ctx, params)
var validation *einvoice.ValidationError
var apiErr *einvoice.APIError
switch {
case errors.As(err, &validation):
	for _, e := range validation.Errors {
		fmt.Println(e.Field, e.Message)
	}
case errors.As(err, &apiErr):
	fmt.Println(apiErr.Status, apiErr.ErrorCode, apiErr.RequestID) // quote RequestID to support
}

Branch on ErrorCode, never on the message. Outside the API: *TimeoutError, *ConnectionError (unwraps to the transport's error), *ConfigError, *WebhookError. Every error the SDK returns implements the einvoice.Error interface; a cancelled context is returned as ctx.Err().

Retries and idempotency

client, err := einvoice.New(key,
	einvoice.WithTimeout(30*time.Second),
	einvoice.WithRetry(einvoice.RetryConfig{MaxRetries: einvoice.Ptr(3), BaseDelay: 500 * time.Millisecond, MaxDelay: 8 * time.Second, MaxRetryAfter: 30 * time.Second}),
)

The SDK retries GET, PUT and DELETE, and writes that carry an Idempotency-Key, on network errors, timeouts, 408, 429 and 5xx, with exponential backoff and jitter; a Retry-After on 429/503 is waited out up to MaxRetryAfter (a longer one is returned at once, with RetryAfter set). Other writes are never retried for you. WithTimeout bounds each attempt, headers and body.

On routes that accept an Idempotency-Key (Invoices.Create, Submissions.Submit, Output.Send, the downloads…) the SDK generates one per call, so its own retries are never applied or charged twice. Pass your own to make a retry across process restarts safe:

client.Invoices.Create(ctx, params, einvoice.WithIdempotencyKey("order-"+orderID))

The other per-call options are WithRequestTimeout, WithRequestHeaders and WithMaxRetries.

Webhooks

http.HandleFunc("/webhooks/yona", func(w http.ResponseWriter, r *http.Request) {
	raw, _ := io.ReadAll(r.Body)
	event, err := einvoice.VerifyWebhook(raw, r.Header, os.Getenv("YONA_WEBHOOK_SECRET"))
	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		return
	}
	if event.Type == einvoice.WebhookEventInvoiceAccepted {
		var data struct{ InvoiceID string `json:"invoiceId"` }
		_ = event.DecodeData(&data)
	}
	w.WriteHeader(http.StatusOK)
})

Yona signs t + "." + raw body with HMAC-SHA256 and sends Yona-Signature: t=…,v1=… (a second v1= while a rotated secret overlaps). VerifyWebhook accepts the delivery when a signature matches in constant time and t is within ±300 s (WithTolerance, WithNow), and returns the parsed *WebhookEvent. Pass the raw body bytes, never a re-serialised object. Deduplicate on event.ID. SignWebhookPayload signs a payload exactly as Yona does, for testing your handler. Endpoints are registered in the dashboard; the key can list and test them (client.Webhooks.Endpoints), read deliveries and redeliver.

What an API key cannot do

Users, invitations, roles, API keys, organisation management, collections, purchases and webhook endpoint writes are done by a signed-in user in the dashboard; the API answers 403 AUTH018 to a key. The seller is the organisation itself (read-only; Sellers.Create/Update/Delete are 409 BIZ205 and have no method). ExcludedOperations lists the API-key operations the SDK deliberately has no method for, with the reason.

API reference

Every method takes ctx context.Context first and optional trailing ...RequestOption. Query and body parameters are the generated structs named after the operation (*ListInvoicesQuery, *CreateInvoiceBody); a query may be nil.

client.Invoices

Create(params), List(query), Get(id), Update(id, params), Delete(id), Finalise(id), Reopen(id), Revise(id), Cancel(id, params), IssueCreditNote(id, params), IssueDebitNote(id, params), GetOverview(query), GetStatistics(query), GetSummary(query)

client.Submissions

Submit(id, query), Issue(id), CreateAndSubmit(params), BatchSubmit(params), Retry(id), Renumber(id), QueryStatus(id), GetStatus(id), RecordPayment(id, params), GetAuthorityCopy(id)

client.Output

GetDownloadLink(id), DownloadPDF(id) → *BinaryResponse, Send(id, params)

Create(invoiceID, params), List(invoiceID), Revoke(invoiceID, linkID)

client.Items

List(query), Create(params), Get(id), Update(id, params), Delete(id), Archive(id), Unarchive(id), ListUsedCodes(query)

client.Reference

ListHsCodes(query), ListHsCodeCategories(), ListResources(), GetResource(listType), LookupTaxID(value, query), ValidateInvoice(params)

client.Buyers

Create(params), List(query), Get(id), Update(id, params), Delete(id), BulkDelete(params), VerifyTaxNumber(id), GetVerificationStatus(id), Search(query), CheckReachability(query), CheckWithTaxAuthority(params)

client.Sellers

List(query), Get(id), GetVerificationStatus(id), Search(query)

client.InboundInvoices

List(query) → *Paginated, Get(id), GetAnalytics(query), ListHistoryRuns(query) → *Paginated, GetHistoryRun(runID), LoadOlder() (deprecated)

client.IssuedHistory

List(query) → *Paginated, Get(id), DownloadPDF(id) → *BinaryResponse

client.InvoiceSettings · client.TaxConnection

Get()

client.Organization

Get(orgID), GetReadiness()

client.Billing.Accounts

GetMine(query), GetStats(accountID, query) ("" is me), CheckBalance(accountID, query)

client.Billing.Payments

List(query), Get(id)

client.Billing.Sandbox

ListTransactions(query), GetUsage()

client.Billing.Statements

Get(period, query)

client.Billing.Subscriptions

GetActive(), List(query), Get(id), ListRenewals(query), PreviewPlanChange(id, query)

client.Billing.Transactions

List(query), Get(id), GetUsageAnalytics(query), GetUsageByCostCode(query)

client.Webhooks.Endpoints

List(), Get(id), Test(id, params) (nil sends {})

client.Webhooks.Deliveries

List(query), Get(id), Redeliver(id)

client.Webhooks.Events

List(query), Get(id), Redeliver(id, params)

client.Webhooks.EventTypes

List()

Webhook verification (package level)

VerifyWebhook(payload, headers, secret, ...VerifyOption) with WithTolerance(seconds), WithNow(unix); SignWebhookPayload(payload, secrets, timestamp) (0 = now); ComputeWebhookSignature(payload, secret, timestamp); ParseSignatureHeader(header)

Advanced: WithBaseURL, WithTransport

WithBaseURL points the client at another gateway (a local one in development). It never changes the mode: the key does. Never switch hosts by mode in your own code. WithHTTPClient sends with your own *http.Client; WithTransport with anything that has Do(*http.Request) (a recorder in tests). client.HTTP.Request(ctx, einvoice.Call{...}) makes a raw call with the SDK's envelope, retry and idempotency handling.

Development

make test           # go test ./... -cover, parity and guides included
make lint           # gofmt + go vet (+ golangci-lint when installed)
make sync           # copy the snapshot and vectors from einvoice-js and regenerate types_gen.go (needs git + Node 22)
make sync-check     # CI: the three must match the einvoice-js commit (or tag) pinned in scripts/sync.sh
make guides         # examples/ → guides/guides.json (a test fails when it is stale)
make examples       # run the examples (YONA_API_KEY; YONA_BASE_URL to point elsewhere)
make smoke-remote   # verify your own sandbox key (see "Verifying your setup")

The models (types_gen.go), the API snapshot and the webhook test vectors come from einvoice-js, the source of truth for every Yona SDK, at the commit (or tag) pinned in scripts/sync.sh; parity_test.go fails when a method and the snapshot disagree. The SDKs are versioned independently (version.go).

License

MIT

Documentation

Overview

Package einvoice is the official Go SDK for the Yona e-invoicing API, the port of @useyona/einvoice-js module for module. It covers exactly what an API key may call: invoicing, submissions to the tax authority, output and share links, items, reference data, buyers, the read-only seller, received invoices and issued history, invoice settings, the tax connection, the organisation (read), billing reads and webhooks (read, test, redeliver). Users, invitations, roles, API keys, organisation management, collections, purchases and webhook-endpoint writes are done by a signed-in user in the dashboard and are not in the SDK.

The key decides the mode: an `sk_test_…` key is the sandbox and an `sk_live_…` key is live, on the same host. There is nothing else to configure:

client, err := einvoice.New(os.Getenv("YONA_API_KEY"))
if err != nil {
	log.Fatal(err)
}
invoice, err := client.Invoices.Create(ctx, &einvoice.CreateInvoiceBody{…})

Every refusal of the API is a typed error; narrow it with errors.As:

var ve *einvoice.ValidationError
if errors.As(err, &ve) { … }
var ae *einvoice.APIError
if errors.As(err, &ae) { fmt.Println(ae.Status, ae.ErrorCode, ae.RequestID) }

The request and response shapes (CreateInvoiceBody, ListInvoicesQuery, InvoiceViewDto …) are generated from the API's OpenAPI into types_gen.go; never edit that file. Webhook deliveries are verified with VerifyWebhook. Zero dependencies outside the standard library.

Index

Constants

View Source
const (
	DefaultTimeout       = 30 * time.Second
	DefaultMaxRetries    = 2
	DefaultBaseDelay     = 500 * time.Millisecond
	DefaultMaxDelay      = 8 * time.Second
	DefaultMaxRetryAfter = 60 * time.Second
)

Default values of the client.

View Source
const (
	WebhookEventIDHeader         = "Yona-Event-Id"
	WebhookEventTypeHeader       = "Yona-Event-Type"
	WebhookDeliveryIDHeader      = "Yona-Delivery-Id"
	WebhookDeliveryAttemptHeader = "Yona-Delivery-Attempt"
)

The other headers of a webhook delivery (names are case-insensitive).

View Source
const DefaultBaseURL = "https://gp.useyona.com"

DefaultBaseURL is the production gateway, for sandbox and live keys alike (the key's prefix picks the mode).

THIS NAME IS PERMANENT. It is compiled into every installed copy of the SDK, so infrastructure moves by repointing DNS behind it, never by changing it here: 0.7.0 broke for everyone when its built-in `gateway.useyona.com` stopped serving.

View Source
const DefaultToleranceSeconds int64 = 300

DefaultToleranceSeconds: a delivery whose `t` is further than this from the receiver's clock is refused.

View Source
const Version = "0.1.0"

Version is the SDK version, sent as `User-Agent: einvoice-go/<Version>` and recorded by the guides export. The ports are versioned independently of einvoice-js; the einvoice-js tag pinned in scripts/sync.sh records which JS release this one tracks.

View Source
const WebhookSignatureHeader = "Yona-Signature"

WebhookSignatureHeader is the signature header Yona sends on every webhook delivery.

Variables

View Source
var ExcludedOperations = []ExcludedOperation{
	{Method: "POST", Path: "/i/v1/sellers", Reason: "Always 409 BIZ205: the organisation is its only seller."},
	{Method: "PATCH", Path: "/i/v1/sellers/{id}", Reason: "Always 409 BIZ205: the seller is edited as the organisation profile in the dashboard."},
	{Method: "DELETE", Path: "/i/v1/sellers/{id}", Reason: "Always 409 BIZ205: the organisation is its only seller."},
	{Method: "POST", Path: "/i/v1/sellers/{id}/verify-tax-number", Reason: "Always 409 BIZ205: the TIN is verified in organisation settings."},
	{Method: "GET", Path: "/i/v1/sellers/setup", Reason: "Dashboard form metadata; the seller itself is Sellers.Get/List."},
	{Method: "GET", Path: "/i/v1/buyers/setup", Reason: "Dashboard form metadata; the code lists are Reference.GetResource."},
	{Method: "GET", Path: "/i/v1/invoices/setup", Reason: "Dashboard form metadata; the code lists are Reference.GetResource, the connection TaxConnection.Get."},
	{Method: "GET", Path: "/b/v1/setup", Reason: "Dashboard billing overview in one call; its parts are Billing.Accounts/Subscriptions/Sandbox."},
}

ExcludedOperations lists the API-key operations the SDK deliberately has no method for, each with its reason. parity_test.go requires every API-key operation in scripts/openapi-api-key-ops.json to be either an SDK method or listed here, and nothing here to be missing from the snapshot.

Functions

func Collect

func Collect[T any](ctx context.Context, list func(ctx context.Context, page int64) (*Page[T], error)) ([]T, error)

Collect gathers every item of a paged list into one slice (see Paginate).

func ComputeWebhookSignature

func ComputeWebhookSignature(payload []byte, secret string, timestamp int64) string

ComputeWebhookSignature computes one `v1` value: hex HMAC-SHA256, keyed with the endpoint secret as UTF-8, over `<t> + "." + <raw body>`.

func GenerateIdempotencyKey

func GenerateIdempotencyKey() string

GenerateIdempotencyKey returns a fresh idempotency key (a UUID v4).

func Paginate

func Paginate[T any](ctx context.Context, list func(ctx context.Context, page int64) (*Page[T], error), fn func(item T) error) error

Paginate iterates every item of a paged list, fetching page after page. list is called with the 1-based page number and returns that page (set it on the query you close over); fn is called for each item and stops the walk by returning an error, which Paginate returns as is. The walk ends when a page says it has no next page, or comes back empty.

query := &einvoice.ListBuyersQuery{Limit: einvoice.Ptr(100.0)}
err := einvoice.Paginate(ctx, func(ctx context.Context, page int64) (*einvoice.Page[einvoice.BuyerViewDto], error) {
	query.Page = einvoice.Ptr(float64(page))
	return client.Buyers.List(ctx, query)
}, func(buyer einvoice.BuyerViewDto) error {
	fmt.Println(buyer.Name)
	return nil
})

func ParseRetryAfter

func ParseRetryAfter(value string, now time.Time) (seconds int, ok bool)

ParseRetryAfter reads seconds from a `Retry-After` header (delta-seconds or an HTTP date, relative to now). ok is false for an empty or unreadable value.

func ParseSignatureHeader

func ParseSignatureHeader(header string) (timestamp int64, signatures []string, err error)

ParseSignatureHeader returns the `t` and every `v1` of a `Yona-Signature` header.

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v, for the optional fields of the generated query and body structs: `&einvoice.ListBuyersQuery{Limit: einvoice.Ptr(50.0)}`.

func SignWebhookPayload

func SignWebhookPayload(payload []byte, secrets []string, timestamp int64) string

SignWebhookPayload builds a `Yona-Signature` header for a payload, for testing your own webhook handler. Pass two secrets to imitate a rotation overlap (the current one first). A timestamp of 0 means now.

Types

type APIError

type APIError struct {
	// Status is the HTTP status.
	Status int
	// ErrorCode is `meta.errorCode` (e.g. `VAL001`, `RES001`, `AUTH019`, `BIZ001`, `SYS005`).
	// Branch on this, never on the message. Empty when the body was not the envelope.
	ErrorCode string
	// Message is `meta.message`, or `HTTP <status>` when the body was not the envelope.
	Message string
	// Errors is `meta.errors`, unpacked.
	Errors []ErrorDetail
	// RequestID is `meta.requestId`, falling back to the `x-request-id` header. Quote it in a support request.
	RequestID string
	// RetryAfter is the seconds the API asked the caller to wait (`Retry-After`); 0 when it sent none.
	RetryAfter int
	// Body is the parsed response body (or the raw text when it was not JSON), for anything the fields above do not carry.
	Body any
}

APIError is the API's refusal of a request. Every refusal carries the envelope `{ meta: { statusCode, errorCode, message, errors, requestId }, data: null }`. The SDK returns a typed wrapper chosen by status (ValidationError, NotFoundError …), each of which unwraps to the *APIError, so both of these work:

var nf *einvoice.NotFoundError
if errors.As(err, &nf) { … }
var ae *einvoice.APIError
if errors.As(err, &ae) {
	fmt.Println(ae.Status, ae.ErrorCode, ae.RequestID) // quote RequestID to support
}

func (*APIError) Error

func (e *APIError) Error() string

type AccessPointBucketDto

type AccessPointBucketDto struct {
	Count float64 `json:"count"`

	// GrossPayableMinor MINOR units, reporting currency.
	GrossPayableMinor float64 `json:"grossPayableMinor"`

	AccessPoint *string `json:"accessPoint"`
}

AccessPointBucketDto is `invoice.AccessPointBucketDto`.

type AccountStatsDto

type AccountStatsDto struct {
	CurrentBalance int64 `json:"currentBalance"`

	LifetimeConsumed int64 `json:"lifetimeConsumed"`

	LifetimePurchased int64 `json:"lifetimePurchased"`

	// AverageDailyConsumption Credits per day over the last 30 days. A rate, not money: may be fractional.
	AverageDailyConsumption float64 `json:"averageDailyConsumption"`

	// DaysUntilDepleted At the current rate; null when nothing was consumed.
	DaysUntilDepleted *int64 `json:"daysUntilDepleted"`

	IsLowBalance bool `json:"isLowBalance"`
}

AccountStatsDto is `billing.AccountStatsDto`.

type ActiveSubscriptionDto

type ActiveSubscriptionDto struct {
	ID string `json:"id"`

	// PlanCode Example: "starter".
	PlanCode string `json:"planCode"`

	PlanName string `json:"planName"`

	// PlanVersion Catalogue plan version this subscription is priced at.
	PlanVersion int64 `json:"planVersion"`

	Interval ActiveSubscriptionDtoInterval `json:"interval"`

	Status ActiveSubscriptionDtoStatus `json:"status"`

	// AmountMinor Integer minor units per period (0 for Free).
	AmountMinor int64 `json:"amountMinor"`

	Currency ActiveSubscriptionDtoCurrency `json:"currency"`

	MonthlyCredits int64 `json:"monthlyCredits"`

	CurrentPeriodStart *string `json:"currentPeriodStart"`

	CurrentPeriodEnd *string `json:"currentPeriodEnd"`

	CancelAtPeriodEnd bool `json:"cancelAtPeriodEnd"`

	PastDueSince *string `json:"pastDueSince"`

	// GraceEndsAt When the grace period after the missed payment ends (pastDueSince plus the configured grace days); null unless past_due.
	GraceEndsAt *string `json:"graceEndsAt"`

	CreatedAt string `json:"createdAt"`

	Window *AllocationWindowDto `json:"window"`

	// Limits The limits that govern this organisation now: its plan version's, and for a secondary organisation the larger of its own plan's and its main organisation's, per limit.
	Limits PlanLimitsDto `json:"limits"`

	// PlanChange The open plan change of this subscription (awaiting payment, or scheduled for the period end), without a checkout URL; null when none is open.
	PlanChange *PlanChangeDto `json:"planChange"`
}

ActiveSubscriptionDto is `billing.ActiveSubscriptionDto`.

type ActiveSubscriptionDtoCurrency

type ActiveSubscriptionDtoCurrency string

ActiveSubscriptionDtoCurrency is the type of ActiveSubscriptionDto.Currency. The API may add values.

const (
	ActiveSubscriptionDtoCurrencyNGN ActiveSubscriptionDtoCurrency = "NGN"
	ActiveSubscriptionDtoCurrencyUSD ActiveSubscriptionDtoCurrency = "USD"
)

Values of ActiveSubscriptionDtoCurrency.

type ActiveSubscriptionDtoInterval

type ActiveSubscriptionDtoInterval string

ActiveSubscriptionDtoInterval is the type of ActiveSubscriptionDto.Interval. The API may add values.

const (
	ActiveSubscriptionDtoIntervalMonthly ActiveSubscriptionDtoInterval = "monthly"
	ActiveSubscriptionDtoIntervalYearly  ActiveSubscriptionDtoInterval = "yearly"
)

Values of ActiveSubscriptionDtoInterval.

type ActiveSubscriptionDtoStatus

type ActiveSubscriptionDtoStatus string

ActiveSubscriptionDtoStatus is the type of ActiveSubscriptionDto.Status. The API may add values.

const (
	ActiveSubscriptionDtoStatusPendingPayment ActiveSubscriptionDtoStatus = "pending_payment"
	ActiveSubscriptionDtoStatusActive         ActiveSubscriptionDtoStatus = "active"
	ActiveSubscriptionDtoStatusPastDue        ActiveSubscriptionDtoStatus = "past_due"
	ActiveSubscriptionDtoStatusCancelled      ActiveSubscriptionDtoStatus = "cancelled"
	ActiveSubscriptionDtoStatusExpired        ActiveSubscriptionDtoStatus = "expired"
)

Values of ActiveSubscriptionDtoStatus.

type AddressResponseDto

type AddressResponseDto struct {
	Line1 string `json:"line1"`

	Line2 *string `json:"line2,omitempty"`

	City string `json:"city"`

	State string `json:"state"`

	PostalCode *string `json:"postalCode,omitempty"`

	// Country Example: "NG".
	Country string `json:"country"`
}

AddressResponseDto is `auth.AddressResponseDto`.

type AllocationWindowDto

type AllocationWindowDto struct {
	Start string `json:"start"`

	End string `json:"end"`

	// Allocated Credits granted for this window.
	Allocated int64 `json:"allocated"`

	// Used Credits drawn from this window’s lot.
	Used int64 `json:"used"`
}

AllocationWindowDto is `billing.AllocationWindowDto`.

type Amount

type Amount struct {
	// contains filtered or unexported fields
}

Amount is a JSON value the API types as `string | number`: a quantity, a unit price, an allowance. It keeps the exact bytes the server sent, so a decimal string is never rounded through a float: use String for the text and Float64 when a number is wanted. Build one with AmountString (the form the API prefers for money) or AmountNumber. The zero value marshals as JSON null.

func AmountNumber

func AmountNumber(f float64) Amount

AmountNumber makes an Amount that marshals as a JSON number.

func AmountString

func AmountString(s string) Amount

AmountString makes an Amount that marshals as the JSON string s, e.g. AmountString("25000.00").

func (Amount) Float64

func (a Amount) Float64() (float64, error)

Float64 parses the value as a number, whether it was sent as a string or a number.

func (Amount) IsString

func (a Amount) IsString() bool

IsString reports whether the value is a JSON string (false for a number or the zero value).

func (Amount) IsZero

func (a Amount) IsZero() bool

IsZero reports whether the Amount carries no value (the zero value, or JSON null).

func (Amount) MarshalJSON

func (a Amount) MarshalJSON() ([]byte, error)

MarshalJSON writes the raw bytes as they were given or received; the zero value is null.

func (Amount) Raw

func (a Amount) Raw() json.RawMessage

Raw returns the exact JSON bytes (nil for the zero value).

func (Amount) String

func (a Amount) String() string

String returns the value as text: the string's content, or the number's digits exactly as sent. The zero value is "".

func (*Amount) UnmarshalJSON

func (a *Amount) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a JSON string, a JSON number or null.

type AmountBucketDto

type AmountBucketDto struct {
	Count float64 `json:"count"`

	// GrossPayableMinor MINOR units, reporting currency.
	GrossPayableMinor float64 `json:"grossPayableMinor"`
}

AmountBucketDto is `invoice.AmountBucketDto`.

type AnalyticsTotalsDto

type AnalyticsTotalsDto struct {
	Count float64 `json:"count"`

	// PricedCount Rows in the reporting currency with a known amount: the base of the sums.
	PricedCount float64 `json:"pricedCount"`

	GrossPayableMinor float64 `json:"grossPayableMinor"`

	InputVATMinor float64 `json:"inputVatMinor"`

	ByCurrency []CurrencyBucketDto `json:"byCurrency"`
}

AnalyticsTotalsDto is `invoice.AnalyticsTotalsDto`.

type ArchiveItemData

type ArchiveItemData = ItemViewDto

ArchiveItemData is the data of a successful POST /i/v1/items/{id}/archive.

type AuthApiPaginationMetaDto

type AuthApiPaginationMetaDto struct {
	// Total Example: 137.
	Total float64 `json:"total"`

	// Page 1-based page number.
	// Example: 1.
	Page float64 `json:"page"`

	// PageSize Items per page (the `limit` query parameter).
	// Example: 20.
	PageSize float64 `json:"pageSize"`

	// TotalPages `ceil(total / pageSize)`; an empty set is 0 pages.
	// Example: 7.
	TotalPages float64 `json:"totalPages"`

	// HasNext Example: true.
	HasNext bool `json:"hasNext"`

	// HasPrevious Example: false.
	HasPrevious bool `json:"hasPrevious"`

	NextPage *string `json:"nextPage,omitempty"`

	PreviousPage *string `json:"previousPage,omitempty"`

	CurrentPage *string `json:"currentPage,omitempty"`
}

AuthApiPaginationMetaDto is `auth.ApiPaginationMetaDto`.

type AuthApiSuccessMetaDto

type AuthApiSuccessMetaDto struct {
	// StatusCode Example: 200.
	StatusCode float64 `json:"statusCode"`

	// Success Example: true.
	Success bool `json:"success"`

	// Message Copy for humans. Never branch on it.
	// Example: "Success".
	Message string `json:"message"`

	Errors []map[string]string `json:"errors"`

	// Timestamp Example: "2026-09-29T10:00:00.000Z".
	Timestamp string `json:"timestamp"`

	// RequestID This service’s request id (also the `x-request-id` header) — quote it in a bug report.
	RequestID string `json:"requestId"`

	// Pagination Present on list responses.
	Pagination *AuthApiPaginationMetaDto `json:"pagination,omitempty"`
}

AuthApiSuccessMetaDto is `auth.ApiSuccessMetaDto`.

type AuthenticationError

type AuthenticationError struct{ *APIError }

AuthenticationError is 401: the key is missing, malformed, revoked or expired (`AUTH…`).

func (*AuthenticationError) Unwrap

func (e *AuthenticationError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type AuthorityCopyDto

type AuthorityCopyDto struct {
	// AuthorityReference The IRN.
	AuthorityReference string `json:"authorityReference"`

	// Document The tax authority’s own copy of the document, decrypted, as it returns it.
	Document map[string]any `json:"document"`
}

AuthorityCopyDto is `invoice.AuthorityCopyDto`.

type AuthorityIdentifiersViewDto

type AuthorityIdentifiersViewDto struct {
	BusinessID *string `json:"businessId"`

	ServiceID *string `json:"serviceId"`

	EntityID *string `json:"entityId"`
}

AuthorityIdentifiersViewDto is `invoice.AuthorityIdentifiersViewDto`.

type AuthorityNextActionDto

type AuthorityNextActionDto struct {
	Code string `json:"code"`

	Title string `json:"title"`

	Steps []string `json:"steps"`
}

AuthorityNextActionDto is `invoice.AuthorityNextActionDto`.

type AuthorityStatusDto

type AuthorityStatusDto struct {
	Transmitted bool `json:"transmitted"`

	Delivered bool `json:"delivered"`

	// PaymentStatus The payment status the tax authority holds, when it gave one.
	PaymentStatus *string `json:"paymentStatus,omitempty"`

	CheckedAt string `json:"checkedAt"`
}

AuthorityStatusDto is `invoice.AuthorityStatusDto`.

type AvailablePlanDto

type AvailablePlanDto struct {
	// Code Example: "starter".
	Code string `json:"code"`

	Name string `json:"name"`

	Description string `json:"description"`

	// Currency The account’s defaultCurrency.
	Currency AvailablePlanDtoCurrency `json:"currency"`

	// MonthlyPrice Integer minor units.
	MonthlyPrice int64 `json:"monthlyPrice"`

	// YearlyPrice Integer minor units; null when not offered yearly.
	YearlyPrice *int64 `json:"yearlyPrice"`

	MonthlyCredits int64 `json:"monthlyCredits"`

	YearlyCredits int64 `json:"yearlyCredits"`

	Badge *string `json:"badge"`

	Features []string `json:"features"`

	IsCurrent bool `json:"isCurrent"`
}

AvailablePlanDto is `billing.AvailablePlanDto`.

type AvailablePlanDtoCurrency

type AvailablePlanDtoCurrency string

AvailablePlanDtoCurrency is the type of AvailablePlanDto.Currency. The API may add values.

const (
	AvailablePlanDtoCurrencyNGN AvailablePlanDtoCurrency = "NGN"
	AvailablePlanDtoCurrencyUSD AvailablePlanDtoCurrency = "USD"
)

Values of AvailablePlanDtoCurrency.

type BalanceBySourceDto

type BalanceBySourceDto struct {
	// Plan Plan allocation lots (expire with the plan window).
	Plan int64 `json:"plan"`

	// Purchase Purchased credit-pack lots (never expire).
	Purchase int64 `json:"purchase"`

	// Allowance Sandbox allowance lots — always 0 on live.
	Allowance int64 `json:"allowance"`

	// Adjustment Operator adjustment lots.
	Adjustment int64 `json:"adjustment"`

	// Transfer Credits received from a relative by transfer (never expire).
	Transfer int64 `json:"transfer"`
}

BalanceBySourceDto is `billing.BalanceBySourceDto`.

type BatchItemResultDto

type BatchItemResultDto struct {
	InvoiceID string `json:"invoiceId"`

	Status BatchItemResultDtoStatus `json:"status"`

	// SubmissionID When queued.
	SubmissionID *string `json:"submissionId,omitempty"`

	// Replayed When queued: a submission already in flight was returned.
	Replayed *bool `json:"replayed,omitempty"`

	// ErrorCode When failed: the error code.
	// Example: "BIZ201".
	ErrorCode *string `json:"errorCode,omitempty"`

	// Message When failed.
	Message *string `json:"message,omitempty"`
}

BatchItemResultDto is `invoice.BatchItemResultDto`.

type BatchItemResultDtoStatus

type BatchItemResultDtoStatus string

BatchItemResultDtoStatus is the type of BatchItemResultDto.Status. The API may add values.

const (
	BatchItemResultDtoStatusQueued BatchItemResultDtoStatus = "queued"
	BatchItemResultDtoStatusFailed BatchItemResultDtoStatus = "failed"
)

Values of BatchItemResultDtoStatus.

type BatchSubmitDto

type BatchSubmitDto struct {
	InvoiceIds []string `json:"invoiceIds"`
}

BatchSubmitDto is `invoice.BatchSubmitDto`.

type BatchSubmitInvoicesBody

type BatchSubmitInvoicesBody = BatchSubmitDto

BatchSubmitInvoicesBody is the request body of POST /i/v1/invoices/batch-submit.

type BatchSubmitInvoicesData

type BatchSubmitInvoicesData = BatchSubmitResultDto

BatchSubmitInvoicesData is the data of a successful POST /i/v1/invoices/batch-submit.

type BatchSubmitResultDto

type BatchSubmitResultDto struct {
	TotalQueued int64 `json:"totalQueued"`

	TotalFailed int64 `json:"totalFailed"`

	Results []BatchItemResultDto `json:"results"`
}

BatchSubmitResultDto is `invoice.BatchSubmitResultDto`.

type BillingAccountDto

type BillingAccountDto struct {
	ID string `json:"id"`

	OrganizationID string `json:"organizationId"`

	DefaultCurrency BillingAccountDtoDefaultCurrency `json:"defaultCurrency"`

	// LowBalanceThreshold Live low-balance threshold; 0 disables.
	LowBalanceThreshold int64 `json:"lowBalanceThreshold"`

	CreatedAt string `json:"createdAt"`

	// Mode The ledger `creditBalance` reports.
	Mode BillingAccountDtoMode `json:"mode"`

	// CreditBalance The `available` balance of `mode`.
	CreditBalance int64 `json:"creditBalance"`

	Balances LedgerBalancesDto `json:"balances"`
}

BillingAccountDto is `billing.BillingAccountDto`.

type BillingAccountDtoDefaultCurrency

type BillingAccountDtoDefaultCurrency string

BillingAccountDtoDefaultCurrency is the type of BillingAccountDto.DefaultCurrency. The API may add values.

const (
	BillingAccountDtoDefaultCurrencyNGN BillingAccountDtoDefaultCurrency = "NGN"
	BillingAccountDtoDefaultCurrencyUSD BillingAccountDtoDefaultCurrency = "USD"
)

Values of BillingAccountDtoDefaultCurrency.

type BillingAccountDtoMode

type BillingAccountDtoMode string

BillingAccountDtoMode is the type of BillingAccountDto.Mode. The API may add values.

const (
	BillingAccountDtoModeSandbox BillingAccountDtoMode = "sandbox"
	BillingAccountDtoModeLive    BillingAccountDtoMode = "live"
)

Values of BillingAccountDtoMode.

type BillingAccountsService

type BillingAccountsService struct {
	// contains filtered or unexported fields
}

BillingAccountsService is billing accounts (`/b/v1/billing-accounts`): the credit balance.

func (*BillingAccountsService) CheckBalance

CheckBalance is whether the balance covers `Credits` (advisory; `billing.account.read`). accountID is the id or `"me"`.

func (*BillingAccountsService) GetMine

GetMine is the organisation's billing account; an API key sees its own mode's balance (`billing.account.read`).

func (*BillingAccountsService) GetStats

GetStats is balance, lifetime totals and 30-day consumption; accountID is the account's id or `"me"` ("" means "me") (`billing.account.read`).

type BillingApiPaginationMetaDto

type BillingApiPaginationMetaDto struct {
	// Total Example: 137.
	Total float64 `json:"total"`

	// Page 1-based page number.
	// Example: 1.
	Page float64 `json:"page"`

	// PageSize Items per page (the `limit` query parameter).
	// Example: 20.
	PageSize float64 `json:"pageSize"`

	// TotalPages `ceil(total / pageSize)`; an empty set is 0 pages.
	// Example: 7.
	TotalPages float64 `json:"totalPages"`

	// HasNext Example: true.
	HasNext bool `json:"hasNext"`

	// HasPrevious Example: false.
	HasPrevious bool `json:"hasPrevious"`

	NextPage *string `json:"nextPage,omitempty"`

	PreviousPage *string `json:"previousPage,omitempty"`

	CurrentPage *string `json:"currentPage,omitempty"`
}

BillingApiPaginationMetaDto is `billing.ApiPaginationMetaDto`.

type BillingApiSuccessMetaDto

type BillingApiSuccessMetaDto struct {
	// StatusCode Example: 200.
	StatusCode float64 `json:"statusCode"`

	// Success Example: true.
	Success bool `json:"success"`

	// Message Copy for humans. Never branch on it.
	// Example: "Success".
	Message string `json:"message"`

	Errors []map[string]string `json:"errors"`

	// Timestamp Example: "2026-09-29T10:00:00.000Z".
	Timestamp string `json:"timestamp"`

	// RequestID This service’s request id (also the `x-request-id` header) — quote it in a bug report.
	RequestID string `json:"requestId"`

	// Pagination Present on list responses.
	Pagination *BillingApiPaginationMetaDto `json:"pagination,omitempty"`
}

BillingApiSuccessMetaDto is `billing.ApiSuccessMetaDto`.

type BillingService

type BillingService struct {
	// Accounts: the billing account and balance.
	Accounts *BillingAccountsService
	// Payments (read-only).
	Payments *PaymentsService
	// Sandbox: the sandbox ledger and allowance.
	Sandbox *SandboxService
	// Statements: monthly statements.
	Statements *StatementsService
	// Subscriptions (read-only).
	Subscriptions *SubscriptionsService
	// Transactions: the credit ledger and usage.
	Transactions *TransactionsService
}

BillingService is billing (`/b/v1`), grouped as the API tags it.

type BinaryResponse

type BinaryResponse struct {
	// Data is the file's bytes.
	Data []byte
	// ContentType is `Content-Type`, e.g. `application/pdf`.
	ContentType string
	// FileName is the file name from `Content-Disposition`, when sent.
	FileName string
	// RequestID is the request id of the answer.
	RequestID string
}

BinaryResponse is a binary download (a PDF).

type BulkDeleteBuyersBody

type BulkDeleteBuyersBody = BulkDeleteBuyersDto

BulkDeleteBuyersBody is the request body of DELETE /i/v1/buyers/bulk.

type BulkDeleteBuyersData

type BulkDeleteBuyersData = BulkDeleteResultDto

BulkDeleteBuyersData is the data of a successful DELETE /i/v1/buyers/bulk.

type BulkDeleteBuyersDto

type BulkDeleteBuyersDto struct {
	Ids []string `json:"ids"`
}

BulkDeleteBuyersDto is `invoice.BulkDeleteBuyersDto`.

type BulkDeleteResultDto

type BulkDeleteResultDto struct {
	Deleted []string `json:"deleted"`

	// Archived Kept as archived because an issued invoice names them.
	Archived []string `json:"archived"`

	NotFound []string `json:"notFound"`
}

BulkDeleteResultDto is `invoice.BulkDeleteResultDto`.

type BuyerAddressDto

type BuyerAddressDto struct {
	Line1 string `json:"line1"`

	Line2 *string `json:"line2,omitempty"`

	City string `json:"city"`

	State *string `json:"state,omitempty"`

	// Lga Local government area.
	Lga *string `json:"lga,omitempty"`

	PostalCode *string `json:"postalCode,omitempty"`

	// Country ISO 3166-1 alpha-2.
	// Example: "NG".
	Country string `json:"country"`
}

BuyerAddressDto is `invoice.BuyerAddressDto`.

type BuyerDeleteResultDto

type BuyerDeleteResultDto struct {
	ID string `json:"id"`

	// Outcome `archived` when an issued invoice names the buyer, so it is kept.
	Outcome BuyerDeleteResultDtoOutcome `json:"outcome"`
}

BuyerDeleteResultDto is `invoice.BuyerDeleteResultDto`.

type BuyerDeleteResultDtoOutcome

type BuyerDeleteResultDtoOutcome string

BuyerDeleteResultDtoOutcome is the type of BuyerDeleteResultDto.Outcome. The API may add values.

const (
	BuyerDeleteResultDtoOutcomeDeleted  BuyerDeleteResultDtoOutcome = "deleted"
	BuyerDeleteResultDtoOutcomeArchived BuyerDeleteResultDtoOutcome = "archived"
)

Values of BuyerDeleteResultDtoOutcome.

type BuyerNrsCheckDto

type BuyerNrsCheckDto struct {
	// TaxID Example: "33875194-0001".
	TaxID string `json:"taxId"`
}

BuyerNrsCheckDto is `invoice.BuyerNrsCheckDto`.

type BuyerReachabilityAnswerDto

type BuyerReachabilityAnswerDto struct {
	// TaxID The TIN in the form the tax authority shows it.
	TaxID string `json:"taxId"`

	// OnNetwork Whether the e-invoicing network reaches the TIN; null when no answer could be had.
	OnNetwork *bool `json:"onNetwork"`

	AccessPoint *string `json:"accessPoint"`

	BusinessName *string `json:"businessName"`

	CheckedAt *string `json:"checkedAt"`

	// Stale The answer is not fresh: an earlier lookup, served because the tax authority could not be asked now.
	Stale bool `json:"stale"`

	// Unavailable No answer could be had and none is known: `onNetwork`, `accessPoint`, `businessName` and `checkedAt` are null.
	Unavailable bool `json:"unavailable"`
}

BuyerReachabilityAnswerDto is `invoice.BuyerReachabilityAnswerDto`.

type BuyerReachabilityViewDto

type BuyerReachabilityViewDto struct {
	// OnNetwork Whether the tax authority’s e-invoicing network reaches the TIN.
	OnNetwork bool `json:"onNetwork"`

	// AccessPoint The access point the buyer receives through, when on the network.
	AccessPoint *string `json:"accessPoint"`

	// BusinessName The business name the tax authority holds for the TIN.
	BusinessName *string `json:"businessName"`

	CheckedAt string `json:"checkedAt"`
}

BuyerReachabilityViewDto is `invoice.BuyerReachabilityViewDto`.

type BuyerSetupDto

type BuyerSetupDto struct {
	PartyTypes []BuyerSetupDtoPartyTypes `json:"partyTypes"`

	TaxIDTypes []TaxIdTypeOptionDto `json:"taxIdTypes"`

	Countries []CountryOptionDto `json:"countries"`
}

BuyerSetupDto is `invoice.BuyerSetupDto`.

type BuyerSetupDtoPartyTypes

type BuyerSetupDtoPartyTypes string

BuyerSetupDtoPartyTypes is the type of BuyerSetupDto.PartyTypes. The API may add values.

const (
	BuyerSetupDtoPartyTypesIndividual  BuyerSetupDtoPartyTypes = "individual"
	BuyerSetupDtoPartyTypesCompany     BuyerSetupDtoPartyTypes = "company"
	BuyerSetupDtoPartyTypesPartnership BuyerSetupDtoPartyTypes = "partnership"
	BuyerSetupDtoPartyTypesNonProfit   BuyerSetupDtoPartyTypes = "non_profit"
	BuyerSetupDtoPartyTypesGovernment  BuyerSetupDtoPartyTypes = "government"
)

Values of BuyerSetupDtoPartyTypes.

type BuyerVerificationRequestedDto

type BuyerVerificationRequestedDto struct {
	VerificationID string `json:"verificationId"`

	State BuyerVerificationRequestedDtoState `json:"state"`
}

BuyerVerificationRequestedDto is `invoice.BuyerVerificationRequestedDto`.

type BuyerVerificationRequestedDtoState

type BuyerVerificationRequestedDtoState string

BuyerVerificationRequestedDtoState is the type of BuyerVerificationRequestedDto.State. The API may add values.

const (
	BuyerVerificationRequestedDtoStatePending BuyerVerificationRequestedDtoState = "pending"
)

Values of BuyerVerificationRequestedDtoState.

type BuyerVerificationStatusDto

type BuyerVerificationStatusDto struct {
	// VerificationID The latest verification; null when none was ever requested.
	VerificationID *string `json:"verificationId"`

	State *BuyerVerificationStatusDtoState `json:"state"`

	TaxIDStatus BuyerVerificationStatusDtoTaxIDStatus `json:"taxIdStatus"`

	// CheckedAt When the latest verification finished; null while pending or never run.
	CheckedAt *string `json:"checkedAt"`

	// RegisteredName The registered name the TIN check returned; left out when none.
	RegisteredName *string `json:"registeredName,omitempty"`
}

BuyerVerificationStatusDto is `invoice.BuyerVerificationStatusDto`.

type BuyerVerificationStatusDtoState

type BuyerVerificationStatusDtoState string

BuyerVerificationStatusDtoState is the type of BuyerVerificationStatusDto.State. The API may add values.

const (
	BuyerVerificationStatusDtoStatePending      BuyerVerificationStatusDtoState = "pending"
	BuyerVerificationStatusDtoStateVerified     BuyerVerificationStatusDtoState = "verified"
	BuyerVerificationStatusDtoStateNotFound     BuyerVerificationStatusDtoState = "not_found"
	BuyerVerificationStatusDtoStateNameMismatch BuyerVerificationStatusDtoState = "name_mismatch"
	BuyerVerificationStatusDtoStateUnavailable  BuyerVerificationStatusDtoState = "unavailable"
)

Values of BuyerVerificationStatusDtoState.

type BuyerVerificationStatusDtoTaxIDStatus

type BuyerVerificationStatusDtoTaxIDStatus string

BuyerVerificationStatusDtoTaxIDStatus is the type of BuyerVerificationStatusDto.TaxIDStatus. The API may add values.

const (
	BuyerVerificationStatusDtoTaxIDStatusUnverified      BuyerVerificationStatusDtoTaxIDStatus = "unverified"
	BuyerVerificationStatusDtoTaxIDStatusPending         BuyerVerificationStatusDtoTaxIDStatus = "pending"
	BuyerVerificationStatusDtoTaxIDStatusVerified        BuyerVerificationStatusDtoTaxIDStatus = "verified"
	BuyerVerificationStatusDtoTaxIDStatusNotFound        BuyerVerificationStatusDtoTaxIDStatus = "not_found"
	BuyerVerificationStatusDtoTaxIDStatusNameMismatch    BuyerVerificationStatusDtoTaxIDStatus = "name_mismatch"
	BuyerVerificationStatusDtoTaxIDStatusUnavailable     BuyerVerificationStatusDtoTaxIDStatus = "unavailable"
	BuyerVerificationStatusDtoTaxIDStatusValidOffNetwork BuyerVerificationStatusDtoTaxIDStatus = "valid_off_network"
	BuyerVerificationStatusDtoTaxIDStatusChecking        BuyerVerificationStatusDtoTaxIDStatus = "checking"
)

Values of BuyerVerificationStatusDtoTaxIDStatus.

type BuyerViewDto

type BuyerViewDto struct {
	ID string `json:"id"`

	Name string `json:"name"`

	LegalName *string `json:"legalName"`

	TaxID *string `json:"taxId"`

	TaxIDType BuyerViewDtoTaxIDType `json:"taxIdType"`

	// TaxIDStatus `verified` (found on the tax authority’s e-invoicing network, or confirmed by the TIN check — see `taxIdVerifiedSource`), `valid_off_network` (a valid TIN not on the e-invoicing network; usable), `checking` (the network lookup is being retried), `unverified` (no TIN, or a tax id the lookup cannot check), and the TIN check’s own `pending`, `not_found`, `name_mismatch` and `unavailable`.
	TaxIDStatus BuyerViewDtoTaxIDStatus `json:"taxIdStatus"`

	TaxIDVerifiedAt *string `json:"taxIdVerifiedAt"`

	// TaxIDVerifiedName The name the verification returned.
	TaxIDVerifiedName *string `json:"taxIdVerifiedName"`

	// TaxIDVerifiedSource Who verified a `verified` TIN: `nrs` (the e-invoicing network lookup) or `tin_check`; null otherwise.
	TaxIDVerifiedSource *BuyerViewDtoTaxIDVerifiedSource `json:"taxIdVerifiedSource"`

	Email *string `json:"email"`

	// Phone E.164.
	Phone *string `json:"phone"`

	// Address Null when no address, or one missing line1, city or country, is recorded.
	Address *PartyAddressDto `json:"address"`

	// PartyType Example: "company".
	PartyType *string `json:"partyType"`

	BusinessDescription *string `json:"businessDescription"`

	// Reference Your own reference for this buyer.
	Reference *string `json:"reference"`

	// NRSReachability The last e-invoicing network lookup for the buyer’s tax id; null until one answered, and again after the tax identity changes.
	NRSReachability *BuyerReachabilityViewDto `json:"nrsReachability"`

	// TINUsable Whether the buyer’s TIN can go on a document. False when it fails the jurisdiction’s format rule or the TIN check found no such taxpayer: invoices to this buyer are then issued as B2C with no buyer TIN.
	TINUsable bool `json:"tinUsable"`

	// TINProblem Why `tinUsable` is false; null when it is true.
	TINProblem *BuyerViewDtoTINProblem `json:"tinProblem"`

	// ArchivedAt Set when the buyer was archived (kept because an issued invoice names it).
	ArchivedAt *string `json:"archivedAt"`

	CreatedAt string `json:"createdAt"`

	UpdatedAt string `json:"updatedAt"`
}

BuyerViewDto is `invoice.BuyerViewDto`.

type BuyerViewDtoTINProblem

type BuyerViewDtoTINProblem string

BuyerViewDtoTINProblem is the type of BuyerViewDto.TINProblem. The API may add values.

const (
	BuyerViewDtoTINProblemFormat   BuyerViewDtoTINProblem = "format"
	BuyerViewDtoTINProblemNotFound BuyerViewDtoTINProblem = "not_found"
)

Values of BuyerViewDtoTINProblem.

type BuyerViewDtoTaxIDStatus

type BuyerViewDtoTaxIDStatus string

BuyerViewDtoTaxIDStatus is the type of BuyerViewDto.TaxIDStatus. The API may add values.

const (
	BuyerViewDtoTaxIDStatusUnverified      BuyerViewDtoTaxIDStatus = "unverified"
	BuyerViewDtoTaxIDStatusPending         BuyerViewDtoTaxIDStatus = "pending"
	BuyerViewDtoTaxIDStatusVerified        BuyerViewDtoTaxIDStatus = "verified"
	BuyerViewDtoTaxIDStatusNotFound        BuyerViewDtoTaxIDStatus = "not_found"
	BuyerViewDtoTaxIDStatusNameMismatch    BuyerViewDtoTaxIDStatus = "name_mismatch"
	BuyerViewDtoTaxIDStatusUnavailable     BuyerViewDtoTaxIDStatus = "unavailable"
	BuyerViewDtoTaxIDStatusValidOffNetwork BuyerViewDtoTaxIDStatus = "valid_off_network"
	BuyerViewDtoTaxIDStatusChecking        BuyerViewDtoTaxIDStatus = "checking"
)

Values of BuyerViewDtoTaxIDStatus.

type BuyerViewDtoTaxIDType

type BuyerViewDtoTaxIDType string

BuyerViewDtoTaxIDType is the type of BuyerViewDto.TaxIDType. The API may add values.

const (
	BuyerViewDtoTaxIDTypeTIN     BuyerViewDtoTaxIDType = "tin"
	BuyerViewDtoTaxIDTypeRn      BuyerViewDtoTaxIDType = "rn"
	BuyerViewDtoTaxIDTypeForeign BuyerViewDtoTaxIDType = "foreign"
	BuyerViewDtoTaxIDTypeNone    BuyerViewDtoTaxIDType = "none"
)

Values of BuyerViewDtoTaxIDType.

type BuyerViewDtoTaxIDVerifiedSource

type BuyerViewDtoTaxIDVerifiedSource string

BuyerViewDtoTaxIDVerifiedSource is the type of BuyerViewDto.TaxIDVerifiedSource. The API may add values.

const (
	BuyerViewDtoTaxIDVerifiedSourceNRS      BuyerViewDtoTaxIDVerifiedSource = "nrs"
	BuyerViewDtoTaxIDVerifiedSourceTINCheck BuyerViewDtoTaxIDVerifiedSource = "tin_check"
)

Values of BuyerViewDtoTaxIDVerifiedSource.

type BuyersService

type BuyersService struct {
	// contains filtered or unexported fields
}

BuyersService is buyers (`/i/v1/buyers`): the parties the organisation invoices.

func (*BuyersService) BulkDelete

BulkDelete deletes up to 100 buyers, each like a single delete (`buyer.delete`).

func (*BuyersService) CheckReachability

CheckReachability is whether the e-invoicing network reaches a TIN, from the cache (`buyer.read`; free).

func (*BuyersService) CheckWithTaxAuthority

CheckWithTaxAuthority asks the tax authority about a TIN now (`buyer.read`; charged, refunded when unanswered). Sends an `Idempotency-Key`.

func (*BuyersService) Create

func (s *BuyersService) Create(ctx context.Context, params *CreateBuyerBody, opts ...RequestOption) (*CreateBuyerData, error)

Create creates a buyer (`buyer.create`; charged per buyer).

func (*BuyersService) Delete

func (s *BuyersService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeleteBuyerData, error)

Delete deletes a buyer, or archives it when an issued invoice names it (`Outcome` says which; `buyer.delete`).

func (*BuyersService) Get

func (s *BuyersService) Get(ctx context.Context, id string, opts ...RequestOption) (*GetBuyerData, error)

Get gets a buyer, archived ones included (`buyer.read`).

func (*BuyersService) GetVerificationStatus

func (s *BuyersService) GetVerificationStatus(ctx context.Context, id string, opts ...RequestOption) (*GetBuyerVerificationStatusData, error)

GetVerificationStatus is the latest verification and the buyer's tax-id status (`buyer.read`).

func (*BuyersService) List

List lists buyers, filtered by `Search` and `TaxIDStatus` (`buyer.read`).

func (*BuyersService) Search

func (s *BuyersService) Search(ctx context.Context, query *SearchBuyersQuery, opts ...RequestOption) ([]SearchBuyersItem, error)

Search searches buyers by name, legal name or tax id (`Q` ≥ 2 characters; `buyer.read`).

func (*BuyersService) Update

func (s *BuyersService) Update(ctx context.Context, id string, params *UpdateBuyerBody, opts ...RequestOption) (*UpdateBuyerData, error)

Update updates a buyer; `null` clears an optional field (`buyer.update`; charged when the edit changes something, free for a no-op). Retried only with WithIdempotencyKey.

func (*BuyersService) VerifyTaxNumber

func (s *BuyersService) VerifyTaxNumber(ctx context.Context, id string, opts ...RequestOption) (*VerifyBuyerTaxNumberData, error)

VerifyTaxNumber starts a tax-number verification (`buyer.verify_tax_id`; 202, or 200 with the one pending).

type Call

type Call struct {
	Method string
	Path   string
	// Query is a `<Op>Query` struct (encoded from its json tags), url.Values, map[string]any or map[string]string.
	Query any
	// Body is marshalled as JSON when not nil.
	Body any
	// Idempotent: the route honours `Idempotency-Key`, so the SDK sends one (generated unless the caller gave one).
	Idempotent bool
	// Binary: expect a binary body (a PDF) instead of the JSON envelope.
	Binary bool
	// Headers set by the service (e.g. `Accept`).
	Headers map[string]string
	// Options are the caller's per-request options.
	Options *RequestOptions
}

Call is how one API call is made. Services build it; integrators normally never touch it.

type CancelInvoiceBody

type CancelInvoiceBody = CancelInvoiceDto

CancelInvoiceBody is the request body of POST /i/v1/invoices/{id}/cancel.

type CancelInvoiceData

type CancelInvoiceData = InvoiceViewDto

CancelInvoiceData is the data of a successful POST /i/v1/invoices/{id}/cancel.

type CancelInvoiceDto

type CancelInvoiceDto struct {
	// Reason Example: "Issued to the wrong buyer".
	Reason string `json:"reason"`
}

CancelInvoiceDto is `invoice.CancelInvoiceDto`.

type CheckBalanceDto

type CheckBalanceDto struct {
	HasSufficientBalance bool `json:"hasSufficientBalance"`

	RequestedCredits int64 `json:"requestedCredits"`

	CurrentBalance int64 `json:"currentBalance"`
}

CheckBalanceDto is `billing.CheckBalanceDto`.

type CheckBillingAccountBalanceData

type CheckBillingAccountBalanceData = CheckBalanceDto

CheckBillingAccountBalanceData is the data of a successful GET /b/v1/billing-accounts/{id}/check-balance.

type CheckBillingAccountBalanceQuery

type CheckBillingAccountBalanceQuery struct {
	// Mode Which ledger to read. Defaults to the token's mode. API keys may only name their own mode (403 BIZ108).
	Mode *CheckBillingAccountBalanceQueryMode `json:"mode,omitempty"`

	// Credits Example: 100.
	Credits int64 `json:"credits"`
}

CheckBillingAccountBalanceQuery holds the query parameters of GET /b/v1/billing-accounts/{id}/check-balance.

type CheckBillingAccountBalanceQueryMode

type CheckBillingAccountBalanceQueryMode string

CheckBillingAccountBalanceQueryMode is the type of CheckBillingAccountBalanceQuery.Mode. The API may add values.

const (
	CheckBillingAccountBalanceQueryModeSandbox CheckBillingAccountBalanceQueryMode = "sandbox"
	CheckBillingAccountBalanceQueryModeLive    CheckBillingAccountBalanceQueryMode = "live"
)

Values of CheckBillingAccountBalanceQueryMode.

type CheckBuyerReachabilityData

type CheckBuyerReachabilityData = BuyerReachabilityAnswerDto

CheckBuyerReachabilityData is the data of a successful GET /i/v1/buyers/reachability.

type CheckBuyerReachabilityQuery

type CheckBuyerReachabilityQuery struct {
	// TaxID Example: "33875194-0001".
	TaxID string `json:"taxId"`
}

CheckBuyerReachabilityQuery holds the query parameters of GET /i/v1/buyers/reachability.

type CheckBuyerWithTaxAuthorityBody

type CheckBuyerWithTaxAuthorityBody = BuyerNrsCheckDto

CheckBuyerWithTaxAuthorityBody is the request body of POST /i/v1/buyers/reachability/check.

type CheckBuyerWithTaxAuthorityData

type CheckBuyerWithTaxAuthorityData = BuyerReachabilityAnswerDto

CheckBuyerWithTaxAuthorityData is the data of a successful POST /i/v1/buyers/reachability/check.

type ClaimedIdentifiersViewDto

type ClaimedIdentifiersViewDto struct {
	// BusinessID Left out when not claimed.
	BusinessID *string `json:"businessId,omitempty"`

	// ServiceID Left out when not claimed.
	ServiceID *string `json:"serviceId,omitempty"`
}

ClaimedIdentifiersViewDto is `invoice.ClaimedIdentifiersViewDto`.

type Client

type Client struct {
	// Invoices: drafts, lifecycle, credit and debit notes, statistics.
	Invoices *InvoicesService
	// Submissions to the tax authority and their status.
	Submissions *SubmissionsService
	// Output: the invoice PDF and sending it to the buyer.
	Output *OutputService
	// ShareLinks: revocable share links to an invoice.
	ShareLinks *ShareLinksService
	// Items: saved items (goods and services).
	Items *ItemsService
	// Reference: code lists, HS codes, tax-id lookup and dry-run validation.
	Reference *ReferenceService
	// Buyers.
	Buyers *BuyersService
	// Sellers: the organisation's seller (read-only).
	Sellers *SellersService
	// InboundInvoices: invoices other businesses issued to the organisation.
	InboundInvoices *InboundInvoicesService
	// IssuedHistory: invoices the organisation issued outside Yona that the tax authority holds.
	IssuedHistory *IssuedHistoryService
	// InvoiceSettings (read-only).
	InvoiceSettings *InvoiceSettingsService
	// TaxConnection: the connection to the tax authority (read-only).
	TaxConnection *TaxConnectionService
	// Organization: the key's organisation (read-only).
	Organization *OrganizationService
	// Billing reads: account, ledger, statements, subscriptions, payments, sandbox allowance.
	Billing *BillingService
	// Webhooks: endpoints (read, test), deliveries, events and the event catalogue.
	Webhooks *WebhooksService
	// HTTP is the transport, for advanced use.
	HTTP *HttpClient
}

Client is the client of the Yona e-invoicing API (the EInvoice client of the other SDKs). It covers what an API key may call: invoicing, buyers, items, received invoices, billing reads and webhooks. Users, invitations, roles, API keys and organisation management are done in the dashboard.

The key decides the mode: `sk_test_…` is sandbox and `sk_live_…` is live, on the same host.

client, err := einvoice.New(os.Getenv("YONA_API_KEY"))
if err != nil {
	log.Fatal(err)
}
client.Mode() // einvoice.ModeSandbox or einvoice.ModeLive
invoice, err := client.Invoices.Create(ctx, &einvoice.CreateInvoiceBody{…})

func New

func New(apiKey string, opts ...Option) (*Client, error)

New creates a client. It returns a *ConfigError for a missing or malformed key, or when WithAssertMode does not match the key. Options: WithBaseURL, WithAssertMode, WithTimeout, WithRetry, WithHeaders, WithHTTPClient, WithTransport.

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL is the host requests go to.

func (*Client) Mode

func (c *Client) Mode() Mode

Mode is ModeSandbox for an `sk_test_` key, ModeLive for an `sk_live_` key.

type CodeListDto

type CodeListDto struct {
	// Type Example: "tax-categories".
	Type string `json:"type"`

	// Version Example: 2.
	Version float64 `json:"version"`

	// Items `countries`: {code, name}. `services-codes`: {code, description, category}. Any other list: the tax authority’s own item, as it publishes it (free-form).
	Items []map[string]any `json:"items"`

	FetchedAt string `json:"fetchedAt"`

	Stale bool `json:"stale"`
}

CodeListDto is `invoice.CodeListDto`.

type CodeListIndexDto

type CodeListIndexDto struct {
	// Jurisdiction The organisation’s tax jurisdiction.
	// Example: "NG".
	Jurisdiction string `json:"jurisdiction"`

	Lists []CodeListSummaryDto `json:"lists"`
}

CodeListIndexDto is `invoice.CodeListIndexDto`.

type CodeListSummaryDto

type CodeListSummaryDto struct {
	// Type Example: "tax-categories".
	Type string `json:"type"`

	// Version Example: 2.
	Version *float64 `json:"version,omitempty"`

	// ItemCount Example: 27.
	ItemCount float64 `json:"itemCount"`

	FetchedAt *string `json:"fetchedAt,omitempty"`

	// Stale Older than the authority gateway’s 48 h stale window, or not stored yet.
	Stale bool `json:"stale"`
}

CodeListSummaryDto is `invoice.CodeListSummaryDto`.

type ConfigError

type ConfigError struct {
	Message string
}

ConfigError means the SDK is misconfigured: a missing or malformed API key, a mode mismatch, a bad option.

func (*ConfigError) Error

func (e *ConfigError) Error() string

type ConflictError

type ConflictError struct{ *APIError }

ConflictError is 409: the resource's state does not allow it (e.g. `BIZ004`, `BIZ201`, `BIZ205`).

func (*ConflictError) Unwrap

func (e *ConflictError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type ConnectionError

type ConnectionError struct {
	// BaseURL is the host that could not be reached.
	BaseURL string
	// Err is the transport's error.
	Err error
}

ConnectionError means the request never reached the API (DNS, TLS, connection reset …).

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

Unwrap returns the transport's error.

type ConnectionFallbackDto

type ConnectionFallbackDto struct {
	Kind ConnectionFallbackDtoKind `json:"kind"`

	// TaxID The sandbox test entity’s TIN.
	TaxID string `json:"taxId"`

	// ServiceID The sandbox test entity’s service id.
	ServiceID string `json:"serviceId"`
}

ConnectionFallbackDto is `invoice.ConnectionFallbackDto`.

type ConnectionFallbackDtoKind

type ConnectionFallbackDtoKind string

ConnectionFallbackDtoKind is the type of ConnectionFallbackDto.Kind. The API may add values.

const (
	ConnectionFallbackDtoKindTestEntity ConnectionFallbackDtoKind = "test_entity"
)

Values of ConnectionFallbackDtoKind.

type ConnectionKeyDto

type ConnectionKeyDto struct {
	// State Whether a signing key is installed with the access point.
	State ConnectionKeyDtoState `json:"state"`

	// CertificateFingerprint SHA-256 of the installed certificate, hex. Nothing else about the key is returned.
	CertificateFingerprint *string `json:"certificateFingerprint"`

	InstalledAt *string `json:"installedAt"`

	InstalledBy *InstalledByDto `json:"installedBy"`

	Previous *PreviousKeyDto `json:"previous"`
}

ConnectionKeyDto is `invoice.ConnectionKeyDto`.

type ConnectionKeyDtoState

type ConnectionKeyDtoState string

ConnectionKeyDtoState is the type of ConnectionKeyDto.State. The API may add values.

const (
	ConnectionKeyDtoStateNone      ConnectionKeyDtoState = "none"
	ConnectionKeyDtoStateInstalled ConnectionKeyDtoState = "installed"
	ConnectionKeyDtoStatePlatform  ConnectionKeyDtoState = "platform"
)

Values of ConnectionKeyDtoState.

type ConnectionNextActionDto

type ConnectionNextActionDto struct {
	// Code Example: "install_key".
	Code string `json:"code"`

	// Actor Who must act.
	Actor ConnectionNextActionDtoActor `json:"actor"`

	// Message Plain-language guidance for the code.
	Message string `json:"message"`
}

ConnectionNextActionDto is `invoice.ConnectionNextActionDto`.

type ConnectionNextActionDtoActor

type ConnectionNextActionDtoActor string

ConnectionNextActionDtoActor is the type of ConnectionNextActionDto.Actor. The API may add values.

const (
	ConnectionNextActionDtoActorTaxpayer ConnectionNextActionDtoActor = "taxpayer"
	ConnectionNextActionDtoActorProvider ConnectionNextActionDtoActor = "provider"
	ConnectionNextActionDtoActorTenant   ConnectionNextActionDtoActor = "tenant"
)

Values of ConnectionNextActionDtoActor.

type ConnectionPrerequisitesViewDto

type ConnectionPrerequisitesViewDto struct {
	// TaxIDVerified The organisation’s tax id is verified.
	TaxIDVerified bool `json:"taxIdVerified"`

	// TaxIDConnectable The verified tax id is in the form the tax authority opens a connection for (Nigeria: the 12-digit TIN `12345678-0001`). False: connecting answers 409 `BIZ218`.
	TaxIDConnectable bool `json:"taxIdConnectable"`

	// JurisdictionSupported The organisation’s country is supported.
	JurisdictionSupported bool `json:"jurisdictionSupported"`

	// TaxpayerEnabled Whether the taxpayer enabled e-invoicing with this access point; null with no connection.
	TaxpayerEnabled *bool `json:"taxpayerEnabled"`
}

ConnectionPrerequisitesViewDto is `invoice.ConnectionPrerequisitesViewDto`.

type ConnectionViewDto

type ConnectionViewDto struct {
	// Mode The token’s mode.
	Mode ConnectionViewDtoMode `json:"mode"`

	// Jurisdiction Example: "NG".
	Jurisdiction *string `json:"jurisdiction"`

	Kind ConnectionViewDtoKind `json:"kind"`

	State ConnectionViewDtoState `json:"state"`

	// IssuesAs The identity a submission made now goes out under: `organisation`, or in sandbox `test_entity` until the organisation is connected.
	IssuesAs ConnectionViewDtoIssuesAs `json:"issuesAs"`

	// Fallback The sandbox test entity while `issuesAs` is `test_entity`; null otherwise and always in live.
	Fallback *ConnectionFallbackDto `json:"fallback"`

	// TaxID The organisation’s own verified tax id the connection is for.
	TaxID *string `json:"taxId"`

	// TaxIDType Example: "tin".
	TaxIDType string `json:"taxIdType"`

	// AuthorityIdentifiers The identifiers the tax authority reports, shown once a connected grant showed them.
	AuthorityIdentifiers *AuthorityIdentifiersViewDto `json:"authorityIdentifiers"`

	// ClaimedIdentifiers The identifiers sent when connecting; null when none were.
	ClaimedIdentifiers *ClaimedIdentifiersViewDto `json:"claimedIdentifiers"`

	NextAction *ConnectionNextActionDto `json:"nextAction"`

	Prerequisites ConnectionPrerequisitesViewDto `json:"prerequisites"`

	Key ConnectionKeyDto `json:"key"`

	// AuthorityNextAction The tax authority gateway’s own guidance on what must happen next, relayed as the last check showed it; null when nothing is to do, before any check, and with no connection.
	AuthorityNextAction *AuthorityNextActionDto `json:"authorityNextAction"`

	// AuthorityLastCheckedAt When the gateway last checked the grant with the tax authority.
	AuthorityLastCheckedAt *string `json:"authorityLastCheckedAt"`

	// AuthorityNextCheckAt When the gateway will next check the grant; null when not scheduled or unknown.
	AuthorityNextCheckAt *string `json:"authorityNextCheckAt"`

	// SubmissionsAllowed Whether a live submission would be accepted now.
	SubmissionsAllowed bool `json:"submissionsAllowed"`

	LastCheckedAt *string `json:"lastCheckedAt"`

	ConnectedAt *string `json:"connectedAt"`

	DisconnectedAt *string `json:"disconnectedAt"`

	// History Every tax id the organisation’s grant was connected for in this mode, newest first; at most one open.
	History []TaxIdentityViewDto `json:"history"`

	// SharedWith The other mode whose connection shares this grant (disconnecting here then keeps it for that mode); null otherwise.
	SharedWith *ConnectionViewDtoSharedWith `json:"sharedWith"`

	// BusinessProfile The business the tax authority knows under this tax id, as the gateway relayed it (free-form, the authority’s fields); null until a check showed one, and with no connection.
	BusinessProfile map[string]any `json:"businessProfile"`

	// LegalNameMatches Whether that profile’s business name is the organisation’s verified legal name (case, spacing, punctuation and `LTD`/`LIMITED` ignored); null when either is unknown.
	LegalNameMatches *bool `json:"legalNameMatches"`
}

ConnectionViewDto is `invoice.ConnectionViewDto`.

type ConnectionViewDtoIssuesAs

type ConnectionViewDtoIssuesAs string

ConnectionViewDtoIssuesAs is the type of ConnectionViewDto.IssuesAs. The API may add values.

const (
	ConnectionViewDtoIssuesAsOrganisation ConnectionViewDtoIssuesAs = "organisation"
	ConnectionViewDtoIssuesAsTestEntity   ConnectionViewDtoIssuesAs = "test_entity"
)

Values of ConnectionViewDtoIssuesAs.

type ConnectionViewDtoKind

type ConnectionViewDtoKind string

ConnectionViewDtoKind is the type of ConnectionViewDto.Kind. The API may add values.

const (
	ConnectionViewDtoKindOrganization ConnectionViewDtoKind = "organization"
)

Values of ConnectionViewDtoKind.

type ConnectionViewDtoMode

type ConnectionViewDtoMode string

ConnectionViewDtoMode is the type of ConnectionViewDto.Mode. The API may add values.

const (
	ConnectionViewDtoModeSandbox ConnectionViewDtoMode = "sandbox"
	ConnectionViewDtoModeLive    ConnectionViewDtoMode = "live"
)

Values of ConnectionViewDtoMode.

type ConnectionViewDtoSharedWith

type ConnectionViewDtoSharedWith string

ConnectionViewDtoSharedWith is the type of ConnectionViewDto.SharedWith. The API may add values.

const (
	ConnectionViewDtoSharedWithSandbox ConnectionViewDtoSharedWith = "sandbox"
	ConnectionViewDtoSharedWithLive    ConnectionViewDtoSharedWith = "live"
)

Values of ConnectionViewDtoSharedWith.

type ConnectionViewDtoState

type ConnectionViewDtoState string

ConnectionViewDtoState is the type of ConnectionViewDto.State. The API may add values.

const (
	ConnectionViewDtoStateNotConnected              ConnectionViewDtoState = "not_connected"
	ConnectionViewDtoStatePendingTaxpayerEnablement ConnectionViewDtoState = "pending_taxpayer_enablement"
	ConnectionViewDtoStatePendingGrantApproval      ConnectionViewDtoState = "pending_grant_approval"
	ConnectionViewDtoStatePendingKey                ConnectionViewDtoState = "pending_key"
	ConnectionViewDtoStateConnected                 ConnectionViewDtoState = "connected"
	ConnectionViewDtoStateSuspended                 ConnectionViewDtoState = "suspended"
	ConnectionViewDtoStateRevoked                   ConnectionViewDtoState = "revoked"
)

Values of ConnectionViewDtoState.

type CostCodeUsageDto

type CostCodeUsageDto struct {
	// CostCode Example: "INVOICE_CREATE".
	CostCode string `json:"costCode"`

	// Label Example: "Create invoice".
	Label string `json:"label"`

	Count int64 `json:"count"`

	// Credits Credits spent, net of refunds.
	Credits int64 `json:"credits"`
}

CostCodeUsageDto is `billing.CostCodeUsageDto`.

type CountryOptionDto

type CountryOptionDto struct {
	// Code ISO 3166-1 alpha-2, upper case.
	// Example: "NG".
	Code string `json:"code"`

	// Name Example: "Nigeria".
	Name string `json:"name"`
}

CountryOptionDto is `invoice.CountryOptionDto`.

type CreateAndSubmitInvoiceBody

type CreateAndSubmitInvoiceBody = CreateInvoiceDto

CreateAndSubmitInvoiceBody is the request body of POST /i/v1/invoices/create-and-submit.

type CreateAndSubmitInvoiceData

type CreateAndSubmitInvoiceData = CreateAndSubmitResultDto

CreateAndSubmitInvoiceData is the data of a successful POST /i/v1/invoices/create-and-submit.

type CreateAndSubmitResultDto

type CreateAndSubmitResultDto struct {
	Invoice InvoiceViewDto `json:"invoice"`

	// Submission The queued submission; null when the submit was refused (the draft is kept).
	Submission *SubmissionViewDto `json:"submission"`

	// SubmitRefusal Why the submit was refused; null when it was queued.
	SubmitRefusal *SubmitRefusalDto `json:"submitRefusal"`
}

CreateAndSubmitResultDto is `invoice.CreateAndSubmitResultDto`.

type CreateBuyerBody

type CreateBuyerBody = CreateBuyerDto

CreateBuyerBody is the request body of POST /i/v1/buyers.

type CreateBuyerData

type CreateBuyerData = BuyerViewDto

CreateBuyerData is the data of a successful POST /i/v1/buyers.

type CreateBuyerDto

type CreateBuyerDto struct {
	Name string `json:"name"`

	LegalName *string `json:"legalName,omitempty"`

	// TaxID Example: "12345678-0001".
	TaxID *string `json:"taxId,omitempty"`

	// TaxIDType Defaults to `tin` when a taxId is sent; `none` when there is none.
	TaxIDType *CreateBuyerDtoTaxIDType `json:"taxIdType,omitempty"`

	Email *string `json:"email,omitempty"`

	// Phone E.164.
	// Example: "+2348098765432".
	Phone *string `json:"phone,omitempty"`

	Address *BuyerAddressDto `json:"address,omitempty"`

	PartyType *CreateBuyerDtoPartyType `json:"partyType,omitempty"`

	BusinessDescription *string `json:"businessDescription,omitempty"`

	// Reference The tenant’s own reference for this buyer.
	Reference *string `json:"reference,omitempty"`
}

CreateBuyerDto is `invoice.CreateBuyerDto`.

type CreateBuyerDtoPartyType

type CreateBuyerDtoPartyType string

CreateBuyerDtoPartyType is the type of CreateBuyerDto.PartyType. The API may add values.

const (
	CreateBuyerDtoPartyTypeIndividual  CreateBuyerDtoPartyType = "individual"
	CreateBuyerDtoPartyTypeCompany     CreateBuyerDtoPartyType = "company"
	CreateBuyerDtoPartyTypePartnership CreateBuyerDtoPartyType = "partnership"
	CreateBuyerDtoPartyTypeNonProfit   CreateBuyerDtoPartyType = "non_profit"
	CreateBuyerDtoPartyTypeGovernment  CreateBuyerDtoPartyType = "government"
)

Values of CreateBuyerDtoPartyType.

type CreateBuyerDtoTaxIDType

type CreateBuyerDtoTaxIDType string

CreateBuyerDtoTaxIDType is the type of CreateBuyerDto.TaxIDType. The API may add values.

const (
	CreateBuyerDtoTaxIDTypeTIN     CreateBuyerDtoTaxIDType = "tin"
	CreateBuyerDtoTaxIDTypeRn      CreateBuyerDtoTaxIDType = "rn"
	CreateBuyerDtoTaxIDTypeForeign CreateBuyerDtoTaxIDType = "foreign"
	CreateBuyerDtoTaxIDTypeNone    CreateBuyerDtoTaxIDType = "none"
)

Values of CreateBuyerDtoTaxIDType.

type CreateInvoiceBody

type CreateInvoiceBody = CreateInvoiceDto

CreateInvoiceBody is the request body of POST /i/v1/invoices.

type CreateInvoiceData

type CreateInvoiceData = InvoiceViewDto

CreateInvoiceData is the data of a successful POST /i/v1/invoices.

type CreateInvoiceDto

type CreateInvoiceDto struct {
	// SellerID Only the organisation’s own seller id.
	SellerID *string `json:"sellerId,omitempty"`

	BuyerID *string `json:"buyerId,omitempty"`

	// InvoiceKind A kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
	// Example: "B2B".
	InvoiceKind string `json:"invoiceKind"`

	// InvoiceNumber Allocated when absent. When sent, it must be a document number of this organisation, mode and issue year: channel (3 letters), seller code (3 to 5 letters), the issue year’s two digits, then 6 or more digits.
	// Example: "YPLEKA26000042".
	InvoiceNumber *string `json:"invoiceNumber,omitempty"`

	// InvoiceType Only `standard`: credit and debit notes are issued against an invoice (cancel, credit-notes, debit-notes).
	InvoiceType *CreateInvoiceDtoInvoiceType `json:"invoiceType,omitempty"`

	// InvoiceDate The issue date.
	// Example: "2026-09-30".
	InvoiceDate string `json:"invoiceDate"`

	// IssueTime Example: "14:30:00".
	IssueTime *string `json:"issueTime,omitempty"`

	// DueDate ≥ the issue date.
	// Example: "2026-10-30".
	DueDate *string `json:"dueDate,omitempty"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	LineItems []InvoiceLineItemDto `json:"lineItems"`

	// AllowanceAmount Document allowance, major units, ≤ 2 decimals.
	// Example: "0".
	AllowanceAmount *Amount `json:"allowanceAmount,omitempty"`

	// ChargeAmount Document charge, major units, ≤ 2 decimals.
	// Example: "0".
	ChargeAmount *Amount `json:"chargeAmount,omitempty"`

	PaymentTerms *string `json:"paymentTerms,omitempty"`

	Notes *string `json:"notes,omitempty"`

	PurchaseOrderReference *string `json:"purchaseOrderReference,omitempty"`

	BuyerReference *string `json:"buyerReference,omitempty"`

	AccountingCost *string `json:"accountingCost,omitempty"`
}

CreateInvoiceDto is `invoice.CreateInvoiceDto`.

type CreateInvoiceDtoInvoiceType

type CreateInvoiceDtoInvoiceType string

CreateInvoiceDtoInvoiceType is the type of CreateInvoiceDto.InvoiceType. The API may add values.

const (
	CreateInvoiceDtoInvoiceTypeStandard CreateInvoiceDtoInvoiceType = "standard"
)

Values of CreateInvoiceDtoInvoiceType.

type CreateInvoiceShareLinkBody

type CreateInvoiceShareLinkBody = CreateShareLinkDto

CreateInvoiceShareLinkBody is the request body of POST /i/v1/invoices/{id}/share-links.

type CreateInvoiceShareLinkData

type CreateInvoiceShareLinkData = ShareLinkViewDto

CreateInvoiceShareLinkData is the data of a successful POST /i/v1/invoices/{id}/share-links.

type CreateItemBody

type CreateItemBody = CreateItemDto

CreateItemBody is the request body of POST /i/v1/items.

type CreateItemData

type CreateItemData = ItemViewDto

CreateItemData is the data of a successful POST /i/v1/items.

type CreateItemDto

type CreateItemDto struct {
	// Name Example: "Consulting hour".
	Name string `json:"name"`

	Description *string `json:"description,omitempty"`

	// ItemType Example: "service".
	ItemType CreateItemDtoItemType `json:"itemType"`

	// HSNCode Required for goods.
	// Example: "8471.30".
	HSNCode *string `json:"hsnCode,omitempty"`

	// ServiceCode Required for services.
	// Example: "6201".
	ServiceCode *string `json:"serviceCode,omitempty"`

	// ProductCategory Example: "Machinery".
	ProductCategory string `json:"productCategory"`

	// UnitCode Example: "EA".
	UnitCode string `json:"unitCode"`

	// UnitPriceMinor Minor units as a decimal string (₦1,500.50 → "150050"); at most 10^14 — the same maximum as an invoice line’s unit price.
	// Example: "150050".
	UnitPriceMinor string `json:"unitPriceMinor"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// TaxCategory A tax-category id the jurisdiction serves, or a line alias (standard | zero | exempt).
	// Example: "STANDARD_VAT".
	TaxCategory string `json:"taxCategory"`

	// SKU Unique among the organisation’s non-archived items.
	// Example: "CONS-HR".
	SKU *string `json:"sku,omitempty"`
}

CreateItemDto is `invoice.CreateItemDto`.

type CreateItemDtoItemType

type CreateItemDtoItemType string

CreateItemDtoItemType is the type of CreateItemDto.ItemType. The API may add values.

const (
	CreateItemDtoItemTypeGoods   CreateItemDtoItemType = "goods"
	CreateItemDtoItemTypeService CreateItemDtoItemType = "service"
)

Values of CreateItemDtoItemType.

type CreateShareLinkDto

type CreateShareLinkDto struct {
	// ExpiresInSeconds Lifetime in seconds: 3600 (1 hour) to 2592000 (30 days); default 604800 (7 days).
	// Example: 604800.
	ExpiresInSeconds *float64 `json:"expiresInSeconds,omitempty"`

	// MaxViews How many times the link may be opened (1 = open once); absent = unlimited.
	// Example: 1.
	MaxViews *float64 `json:"maxViews,omitempty"`
}

CreateShareLinkDto is `invoice.CreateShareLinkDto`.

type CreditNoteIssuedDto

type CreditNoteIssuedDto struct {
	// Invoice The original invoice as it now stands.
	Invoice InvoiceViewDto `json:"invoice"`

	// CreditNote The credit note just issued.
	CreditNote InvoiceViewDto `json:"creditNote"`
}

CreditNoteIssuedDto is `invoice.CreditNoteIssuedDto`.

type CreditNoteLineDto

type CreditNoteLineDto struct {
	// LineNo the ORIGINAL invoice's line number
	// Example: 1.
	LineNo float64 `json:"lineNo"`

	// Quantity decimal > 0, at most 6 decimals, ≤ what is left of the line
	// Example: "2".
	Quantity Amount `json:"quantity"`
}

CreditNoteLineDto is `invoice.CreditNoteLineDto`.

type CreditNotePreviewAnswerDto

type CreditNotePreviewAnswerDto struct {
	Preview CreditNotePreviewDto `json:"preview"`
}

CreditNotePreviewAnswerDto is `invoice.CreditNotePreviewAnswerDto`.

type CreditNotePreviewDto

type CreditNotePreviewDto struct {
	Mode CreditNotePreviewDtoMode `json:"mode"`

	// Closing The note would credit the invoice in full.
	Closing bool `json:"closing"`

	Lines []NotePreviewLineDto `json:"lines"`

	Totals NotePreviewTotalsDto `json:"totals"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// CreditedBeforeMinor Credited before this note. Integer minor units.
	CreditedBeforeMinor int64 `json:"creditedBeforeMinor"`

	// NetReceivableBeforeMinor Integer minor units.
	NetReceivableBeforeMinor int64 `json:"netReceivableBeforeMinor"`

	// NetReceivableAfterMinor Integer minor units.
	NetReceivableAfterMinor int64 `json:"netReceivableAfterMinor"`

	// RefundOwedMinor The refund this note would owe the buyer. Integer minor units.
	RefundOwedMinor int64 `json:"refundOwedMinor"`
}

CreditNotePreviewDto is `invoice.CreditNotePreviewDto`.

type CreditNotePreviewDtoMode

type CreditNotePreviewDtoMode string

CreditNotePreviewDtoMode is the type of CreditNotePreviewDto.Mode. The API may add values.

const (
	CreditNotePreviewDtoModeFull   CreditNotePreviewDtoMode = "full"
	CreditNotePreviewDtoModeLines  CreditNotePreviewDtoMode = "lines"
	CreditNotePreviewDtoModeAmount CreditNotePreviewDtoMode = "amount"
)

Values of CreditNotePreviewDtoMode.

type CurrencyAmountCountDto

type CurrencyAmountCountDto struct {
	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	Count int64 `json:"count"`
}

CurrencyAmountCountDto is `invoice.CurrencyAmountCountDto`.

type CurrencyAmountDto

type CurrencyAmountDto struct {
	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`
}

CurrencyAmountDto is `invoice.CurrencyAmountDto`.

type CurrencyBucketDto

type CurrencyBucketDto struct {
	Count float64 `json:"count"`

	// GrossPayableMinor MINOR units, reporting currency.
	GrossPayableMinor float64 `json:"grossPayableMinor"`

	Currency string `json:"currency"`

	// InputVATMinor MINOR units of this currency.
	InputVATMinor float64 `json:"inputVatMinor"`
}

CurrencyBucketDto is `invoice.CurrencyBucketDto`.

type CurrencyTotalDto

type CurrencyTotalDto struct {
	// Currency Example: "NGN".
	Currency string `json:"currency"`

	Count int64 `json:"count"`

	// PayableMinor Integer minor units.
	PayableMinor int64 `json:"payableMinor"`
}

CurrencyTotalDto is `invoice.CurrencyTotalDto`.

type DebitNoteIssuedDto

type DebitNoteIssuedDto struct {
	// Invoice The original invoice as it now stands.
	Invoice InvoiceViewDto `json:"invoice"`

	// DebitNote The debit note just issued.
	DebitNote InvoiceViewDto `json:"debitNote"`
}

DebitNoteIssuedDto is `invoice.DebitNoteIssuedDto`.

type DebitNotePreviewAnswerDto

type DebitNotePreviewAnswerDto struct {
	Preview DebitNotePreviewDto `json:"preview"`
}

DebitNotePreviewAnswerDto is `invoice.DebitNotePreviewAnswerDto`.

type DebitNotePreviewDto

type DebitNotePreviewDto struct {
	Lines []NotePreviewLineDto `json:"lines"`

	Totals NotePreviewTotalsDto `json:"totals"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// NetReceivableBeforeMinor Integer minor units.
	NetReceivableBeforeMinor int64 `json:"netReceivableBeforeMinor"`

	// NetReceivableAfterMinor Integer minor units.
	NetReceivableAfterMinor int64 `json:"netReceivableAfterMinor"`
}

DebitNotePreviewDto is `invoice.DebitNotePreviewDto`.

type DeleteBuyerData

type DeleteBuyerData = BuyerDeleteResultDto

DeleteBuyerData is the data of a successful DELETE /i/v1/buyers/{id}.

type DeleteInvoiceData

type DeleteInvoiceData = InvoiceDeletedDto

DeleteInvoiceData is the data of a successful DELETE /i/v1/invoices/{id}.

type DeleteItemData

type DeleteItemData = ItemDeletedDto

DeleteItemData is the data of a successful DELETE /i/v1/items/{id}.

type DownloadInvoiceData

type DownloadInvoiceData = DownloadLinkDto

DownloadInvoiceData is the data of a successful GET /i/v1/invoices/{id}/download.

type DownloadInvoiceQuery

type DownloadInvoiceQuery struct {
	// Format Only `pdf` exists.
	Format *DownloadInvoiceQueryFormat `json:"format,omitempty"`
}

DownloadInvoiceQuery holds the query parameters of GET /i/v1/invoices/{id}/download.

type DownloadInvoiceQueryFormat

type DownloadInvoiceQueryFormat string

DownloadInvoiceQueryFormat is the type of DownloadInvoiceQuery.Format. The API may add values.

const (
	DownloadInvoiceQueryFormatPDF DownloadInvoiceQueryFormat = "pdf"
)

Values of DownloadInvoiceQueryFormat.

type DownloadLinkDto

type DownloadLinkDto struct {
	// DownloadURL Presigned GET on the private documents bucket.
	DownloadURL string `json:"downloadUrl"`

	// FileName Example: "INV00001.pdf".
	FileName string `json:"fileName"`

	ExpiresAt string `json:"expiresAt"`

	// FileSize Bytes.
	// Example: 7683.
	FileSize float64 `json:"fileSize"`
}

DownloadLinkDto is `invoice.DownloadLinkDto`.

type Error

type Error interface {
	error
	// contains filtered or unexported methods
}

Error is implemented by every error the SDK returns, so `var e einvoice.Error; errors.As(err, &e)` tells an SDK error from any other. Narrow further with the concrete types below.

type ErrorDetail

type ErrorDetail struct {
	// Field is the field (or code) the message is about: the single key of the wire object.
	Field string
	// Message is the human-readable message.
	Message string
}

ErrorDetail is one entry of the API's `meta.errors`: the wire shape is a single-key object `{ "<field-or-code>": "<message>" }`; the SDK gives it as Field + Message.

type ExcludedOperation

type ExcludedOperation struct {
	Method string
	Path   string
	Reason string
}

ExcludedOperation is an operation an API key may call that the SDK deliberately has no method for, and why.

type FinaliseInvoiceData

type FinaliseInvoiceData = InvoiceViewDto

FinaliseInvoiceData is the data of a successful POST /i/v1/invoices/{id}/finalise.

type GetActiveSubscriptionData

type GetActiveSubscriptionData = ActiveSubscriptionDto

GetActiveSubscriptionData is the data of a successful GET /b/v1/subscriptions/active.

type GetBillingAccountData

type GetBillingAccountData = BillingAccountDto

GetBillingAccountData is the data of a successful GET /b/v1/billing-accounts/me.

type GetBillingAccountQuery

type GetBillingAccountQuery struct {
	// Mode Which ledger to read. Defaults to the token's mode. API keys may only name their own mode (403 BIZ108).
	Mode *GetBillingAccountQueryMode `json:"mode,omitempty"`
}

GetBillingAccountQuery holds the query parameters of GET /b/v1/billing-accounts/me.

type GetBillingAccountQueryMode

type GetBillingAccountQueryMode string

GetBillingAccountQueryMode is the type of GetBillingAccountQuery.Mode. The API may add values.

const (
	GetBillingAccountQueryModeSandbox GetBillingAccountQueryMode = "sandbox"
	GetBillingAccountQueryModeLive    GetBillingAccountQueryMode = "live"
)

Values of GetBillingAccountQueryMode.

type GetBillingAccountStatsData

type GetBillingAccountStatsData = AccountStatsDto

GetBillingAccountStatsData is the data of a successful GET /b/v1/billing-accounts/{id}/stats.

type GetBillingAccountStatsQuery

type GetBillingAccountStatsQuery struct {
	// Mode Which ledger to read. Defaults to the token's mode. API keys may only name their own mode (403 BIZ108).
	Mode *GetBillingAccountStatsQueryMode `json:"mode,omitempty"`
}

GetBillingAccountStatsQuery holds the query parameters of GET /b/v1/billing-accounts/{id}/stats.

type GetBillingAccountStatsQueryMode

type GetBillingAccountStatsQueryMode string

GetBillingAccountStatsQueryMode is the type of GetBillingAccountStatsQuery.Mode. The API may add values.

const (
	GetBillingAccountStatsQueryModeSandbox GetBillingAccountStatsQueryMode = "sandbox"
	GetBillingAccountStatsQueryModeLive    GetBillingAccountStatsQueryMode = "live"
)

Values of GetBillingAccountStatsQueryMode.

type GetBillingSetupData

type GetBillingSetupData = SetupDto

GetBillingSetupData is the data of a successful GET /b/v1/setup.

type GetBillingStatementData

type GetBillingStatementData = StatementDto

GetBillingStatementData is the data of a successful GET /b/v1/statements/{period}.

type GetBillingStatementQuery

type GetBillingStatementQuery struct {
	// Mode Which ledger to read. Defaults to the token's mode. API keys may only name their own mode (403 BIZ108).
	Mode *GetBillingStatementQueryMode `json:"mode,omitempty"`
}

GetBillingStatementQuery holds the query parameters of GET /b/v1/statements/{period}.

type GetBillingStatementQueryMode

type GetBillingStatementQueryMode string

GetBillingStatementQueryMode is the type of GetBillingStatementQuery.Mode. The API may add values.

const (
	GetBillingStatementQueryModeSandbox GetBillingStatementQueryMode = "sandbox"
	GetBillingStatementQueryModeLive    GetBillingStatementQueryMode = "live"
)

Values of GetBillingStatementQueryMode.

type GetBuyerData

type GetBuyerData = BuyerViewDto

GetBuyerData is the data of a successful GET /i/v1/buyers/{id}.

type GetBuyerSetupData

type GetBuyerSetupData = BuyerSetupDto

GetBuyerSetupData is the data of a successful GET /i/v1/buyers/setup.

type GetBuyerVerificationStatusData

type GetBuyerVerificationStatusData = BuyerVerificationStatusDto

GetBuyerVerificationStatusData is the data of a successful GET /i/v1/buyers/{id}/verification-status.

type GetInboundHistoryRunData

type GetInboundHistoryRunData = HistoryRunDto

GetInboundHistoryRunData is the data of a successful GET /i/v1/inbound-invoices/history-runs/{runId}.

type GetInboundInvoiceAnalyticsData

type GetInboundInvoiceAnalyticsData = InboundAnalyticsDto

GetInboundInvoiceAnalyticsData is the data of a successful GET /i/v1/inbound-invoices/analytics.

type GetInboundInvoiceAnalyticsQuery

type GetInboundInvoiceAnalyticsQuery struct {
	// Seller The seller: a name (substring, any case) or a TIN (prefix). A TIN may be typed with its hyphen, without it, or in groups.
	Seller *string `json:"seller,omitempty"`

	// AccessPoint The seller’s access point (`supplier.app_reference`), exact.
	AccessPoint *string `json:"accessPoint,omitempty"`

	// TransmissionStatus As the gateway reports it, exact.
	TransmissionStatus *string `json:"transmissionStatus,omitempty"`

	// PaymentStatus `overdue`: a due date before today and not paid.
	PaymentStatus *GetInboundInvoiceAnalyticsQueryPaymentStatus `json:"paymentStatus,omitempty"`

	// IssueDateFrom Inclusive.
	// Example: "2026-09-01".
	IssueDateFrom *string `json:"issueDateFrom,omitempty"`

	// IssueDateTo Inclusive.
	// Example: "2026-09-30".
	IssueDateTo *string `json:"issueDateTo,omitempty"`

	// ReceivedFrom Inclusive (an instant or a day).
	// Example: "2026-09-01T00:00:00Z".
	ReceivedFrom *string `json:"receivedFrom,omitempty"`

	// ReceivedTo Exclusive for an instant; a calendar day includes that whole day.
	// Example: "2026-10-01T00:00:00Z".
	ReceivedTo *string `json:"receivedTo,omitempty"`

	// AmountMin Payable amount, MAJOR units, inclusive.
	// Example: "1000.00".
	AmountMin *string `json:"amountMin,omitempty"`

	// AmountMax Payable amount, MAJOR units, inclusive.
	// Example: "50000".
	AmountMax *string `json:"amountMax,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	// Q Seller name or TIN, IRN, or the seller’s invoice number (substring, any case). A TIN may be typed with its hyphen, without it, or in groups.
	Q *string `json:"q,omitempty"`

	// TaxID One of `taxpayer.taxIds` (the organisation’s own tax ids in this mode); any other is 400.
	TaxID *string `json:"taxId,omitempty"`

	// Tier `forward` (default): invoices received since the organisation connected its tax id. `history`: invoices retrieved from the tax authority on request (409 `BIZ221` while retrieving history is not available).
	Tier *GetInboundInvoiceAnalyticsQueryTier `json:"tier,omitempty"`
}

GetInboundInvoiceAnalyticsQuery holds the query parameters of GET /i/v1/inbound-invoices/analytics.

type GetInboundInvoiceAnalyticsQueryPaymentStatus

type GetInboundInvoiceAnalyticsQueryPaymentStatus string

GetInboundInvoiceAnalyticsQueryPaymentStatus is the type of GetInboundInvoiceAnalyticsQuery.PaymentStatus. The API may add values.

const (
	GetInboundInvoiceAnalyticsQueryPaymentStatusPaid     GetInboundInvoiceAnalyticsQueryPaymentStatus = "paid"
	GetInboundInvoiceAnalyticsQueryPaymentStatusUnpaid   GetInboundInvoiceAnalyticsQueryPaymentStatus = "unpaid"
	GetInboundInvoiceAnalyticsQueryPaymentStatusPartial  GetInboundInvoiceAnalyticsQueryPaymentStatus = "partial"
	GetInboundInvoiceAnalyticsQueryPaymentStatusRejected GetInboundInvoiceAnalyticsQueryPaymentStatus = "rejected"
	GetInboundInvoiceAnalyticsQueryPaymentStatusOverdue  GetInboundInvoiceAnalyticsQueryPaymentStatus = "overdue"
)

Values of GetInboundInvoiceAnalyticsQueryPaymentStatus.

type GetInboundInvoiceAnalyticsQueryTier

type GetInboundInvoiceAnalyticsQueryTier string

GetInboundInvoiceAnalyticsQueryTier is the type of GetInboundInvoiceAnalyticsQuery.Tier. The API may add values.

const (
	GetInboundInvoiceAnalyticsQueryTierForward GetInboundInvoiceAnalyticsQueryTier = "forward"
	GetInboundInvoiceAnalyticsQueryTierHistory GetInboundInvoiceAnalyticsQueryTier = "history"
)

Values of GetInboundInvoiceAnalyticsQueryTier.

type GetInboundInvoiceData

type GetInboundInvoiceData = InboundInvoiceDetailDto

GetInboundInvoiceData is the data of a successful GET /i/v1/inbound-invoices/{id}.

type GetInvoiceAuthorityCopyData

type GetInvoiceAuthorityCopyData = AuthorityCopyDto

GetInvoiceAuthorityCopyData is the data of a successful GET /i/v1/invoices/{id}/authority-download.

type GetInvoiceData

type GetInvoiceData = InvoiceViewDto

GetInvoiceData is the data of a successful GET /i/v1/invoices/{id}.

type GetInvoiceListSummaryData

type GetInvoiceListSummaryData = InvoiceListSummaryDto

GetInvoiceListSummaryData is the data of a successful GET /i/v1/invoices/summary.

type GetInvoiceListSummaryQuery

type GetInvoiceListSummaryQuery struct {
	Status *GetInvoiceListSummaryQueryStatus `json:"status,omitempty"`

	InvoiceType *GetInvoiceListSummaryQueryInvoiceType `json:"invoiceType,omitempty"`

	PaymentStatus *GetInvoiceListSummaryQueryPaymentStatus `json:"paymentStatus,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	BuyerID *string `json:"buyerId,omitempty"`

	// SellerID Only the organisation’s own seller id.
	SellerID *string `json:"sellerId,omitempty"`

	// CreatedBy Only documents created by this actor id (`createdBy.id`): an auth user id, or an API-key id with `createdByType=api_key`.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType Only documents created by this kind of actor (`createdBy.type`).
	CreatedByType *GetInvoiceListSummaryQueryCreatedByType `json:"createdByType,omitempty"`

	// InvoiceDateFrom Example: "2026-09-01".
	InvoiceDateFrom *string `json:"invoiceDateFrom,omitempty"`

	// InvoiceDateTo Example: "2026-09-30".
	InvoiceDateTo *string `json:"invoiceDateTo,omitempty"`

	DueDateFrom *string `json:"dueDateFrom,omitempty"`

	DueDateTo *string `json:"dueDateTo,omitempty"`

	// CreatedAtFrom Example: "2026-09-01T00:00:00Z".
	CreatedAtFrom *string `json:"createdAtFrom,omitempty"`

	// CreatedAtTo Exclusive.
	// Example: "2026-10-01T00:00:00Z".
	CreatedAtTo *string `json:"createdAtTo,omitempty"`

	// Search Matches the document number, the number NRS holds or the IRN by prefix, and the buyer name or TIN anywhere in it. Case-insensitive; `%` and `_` are plain characters. A TIN may be typed with its hyphen, without it, or in groups.
	Search *string `json:"search,omitempty"`

	// SimpleStatus Only documents with this simple status (`simpleStatus`).
	SimpleStatus *GetInvoiceListSummaryQuerySimpleStatus `json:"simpleStatus,omitempty"`

	// Reporting Only documents at this reporting stage, as the summary cards count them (`needs_attention` = rejected or on hold, not cancelled).
	Reporting *GetInvoiceListSummaryQueryReporting `json:"reporting,omitempty"`

	// Delivery Only documents with this delivery channel (`reporting.delivery`).
	Delivery *GetInvoiceListSummaryQueryDelivery `json:"delivery,omitempty"`

	// Credited `true`: documents credited by a credit note that counts against them; `false`: invoices no credit note credits.
	Credited *GetInvoiceListSummaryQueryCredited `json:"credited,omitempty"`

	// RefundOwed `true`: documents on which a refund is still owed to the buyer; `false`: documents on which none is.
	RefundOwed *GetInvoiceListSummaryQueryRefundOwed `json:"refundOwed,omitempty"`

	// Overdue Only issued invoices still owing (net of credit notes) past their due date today.
	Overdue *GetInvoiceListSummaryQueryOverdue `json:"overdue,omitempty"`

	// AmountFromMinor Payable amount at least this (minor units).
	AmountFromMinor *float64 `json:"amountFromMinor,omitempty"`

	// AmountToMinor Payable amount at most this (minor units).
	AmountToMinor *float64 `json:"amountToMinor,omitempty"`
}

GetInvoiceListSummaryQuery holds the query parameters of GET /i/v1/invoices/summary.

type GetInvoiceListSummaryQueryCreatedByType

type GetInvoiceListSummaryQueryCreatedByType string

GetInvoiceListSummaryQueryCreatedByType is the type of GetInvoiceListSummaryQuery.CreatedByType. The API may add values.

const (
	GetInvoiceListSummaryQueryCreatedByTypeUser    GetInvoiceListSummaryQueryCreatedByType = "user"
	GetInvoiceListSummaryQueryCreatedByTypeAPIKey  GetInvoiceListSummaryQueryCreatedByType = "api_key"
	GetInvoiceListSummaryQueryCreatedByTypeService GetInvoiceListSummaryQueryCreatedByType = "service"
	GetInvoiceListSummaryQueryCreatedByTypeSystem  GetInvoiceListSummaryQueryCreatedByType = "system"
)

Values of GetInvoiceListSummaryQueryCreatedByType.

type GetInvoiceListSummaryQueryCredited

type GetInvoiceListSummaryQueryCredited string

GetInvoiceListSummaryQueryCredited is the type of GetInvoiceListSummaryQuery.Credited. The API may add values.

const (
	GetInvoiceListSummaryQueryCreditedTrue  GetInvoiceListSummaryQueryCredited = "true"
	GetInvoiceListSummaryQueryCreditedFalse GetInvoiceListSummaryQueryCredited = "false"
)

Values of GetInvoiceListSummaryQueryCredited.

type GetInvoiceListSummaryQueryDelivery

type GetInvoiceListSummaryQueryDelivery string

GetInvoiceListSummaryQueryDelivery is the type of GetInvoiceListSummaryQuery.Delivery. The API may add values.

const (
	GetInvoiceListSummaryQueryDeliveryNRS            GetInvoiceListSummaryQueryDelivery = "nrs"
	GetInvoiceListSummaryQueryDeliveryDeliverToBuyer GetInvoiceListSummaryQueryDelivery = "deliver_to_buyer"
	GetInvoiceListSummaryQueryDeliverySentEmail      GetInvoiceListSummaryQueryDelivery = "sent_email"
	GetInvoiceListSummaryQueryDeliverySharedLink     GetInvoiceListSummaryQueryDelivery = "shared_link"
	GetInvoiceListSummaryQueryDeliveryNone           GetInvoiceListSummaryQueryDelivery = "none"
)

Values of GetInvoiceListSummaryQueryDelivery.

type GetInvoiceListSummaryQueryInvoiceType

type GetInvoiceListSummaryQueryInvoiceType string

GetInvoiceListSummaryQueryInvoiceType is the type of GetInvoiceListSummaryQuery.InvoiceType. The API may add values.

const (
	GetInvoiceListSummaryQueryInvoiceTypeStandard   GetInvoiceListSummaryQueryInvoiceType = "standard"
	GetInvoiceListSummaryQueryInvoiceTypeCreditNote GetInvoiceListSummaryQueryInvoiceType = "credit_note"
	GetInvoiceListSummaryQueryInvoiceTypeDebitNote  GetInvoiceListSummaryQueryInvoiceType = "debit_note"
)

Values of GetInvoiceListSummaryQueryInvoiceType.

type GetInvoiceListSummaryQueryOverdue

type GetInvoiceListSummaryQueryOverdue string

GetInvoiceListSummaryQueryOverdue is the type of GetInvoiceListSummaryQuery.Overdue. The API may add values.

const (
	GetInvoiceListSummaryQueryOverdueTrue GetInvoiceListSummaryQueryOverdue = "true"
)

Values of GetInvoiceListSummaryQueryOverdue.

type GetInvoiceListSummaryQueryPaymentStatus

type GetInvoiceListSummaryQueryPaymentStatus string

GetInvoiceListSummaryQueryPaymentStatus is the type of GetInvoiceListSummaryQuery.PaymentStatus. The API may add values.

const (
	GetInvoiceListSummaryQueryPaymentStatusUnpaid        GetInvoiceListSummaryQueryPaymentStatus = "unpaid"
	GetInvoiceListSummaryQueryPaymentStatusPartiallyPaid GetInvoiceListSummaryQueryPaymentStatus = "partially_paid"
	GetInvoiceListSummaryQueryPaymentStatusPaid          GetInvoiceListSummaryQueryPaymentStatus = "paid"
	GetInvoiceListSummaryQueryPaymentStatusPaymentFailed GetInvoiceListSummaryQueryPaymentStatus = "payment_failed"
)

Values of GetInvoiceListSummaryQueryPaymentStatus.

type GetInvoiceListSummaryQueryRefundOwed

type GetInvoiceListSummaryQueryRefundOwed string

GetInvoiceListSummaryQueryRefundOwed is the type of GetInvoiceListSummaryQuery.RefundOwed. The API may add values.

const (
	GetInvoiceListSummaryQueryRefundOwedTrue  GetInvoiceListSummaryQueryRefundOwed = "true"
	GetInvoiceListSummaryQueryRefundOwedFalse GetInvoiceListSummaryQueryRefundOwed = "false"
)

Values of GetInvoiceListSummaryQueryRefundOwed.

type GetInvoiceListSummaryQueryReporting

type GetInvoiceListSummaryQueryReporting string

GetInvoiceListSummaryQueryReporting is the type of GetInvoiceListSummaryQuery.Reporting. The API may add values.

const (
	GetInvoiceListSummaryQueryReportingDraft          GetInvoiceListSummaryQueryReporting = "draft"
	GetInvoiceListSummaryQueryReportingNotReported    GetInvoiceListSummaryQueryReporting = "not_reported"
	GetInvoiceListSummaryQueryReportingInProgress     GetInvoiceListSummaryQueryReporting = "in_progress"
	GetInvoiceListSummaryQueryReportingReported       GetInvoiceListSummaryQueryReporting = "reported"
	GetInvoiceListSummaryQueryReportingNeedsAttention GetInvoiceListSummaryQueryReporting = "needs_attention"
)

Values of GetInvoiceListSummaryQueryReporting.

type GetInvoiceListSummaryQuerySimpleStatus

type GetInvoiceListSummaryQuerySimpleStatus string

GetInvoiceListSummaryQuerySimpleStatus is the type of GetInvoiceListSummaryQuery.SimpleStatus. The API may add values.

const (
	GetInvoiceListSummaryQuerySimpleStatusDraft       GetInvoiceListSummaryQuerySimpleStatus = "draft"
	GetInvoiceListSummaryQuerySimpleStatusIssued      GetInvoiceListSummaryQuerySimpleStatus = "issued"
	GetInvoiceListSummaryQuerySimpleStatusReported    GetInvoiceListSummaryQuerySimpleStatus = "reported"
	GetInvoiceListSummaryQuerySimpleStatusTransmitted GetInvoiceListSummaryQuerySimpleStatus = "transmitted"
	GetInvoiceListSummaryQuerySimpleStatusDelivered   GetInvoiceListSummaryQuerySimpleStatus = "delivered"
	GetInvoiceListSummaryQuerySimpleStatusPaid        GetInvoiceListSummaryQuerySimpleStatus = "paid"
	GetInvoiceListSummaryQuerySimpleStatusPartPaid    GetInvoiceListSummaryQuerySimpleStatus = "part_paid"
	GetInvoiceListSummaryQuerySimpleStatusCancelled   GetInvoiceListSummaryQuerySimpleStatus = "cancelled"
)

Values of GetInvoiceListSummaryQuerySimpleStatus.

type GetInvoiceListSummaryQueryStatus

type GetInvoiceListSummaryQueryStatus string

GetInvoiceListSummaryQueryStatus is the type of GetInvoiceListSummaryQuery.Status. The API may add values.

const (
	GetInvoiceListSummaryQueryStatusDraft               GetInvoiceListSummaryQueryStatus = "draft"
	GetInvoiceListSummaryQueryStatusFinalised           GetInvoiceListSummaryQueryStatus = "finalised"
	GetInvoiceListSummaryQueryStatusQueued              GetInvoiceListSummaryQueryStatus = "queued"
	GetInvoiceListSummaryQueryStatusSigned              GetInvoiceListSummaryQueryStatus = "signed"
	GetInvoiceListSummaryQueryStatusTransmitted         GetInvoiceListSummaryQueryStatus = "transmitted"
	GetInvoiceListSummaryQueryStatusAccepted            GetInvoiceListSummaryQueryStatus = "accepted"
	GetInvoiceListSummaryQueryStatusRejected            GetInvoiceListSummaryQueryStatus = "rejected"
	GetInvoiceListSummaryQueryStatusFailed              GetInvoiceListSummaryQueryStatus = "failed"
	GetInvoiceListSummaryQueryStatusCancellationPending GetInvoiceListSummaryQueryStatus = "cancellation_pending"
	GetInvoiceListSummaryQueryStatusCancelled           GetInvoiceListSummaryQueryStatus = "cancelled"
)

Values of GetInvoiceListSummaryQueryStatus.

type GetInvoiceOverviewData

type GetInvoiceOverviewData = InvoiceOverviewDto

GetInvoiceOverviewData is the data of a successful GET /i/v1/invoices/overview.

type GetInvoiceOverviewQuery

type GetInvoiceOverviewQuery struct {
	WindowDays *float64 `json:"windowDays,omitempty"`
}

GetInvoiceOverviewQuery holds the query parameters of GET /i/v1/invoices/overview.

type GetInvoiceReferenceListData

type GetInvoiceReferenceListData = CodeListDto

GetInvoiceReferenceListData is the data of a successful GET /i/v1/invoices/resources/{type}.

type GetInvoiceSettingsData

type GetInvoiceSettingsData = InvoiceSettingsViewDto

GetInvoiceSettingsData is the data of a successful GET /i/v1/invoice-settings.

type GetInvoiceSetupData

type GetInvoiceSetupData = InvoiceSetupDto

GetInvoiceSetupData is the data of a successful GET /i/v1/invoices/setup.

type GetInvoiceStatisticsData

type GetInvoiceStatisticsData = InvoiceStatisticsDto

GetInvoiceStatisticsData is the data of a successful GET /i/v1/invoices/statistics.

type GetInvoiceStatisticsQuery

type GetInvoiceStatisticsQuery struct {
	// From Example: "2026-09-01T00:00:00Z".
	From *string `json:"from,omitempty"`

	// To Exclusive.
	// Example: "2026-10-01T00:00:00Z".
	To *string `json:"to,omitempty"`
}

GetInvoiceStatisticsQuery holds the query parameters of GET /i/v1/invoices/statistics.

type GetInvoiceStatusData

type GetInvoiceStatusData = SubmissionStatusDto

GetInvoiceStatusData is the data of a successful GET /i/v1/invoices/{id}/status.

type GetIssuedHistoryInvoiceData

type GetIssuedHistoryInvoiceData = InboundInvoiceDetailDto

GetIssuedHistoryInvoiceData is the data of a successful GET /i/v1/issued-history/{id}.

type GetItemData

type GetItemData = ItemViewDto

GetItemData is the data of a successful GET /i/v1/items/{id}.

type GetLedgerEntryData

type GetLedgerEntryData = LedgerEntryDto

GetLedgerEntryData is the data of a successful GET /b/v1/transactions/{id}.

type GetOrganizationData

type GetOrganizationData = OrganizationProfileResponseDto

GetOrganizationData is the data of a successful GET /a/v1/organizations/{orgId}.

type GetOrganizationReadinessData

type GetOrganizationReadinessData = ReadinessResponseDto

GetOrganizationReadinessData is the data of a successful GET /a/v1/organizations/me/readiness.

type GetPaymentData

type GetPaymentData = PaymentDetailDto

GetPaymentData is the data of a successful GET /b/v1/payments/{id}.

type GetSandboxUsageData

type GetSandboxUsageData = SandboxUsageDto

GetSandboxUsageData is the data of a successful GET /b/v1/sandbox/usage.

type GetSellerData

type GetSellerData = SellerViewDto

GetSellerData is the data of a successful GET /i/v1/sellers/{id}.

type GetSellerSetupData

type GetSellerSetupData = SellerSetupDto

GetSellerSetupData is the data of a successful GET /i/v1/sellers/setup.

type GetSellerVerificationStatusData

type GetSellerVerificationStatusData = SellerVerificationStatusDto

GetSellerVerificationStatusData is the data of a successful GET /i/v1/sellers/{id}/verification-status.

type GetSubscriptionData

type GetSubscriptionData = SubscriptionDto

GetSubscriptionData is the data of a successful GET /b/v1/subscriptions/{id}.

type GetTaxConnectionData

type GetTaxConnectionData = ConnectionViewDto

GetTaxConnectionData is the data of a successful GET /i/v1/tax-connection.

type GetUsageAnalyticsItem

type GetUsageAnalyticsItem = UsageBucketDto

GetUsageAnalyticsItem is one element of the page GET /b/v1/transactions/analytics/usage answers.

type GetUsageAnalyticsQuery

type GetUsageAnalyticsQuery struct {
	Mode *GetUsageAnalyticsQueryMode `json:"mode,omitempty"`

	StartDate *string `json:"startDate,omitempty"`

	// EndDate At most 366 days after startDate.
	EndDate *string `json:"endDate,omitempty"`

	Period *GetUsageAnalyticsQueryPeriod `json:"period,omitempty"`
}

GetUsageAnalyticsQuery holds the query parameters of GET /b/v1/transactions/analytics/usage.

type GetUsageAnalyticsQueryMode

type GetUsageAnalyticsQueryMode string

GetUsageAnalyticsQueryMode is the type of GetUsageAnalyticsQuery.Mode. The API may add values.

const (
	GetUsageAnalyticsQueryModeSandbox GetUsageAnalyticsQueryMode = "sandbox"
	GetUsageAnalyticsQueryModeLive    GetUsageAnalyticsQueryMode = "live"
)

Values of GetUsageAnalyticsQueryMode.

type GetUsageAnalyticsQueryPeriod

type GetUsageAnalyticsQueryPeriod string

GetUsageAnalyticsQueryPeriod is the type of GetUsageAnalyticsQuery.Period. The API may add values.

const (
	GetUsageAnalyticsQueryPeriodDaily   GetUsageAnalyticsQueryPeriod = "daily"
	GetUsageAnalyticsQueryPeriodWeekly  GetUsageAnalyticsQueryPeriod = "weekly"
	GetUsageAnalyticsQueryPeriodMonthly GetUsageAnalyticsQueryPeriod = "monthly"
)

Values of GetUsageAnalyticsQueryPeriod.

type GetUsageByCostCodeItem

type GetUsageByCostCodeItem = CostCodeUsageDto

GetUsageByCostCodeItem is one element of the page GET /b/v1/transactions/breakdown/by-endpoint answers.

type GetUsageByCostCodeQuery

type GetUsageByCostCodeQuery struct {
	Mode *GetUsageByCostCodeQueryMode `json:"mode,omitempty"`

	StartDate *string `json:"startDate,omitempty"`

	// EndDate At most 366 days after startDate.
	EndDate *string `json:"endDate,omitempty"`
}

GetUsageByCostCodeQuery holds the query parameters of GET /b/v1/transactions/breakdown/by-endpoint.

type GetUsageByCostCodeQueryMode

type GetUsageByCostCodeQueryMode string

GetUsageByCostCodeQueryMode is the type of GetUsageByCostCodeQuery.Mode. The API may add values.

const (
	GetUsageByCostCodeQueryModeSandbox GetUsageByCostCodeQueryMode = "sandbox"
	GetUsageByCostCodeQueryModeLive    GetUsageByCostCodeQueryMode = "live"
)

Values of GetUsageByCostCodeQueryMode.

type GetWebhookDeliveryData

type GetWebhookDeliveryData = WebhookDeliveryDetailDto

GetWebhookDeliveryData is the data of a successful GET /n/v1/webhook-deliveries/{id}.

type GetWebhookEndpointData

type GetWebhookEndpointData = WebhookEndpointDto

GetWebhookEndpointData is the data of a successful GET /n/v1/webhook-endpoints/{id}.

type GetWebhookEventData

type GetWebhookEventData = WebhookEventDto

GetWebhookEventData is the data of a successful GET /n/v1/webhook-events/{id}.

type HeaderGetter

type HeaderGetter interface {
	Get(name string) string
}

HeaderGetter is anything that answers a header by name, case-insensitively: http.Header does.

type HistoryRunAddedDto

type HistoryRunAddedDto struct {
	// Received Received invoices new to the History tab.
	Received float64 `json:"received"`

	// Issued Issued invoices new to Issued history.
	Issued float64 `json:"issued"`

	// Total `received + issued`: the run is charged only when this is ≥ 1.
	Total float64 `json:"total"`
}

HistoryRunAddedDto is `invoice.HistoryRunAddedDto`.

type HistoryRunDto

type HistoryRunDto struct {
	ID string `json:"id"`

	Status HistoryRunDtoStatus `json:"status"`

	// Phase `received`, then `issued` (the run also feeds Issued history), then `done`.
	Phase HistoryRunDtoPhase `json:"phase"`

	// RequestedAt When it was asked for (ISO).
	RequestedAt string `json:"requestedAt"`

	RequestedBy HistoryRunRequesterDto `json:"requestedBy"`

	StartedAt *string `json:"startedAt"`

	// FinishedAt Null while queued or running.
	FinishedAt *string `json:"finishedAt"`

	Progress HistoryRunProgressDto `json:"progress"`

	Added HistoryRunAddedDto `json:"added"`

	// ReachedEnd Both sides were read to the end of what the gateway holds.
	ReachedEnd bool `json:"reachedEnd"`

	// MoreAvailable Null until finished. True: "Check for more" may find more (the end was not reached, or the tax authority has more history to import).
	MoreAvailable *bool `json:"moreAvailable"`

	// Charged True: the run was paid for (it added invoices). False: it was free (nothing new). Null while it runs, or until billing confirms.
	Charged *bool `json:"charged"`

	// Error Why a run failed (a code: `not_connected`, `stalled`, `unavailable:…`); null otherwise.
	Error *string `json:"error"`
}

HistoryRunDto is `invoice.HistoryRunDto`.

type HistoryRunDtoPhase

type HistoryRunDtoPhase string

HistoryRunDtoPhase is the type of HistoryRunDto.Phase. The API may add values.

const (
	HistoryRunDtoPhaseReceived HistoryRunDtoPhase = "received"
	HistoryRunDtoPhaseIssued   HistoryRunDtoPhase = "issued"
	HistoryRunDtoPhaseDone     HistoryRunDtoPhase = "done"
)

Values of HistoryRunDtoPhase.

type HistoryRunDtoStatus

type HistoryRunDtoStatus string

HistoryRunDtoStatus is the type of HistoryRunDto.Status. The API may add values.

const (
	HistoryRunDtoStatusQueued    HistoryRunDtoStatus = "queued"
	HistoryRunDtoStatusRunning   HistoryRunDtoStatus = "running"
	HistoryRunDtoStatusSucceeded HistoryRunDtoStatus = "succeeded"
	HistoryRunDtoStatusFailed    HistoryRunDtoStatus = "failed"
)

Values of HistoryRunDtoStatus.

type HistoryRunListDto

type HistoryRunListDto struct {
	// Items Newest first.
	Items []HistoryRunDto `json:"items"`

	// Active The run queued or running now, if any (at most one).
	Active *HistoryRunDto `json:"active"`
}

HistoryRunListDto is `invoice.HistoryRunListDto`.

type HistoryRunProgressDto

type HistoryRunProgressDto struct {
	// PagesRead Pages of the tax authority gateway’s feed read so far.
	PagesRead float64 `json:"pagesRead"`

	// InvoicesSeen The organisation’s invoices those pages held.
	InvoicesSeen float64 `json:"invoicesSeen"`
}

HistoryRunProgressDto is `invoice.HistoryRunProgressDto`.

type HistoryRunRequesterDto

type HistoryRunRequesterDto struct {
	Type HistoryRunRequesterDtoType `json:"type"`

	// ID The user (or key) id.
	ID string `json:"id"`
}

HistoryRunRequesterDto is `invoice.HistoryRunRequesterDto`.

type HistoryRunRequesterDtoType

type HistoryRunRequesterDtoType string

HistoryRunRequesterDtoType is the type of HistoryRunRequesterDto.Type. The API may add values.

const (
	HistoryRunRequesterDtoTypeUser   HistoryRunRequesterDtoType = "user"
	HistoryRunRequesterDtoTypeAPIKey HistoryRunRequesterDtoType = "api_key"
)

Values of HistoryRunRequesterDtoType.

type HsCodeDto

type HsCodeDto struct {
	// Code Example: "9983".
	Code string `json:"code"`

	// Description Example: "Other professional, technical and business services".
	Description string `json:"description"`

	// Category Example: "Services".
	Category *string `json:"category,omitempty"`
}

HsCodeDto is `invoice.HsCodeDto`.

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

HttpClient is the transport: authentication, the envelope, errors, idempotency keys, retries and timeouts. Services call Request; integrators normally never touch it (it is Client.HTTP).

func NewHttpClient

func NewHttpClient(apiKey string, opts ...Option) (*HttpClient, error)

NewHttpClient builds the transport. New calls it; use it directly only to make raw calls.

func (*HttpClient) BaseURL

func (c *HttpClient) BaseURL() string

BaseURL is the host requests go to.

func (*HttpClient) Mode

func (c *HttpClient) Mode() Mode

Mode is the key's mode, from its prefix.

func (*HttpClient) Request

func (c *HttpClient) Request(ctx context.Context, call Call) (*RawResponse, error)

Request sends one API call and returns the parsed success, or an error: an *APIError wrapper for a refusal, *TimeoutError, *ConnectionError, *ConfigError, or ctx.Err() when the caller cancelled.

type InboundAnalyticsDto

type InboundAnalyticsDto struct {
	// ReportingCurrency The currency every amount (except `byCurrency`) is in: the filter’s, else the most common.
	ReportingCurrency *string `json:"reportingCurrency"`

	Totals AnalyticsTotalsDto `json:"totals"`

	// ByMonth By issue month (else received month), ascending.
	ByMonth []MonthBucketDto `json:"byMonth"`

	TopSuppliers TopSuppliersDto `json:"topSuppliers"`

	PaymentStatus PaymentBreakdownDto `json:"paymentStatus"`

	AccessPoints []AccessPointBucketDto `json:"accessPoints"`

	// AverageDaysToPay Mean days from issue to the last payment over paid invoices that name both; null when none do.
	AverageDaysToPay *float64 `json:"averageDaysToPay"`

	AverageDaysToPayBasis float64 `json:"averageDaysToPayBasis"`

	// Truncated More rows matched than analytics reads (100 000): the figures cover the first.
	Truncated bool `json:"truncated"`

	Taxpayer InboundTaxpayerDto `json:"taxpayer"`

	Sync InboundSyncDto `json:"sync"`
}

InboundAnalyticsDto is `invoice.InboundAnalyticsDto`.

type InboundInvoiceDetailDto

type InboundInvoiceDetailDto struct {
	// ID The gateway’s row id (the `id` of `GET /i/v1/inbound-invoices/{id}`).
	ID string `json:"id"`

	// Irn The SELLER’s IRN: `<their invoice number>-<their service id>-<YYYYMMDD>`.
	Irn string `json:"irn"`

	// SellerInvoiceNumber The document’s number, else parsed from the IRN.
	SellerInvoiceNumber *string `json:"sellerInvoiceNumber"`

	// SellerIssueDate Parsed from the IRN (YYYY-MM-DD).
	SellerIssueDate *string `json:"sellerIssueDate"`

	// TaxpayerTaxID The organisation’s TIN it was sent to (the authority’s form).
	TaxpayerTaxID *string `json:"taxpayerTaxId"`

	TaxpayerRole *string `json:"taxpayerRole"`

	Source *string `json:"source"`

	// Tier `forward`: received through the forward feed since the organisation connected this tax id (the Received tab). `history`: retrieved from the tax authority on request (the History tab); every issued-history invoice.
	Tier InboundInvoiceDetailDtoTier `json:"tier"`

	// Supplier The seller as the tax authority gateway sends it (free-form: business reference, access point, and the document’s party fields).
	Supplier map[string]any `json:"supplier"`

	// Customer The buyer as the tax authority gateway sends it (free-form).
	Customer map[string]any `json:"customer"`

	// AccessPoint The seller’s access point (`supplier.app_reference`).
	AccessPoint *string `json:"accessPoint"`

	TransmittedBy TransmittedByDto `json:"transmittedBy"`

	Currency *string `json:"currency"`

	// Totals The totals as the tax authority gateway sends them (free-form).
	Totals map[string]any `json:"totals"`

	// PayableAmountMinor Payable amount in MINOR units (the gateway’s summary, else the document’s `legal_monetary_total`).
	PayableAmountMinor *float64 `json:"payableAmountMinor"`

	// TaxAmountMinor Tax (input VAT) in MINOR units (the gateway’s summary, else the sum of the document’s `tax_total`).
	TaxAmountMinor *float64 `json:"taxAmountMinor"`

	// PaymentStatus The authority’s payment status (PENDING → `unpaid`); null until the gateway or the document says.
	PaymentStatus *InboundInvoiceDetailDtoPaymentStatus `json:"paymentStatus"`

	// IssueDate YYYY-MM-DD (the document’s, else the IRN’s).
	IssueDate *string `json:"issueDate"`

	DueDate *string `json:"dueDate"`

	TransmissionStatus *string `json:"transmissionStatus"`

	AckStatus *string `json:"ackStatus"`

	AcknowledgedAt *string `json:"acknowledgedAt"`

	DocumentRef *string `json:"documentRef"`

	// ReceivedAt When the access point received it.
	ReceivedAt *string `json:"receivedAt"`

	// GrantID The authority grant whose window received it (one of the organisation’s own).
	GrantID *string `json:"grantId"`

	// SortAt The gateway’s ordering instant.
	SortAt *string `json:"sortAt"`

	// UpdatedAt The gateway’s `updated_at`.
	UpdatedAt *string `json:"updatedAt"`

	SupplierName *string `json:"supplierName"`

	// SupplierTIN The seller’s TIN from the document (unmasked), when the gateway gives it.
	SupplierTIN *string `json:"supplierTin"`

	CustomerName *string `json:"customerName"`

	CustomerTIN *string `json:"customerTin"`

	// SupplierNameSource Where `supplierName` came from: `nrs`, `document` or `reference`.
	SupplierNameSource *string `json:"supplierNameSource"`

	// CustomerNameSource Where `customerName` came from: `nrs`, `document` or `reference`.
	CustomerNameSource *string `json:"customerNameSource"`

	// SyncedAt When the mirror last confirmed this row with the gateway.
	SyncedAt string `json:"syncedAt"`

	// ConfirmedAt NRS’s receiver-side confirmation time (`raw_payload.confirmed_at`), when given.
	ConfirmedAt *string `json:"confirmedAt"`

	// RawPayload NRS’s own record of the invoice as the gateway stored it (free-form).
	RawPayload map[string]any `json:"rawPayload"`

	// Document The decrypted authority copy (parties, lines, totals; free-form, in the authority’s fields); null when the gateway has none (yet) or could not be asked.
	Document map[string]any `json:"document"`

	// DocumentFetchedAt When the detail (document) was last read from the gateway; null = never.
	DocumentFetchedAt *string `json:"documentFetchedAt"`
}

InboundInvoiceDetailDto is `invoice.InboundInvoiceDetailDto`.

type InboundInvoiceDetailDtoPaymentStatus

type InboundInvoiceDetailDtoPaymentStatus string

InboundInvoiceDetailDtoPaymentStatus is the type of InboundInvoiceDetailDto.PaymentStatus. The API may add values.

const (
	InboundInvoiceDetailDtoPaymentStatusPaid     InboundInvoiceDetailDtoPaymentStatus = "paid"
	InboundInvoiceDetailDtoPaymentStatusUnpaid   InboundInvoiceDetailDtoPaymentStatus = "unpaid"
	InboundInvoiceDetailDtoPaymentStatusPartial  InboundInvoiceDetailDtoPaymentStatus = "partial"
	InboundInvoiceDetailDtoPaymentStatusRejected InboundInvoiceDetailDtoPaymentStatus = "rejected"
)

Values of InboundInvoiceDetailDtoPaymentStatus.

type InboundInvoiceDetailDtoTier

type InboundInvoiceDetailDtoTier string

InboundInvoiceDetailDtoTier is the type of InboundInvoiceDetailDto.Tier. The API may add values.

const (
	InboundInvoiceDetailDtoTierForward InboundInvoiceDetailDtoTier = "forward"
	InboundInvoiceDetailDtoTierHistory InboundInvoiceDetailDtoTier = "history"
)

Values of InboundInvoiceDetailDtoTier.

type InboundInvoiceViewDto

type InboundInvoiceViewDto struct {
	// ID The gateway’s row id (the `id` of `GET /i/v1/inbound-invoices/{id}`).
	ID string `json:"id"`

	// Irn The SELLER’s IRN: `<their invoice number>-<their service id>-<YYYYMMDD>`.
	Irn string `json:"irn"`

	// SellerInvoiceNumber The document’s number, else parsed from the IRN.
	SellerInvoiceNumber *string `json:"sellerInvoiceNumber"`

	// SellerIssueDate Parsed from the IRN (YYYY-MM-DD).
	SellerIssueDate *string `json:"sellerIssueDate"`

	// TaxpayerTaxID The organisation’s TIN it was sent to (the authority’s form).
	TaxpayerTaxID *string `json:"taxpayerTaxId"`

	TaxpayerRole *string `json:"taxpayerRole"`

	Source *string `json:"source"`

	// Tier `forward`: received through the forward feed since the organisation connected this tax id (the Received tab). `history`: retrieved from the tax authority on request (the History tab); every issued-history invoice.
	Tier InboundInvoiceViewDtoTier `json:"tier"`

	// Supplier The seller as the tax authority gateway sends it (free-form: business reference, access point, and the document’s party fields).
	Supplier map[string]any `json:"supplier"`

	// Customer The buyer as the tax authority gateway sends it (free-form).
	Customer map[string]any `json:"customer"`

	// AccessPoint The seller’s access point (`supplier.app_reference`).
	AccessPoint *string `json:"accessPoint"`

	TransmittedBy TransmittedByDto `json:"transmittedBy"`

	Currency *string `json:"currency"`

	// Totals The totals as the tax authority gateway sends them (free-form).
	Totals map[string]any `json:"totals"`

	// PayableAmountMinor Payable amount in MINOR units (the gateway’s summary, else the document’s `legal_monetary_total`).
	PayableAmountMinor *float64 `json:"payableAmountMinor"`

	// TaxAmountMinor Tax (input VAT) in MINOR units (the gateway’s summary, else the sum of the document’s `tax_total`).
	TaxAmountMinor *float64 `json:"taxAmountMinor"`

	// PaymentStatus The authority’s payment status (PENDING → `unpaid`); null until the gateway or the document says.
	PaymentStatus *InboundInvoiceViewDtoPaymentStatus `json:"paymentStatus"`

	// IssueDate YYYY-MM-DD (the document’s, else the IRN’s).
	IssueDate *string `json:"issueDate"`

	DueDate *string `json:"dueDate"`

	TransmissionStatus *string `json:"transmissionStatus"`

	AckStatus *string `json:"ackStatus"`

	AcknowledgedAt *string `json:"acknowledgedAt"`

	DocumentRef *string `json:"documentRef"`

	// ReceivedAt When the access point received it.
	ReceivedAt *string `json:"receivedAt"`

	// GrantID The authority grant whose window received it (one of the organisation’s own).
	GrantID *string `json:"grantId"`

	// SortAt The gateway’s ordering instant.
	SortAt *string `json:"sortAt"`

	// UpdatedAt The gateway’s `updated_at`.
	UpdatedAt *string `json:"updatedAt"`

	SupplierName *string `json:"supplierName"`

	// SupplierTIN The seller’s TIN from the document (unmasked), when the gateway gives it.
	SupplierTIN *string `json:"supplierTin"`

	CustomerName *string `json:"customerName"`

	CustomerTIN *string `json:"customerTin"`

	// SupplierNameSource Where `supplierName` came from: `nrs`, `document` or `reference`.
	SupplierNameSource *string `json:"supplierNameSource"`

	// CustomerNameSource Where `customerName` came from: `nrs`, `document` or `reference`.
	CustomerNameSource *string `json:"customerNameSource"`

	// SyncedAt When the mirror last confirmed this row with the gateway.
	SyncedAt string `json:"syncedAt"`
}

InboundInvoiceViewDto is `invoice.InboundInvoiceViewDto`.

type InboundInvoiceViewDtoPaymentStatus

type InboundInvoiceViewDtoPaymentStatus string

InboundInvoiceViewDtoPaymentStatus is the type of InboundInvoiceViewDto.PaymentStatus. The API may add values.

const (
	InboundInvoiceViewDtoPaymentStatusPaid     InboundInvoiceViewDtoPaymentStatus = "paid"
	InboundInvoiceViewDtoPaymentStatusUnpaid   InboundInvoiceViewDtoPaymentStatus = "unpaid"
	InboundInvoiceViewDtoPaymentStatusPartial  InboundInvoiceViewDtoPaymentStatus = "partial"
	InboundInvoiceViewDtoPaymentStatusRejected InboundInvoiceViewDtoPaymentStatus = "rejected"
)

Values of InboundInvoiceViewDtoPaymentStatus.

type InboundInvoiceViewDtoTier

type InboundInvoiceViewDtoTier string

InboundInvoiceViewDtoTier is the type of InboundInvoiceViewDto.Tier. The API may add values.

const (
	InboundInvoiceViewDtoTierForward InboundInvoiceViewDtoTier = "forward"
	InboundInvoiceViewDtoTierHistory InboundInvoiceViewDtoTier = "history"
)

Values of InboundInvoiceViewDtoTier.

type InboundInvoicesService

type InboundInvoicesService struct {
	// contains filtered or unexported fields
}

InboundInvoicesService is received invoices (`/i/v1/inbound-invoices`): what other businesses issued to the organisation.

func (*InboundInvoicesService) Get

Get gets a received invoice; `Document` is read from the gateway on first view (`invoice.inbound.read`).

func (*InboundInvoicesService) GetAnalytics

GetAnalytics is analytics over received invoices, with the list's filters (`invoice.inbound.read`; free).

func (*InboundInvoicesService) GetHistoryRun

func (s *InboundInvoicesService) GetHistoryRun(ctx context.Context, runID string, opts ...RequestOption) (*GetInboundHistoryRunData, error)

GetHistoryRun is one history retrieval, for polling its progress (`invoice.inbound.read`; free).

func (*InboundInvoicesService) List

List lists received invoices (`invoice.inbound.read`; free). `Tier: "history"` lists those retrieved by a history run. `Data.Items` holds the page; `Pagination` is `meta.pagination`.

func (*InboundInvoicesService) ListHistoryRuns

ListHistoryRuns is the history retrievals, newest first, and the active one (`invoice.inbound.read`; free).

func (*InboundInvoicesService) LoadOlder deprecated

LoadOlder is kept for older clients: it reads and charges nothing and answers that nothing older belongs in the Received tab. Older invoices come from history runs (started in the dashboard).

Deprecated: use ListHistoryRuns and List with `Tier: "history"`.

type InboundLoadOlderDto

type InboundLoadOlderDto struct {
	// Fetched Always 0: nothing is read (older invoices are retrieved by a history retrieval).
	Fetched float64 `json:"fetched"`

	// Added Always 0: nothing is added and nothing is charged.
	Added float64 `json:"added"`

	// HasMore Always false: the Received tab starts at the tax connection.
	HasMore bool `json:"hasMore"`

	// HistoryExhausted Always true: nothing older belongs in the Received tab.
	HistoryExhausted *bool `json:"historyExhausted"`

	Sync InboundSyncDto `json:"sync"`
}

InboundLoadOlderDto is `invoice.InboundLoadOlderDto`.

type InboundPageDto

type InboundPageDto struct {
	Items []InboundInvoiceViewDto `json:"items"`

	Taxpayer InboundTaxpayerDto `json:"taxpayer"`

	Sync InboundSyncDto `json:"sync"`
}

InboundPageDto is `invoice.InboundPageDto`.

type InboundSyncDto

type InboundSyncDto struct {
	// LastSyncedAt The last successful read of the feed’s head; null = never.
	LastSyncedAt *string `json:"lastSyncedAt"`

	// HistoryExhausted Received tab: true once the first sync read the feed — nothing older than `since` belongs in it (older invoices are retrieved into the History tab); null before. History tab: the newest finished retrieval reached the end of what the tax authority holds; null before any retrieval. Issued history: the gateway has imported all the tax authority holds for these tax ids.
	HistoryExhausted *bool `json:"historyExhausted"`

	// Syncing A sync is running or queued: the list may grow; poll again.
	Syncing bool `json:"syncing"`

	// Error The last sync failure (a code, e.g. `unavailable:http_5xx`; on the History tab the newest retrieval’s failure); the mirror is served as it is.
	Error *string `json:"error"`

	// Since Received tab: the instant it starts at — when the organisation first connected its tax id in this mode; null with no connection. Null on the History tab and in issued history.
	Since *string `json:"since"`
}

InboundSyncDto is `invoice.InboundSyncDto`.

type InboundTaxpayerDto

type InboundTaxpayerDto struct {
	// TaxID The tax id of the organisation’s live connection in this mode, as stored.
	TaxID *string `json:"taxId"`

	// ConnectionState The connection state in this mode (null: no live connection). Received invoices are shown while the organisation has any tax-identity history or a connected grant.
	ConnectionState *string `json:"connectionState"`

	// TaxIds The organisation’s tax ids in this mode (authority form, deduped, the current connected one first). Empty: nothing is shown.
	TaxIds []string `json:"taxIds"`
}

InboundTaxpayerDto is `invoice.InboundTaxpayerDto`.

type InstalledByDto

type InstalledByDto struct {
	// Type Example: "user".
	Type string `json:"type"`

	ID *string `json:"id"`
}

InstalledByDto is `invoice.InstalledByDto`.

type InsufficientCreditsError

type InsufficientCreditsError struct{ *APIError }

InsufficientCreditsError is 402: not enough credits for the charge (`BIZ001`).

func (*InsufficientCreditsError) Unwrap

func (e *InsufficientCreditsError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type InvoiceActorDto

type InvoiceActorDto struct {
	// Type The kind of actor.
	Type InvoiceActorDtoType `json:"type"`

	// ID The auth user id for `user`, the API-key id for `api_key`; may be null for `service` and `system`.
	ID *string `json:"id"`
}

InvoiceActorDto is `invoice.InvoiceActorDto`.

type InvoiceActorDtoType

type InvoiceActorDtoType string

InvoiceActorDtoType is the type of InvoiceActorDto.Type. The API may add values.

const (
	InvoiceActorDtoTypeUser    InvoiceActorDtoType = "user"
	InvoiceActorDtoTypeAPIKey  InvoiceActorDtoType = "api_key"
	InvoiceActorDtoTypeService InvoiceActorDtoType = "service"
	InvoiceActorDtoTypeSystem  InvoiceActorDtoType = "system"
)

Values of InvoiceActorDtoType.

type InvoiceAdjustmentDto

type InvoiceAdjustmentDto struct {
	InvoiceID string `json:"invoiceId"`

	// InvoiceNumber The linked document’s own number.
	InvoiceNumber string `json:"invoiceNumber"`

	// ID Same as `invoiceId`.
	ID string `json:"id"`

	// Number The number NRS holds once the linked document is registered; its own number before.
	Number string `json:"number"`

	// Irn Its IRN once registered.
	Irn *string `json:"irn"`

	RegisteredAt *string `json:"registeredAt"`

	Kind InvoiceAdjustmentDtoKind `json:"kind"`

	// IssueDate Example: "2026-09-30".
	IssueDate string `json:"issueDate"`

	// PayableMinor Integer minor units.
	PayableMinor int64 `json:"payableMinor"`

	Status InvoiceAdjustmentDtoStatus `json:"status"`

	// Counts False once NRS refused the note (it no longer counts).
	Counts bool `json:"counts"`

	// Closing The credit note that credits the invoice in full.
	Closing bool `json:"closing"`

	// RefundOwedMinor A credit note’s share of the refund owed; null on a debit note. Integer minor units.
	RefundOwedMinor *int64 `json:"refundOwedMinor"`
}

InvoiceAdjustmentDto is `invoice.InvoiceAdjustmentDto`.

type InvoiceAdjustmentDtoKind

type InvoiceAdjustmentDtoKind string

InvoiceAdjustmentDtoKind is the type of InvoiceAdjustmentDto.Kind. The API may add values.

const (
	InvoiceAdjustmentDtoKindCreditNote InvoiceAdjustmentDtoKind = "credit_note"
	InvoiceAdjustmentDtoKindDebitNote  InvoiceAdjustmentDtoKind = "debit_note"
)

Values of InvoiceAdjustmentDtoKind.

type InvoiceAdjustmentDtoStatus

type InvoiceAdjustmentDtoStatus string

InvoiceAdjustmentDtoStatus is the type of InvoiceAdjustmentDto.Status. The API may add values.

const (
	InvoiceAdjustmentDtoStatusDraft               InvoiceAdjustmentDtoStatus = "draft"
	InvoiceAdjustmentDtoStatusFinalised           InvoiceAdjustmentDtoStatus = "finalised"
	InvoiceAdjustmentDtoStatusQueued              InvoiceAdjustmentDtoStatus = "queued"
	InvoiceAdjustmentDtoStatusSigned              InvoiceAdjustmentDtoStatus = "signed"
	InvoiceAdjustmentDtoStatusTransmitted         InvoiceAdjustmentDtoStatus = "transmitted"
	InvoiceAdjustmentDtoStatusAccepted            InvoiceAdjustmentDtoStatus = "accepted"
	InvoiceAdjustmentDtoStatusRejected            InvoiceAdjustmentDtoStatus = "rejected"
	InvoiceAdjustmentDtoStatusFailed              InvoiceAdjustmentDtoStatus = "failed"
	InvoiceAdjustmentDtoStatusCancellationPending InvoiceAdjustmentDtoStatus = "cancellation_pending"
	InvoiceAdjustmentDtoStatusCancelled           InvoiceAdjustmentDtoStatus = "cancelled"
)

Values of InvoiceAdjustmentDtoStatus.

type InvoiceApiPaginationMetaDto

type InvoiceApiPaginationMetaDto struct {
	// Total Example: 137.
	Total float64 `json:"total"`

	// Page 1-based page number.
	// Example: 1.
	Page float64 `json:"page"`

	// PageSize Items per page (the `limit` query parameter).
	// Example: 20.
	PageSize float64 `json:"pageSize"`

	// TotalPages `ceil(total / pageSize)`; an empty set is 0 pages.
	// Example: 7.
	TotalPages float64 `json:"totalPages"`

	// HasNext Example: true.
	HasNext bool `json:"hasNext"`

	// HasPrevious Example: false.
	HasPrevious bool `json:"hasPrevious"`

	NextPage *string `json:"nextPage,omitempty"`

	PreviousPage *string `json:"previousPage,omitempty"`

	CurrentPage *string `json:"currentPage,omitempty"`
}

InvoiceApiPaginationMetaDto is `invoice.ApiPaginationMetaDto`.

type InvoiceApiSuccessMetaDto

type InvoiceApiSuccessMetaDto struct {
	// StatusCode Example: 200.
	StatusCode float64 `json:"statusCode"`

	// Success Example: true.
	Success bool `json:"success"`

	// Message Copy for humans. Never branch on it.
	// Example: "Success".
	Message string `json:"message"`

	Errors []map[string]string `json:"errors"`

	// Timestamp Example: "2026-09-29T10:00:00.000Z".
	Timestamp string `json:"timestamp"`

	// RequestID This service’s request id (also the `x-request-id` header) — quote it in a bug report.
	RequestID string `json:"requestId"`

	// Pagination Present on list responses.
	Pagination *InvoiceApiPaginationMetaDto `json:"pagination,omitempty"`
}

InvoiceApiSuccessMetaDto is `invoice.ApiSuccessMetaDto`.

type InvoiceBuyerDeliveryDto

type InvoiceBuyerDeliveryDto struct {
	// Channel `nrs`: through the NRS network; `email`: off the network, emailed once registered; `none`: no buyer, or no way to reach them.
	Channel InvoiceBuyerDeliveryDtoChannel `json:"channel"`

	Reason InvoiceBuyerDeliveryDtoReason `json:"reason"`

	SentToBuyerAt *string `json:"sentToBuyerAt"`
}

InvoiceBuyerDeliveryDto is `invoice.InvoiceBuyerDeliveryDto`.

type InvoiceBuyerDeliveryDtoChannel

type InvoiceBuyerDeliveryDtoChannel string

InvoiceBuyerDeliveryDtoChannel is the type of InvoiceBuyerDeliveryDto.Channel. The API may add values.

const (
	InvoiceBuyerDeliveryDtoChannelNRS   InvoiceBuyerDeliveryDtoChannel = "nrs"
	InvoiceBuyerDeliveryDtoChannelEmail InvoiceBuyerDeliveryDtoChannel = "email"
	InvoiceBuyerDeliveryDtoChannelNone  InvoiceBuyerDeliveryDtoChannel = "none"
)

Values of InvoiceBuyerDeliveryDtoChannel.

type InvoiceBuyerDeliveryDtoReason

type InvoiceBuyerDeliveryDtoReason string

InvoiceBuyerDeliveryDtoReason is the type of InvoiceBuyerDeliveryDto.Reason. The API may add values.

const (
	InvoiceBuyerDeliveryDtoReasonBuyerOffNetwork InvoiceBuyerDeliveryDtoReason = "buyer_off_network"
	InvoiceBuyerDeliveryDtoReasonBuyerOnNetwork  InvoiceBuyerDeliveryDtoReason = "buyer_on_network"
	InvoiceBuyerDeliveryDtoReasonNoBuyer         InvoiceBuyerDeliveryDtoReason = "no_buyer"
	InvoiceBuyerDeliveryDtoReasonUnknown         InvoiceBuyerDeliveryDtoReason = "unknown"
)

Values of InvoiceBuyerDeliveryDtoReason.

type InvoiceBuyerSnapshotDto

type InvoiceBuyerSnapshotDto struct {
	ID string `json:"id"`

	Name string `json:"name"`

	LegalName *string `json:"legalName"`

	TaxID *string `json:"taxId"`

	// TaxIDType Example: "tin".
	TaxIDType string `json:"taxIdType"`

	// TaxIDStatus As it stood when the document was finalised (see `buyerVerification` for now).
	TaxIDStatus InvoiceBuyerSnapshotDtoTaxIDStatus `json:"taxIdStatus"`

	Email *string `json:"email"`

	Phone *string `json:"phone"`

	Address *InvoicePostalAddressDto `json:"address"`

	// PartyType Example: "business".
	PartyType *string `json:"partyType"`

	// PartyName The buyer’s name on the document, in capitals: the business name NRS holds, else the verified legal name, else the name entered.
	PartyName string `json:"partyName"`

	// NameSource Where `partyName` came from.
	NameSource InvoiceBuyerSnapshotDtoNameSource `json:"nameSource"`

	// TINProblem Present only when the buyer’s TIN could not be used (`format`: malformed; `not_found`): why the document was issued without it.
	TINProblem *InvoiceBuyerSnapshotDtoTINProblem `json:"tinProblem,omitempty"`
}

InvoiceBuyerSnapshotDto is `invoice.InvoiceBuyerSnapshotDto`.

type InvoiceBuyerSnapshotDtoNameSource

type InvoiceBuyerSnapshotDtoNameSource string

InvoiceBuyerSnapshotDtoNameSource is the type of InvoiceBuyerSnapshotDto.NameSource. The API may add values.

const (
	InvoiceBuyerSnapshotDtoNameSourceNRS      InvoiceBuyerSnapshotDtoNameSource = "nrs"
	InvoiceBuyerSnapshotDtoNameSourceTINCheck InvoiceBuyerSnapshotDtoNameSource = "tin_check"
	InvoiceBuyerSnapshotDtoNameSourceEntered  InvoiceBuyerSnapshotDtoNameSource = "entered"
)

Values of InvoiceBuyerSnapshotDtoNameSource.

type InvoiceBuyerSnapshotDtoTINProblem

type InvoiceBuyerSnapshotDtoTINProblem string

InvoiceBuyerSnapshotDtoTINProblem is the type of InvoiceBuyerSnapshotDto.TINProblem. The API may add values.

const (
	InvoiceBuyerSnapshotDtoTINProblemFormat   InvoiceBuyerSnapshotDtoTINProblem = "format"
	InvoiceBuyerSnapshotDtoTINProblemNotFound InvoiceBuyerSnapshotDtoTINProblem = "not_found"
)

Values of InvoiceBuyerSnapshotDtoTINProblem.

type InvoiceBuyerSnapshotDtoTaxIDStatus

type InvoiceBuyerSnapshotDtoTaxIDStatus string

InvoiceBuyerSnapshotDtoTaxIDStatus is the type of InvoiceBuyerSnapshotDto.TaxIDStatus. The API may add values.

const (
	InvoiceBuyerSnapshotDtoTaxIDStatusUnverified      InvoiceBuyerSnapshotDtoTaxIDStatus = "unverified"
	InvoiceBuyerSnapshotDtoTaxIDStatusPending         InvoiceBuyerSnapshotDtoTaxIDStatus = "pending"
	InvoiceBuyerSnapshotDtoTaxIDStatusVerified        InvoiceBuyerSnapshotDtoTaxIDStatus = "verified"
	InvoiceBuyerSnapshotDtoTaxIDStatusNotFound        InvoiceBuyerSnapshotDtoTaxIDStatus = "not_found"
	InvoiceBuyerSnapshotDtoTaxIDStatusNameMismatch    InvoiceBuyerSnapshotDtoTaxIDStatus = "name_mismatch"
	InvoiceBuyerSnapshotDtoTaxIDStatusUnavailable     InvoiceBuyerSnapshotDtoTaxIDStatus = "unavailable"
	InvoiceBuyerSnapshotDtoTaxIDStatusValidOffNetwork InvoiceBuyerSnapshotDtoTaxIDStatus = "valid_off_network"
	InvoiceBuyerSnapshotDtoTaxIDStatusChecking        InvoiceBuyerSnapshotDtoTaxIDStatus = "checking"
)

Values of InvoiceBuyerSnapshotDtoTaxIDStatus.

type InvoiceBuyerVerificationDto

type InvoiceBuyerVerificationDto struct {
	TaxIDStatus InvoiceBuyerVerificationDtoTaxIDStatus `json:"taxIdStatus"`

	// TaxIDVerifiedSource `nrs` (the network lookup) or `tin_check` (the charged check); null unless verified.
	TaxIDVerifiedSource *InvoiceBuyerVerificationDtoTaxIDVerifiedSource `json:"taxIdVerifiedSource"`

	TaxIDVerifiedName *string `json:"taxIdVerifiedName"`

	TaxIDVerifiedAt *string `json:"taxIdVerifiedAt"`
}

InvoiceBuyerVerificationDto is `invoice.InvoiceBuyerVerificationDto`.

type InvoiceBuyerVerificationDtoTaxIDStatus

type InvoiceBuyerVerificationDtoTaxIDStatus string

InvoiceBuyerVerificationDtoTaxIDStatus is the type of InvoiceBuyerVerificationDto.TaxIDStatus. The API may add values.

const (
	InvoiceBuyerVerificationDtoTaxIDStatusUnverified      InvoiceBuyerVerificationDtoTaxIDStatus = "unverified"
	InvoiceBuyerVerificationDtoTaxIDStatusPending         InvoiceBuyerVerificationDtoTaxIDStatus = "pending"
	InvoiceBuyerVerificationDtoTaxIDStatusVerified        InvoiceBuyerVerificationDtoTaxIDStatus = "verified"
	InvoiceBuyerVerificationDtoTaxIDStatusNotFound        InvoiceBuyerVerificationDtoTaxIDStatus = "not_found"
	InvoiceBuyerVerificationDtoTaxIDStatusNameMismatch    InvoiceBuyerVerificationDtoTaxIDStatus = "name_mismatch"
	InvoiceBuyerVerificationDtoTaxIDStatusUnavailable     InvoiceBuyerVerificationDtoTaxIDStatus = "unavailable"
	InvoiceBuyerVerificationDtoTaxIDStatusValidOffNetwork InvoiceBuyerVerificationDtoTaxIDStatus = "valid_off_network"
	InvoiceBuyerVerificationDtoTaxIDStatusChecking        InvoiceBuyerVerificationDtoTaxIDStatus = "checking"
)

Values of InvoiceBuyerVerificationDtoTaxIDStatus.

type InvoiceBuyerVerificationDtoTaxIDVerifiedSource

type InvoiceBuyerVerificationDtoTaxIDVerifiedSource string

InvoiceBuyerVerificationDtoTaxIDVerifiedSource is the type of InvoiceBuyerVerificationDto.TaxIDVerifiedSource. The API may add values.

const (
	InvoiceBuyerVerificationDtoTaxIDVerifiedSourceNRS      InvoiceBuyerVerificationDtoTaxIDVerifiedSource = "nrs"
	InvoiceBuyerVerificationDtoTaxIDVerifiedSourceTINCheck InvoiceBuyerVerificationDtoTaxIDVerifiedSource = "tin_check"
)

Values of InvoiceBuyerVerificationDtoTaxIDVerifiedSource.

type InvoiceCreditSettlementDto

type InvoiceCreditSettlementDto struct {
	// State `settled`: nothing was paid, the credit settles the debt; otherwise a refund is owed to the buyer.
	State InvoiceCreditSettlementDtoState `json:"state"`

	// RefundOwedMinor What the seller owes the buyer back. Integer minor units.
	RefundOwedMinor int64 `json:"refundOwedMinor"`

	// RefundedMinor What has been recorded as refunded. Integer minor units.
	RefundedMinor int64 `json:"refundedMinor"`

	// RefundOutstandingMinor `refundOwedMinor − refundedMinor`, never below zero. Integer minor units.
	RefundOutstandingMinor int64 `json:"refundOutstandingMinor"`

	// PaidOnOriginalMinor What was paid on the original invoice and its debit notes, as the tax authority accepted it: says why nothing is owed back (nothing paid, or less than what is still owed). Integer minor units.
	PaidOnOriginalMinor *int64 `json:"paidOnOriginalMinor"`

	// StillOwedMinor What the buyer still owes after every credit note, never below zero. Integer minor units.
	StillOwedMinor *int64 `json:"stillOwedMinor"`
}

InvoiceCreditSettlementDto is `invoice.InvoiceCreditSettlementDto`.

type InvoiceCreditSettlementDtoState

type InvoiceCreditSettlementDtoState string

InvoiceCreditSettlementDtoState is the type of InvoiceCreditSettlementDto.State. The API may add values.

const (
	InvoiceCreditSettlementDtoStateSettled        InvoiceCreditSettlementDtoState = "settled"
	InvoiceCreditSettlementDtoStateRefundOwed     InvoiceCreditSettlementDtoState = "refund_owed"
	InvoiceCreditSettlementDtoStatePartlyRefunded InvoiceCreditSettlementDtoState = "partly_refunded"
	InvoiceCreditSettlementDtoStateRefunded       InvoiceCreditSettlementDtoState = "refunded"
)

Values of InvoiceCreditSettlementDtoState.

type InvoiceDeletedDto

type InvoiceDeletedDto struct {
	ID string `json:"id"`

	InvoiceNumber string `json:"invoiceNumber"`

	Deleted bool `json:"deleted"`
}

InvoiceDeletedDto is `invoice.InvoiceDeletedDto`.

type InvoiceDocumentLinkDto

type InvoiceDocumentLinkDto struct {
	InvoiceID string `json:"invoiceId"`

	// InvoiceNumber The linked document’s own number.
	InvoiceNumber string `json:"invoiceNumber"`

	// ID Same as `invoiceId`.
	ID string `json:"id"`

	// Number The number NRS holds once the linked document is registered; its own number before.
	Number string `json:"number"`

	// Irn Its IRN once registered.
	Irn *string `json:"irn"`

	RegisteredAt *string `json:"registeredAt"`
}

InvoiceDocumentLinkDto is `invoice.InvoiceDocumentLinkDto`.

type InvoiceIssuedAsDto

type InvoiceIssuedAsDto struct {
	// Kind `organisation`: the organisation’s own connected tax identity; `test_entity`: the sandbox test taxpayer.
	Kind InvoiceIssuedAsDtoKind `json:"kind"`

	// TaxID The tax id the document was issued under.
	TaxID string `json:"taxId"`

	// ServiceID The service id the tax authority gave the issuer, when there is one.
	ServiceID *string `json:"serviceId"`
}

InvoiceIssuedAsDto is `invoice.InvoiceIssuedAsDto`.

type InvoiceIssuedAsDtoKind

type InvoiceIssuedAsDtoKind string

InvoiceIssuedAsDtoKind is the type of InvoiceIssuedAsDto.Kind. The API may add values.

const (
	InvoiceIssuedAsDtoKindOrganisation InvoiceIssuedAsDtoKind = "organisation"
	InvoiceIssuedAsDtoKindTestEntity   InvoiceIssuedAsDtoKind = "test_entity"
)

Values of InvoiceIssuedAsDtoKind.

type InvoiceLineItemDto

type InvoiceLineItemDto struct {
	// ItemID A saved item of the organisation: every field of the line left out is filled from the item, and a field sent wins.
	ItemID *string `json:"itemId,omitempty"`

	// Description Required without an itemId.
	// Example: "Consulting services".
	Description *string `json:"description,omitempty"`

	ItemName *string `json:"itemName,omitempty"`

	// HSNCode HS code (goods).
	// Example: "1006.30".
	HSNCode *string `json:"hsnCode,omitempty"`

	// ProductCategory The HS description (goods).
	ProductCategory *string `json:"productCategory,omitempty"`

	// ISICCode ISIC code (services); stored as the service code.
	// Example: "0112".
	ISICCode *string `json:"isicCode,omitempty"`

	// ServiceCategory The ISIC description (services). Stored as the line’s product category; send it or productCategory, not both.
	ServiceCategory *string `json:"serviceCategory,omitempty"`

	// Quantity Decimal string (≤ 6 decimals) or number; > 0.
	// Example: "2.5".
	Quantity Amount `json:"quantity"`

	// UnitCode A unit code of the jurisdiction’s list. Required without an itemId.
	// Example: "EA".
	UnitCode *string `json:"unitCode,omitempty"`

	// UnitPrice Major units, decimal string (≤ 4 decimals) or number; ≥ 0. Required without an itemId.
	// Example: "50000.00".
	UnitPrice *Amount `json:"unitPrice,omitempty"`

	// DiscountAmount Major units, ≤ 2 decimals.
	// Example: "0".
	DiscountAmount *Amount `json:"discountAmount,omitempty"`

	// FeeAmount Major units, ≤ 2 decimals.
	// Example: "0".
	FeeAmount *Amount `json:"feeAmount,omitempty"`

	// TaxCategory A tax-category code-list id, or a short alias (standard | zero | exempt). Required without an itemId.
	// Example: "STANDARD_VAT".
	TaxCategory *string `json:"taxCategory,omitempty"`
}

InvoiceLineItemDto is `invoice.InvoiceLineItemDto`.

type InvoiceLineViewDto

type InvoiceLineViewDto struct {
	// LineNo Example: 1.
	LineNo int64 `json:"lineNo"`

	Description string `json:"description"`

	ItemName *string `json:"itemName"`

	// HSNCode HS code (goods).
	HSNCode *string `json:"hsnCode"`

	ProductCategory *string `json:"productCategory"`

	// ServiceCode ISIC code (services).
	ServiceCode *string `json:"serviceCode"`

	// UnitCode Example: "EA".
	UnitCode string `json:"unitCode"`

	// Quantity Exact decimal string.
	// Example: "2.000000".
	Quantity string `json:"quantity"`

	// UnitPrice Major units, exact decimal string.
	// Example: "50000.0000".
	UnitPrice string `json:"unitPrice"`

	// DiscountMinor Integer minor units.
	DiscountMinor int64 `json:"discountMinor"`

	// FeeMinor Integer minor units.
	FeeMinor int64 `json:"feeMinor"`

	// TaxCategory Example: "STANDARD_VAT".
	TaxCategory string `json:"taxCategory"`

	// TaxRate Percent, decimal string.
	// Example: "7.5".
	TaxRate string `json:"taxRate"`

	// LineNetMinor Integer minor units.
	LineNetMinor int64 `json:"lineNetMinor"`

	// LineTaxMinor Integer minor units.
	LineTaxMinor int64 `json:"lineTaxMinor"`

	// LineTotalMinor Integer minor units.
	LineTotalMinor int64 `json:"lineTotalMinor"`

	// ItemID The saved item the line was filled from.
	ItemID *string `json:"itemId"`

	// CreditedQuantity On an invoice: the quantity credit notes have credited (what is left is `quantity − creditedQuantity`). Null on a note.
	// Example: "0.000000".
	CreditedQuantity *string `json:"creditedQuantity"`

	// CreditsLineNo On a credit-note line: the original invoice’s line it credits; null on an amount credit and elsewhere.
	CreditsLineNo *int64 `json:"creditsLineNo"`
}

InvoiceLineViewDto is `invoice.InvoiceLineViewDto`.

type InvoiceListSummaryDto

type InvoiceListSummaryDto struct {
	Total int64 `json:"total"`

	Drafts int64 `json:"drafts"`

	// Issued Not drafts: `notReported + inProgress + reported + needsAttention`.
	Issued int64 `json:"issued"`

	NotReported int64 `json:"notReported"`

	InProgress int64 `json:"inProgress"`

	Reported int64 `json:"reported"`

	// NeedsAttention Rejected or on hold, not cancelled.
	NeedsAttention int64 `json:"needsAttention"`

	// Outstanding Per currency: what buyers still owe on issued invoices, net of credit notes.
	Outstanding []CurrencyAmountCountDto `json:"outstanding"`

	// Overdue Per currency: the part of `outstanding` past its due date.
	Overdue []CurrencyAmountCountDto `json:"overdue"`
}

InvoiceListSummaryDto is `invoice.InvoiceListSummaryDto`.

type InvoiceOverviewDto

type InvoiceOverviewDto struct {
	Window OverviewWindowDto `json:"window"`

	Kpis OverviewKpisDto `json:"kpis"`

	Trend []OverviewTrendPointDto `json:"trend"`

	StatusDistribution InvoiceStatusCountsDto `json:"statusDistribution"`

	PaymentStatus OverviewPaymentStatusDto `json:"paymentStatus"`

	Collections OverviewCollectionsDto `json:"collections"`

	Alerts OverviewAlertsDto `json:"alerts"`

	Readiness OverviewReadinessDto `json:"readiness"`

	// RecentInvoices The most recent documents (without `lineItems`).
	RecentInvoices []InvoiceViewDto `json:"recentInvoices"`

	OutputTax []OutputTaxTotalDto `json:"outputTax"`
}

InvoiceOverviewDto is `invoice.InvoiceOverviewDto`.

type InvoicePaymentEntryDto

type InvoicePaymentEntryDto struct {
	Seq int64 `json:"seq"`

	// Status What was recorded.
	Status InvoicePaymentEntryDtoStatus `json:"status"`

	// AmountPaidMinor The cumulative amount paid this report stands for; null for `unpaid` and `payment_failed`. Integer minor units.
	AmountPaidMinor *int64 `json:"amountPaidMinor"`

	// InstallmentMinor What was actually sent to the tax authority; null when nothing was sent. Integer minor units.
	InstallmentMinor *int64 `json:"installmentMinor"`

	// AuthorityStatus The status the tax authority was sent; null while pending or when superseded.
	AuthorityStatus *InvoicePaymentEntryDtoAuthorityStatus `json:"authorityStatus"`

	// State `pending`: waiting for the tax authority.
	State InvoicePaymentEntryDtoState `json:"state"`

	AuthorityMessage *string `json:"authorityMessage"`

	Reference *string `json:"reference"`

	CreatedAt string `json:"createdAt"`

	SentAt *string `json:"sentAt"`
}

InvoicePaymentEntryDto is `invoice.InvoicePaymentEntryDto`.

type InvoicePaymentEntryDtoAuthorityStatus

type InvoicePaymentEntryDtoAuthorityStatus string

InvoicePaymentEntryDtoAuthorityStatus is the type of InvoicePaymentEntryDto.AuthorityStatus. The API may add values.

const (
	InvoicePaymentEntryDtoAuthorityStatusUnpaid        InvoicePaymentEntryDtoAuthorityStatus = "unpaid"
	InvoicePaymentEntryDtoAuthorityStatusPartiallyPaid InvoicePaymentEntryDtoAuthorityStatus = "partially_paid"
	InvoicePaymentEntryDtoAuthorityStatusPaid          InvoicePaymentEntryDtoAuthorityStatus = "paid"
	InvoicePaymentEntryDtoAuthorityStatusPaymentFailed InvoicePaymentEntryDtoAuthorityStatus = "payment_failed"
)

Values of InvoicePaymentEntryDtoAuthorityStatus.

type InvoicePaymentEntryDtoState

type InvoicePaymentEntryDtoState string

InvoicePaymentEntryDtoState is the type of InvoicePaymentEntryDto.State. The API may add values.

const (
	InvoicePaymentEntryDtoStatePending    InvoicePaymentEntryDtoState = "pending"
	InvoicePaymentEntryDtoStateSent       InvoicePaymentEntryDtoState = "sent"
	InvoicePaymentEntryDtoStateSuperseded InvoicePaymentEntryDtoState = "superseded"
	InvoicePaymentEntryDtoStateRefused    InvoicePaymentEntryDtoState = "refused"
	InvoicePaymentEntryDtoStateLocal      InvoicePaymentEntryDtoState = "local"
)

Values of InvoicePaymentEntryDtoState.

type InvoicePaymentEntryDtoStatus

type InvoicePaymentEntryDtoStatus string

InvoicePaymentEntryDtoStatus is the type of InvoicePaymentEntryDto.Status. The API may add values.

const (
	InvoicePaymentEntryDtoStatusUnpaid        InvoicePaymentEntryDtoStatus = "unpaid"
	InvoicePaymentEntryDtoStatusPartiallyPaid InvoicePaymentEntryDtoStatus = "partially_paid"
	InvoicePaymentEntryDtoStatusPaid          InvoicePaymentEntryDtoStatus = "paid"
	InvoicePaymentEntryDtoStatusPaymentFailed InvoicePaymentEntryDtoStatus = "payment_failed"
)

Values of InvoicePaymentEntryDtoStatus.

type InvoicePaymentStatusCountsDto

type InvoicePaymentStatusCountsDto struct {
	Unpaid int64 `json:"unpaid"`

	PartiallyPaid int64 `json:"partially_paid"`

	Paid int64 `json:"paid"`

	PaymentFailed int64 `json:"payment_failed"`
}

InvoicePaymentStatusCountsDto is `invoice.InvoicePaymentStatusCountsDto`.

type InvoicePostalAddressDto

type InvoicePostalAddressDto struct {
	// Line1 Example: "12 Marina Road".
	Line1 string `json:"line1"`

	Line2 *string `json:"line2,omitempty"`

	// City Example: "Lagos".
	City string `json:"city"`

	// State Example: "Lagos".
	State *string `json:"state,omitempty"`

	// Lga Local government area.
	Lga *string `json:"lga,omitempty"`

	PostalCode *string `json:"postalCode,omitempty"`

	// Country ISO 3166-1 alpha-2 country code.
	// Example: "NG".
	Country string `json:"country"`
}

InvoicePostalAddressDto is `invoice.InvoicePostalAddressDto`.

type InvoiceReportingDto

type InvoiceReportingDto struct {
	// State How the document stands with the tax authority.
	State InvoiceReportingDtoState `json:"state"`

	// Delivery How the buyer gets the document.
	Delivery InvoiceReportingDtoDelivery `json:"delivery"`

	DeliveredAt *string `json:"deliveredAt"`

	// Reason Why the document is delivered the way it is, when that needs saying.
	Reason *InvoiceReportingDtoReason `json:"reason"`

	Irn *string `json:"irn"`

	// NextAction What the seller can do next (renumber and resubmit, or retry), when anything.
	NextAction *InvoiceReportingDtoNextAction `json:"nextAction"`

	NextActionMessage *string `json:"nextActionMessage"`
}

InvoiceReportingDto is `invoice.InvoiceReportingDto`.

type InvoiceReportingDtoDelivery

type InvoiceReportingDtoDelivery string

InvoiceReportingDtoDelivery is the type of InvoiceReportingDto.Delivery. The API may add values.

const (
	InvoiceReportingDtoDeliveryNRS            InvoiceReportingDtoDelivery = "nrs"
	InvoiceReportingDtoDeliveryDeliverToBuyer InvoiceReportingDtoDelivery = "deliver_to_buyer"
	InvoiceReportingDtoDeliverySentEmail      InvoiceReportingDtoDelivery = "sent_email"
	InvoiceReportingDtoDeliverySharedLink     InvoiceReportingDtoDelivery = "shared_link"
	InvoiceReportingDtoDeliveryNone           InvoiceReportingDtoDelivery = "none"
)

Values of InvoiceReportingDtoDelivery.

type InvoiceReportingDtoNextAction

type InvoiceReportingDtoNextAction string

InvoiceReportingDtoNextAction is the type of InvoiceReportingDto.NextAction. The API may add values.

const (
	InvoiceReportingDtoNextActionRenumber InvoiceReportingDtoNextAction = "renumber"
	InvoiceReportingDtoNextActionRetry    InvoiceReportingDtoNextAction = "retry"
)

Values of InvoiceReportingDtoNextAction.

type InvoiceReportingDtoReason

type InvoiceReportingDtoReason string

InvoiceReportingDtoReason is the type of InvoiceReportingDto.Reason. The API may add values.

const (
	InvoiceReportingDtoReasonBuyerOffNetwork     InvoiceReportingDtoReason = "buyer_off_network"
	InvoiceReportingDtoReasonB2CInvalidTIN       InvoiceReportingDtoReason = "b2c_invalid_tin"
	InvoiceReportingDtoReasonB2C                 InvoiceReportingDtoReason = "b2c"
	InvoiceReportingDtoReasonPermissionWithdrawn InvoiceReportingDtoReason = "permission_withdrawn"
)

Values of InvoiceReportingDtoReason.

type InvoiceReportingDtoState

type InvoiceReportingDtoState string

InvoiceReportingDtoState is the type of InvoiceReportingDto.State. The API may add values.

const (
	InvoiceReportingDtoStateNotSubmitted InvoiceReportingDtoState = "not_submitted"
	InvoiceReportingDtoStateInProgress   InvoiceReportingDtoState = "in_progress"
	InvoiceReportingDtoStateReported     InvoiceReportingDtoState = "reported"
	InvoiceReportingDtoStateRejected     InvoiceReportingDtoState = "rejected"
	InvoiceReportingDtoStateOnHold       InvoiceReportingDtoState = "on_hold"
)

Values of InvoiceReportingDtoState.

type InvoiceSellerSnapshotDto

type InvoiceSellerSnapshotDto struct {
	ID string `json:"id"`

	Kind InvoiceSellerSnapshotDtoKind `json:"kind"`

	LegalName *string `json:"legalName"`

	Name string `json:"name"`

	TaxID *string `json:"taxId"`

	// TaxIDType Example: "tin".
	TaxIDType string `json:"taxIdType"`

	TaxIDStatus InvoiceSellerSnapshotDtoTaxIDStatus `json:"taxIdStatus"`

	// Country Example: "NG".
	Country *string `json:"country"`

	Email *string `json:"email"`

	Phone *string `json:"phone"`

	Address *InvoicePostalAddressDto `json:"address"`

	// PartyName The seller’s name on the document, in capitals: the business name NRS holds when connected, else the verified legal name, else the name entered.
	PartyName string `json:"partyName"`

	// NameSource Where `partyName` came from.
	NameSource InvoiceSellerSnapshotDtoNameSource `json:"nameSource"`
}

InvoiceSellerSnapshotDto is `invoice.InvoiceSellerSnapshotDto`.

type InvoiceSellerSnapshotDtoKind

type InvoiceSellerSnapshotDtoKind string

InvoiceSellerSnapshotDtoKind is the type of InvoiceSellerSnapshotDto.Kind. The API may add values.

const (
	InvoiceSellerSnapshotDtoKindOrganization InvoiceSellerSnapshotDtoKind = "organization"
)

Values of InvoiceSellerSnapshotDtoKind.

type InvoiceSellerSnapshotDtoNameSource

type InvoiceSellerSnapshotDtoNameSource string

InvoiceSellerSnapshotDtoNameSource is the type of InvoiceSellerSnapshotDto.NameSource. The API may add values.

const (
	InvoiceSellerSnapshotDtoNameSourceNRS      InvoiceSellerSnapshotDtoNameSource = "nrs"
	InvoiceSellerSnapshotDtoNameSourceTINCheck InvoiceSellerSnapshotDtoNameSource = "tin_check"
	InvoiceSellerSnapshotDtoNameSourceEntered  InvoiceSellerSnapshotDtoNameSource = "entered"
)

Values of InvoiceSellerSnapshotDtoNameSource.

type InvoiceSellerSnapshotDtoTaxIDStatus

type InvoiceSellerSnapshotDtoTaxIDStatus string

InvoiceSellerSnapshotDtoTaxIDStatus is the type of InvoiceSellerSnapshotDto.TaxIDStatus. The API may add values.

const (
	InvoiceSellerSnapshotDtoTaxIDStatusUnverified      InvoiceSellerSnapshotDtoTaxIDStatus = "unverified"
	InvoiceSellerSnapshotDtoTaxIDStatusPending         InvoiceSellerSnapshotDtoTaxIDStatus = "pending"
	InvoiceSellerSnapshotDtoTaxIDStatusVerified        InvoiceSellerSnapshotDtoTaxIDStatus = "verified"
	InvoiceSellerSnapshotDtoTaxIDStatusNotFound        InvoiceSellerSnapshotDtoTaxIDStatus = "not_found"
	InvoiceSellerSnapshotDtoTaxIDStatusNameMismatch    InvoiceSellerSnapshotDtoTaxIDStatus = "name_mismatch"
	InvoiceSellerSnapshotDtoTaxIDStatusUnavailable     InvoiceSellerSnapshotDtoTaxIDStatus = "unavailable"
	InvoiceSellerSnapshotDtoTaxIDStatusValidOffNetwork InvoiceSellerSnapshotDtoTaxIDStatus = "valid_off_network"
	InvoiceSellerSnapshotDtoTaxIDStatusChecking        InvoiceSellerSnapshotDtoTaxIDStatus = "checking"
)

Values of InvoiceSellerSnapshotDtoTaxIDStatus.

type InvoiceSettingsService

type InvoiceSettingsService struct {
	// contains filtered or unexported fields
}

InvoiceSettingsService is invoice settings (`/i/v1/invoice-settings`): read-only for an API key.

func (*InvoiceSettingsService) Get

Get is the organisation's invoice settings in the key's mode (`invoice.read`).

type InvoiceSettingsViewDto

type InvoiceSettingsViewDto struct {
	// ReportAutomatically Whether every invoice issued while connected to NRS is reported automatically.
	ReportAutomatically bool `json:"reportAutomatically"`

	// Version 0 while the settings were never changed; send it back as `If-Match` (also the `ETag`).
	Version int64 `json:"version"`

	// UpdatedAt Null while the settings were never changed.
	UpdatedAt *string `json:"updatedAt"`
}

InvoiceSettingsViewDto is `invoice.InvoiceSettingsViewDto`.

type InvoiceSetupDto

type InvoiceSetupDto struct {
	// NextInvoiceNumber The next number the series would allocate (a preview, not reserved).
	// Example: "INV00042".
	NextInvoiceNumber string `json:"nextInvoiceNumber"`

	// Jurisdiction Example: "NG".
	Jurisdiction *string `json:"jurisdiction"`

	// DefaultCurrency Example: "NGN".
	DefaultCurrency *string `json:"defaultCurrency"`

	Currencies []string `json:"currencies"`

	InvoiceKinds []string `json:"invoiceKinds"`

	TaxCategories []InvoiceTaxCategoryOptionDto `json:"taxCategories"`

	UnitCodes []InvoiceUnitCodeOptionDto `json:"unitCodes"`

	TaxConnection InvoiceSetupTaxConnectionDto `json:"taxConnection"`
}

InvoiceSetupDto is `invoice.InvoiceSetupDto`.

type InvoiceSetupTaxConnectionDto

type InvoiceSetupTaxConnectionDto struct {
	// State The organisation’s tax connection in this mode (always `connected` in sandbox).
	State InvoiceSetupTaxConnectionDtoState `json:"state"`
}

InvoiceSetupTaxConnectionDto is `invoice.InvoiceSetupTaxConnectionDto`.

type InvoiceSetupTaxConnectionDtoState

type InvoiceSetupTaxConnectionDtoState string

InvoiceSetupTaxConnectionDtoState is the type of InvoiceSetupTaxConnectionDto.State. The API may add values.

const (
	InvoiceSetupTaxConnectionDtoStatePendingTaxpayerEnablement InvoiceSetupTaxConnectionDtoState = "pending_taxpayer_enablement"
	InvoiceSetupTaxConnectionDtoStatePendingGrantApproval      InvoiceSetupTaxConnectionDtoState = "pending_grant_approval"
	InvoiceSetupTaxConnectionDtoStatePendingKey                InvoiceSetupTaxConnectionDtoState = "pending_key"
	InvoiceSetupTaxConnectionDtoStateConnected                 InvoiceSetupTaxConnectionDtoState = "connected"
	InvoiceSetupTaxConnectionDtoStateSuspended                 InvoiceSetupTaxConnectionDtoState = "suspended"
	InvoiceSetupTaxConnectionDtoStateRevoked                   InvoiceSetupTaxConnectionDtoState = "revoked"
	InvoiceSetupTaxConnectionDtoStateNotConnected              InvoiceSetupTaxConnectionDtoState = "not_connected"
)

Values of InvoiceSetupTaxConnectionDtoState.

type InvoiceStatisticsDto

type InvoiceStatisticsDto struct {
	Window StatisticsWindowDto `json:"window"`

	Total int64 `json:"total"`

	ByStatus InvoiceStatusCountsDto `json:"byStatus"`

	Submitted int64 `json:"submitted"`

	Registered int64 `json:"registered"`

	// SuccessRate Percent with one decimal: registered (or later) over submitted; 0 when nothing was submitted.
	// Example: 97.5.
	SuccessRate float64 `json:"successRate"`

	TotalsByCurrency []CurrencyTotalDto `json:"totalsByCurrency"`

	ByPaymentStatus InvoicePaymentStatusCountsDto `json:"byPaymentStatus"`

	CreditNotes int64 `json:"creditNotes"`

	// OutputTax Per currency: tax of registered invoices issued in the window less that of registered credit notes.
	OutputTax []OutputTaxTotalDto `json:"outputTax"`
}

InvoiceStatisticsDto is `invoice.InvoiceStatisticsDto`.

type InvoiceStatusCountsDto

type InvoiceStatusCountsDto struct {
	Draft int64 `json:"draft"`

	Finalised int64 `json:"finalised"`

	Queued int64 `json:"queued"`

	Signed int64 `json:"signed"`

	Transmitted int64 `json:"transmitted"`

	Accepted int64 `json:"accepted"`

	Rejected int64 `json:"rejected"`

	Failed int64 `json:"failed"`

	CancellationPending int64 `json:"cancellation_pending"`

	Cancelled int64 `json:"cancelled"`
}

InvoiceStatusCountsDto is `invoice.InvoiceStatusCountsDto`.

type InvoiceTaxCategoryOptionDto

type InvoiceTaxCategoryOptionDto struct {
	// ID Example: "STANDARD_VAT".
	ID string `json:"id"`

	// Label Example: "Standard VAT".
	Label string `json:"label"`

	// Rate Percent, decimal string.
	// Example: "7.5".
	Rate string `json:"rate"`
}

InvoiceTaxCategoryOptionDto is `invoice.InvoiceTaxCategoryOptionDto`.

type InvoiceTaxSubtotalDto

type InvoiceTaxSubtotalDto struct {
	// TaxCategory Example: "STANDARD_VAT".
	TaxCategory string `json:"taxCategory"`

	// TaxRate Example: "7.5".
	TaxRate string `json:"taxRate"`

	// TaxableMinor Integer minor units.
	TaxableMinor int64 `json:"taxableMinor"`

	// TaxMinor Integer minor units.
	TaxMinor int64 `json:"taxMinor"`
}

InvoiceTaxSubtotalDto is `invoice.InvoiceTaxSubtotalDto`.

type InvoiceTotalsDto

type InvoiceTotalsDto struct {
	// LineExtensionMinor Σ line nets. Integer minor units.
	LineExtensionMinor int64 `json:"lineExtensionMinor"`

	// DiscountMinor Integer minor units.
	DiscountMinor int64 `json:"discountMinor"`

	// FeeMinor Integer minor units.
	FeeMinor int64 `json:"feeMinor"`

	// TaxExclusiveMinor Integer minor units.
	TaxExclusiveMinor int64 `json:"taxExclusiveMinor"`

	// TaxMinor Integer minor units.
	TaxMinor int64 `json:"taxMinor"`

	// TaxInclusiveMinor Integer minor units.
	TaxInclusiveMinor int64 `json:"taxInclusiveMinor"`

	// AllowanceMinor Document allowance. Integer minor units.
	AllowanceMinor int64 `json:"allowanceMinor"`

	// ChargeMinor Document charge. Integer minor units.
	ChargeMinor int64 `json:"chargeMinor"`

	// PayableMinor The amount payable. Integer minor units.
	PayableMinor int64 `json:"payableMinor"`
}

InvoiceTotalsDto is `invoice.InvoiceTotalsDto`.

type InvoiceUnitCodeOptionDto

type InvoiceUnitCodeOptionDto struct {
	// Code Example: "EA".
	Code string `json:"code"`

	// Label Example: "Each".
	Label string `json:"label"`
}

InvoiceUnitCodeOptionDto is `invoice.InvoiceUnitCodeOptionDto`.

type InvoiceVerificationDto

type InvoiceVerificationDto struct {
	Artefact InvoiceVerificationDtoArtefact `json:"artefact"`

	// Payload The verification payload persisted when the document registered.
	Payload string `json:"payload"`
}

InvoiceVerificationDto is `invoice.InvoiceVerificationDto`.

type InvoiceVerificationDtoArtefact

type InvoiceVerificationDtoArtefact string

InvoiceVerificationDtoArtefact is the type of InvoiceVerificationDto.Artefact. The API may add values.

const (
	InvoiceVerificationDtoArtefactQR InvoiceVerificationDtoArtefact = "qr"
)

Values of InvoiceVerificationDtoArtefact.

type InvoiceViewDto

type InvoiceViewDto struct {
	ID string `json:"id"`

	// Jurisdiction Example: "NG".
	Jurisdiction string `json:"jurisdiction"`

	// InvoiceNumber The document’s own number, unique per organisation.
	// Example: "INV00042".
	InvoiceNumber string `json:"invoiceNumber"`

	// AuthorityInvoiceNumber The number NRS holds, once registered; null until then.
	AuthorityInvoiceNumber *string `json:"authorityInvoiceNumber"`

	// DisplayNumber The number to show: `authorityInvoiceNumber`, else `invoiceNumber`.
	DisplayNumber string `json:"displayNumber"`

	InvoiceType InvoiceViewDtoInvoiceType `json:"invoiceType"`

	// InvoiceKind Example: "B2B".
	InvoiceKind string `json:"invoiceKind"`

	Status InvoiceViewDtoStatus `json:"status"`

	// AuthorityState The current submission’s state.
	AuthorityState *InvoiceViewDtoAuthorityState `json:"authorityState"`

	// AuthorityReference The IRN, once assigned.
	AuthorityReference *string `json:"authorityReference"`

	// ParkReason Why the current submission is on hold.
	ParkReason *string `json:"parkReason"`

	// IssuedAs The identity the document was issued under; null until its first submission.
	IssuedAs *InvoiceIssuedAsDto `json:"issuedAs"`

	// IssueDate Example: "2026-09-30".
	IssueDate string `json:"issueDate"`

	// IssueTime Example: "14:30:00".
	IssueTime *string `json:"issueTime"`

	// DueDate Example: "2026-09-30".
	DueDate *string `json:"dueDate"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// TaxCurrency Example: "NGN".
	TaxCurrency string `json:"taxCurrency"`

	// Seller A draft shows the seller as it is now; a finalised document as it was when finalised.
	Seller *InvoiceSellerSnapshotDto `json:"seller"`

	// Buyer A draft shows the buyer as it is now; a finalised document as it was when finalised.
	Buyer *InvoiceBuyerSnapshotDto `json:"buyer"`

	// BuyerVerification The buyer’s verification as it stands now; null with no buyer or tax id, or once the buyer’s tax id differs from the document’s.
	BuyerVerification *InvoiceBuyerVerificationDto `json:"buyerVerification"`

	// LineItems The lines. Absent on list items.
	LineItems []InvoiceLineViewDto `json:"lineItems,omitempty"`

	Totals InvoiceTotalsDto `json:"totals"`

	TaxSubtotals []InvoiceTaxSubtotalDto `json:"taxSubtotals"`

	// PaymentStatus What the buyer paid (on a credit note: its refund status). Never moved by a cancellation.
	PaymentStatus InvoiceViewDtoPaymentStatus `json:"paymentStatus"`

	// AmountPaidMinor What the tax authority accepted as paid. Integer minor units.
	AmountPaidMinor int64 `json:"amountPaidMinor"`

	// CreditedMinor On an invoice: Σ its counting credit notes (0 when none). Null on a note. Integer minor units.
	CreditedMinor *int64 `json:"creditedMinor"`

	// DebitedMinor On an invoice: Σ its counting debit notes (0 when none). Null on a note. Integer minor units.
	DebitedMinor *int64 `json:"debitedMinor"`

	// NetReceivableMinor On an invoice: payable + debited − credited, never below zero (also what can still be credited). Null on a note. Integer minor units.
	NetReceivableMinor *int64 `json:"netReceivableMinor"`

	// CreditStatus On an invoice; null on a note.
	CreditStatus *InvoiceViewDtoCreditStatus `json:"creditStatus"`

	// Adjustments An invoice’s credit and debit notes, in issue order (empty on a note).
	Adjustments []InvoiceAdjustmentDto `json:"adjustments"`

	// CreditNoteSettlement On an invoice with a counting credit note, or on a credit note: settled, or a refund owed. Null otherwise.
	CreditNoteSettlement *InvoiceCreditSettlementDto `json:"creditNoteSettlement"`

	// RefundOwedMinor `creditNoteSettlement.refundOwedMinor`, or null with it. Integer minor units.
	RefundOwedMinor *int64 `json:"refundOwedMinor"`

	// PaymentCeilingMinor What "paid in full" records on this document: an invoice, its payable less its credit notes (debit notes are paid on themselves); a credit note, its share of the refund owed; a debit note, its payable. Integer minor units.
	PaymentCeilingMinor int64 `json:"paymentCeilingMinor"`

	// Payments Every payment report, oldest first.
	Payments []InvoicePaymentEntryDto `json:"payments"`

	// DeliveryStatus `not_sent` or `sent`.
	// Example: "not_sent".
	DeliveryStatus string `json:"deliveryStatus"`

	SentToBuyerAt *string `json:"sentToBuyerAt"`

	BuyerDelivery InvoiceBuyerDeliveryDto `json:"buyerDelivery"`

	Reporting InvoiceReportingDto `json:"reporting"`

	// SimpleStatus The one status a person reads. `delivered` only when the tax authority says the buyer received it; `transmitted` when it was sent to the buyer's access point and not yet acknowledged.
	SimpleStatus InvoiceViewDtoSimpleStatus `json:"simpleStatus"`

	// ReportedToNRS The tax authority registered the document; false on a draft.
	ReportedToNRS bool `json:"reportedToNrs"`

	// RefundOwed A refund to the buyer is still owed (`refundOwedMinor > 0`).
	RefundOwed bool `json:"refundOwed"`

	Notes *string `json:"notes"`

	PaymentTerms *string `json:"paymentTerms"`

	PurchaseOrderReference *string `json:"purchaseOrderReference"`

	BuyerReference *string `json:"buyerReference"`

	AccountingCost *string `json:"accountingCost"`

	// CreditNoteOf A credit note: the invoice it credits.
	CreditNoteOf *InvoiceDocumentLinkDto `json:"creditNoteOf"`

	// Credits A credit note: the invoice it credits (same as `creditNoteOf`).
	Credits *InvoiceDocumentLinkDto `json:"credits"`

	// Debits A debit note: the invoice it increases.
	Debits *InvoiceDocumentLinkDto `json:"debits"`

	// CancelledByCreditNote A cancelled (or being cancelled) invoice: its credit note.
	CancelledByCreditNote *InvoiceDocumentLinkDto `json:"cancelledByCreditNote"`

	Verification *InvoiceVerificationDto `json:"verification"`

	FinalisedAt *string `json:"finalisedAt"`

	// SubmissionDueAt When a document issued without a buyer tax id (B2C) and not yet submitted must be submitted to the tax authority by: `finalisedAt` plus the jurisdiction window (24 hours in Nigeria). Null when it is signed, being submitted, a draft, cancelled, or of another kind.
	SubmissionDueAt *string `json:"submissionDueAt"`

	CancelledAt *string `json:"cancelledAt"`

	// CreatedBy Who created the document.
	CreatedBy InvoiceActorDto `json:"createdBy"`

	// SubmittedBy Who submitted it to the tax authority; null while never submitted.
	SubmittedBy *InvoiceActorDto `json:"submittedBy"`

	CreatedAt string `json:"createdAt"`

	UpdatedAt string `json:"updatedAt"`

	// Version The concurrency token: send it back as `If-Match: "<version>"` (also the `ETag`).
	Version int64 `json:"version"`
}

InvoiceViewDto is `invoice.InvoiceViewDto`.

type InvoiceViewDtoAuthorityState

type InvoiceViewDtoAuthorityState string

InvoiceViewDtoAuthorityState is the type of InvoiceViewDto.AuthorityState. The API may add values.

const (
	InvoiceViewDtoAuthorityStateQueued      InvoiceViewDtoAuthorityState = "queued"
	InvoiceViewDtoAuthorityStateHandedOff   InvoiceViewDtoAuthorityState = "handed_off"
	InvoiceViewDtoAuthorityStateRegistered  InvoiceViewDtoAuthorityState = "registered"
	InvoiceViewDtoAuthorityStateTransmitted InvoiceViewDtoAuthorityState = "transmitted"
	InvoiceViewDtoAuthorityStateDelivered   InvoiceViewDtoAuthorityState = "delivered"
	InvoiceViewDtoAuthorityStateRejected    InvoiceViewDtoAuthorityState = "rejected"
	InvoiceViewDtoAuthorityStateParked      InvoiceViewDtoAuthorityState = "parked"
	InvoiceViewDtoAuthorityStateWithdrawn   InvoiceViewDtoAuthorityState = "withdrawn"
)

Values of InvoiceViewDtoAuthorityState.

type InvoiceViewDtoCreditStatus

type InvoiceViewDtoCreditStatus string

InvoiceViewDtoCreditStatus is the type of InvoiceViewDto.CreditStatus. The API may add values.

const (
	InvoiceViewDtoCreditStatusNone           InvoiceViewDtoCreditStatus = "none"
	InvoiceViewDtoCreditStatusPartlyCredited InvoiceViewDtoCreditStatus = "partly_credited"
	InvoiceViewDtoCreditStatusCredited       InvoiceViewDtoCreditStatus = "credited"
)

Values of InvoiceViewDtoCreditStatus.

type InvoiceViewDtoInvoiceType

type InvoiceViewDtoInvoiceType string

InvoiceViewDtoInvoiceType is the type of InvoiceViewDto.InvoiceType. The API may add values.

const (
	InvoiceViewDtoInvoiceTypeStandard   InvoiceViewDtoInvoiceType = "standard"
	InvoiceViewDtoInvoiceTypeCreditNote InvoiceViewDtoInvoiceType = "credit_note"
	InvoiceViewDtoInvoiceTypeDebitNote  InvoiceViewDtoInvoiceType = "debit_note"
)

Values of InvoiceViewDtoInvoiceType.

type InvoiceViewDtoPaymentStatus

type InvoiceViewDtoPaymentStatus string

InvoiceViewDtoPaymentStatus is the type of InvoiceViewDto.PaymentStatus. The API may add values.

const (
	InvoiceViewDtoPaymentStatusUnpaid        InvoiceViewDtoPaymentStatus = "unpaid"
	InvoiceViewDtoPaymentStatusPartiallyPaid InvoiceViewDtoPaymentStatus = "partially_paid"
	InvoiceViewDtoPaymentStatusPaid          InvoiceViewDtoPaymentStatus = "paid"
	InvoiceViewDtoPaymentStatusPaymentFailed InvoiceViewDtoPaymentStatus = "payment_failed"
)

Values of InvoiceViewDtoPaymentStatus.

type InvoiceViewDtoSimpleStatus

type InvoiceViewDtoSimpleStatus string

InvoiceViewDtoSimpleStatus is the type of InvoiceViewDto.SimpleStatus. The API may add values.

const (
	InvoiceViewDtoSimpleStatusDraft       InvoiceViewDtoSimpleStatus = "draft"
	InvoiceViewDtoSimpleStatusIssued      InvoiceViewDtoSimpleStatus = "issued"
	InvoiceViewDtoSimpleStatusReported    InvoiceViewDtoSimpleStatus = "reported"
	InvoiceViewDtoSimpleStatusTransmitted InvoiceViewDtoSimpleStatus = "transmitted"
	InvoiceViewDtoSimpleStatusDelivered   InvoiceViewDtoSimpleStatus = "delivered"
	InvoiceViewDtoSimpleStatusPaid        InvoiceViewDtoSimpleStatus = "paid"
	InvoiceViewDtoSimpleStatusPartPaid    InvoiceViewDtoSimpleStatus = "part_paid"
	InvoiceViewDtoSimpleStatusCancelled   InvoiceViewDtoSimpleStatus = "cancelled"
)

Values of InvoiceViewDtoSimpleStatus.

type InvoiceViewDtoStatus

type InvoiceViewDtoStatus string

InvoiceViewDtoStatus is the type of InvoiceViewDto.Status. The API may add values.

const (
	InvoiceViewDtoStatusDraft               InvoiceViewDtoStatus = "draft"
	InvoiceViewDtoStatusFinalised           InvoiceViewDtoStatus = "finalised"
	InvoiceViewDtoStatusQueued              InvoiceViewDtoStatus = "queued"
	InvoiceViewDtoStatusSigned              InvoiceViewDtoStatus = "signed"
	InvoiceViewDtoStatusTransmitted         InvoiceViewDtoStatus = "transmitted"
	InvoiceViewDtoStatusAccepted            InvoiceViewDtoStatus = "accepted"
	InvoiceViewDtoStatusRejected            InvoiceViewDtoStatus = "rejected"
	InvoiceViewDtoStatusFailed              InvoiceViewDtoStatus = "failed"
	InvoiceViewDtoStatusCancellationPending InvoiceViewDtoStatus = "cancellation_pending"
	InvoiceViewDtoStatusCancelled           InvoiceViewDtoStatus = "cancelled"
)

Values of InvoiceViewDtoStatus.

type InvoicesService

type InvoicesService struct {
	// contains filtered or unexported fields
}

InvoicesService is invoices (`/i/v1/invoices`): drafts, their lifecycle, credit and debit notes, and the organisation's invoice statistics. Submission to the tax authority is SubmissionsService.

func (*InvoicesService) Cancel

Cancel cancels an invoice (`invoice.cancel`; 202): voided locally when the tax authority does not hold it, otherwise by a credit note. A draft is 409 `BIZ201` (delete it instead). Sends an `Idempotency-Key`.

func (*InvoicesService) Create

Create creates a draft invoice (`invoice.create`; charged as one invoice creation). The number is allocated from the series when InvoiceNumber is omitted. Sends an `Idempotency-Key` (generated unless WithIdempotencyKey is given), so a retry is never charged twice.

func (*InvoicesService) Delete

func (s *InvoicesService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeleteInvoiceData, error)

Delete deletes a draft permanently; its number is never reused (`invoice.delete_draft`).

func (*InvoicesService) Finalise

func (s *InvoicesService) Finalise(ctx context.Context, id string, opts ...RequestOption) (*FinaliseInvoiceData, error)

Finalise finalises a draft: freezes the seller and buyer onto it; 422 `VAL001` when the jurisdiction's checks refuse it (`invoice.finalise`).

func (*InvoicesService) Get

Get gets one invoice with its lines (`invoice.read`).

func (*InvoicesService) GetOverview

GetOverview is the dashboard overview: KPIs, trend, alerts and readiness (`invoice.stats.read`).

func (*InvoicesService) GetStatistics

GetStatistics is the invoice statistics for a period (`invoice.stats.read`).

func (*InvoicesService) GetSummary

GetSummary is the counts behind the invoice list's summary cards (`invoice.stats.read`).

func (*InvoicesService) IssueCreditNote

func (s *InvoicesService) IssueCreditNote(ctx context.Context, id string, params *IssueCreditNoteBody, opts ...RequestOption) (*IssueCreditNoteData, error)

IssueCreditNote issues a credit note against a registered invoice (`invoice.cancel`). With `Preview: true` nothing is written or charged. Sends an `Idempotency-Key`. The answer is one of two shapes: decode it with AsCreditNotePreviewAnswerDto or AsCreditNoteIssuedDto.

func (*InvoicesService) IssueDebitNote

func (s *InvoicesService) IssueDebitNote(ctx context.Context, id string, params *IssueDebitNoteBody, opts ...RequestOption) (*IssueDebitNoteData, error)

IssueDebitNote issues a debit note (added lines) against a registered invoice and submits it (`invoice.create` + `invoice.submit`). With `Preview: true` nothing is written. Sends an `Idempotency-Key`. Decode the answer with AsDebitNotePreviewAnswerDto or AsDebitNoteIssuedDto.

func (*InvoicesService) List

List lists invoices, newest first, without LineItems (`invoice.read`).

func (*InvoicesService) Reopen

func (s *InvoicesService) Reopen(ctx context.Context, id string, opts ...RequestOption) (*ReopenInvoiceData, error)

Reopen reopens a finalised invoice as a draft: allowed while its submission was rejected, or when it was never submitted (`invoice.reopen`).

func (*InvoicesService) Revise

func (s *InvoicesService) Revise(ctx context.Context, id string, opts ...RequestOption) (*ReviseInvoiceData, error)

Revise revises an issued invoice that was never reported and is unpaid: back to a draft with the same number and the next version (`invoice.reopen`).

func (*InvoicesService) Update

Update updates a draft (`invoice.update_draft`).

type IssueAnswerDto

type IssueAnswerDto struct {
	Invoice InvoiceViewDto `json:"invoice"`

	// Submission The queued submission when the invoice is being reported; null otherwise.
	Submission *SubmissionViewDto `json:"submission"`

	// Reporting `queued`: being reported; `not_reported`: finalised and sent, not reported.
	Reporting IssueAnswerDtoReporting `json:"reporting"`

	// NotReportedReason Why the invoice was not reported; null when it was queued.
	NotReportedReason *IssueAnswerDtoNotReportedReason `json:"notReportedReason"`

	// SentToBuyer Whether the document was emailed to the buyer.
	SentToBuyer bool `json:"sentToBuyer"`

	// Replayed True when the answer replays an earlier request with the same key.
	Replayed bool `json:"replayed"`
}

IssueAnswerDto is `invoice.IssueAnswerDto`.

type IssueAnswerDtoNotReportedReason

type IssueAnswerDtoNotReportedReason string

IssueAnswerDtoNotReportedReason is the type of IssueAnswerDto.NotReportedReason. The API may add values.

const (
	IssueAnswerDtoNotReportedReasonNotConnected  IssueAnswerDtoNotReportedReason = "not_connected"
	IssueAnswerDtoNotReportedReasonAutoReportOff IssueAnswerDtoNotReportedReason = "auto_report_off"
)

Values of IssueAnswerDtoNotReportedReason.

type IssueAnswerDtoReporting

type IssueAnswerDtoReporting string

IssueAnswerDtoReporting is the type of IssueAnswerDto.Reporting. The API may add values.

const (
	IssueAnswerDtoReportingQueued      IssueAnswerDtoReporting = "queued"
	IssueAnswerDtoReportingNotReported IssueAnswerDtoReporting = "not_reported"
)

Values of IssueAnswerDtoReporting.

type IssueCreditNoteBody

type IssueCreditNoteBody = IssueCreditNoteDto

IssueCreditNoteBody is the request body of POST /i/v1/invoices/{id}/credit-notes.

type IssueCreditNoteData

type IssueCreditNoteData struct {
	json.RawMessage
}

IssueCreditNoteData is the data of a successful POST /i/v1/invoices/{id}/credit-notes: CreditNotePreviewAnswerDto or CreditNoteIssuedDto, as the API answered it. Decode it with one of the As methods.

func (IssueCreditNoteData) AsCreditNoteIssuedDto

func (d IssueCreditNoteData) AsCreditNoteIssuedDto() (*CreditNoteIssuedDto, error)

AsCreditNoteIssuedDto decodes the answer as a CreditNoteIssuedDto.

func (IssueCreditNoteData) AsCreditNotePreviewAnswerDto

func (d IssueCreditNoteData) AsCreditNotePreviewAnswerDto() (*CreditNotePreviewAnswerDto, error)

AsCreditNotePreviewAnswerDto decodes the answer as a CreditNotePreviewAnswerDto.

type IssueCreditNoteDto

type IssueCreditNoteDto struct {
	// Reason Example: "Two units returned".
	Reason string `json:"reason"`

	Mode IssueCreditNoteDtoMode `json:"mode"`

	// Lines mode 'lines' only (required there)
	Lines []CreditNoteLineDto `json:"lines,omitempty"`

	// AmountMinor mode 'amount' only (required there): the TAX-INCLUSIVE amount, minor units
	// Example: 107500.
	AmountMinor *float64 `json:"amountMinor,omitempty"`

	// LineNo mode 'amount' only: the original line whose text, codes and VAT the credit line takes (default 1)
	// Example: 1.
	LineNo *float64 `json:"lineNo,omitempty"`

	// Preview true: answer what would be issued; nothing is written or charged
	Preview *bool `json:"preview,omitempty"`
}

IssueCreditNoteDto is `invoice.IssueCreditNoteDto`.

type IssueCreditNoteDtoMode

type IssueCreditNoteDtoMode string

IssueCreditNoteDtoMode is the type of IssueCreditNoteDto.Mode. The API may add values.

const (
	IssueCreditNoteDtoModeFull   IssueCreditNoteDtoMode = "full"
	IssueCreditNoteDtoModeLines  IssueCreditNoteDtoMode = "lines"
	IssueCreditNoteDtoModeAmount IssueCreditNoteDtoMode = "amount"
)

Values of IssueCreditNoteDtoMode.

type IssueDebitNoteBody

type IssueDebitNoteBody = IssueDebitNoteDto

IssueDebitNoteBody is the request body of POST /i/v1/invoices/{id}/debit-notes.

type IssueDebitNoteData

type IssueDebitNoteData struct {
	json.RawMessage
}

IssueDebitNoteData is the data of a successful POST /i/v1/invoices/{id}/debit-notes: DebitNotePreviewAnswerDto or DebitNoteIssuedDto, as the API answered it. Decode it with one of the As methods.

func (IssueDebitNoteData) AsDebitNoteIssuedDto

func (d IssueDebitNoteData) AsDebitNoteIssuedDto() (*DebitNoteIssuedDto, error)

AsDebitNoteIssuedDto decodes the answer as a DebitNoteIssuedDto.

func (IssueDebitNoteData) AsDebitNotePreviewAnswerDto

func (d IssueDebitNoteData) AsDebitNotePreviewAnswerDto() (*DebitNotePreviewAnswerDto, error)

AsDebitNotePreviewAnswerDto decodes the answer as a DebitNotePreviewAnswerDto.

type IssueDebitNoteDto

type IssueDebitNoteDto struct {
	// Reason Example: "Delivery charge omitted".
	Reason *string `json:"reason,omitempty"`

	LineItems []InvoiceLineItemDto `json:"lineItems"`

	// Preview true: answer what would be issued; nothing is written or charged
	Preview *bool `json:"preview,omitempty"`
}

IssueDebitNoteDto is `invoice.IssueDebitNoteDto`.

type IssueInvoiceData

type IssueInvoiceData = IssueAnswerDto

IssueInvoiceData is the data of a successful POST /i/v1/invoices/{id}/issue.

type IssuedHistoryService

type IssuedHistoryService struct {
	// contains filtered or unexported fields
}

IssuedHistoryService is issued history (`/i/v1/issued-history`): invoices the organisation issued that NRS holds, from before Yona.

func (*IssuedHistoryService) DownloadPDF

func (s *IssuedHistoryService) DownloadPDF(ctx context.Context, id string, opts ...RequestOption) (*BinaryResponse, error)

DownloadPDF is the PDF printed from the authority copy (`invoice.inbound.read`; charged once per invoice if not yet read).

func (*IssuedHistoryService) Get

Get gets one; `Document` is read and charged once per invoice on first open (`invoice.inbound.read`).

func (*IssuedHistoryService) List

List lists invoices issued outside Yona that the tax authority holds (`invoice.inbound.read`; free).

type ItemDeletedDto

type ItemDeletedDto struct {
	ID string `json:"id"`

	Deleted bool `json:"deleted"`
}

ItemDeletedDto is `invoice.ItemDeletedDto`.

type ItemViewDto

type ItemViewDto struct {
	ID string `json:"id"`

	Name string `json:"name"`

	Description *string `json:"description"`

	ItemType ItemViewDtoItemType `json:"itemType"`

	HSNCode *string `json:"hsnCode"`

	ServiceCode *string `json:"serviceCode"`

	ProductCategory string `json:"productCategory"`

	// UnitCode Example: "EA".
	UnitCode string `json:"unitCode"`

	// UnitPriceMinor Minor units as a decimal string.
	// Example: "150050".
	UnitPriceMinor string `json:"unitPriceMinor"`

	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// TaxCategory Stored resolved to the code-list id.
	// Example: "STANDARD_VAT".
	TaxCategory string `json:"taxCategory"`

	SKU *string `json:"sku"`

	ArchivedAt *string `json:"archivedAt"`

	LastUsedAt *string `json:"lastUsedAt"`

	// UseCount Finalised invoice lines built from this item.
	// Example: 3.
	UseCount float64 `json:"useCount"`

	// Referenced Whether any invoice line, drafts included, references the item — while true, the item cannot be deleted (archive it instead).
	// Example: false.
	Referenced bool `json:"referenced"`

	CreatedAt string `json:"createdAt"`

	UpdatedAt string `json:"updatedAt"`
}

ItemViewDto is `invoice.ItemViewDto`.

type ItemViewDtoItemType

type ItemViewDtoItemType string

ItemViewDtoItemType is the type of ItemViewDto.ItemType. The API may add values.

const (
	ItemViewDtoItemTypeGoods   ItemViewDtoItemType = "goods"
	ItemViewDtoItemTypeService ItemViewDtoItemType = "service"
)

Values of ItemViewDtoItemType.

type ItemsService

type ItemsService struct {
	// contains filtered or unexported fields
}

ItemsService is saved items (`/i/v1/items`): the goods and services an invoice line can reference by `ItemID`.

func (*ItemsService) Archive

func (s *ItemsService) Archive(ctx context.Context, id string, opts ...RequestOption) (*ArchiveItemData, error)

Archive archives an item (`item.archive`; idempotent).

func (*ItemsService) Create

func (s *ItemsService) Create(ctx context.Context, params *CreateItemBody, opts ...RequestOption) (*CreateItemData, error)

Create saves an item (`item.create`; free). Goods need `HSNCode`, services `ServiceCode`.

func (*ItemsService) Delete

func (s *ItemsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeleteItemData, error)

Delete deletes an item no invoice line references; otherwise 409 `BIZ004`: archive it (`item.archive`).

func (*ItemsService) Get

func (s *ItemsService) Get(ctx context.Context, id string, opts ...RequestOption) (*GetItemData, error)

Get gets a saved item, archived ones included (`item.read`).

func (*ItemsService) List

func (s *ItemsService) List(ctx context.Context, query *ListItemsQuery, opts ...RequestOption) (*Page[ListItemsItem], error)

List lists saved items; non-archived by default (`item.read`).

func (*ItemsService) ListUsedCodes

func (s *ItemsService) ListUsedCodes(ctx context.Context, query *ListUsedItemCodesQuery, opts ...RequestOption) ([]ListUsedItemCodesItem, error)

ListUsedCodes is the HS (`Type: "goods"`) or service (`Type: "service"`) codes already used on the organisation's invoices (`item.read`).

func (*ItemsService) Unarchive

func (s *ItemsService) Unarchive(ctx context.Context, id string, opts ...RequestOption) (*UnarchiveItemData, error)

Unarchive unarchives an item (`item.archive`; idempotent).

func (*ItemsService) Update

func (s *ItemsService) Update(ctx context.Context, id string, params *UpdateItemBody, opts ...RequestOption) (*UpdateItemData, error)

Update updates a saved item; `ItemType` is immutable (`item.update`; charged). Retried only with WithIdempotencyKey.

type LedgerBalanceDto

type LedgerBalanceDto struct {
	// Available Spendable now: Σ remaining over unexpired lots.
	Available int64 `json:"available"`

	// Held Reserved by open holds.
	Held int64 `json:"held"`

	NextExpiry *NextExpiryDto `json:"nextExpiry"`

	// BySource Live ledger only: `available` by lot source.
	BySource *BalanceBySourceDto `json:"bySource,omitempty"`

	// Transferable Live ledger only: what a transfer could move now — purchased and transferred credits — before any reserve.
	Transferable *int64 `json:"transferable,omitempty"`
}

LedgerBalanceDto is `billing.LedgerBalanceDto`.

type LedgerBalancesDto

type LedgerBalancesDto struct {
	Live *LedgerBalanceDto `json:"live,omitempty"`

	Sandbox *LedgerBalanceDto `json:"sandbox,omitempty"`
}

LedgerBalancesDto is `billing.LedgerBalancesDto`.

type LedgerEntryDto

type LedgerEntryDto struct {
	ID string `json:"id"`

	Mode LedgerEntryDtoMode `json:"mode"`

	Kind LedgerEntryDtoKind `json:"kind"`

	// Credits Signed delta: positive for grants/releases/refunds.
	Credits int64 `json:"credits"`

	BalanceAfter int64 `json:"balanceAfter"`

	// Reference Example: "invoice.create:018f2b4c-6a1e-7c3d-9e2f-0a1b2c3d4e5f".
	Reference string `json:"reference"`

	CostCode *string `json:"costCode"`

	Quantity *int64 `json:"quantity"`

	// Description Human label (cost-code label or grant source).
	Description *string `json:"description"`

	PaymentID *string `json:"paymentId"`

	// CounterpartyOrganizationID The other organisation of the family on a transfer or pool entry (transfer_in/out, pool_in/out, pool_return_in/out); null on every other kind.
	CounterpartyOrganizationID *string `json:"counterpartyOrganizationId"`

	HoldState *LedgerEntryDtoHoldState `json:"holdState"`

	// Hold The hold behind the entry: on a `hold` or `hold_release` entry its own hold, on a `charge` the hold it was captured from; null for a charge taken without a hold and for every other kind.
	Hold *LedgerEntryHoldDto `json:"hold"`

	CreatedAt string `json:"createdAt"`
}

LedgerEntryDto is `billing.LedgerEntryDto`.

type LedgerEntryDtoHoldState

type LedgerEntryDtoHoldState string

LedgerEntryDtoHoldState is the type of LedgerEntryDto.HoldState. The API may add values.

const (
	LedgerEntryDtoHoldStateHeld     LedgerEntryDtoHoldState = "held"
	LedgerEntryDtoHoldStateCaptured LedgerEntryDtoHoldState = "captured"
	LedgerEntryDtoHoldStateReleased LedgerEntryDtoHoldState = "released"
	LedgerEntryDtoHoldStateExpired  LedgerEntryDtoHoldState = "expired"
)

Values of LedgerEntryDtoHoldState.

type LedgerEntryDtoKind

type LedgerEntryDtoKind string

LedgerEntryDtoKind is the type of LedgerEntryDto.Kind. The API may add values.

const (
	LedgerEntryDtoKindGrantPlan       LedgerEntryDtoKind = "grant_plan"
	LedgerEntryDtoKindGrantPurchase   LedgerEntryDtoKind = "grant_purchase"
	LedgerEntryDtoKindGrantAllowance  LedgerEntryDtoKind = "grant_allowance"
	LedgerEntryDtoKindGrantAdjustment LedgerEntryDtoKind = "grant_adjustment"
	LedgerEntryDtoKindCharge          LedgerEntryDtoKind = "charge"
	LedgerEntryDtoKindHold            LedgerEntryDtoKind = "hold"
	LedgerEntryDtoKindHoldRelease     LedgerEntryDtoKind = "hold_release"
	LedgerEntryDtoKindRefund          LedgerEntryDtoKind = "refund"
	LedgerEntryDtoKindClawback        LedgerEntryDtoKind = "clawback"
	LedgerEntryDtoKindAdjustmentDebit LedgerEntryDtoKind = "adjustment_debit"
	LedgerEntryDtoKindExpiry          LedgerEntryDtoKind = "expiry"
	LedgerEntryDtoKindDebtSettlement  LedgerEntryDtoKind = "debt_settlement"
	LedgerEntryDtoKindTransferOut     LedgerEntryDtoKind = "transfer_out"
	LedgerEntryDtoKindTransferIn      LedgerEntryDtoKind = "transfer_in"
	LedgerEntryDtoKindPoolOut         LedgerEntryDtoKind = "pool_out"
	LedgerEntryDtoKindPoolIn          LedgerEntryDtoKind = "pool_in"
	LedgerEntryDtoKindPoolReturnOut   LedgerEntryDtoKind = "pool_return_out"
	LedgerEntryDtoKindPoolReturnIn    LedgerEntryDtoKind = "pool_return_in"
)

Values of LedgerEntryDtoKind.

type LedgerEntryDtoMode

type LedgerEntryDtoMode string

LedgerEntryDtoMode is the type of LedgerEntryDto.Mode. The API may add values.

const (
	LedgerEntryDtoModeSandbox LedgerEntryDtoMode = "sandbox"
	LedgerEntryDtoModeLive    LedgerEntryDtoMode = "live"
)

Values of LedgerEntryDtoMode.

type LedgerEntryHoldDto

type LedgerEntryHoldDto struct {
	State LedgerEntryHoldDtoState `json:"state"`

	// Credits Credits the hold reserved.
	Credits int64 `json:"credits"`

	// HeldAt When the credits were reserved.
	HeldAt string `json:"heldAt"`

	// SettledAt When the hold was captured, released or expired; null while it is open.
	SettledAt *string `json:"settledAt"`
}

LedgerEntryHoldDto is `billing.LedgerEntryHoldDto`.

type LedgerEntryHoldDtoState

type LedgerEntryHoldDtoState string

LedgerEntryHoldDtoState is the type of LedgerEntryHoldDto.State. The API may add values.

const (
	LedgerEntryHoldDtoStateHeld     LedgerEntryHoldDtoState = "held"
	LedgerEntryHoldDtoStateCaptured LedgerEntryHoldDtoState = "captured"
	LedgerEntryHoldDtoStateReleased LedgerEntryHoldDtoState = "released"
	LedgerEntryHoldDtoStateExpired  LedgerEntryHoldDtoState = "expired"
)

Values of LedgerEntryHoldDtoState.

type ListBuyersItem

type ListBuyersItem = BuyerViewDto

ListBuyersItem is one element of the page GET /i/v1/buyers answers.

type ListBuyersQuery

type ListBuyersQuery struct {
	// Search Name, legal name or tax id. A tax id may be typed with its hyphen, without it, or in groups.
	Search *string `json:"search,omitempty"`

	TaxIDStatus *ListBuyersQueryTaxIDStatus `json:"taxIdStatus,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListBuyersQuery holds the query parameters of GET /i/v1/buyers.

type ListBuyersQueryTaxIDStatus

type ListBuyersQueryTaxIDStatus string

ListBuyersQueryTaxIDStatus is the type of ListBuyersQuery.TaxIDStatus. The API may add values.

const (
	ListBuyersQueryTaxIDStatusUnverified      ListBuyersQueryTaxIDStatus = "unverified"
	ListBuyersQueryTaxIDStatusPending         ListBuyersQueryTaxIDStatus = "pending"
	ListBuyersQueryTaxIDStatusVerified        ListBuyersQueryTaxIDStatus = "verified"
	ListBuyersQueryTaxIDStatusNotFound        ListBuyersQueryTaxIDStatus = "not_found"
	ListBuyersQueryTaxIDStatusNameMismatch    ListBuyersQueryTaxIDStatus = "name_mismatch"
	ListBuyersQueryTaxIDStatusUnavailable     ListBuyersQueryTaxIDStatus = "unavailable"
	ListBuyersQueryTaxIDStatusValidOffNetwork ListBuyersQueryTaxIDStatus = "valid_off_network"
	ListBuyersQueryTaxIDStatusChecking        ListBuyersQueryTaxIDStatus = "checking"
)

Values of ListBuyersQueryTaxIDStatus.

type ListHsCodeCategoriesItem

type ListHsCodeCategoriesItem = string

ListHsCodeCategoriesItem is one element of the page GET /i/v1/invoices/hsn-codes/categories answers.

type ListHsCodesItem

type ListHsCodesItem = HsCodeDto

ListHsCodesItem is one element of the page GET /i/v1/invoices/hsn-codes answers.

type ListHsCodesQuery

type ListHsCodesQuery struct {
	// Search Case-insensitive text in the code, description or category.
	Search *string `json:"search,omitempty"`

	// Category Exact category name (case-insensitive).
	Category *string `json:"category,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListHsCodesQuery holds the query parameters of GET /i/v1/invoices/hsn-codes.

type ListInboundHistoryRunsData

type ListInboundHistoryRunsData = HistoryRunListDto

ListInboundHistoryRunsData is the data of a successful GET /i/v1/inbound-invoices/history-runs.

type ListInboundHistoryRunsQuery

type ListInboundHistoryRunsQuery struct {
	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListInboundHistoryRunsQuery holds the query parameters of GET /i/v1/inbound-invoices/history-runs.

type ListInboundInvoicesData

type ListInboundInvoicesData = InboundPageDto

ListInboundInvoicesData is the data of a successful GET /i/v1/inbound-invoices.

type ListInboundInvoicesQuery

type ListInboundInvoicesQuery struct {
	// Seller The seller: a name (substring, any case) or a TIN (prefix). A TIN may be typed with its hyphen, without it, or in groups.
	Seller *string `json:"seller,omitempty"`

	// AccessPoint The seller’s access point (`supplier.app_reference`), exact.
	AccessPoint *string `json:"accessPoint,omitempty"`

	// TransmissionStatus As the gateway reports it, exact.
	TransmissionStatus *string `json:"transmissionStatus,omitempty"`

	// PaymentStatus `overdue`: a due date before today and not paid.
	PaymentStatus *ListInboundInvoicesQueryPaymentStatus `json:"paymentStatus,omitempty"`

	// IssueDateFrom Inclusive.
	// Example: "2026-09-01".
	IssueDateFrom *string `json:"issueDateFrom,omitempty"`

	// IssueDateTo Inclusive.
	// Example: "2026-09-30".
	IssueDateTo *string `json:"issueDateTo,omitempty"`

	// ReceivedFrom Inclusive (an instant or a day).
	// Example: "2026-09-01T00:00:00Z".
	ReceivedFrom *string `json:"receivedFrom,omitempty"`

	// ReceivedTo Exclusive for an instant; a calendar day includes that whole day.
	// Example: "2026-10-01T00:00:00Z".
	ReceivedTo *string `json:"receivedTo,omitempty"`

	// AmountMin Payable amount, MAJOR units, inclusive.
	// Example: "1000.00".
	AmountMin *string `json:"amountMin,omitempty"`

	// AmountMax Payable amount, MAJOR units, inclusive.
	// Example: "50000".
	AmountMax *string `json:"amountMax,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	// Q Seller name or TIN, IRN, or the seller’s invoice number (substring, any case). A TIN may be typed with its hyphen, without it, or in groups.
	Q *string `json:"q,omitempty"`

	// TaxID One of `taxpayer.taxIds` (the organisation’s own tax ids in this mode); any other is 400.
	TaxID *string `json:"taxId,omitempty"`

	// Sort Default `-receivedAt`; with `tier=history`, `-issueDate` (a history row’s `receivedAt` is when the access point imported it).
	Sort *ListInboundInvoicesQuerySort `json:"sort,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`

	// Tier `forward` (default): invoices received since the organisation connected its tax id. `history`: invoices retrieved from the tax authority on request (409 `BIZ221` while retrieving history is not available).
	Tier *ListInboundInvoicesQueryTier `json:"tier,omitempty"`
}

ListInboundInvoicesQuery holds the query parameters of GET /i/v1/inbound-invoices.

type ListInboundInvoicesQueryPaymentStatus

type ListInboundInvoicesQueryPaymentStatus string

ListInboundInvoicesQueryPaymentStatus is the type of ListInboundInvoicesQuery.PaymentStatus. The API may add values.

const (
	ListInboundInvoicesQueryPaymentStatusPaid     ListInboundInvoicesQueryPaymentStatus = "paid"
	ListInboundInvoicesQueryPaymentStatusUnpaid   ListInboundInvoicesQueryPaymentStatus = "unpaid"
	ListInboundInvoicesQueryPaymentStatusPartial  ListInboundInvoicesQueryPaymentStatus = "partial"
	ListInboundInvoicesQueryPaymentStatusRejected ListInboundInvoicesQueryPaymentStatus = "rejected"
	ListInboundInvoicesQueryPaymentStatusOverdue  ListInboundInvoicesQueryPaymentStatus = "overdue"
)

Values of ListInboundInvoicesQueryPaymentStatus.

type ListInboundInvoicesQuerySort

type ListInboundInvoicesQuerySort string

ListInboundInvoicesQuerySort is the type of ListInboundInvoicesQuery.Sort. The API may add values.

const (
	ListInboundInvoicesQuerySortDescReceivedAt ListInboundInvoicesQuerySort = "-receivedAt"
	ListInboundInvoicesQuerySortReceivedAt     ListInboundInvoicesQuerySort = "receivedAt"
	ListInboundInvoicesQuerySortIssueDate      ListInboundInvoicesQuerySort = "issueDate"
	ListInboundInvoicesQuerySortDescIssueDate  ListInboundInvoicesQuerySort = "-issueDate"
	ListInboundInvoicesQuerySortAmount         ListInboundInvoicesQuerySort = "amount"
	ListInboundInvoicesQuerySortDescAmount     ListInboundInvoicesQuerySort = "-amount"
)

Values of ListInboundInvoicesQuerySort.

type ListInboundInvoicesQueryTier

type ListInboundInvoicesQueryTier string

ListInboundInvoicesQueryTier is the type of ListInboundInvoicesQuery.Tier. The API may add values.

const (
	ListInboundInvoicesQueryTierForward ListInboundInvoicesQueryTier = "forward"
	ListInboundInvoicesQueryTierHistory ListInboundInvoicesQueryTier = "history"
)

Values of ListInboundInvoicesQueryTier.

type ListInvoiceReferenceListsData

type ListInvoiceReferenceListsData = CodeListIndexDto

ListInvoiceReferenceListsData is the data of a successful GET /i/v1/invoices/resources.

type ListInvoiceShareLinksItem

type ListInvoiceShareLinksItem = ShareLinkViewDto

ListInvoiceShareLinksItem is one element of the page GET /i/v1/invoices/{id}/share-links answers.

type ListInvoicesItem

type ListInvoicesItem = InvoiceViewDto

ListInvoicesItem is one element of the page GET /i/v1/invoices answers.

type ListInvoicesQuery

type ListInvoicesQuery struct {
	Status *ListInvoicesQueryStatus `json:"status,omitempty"`

	InvoiceType *ListInvoicesQueryInvoiceType `json:"invoiceType,omitempty"`

	PaymentStatus *ListInvoicesQueryPaymentStatus `json:"paymentStatus,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	BuyerID *string `json:"buyerId,omitempty"`

	// SellerID Only the organisation’s own seller id.
	SellerID *string `json:"sellerId,omitempty"`

	// CreatedBy Only documents created by this actor id (`createdBy.id`): an auth user id, or an API-key id with `createdByType=api_key`.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType Only documents created by this kind of actor (`createdBy.type`).
	CreatedByType *ListInvoicesQueryCreatedByType `json:"createdByType,omitempty"`

	// InvoiceDateFrom Example: "2026-09-01".
	InvoiceDateFrom *string `json:"invoiceDateFrom,omitempty"`

	// InvoiceDateTo Example: "2026-09-30".
	InvoiceDateTo *string `json:"invoiceDateTo,omitempty"`

	DueDateFrom *string `json:"dueDateFrom,omitempty"`

	DueDateTo *string `json:"dueDateTo,omitempty"`

	// CreatedAtFrom Example: "2026-09-01T00:00:00Z".
	CreatedAtFrom *string `json:"createdAtFrom,omitempty"`

	// CreatedAtTo Exclusive.
	// Example: "2026-10-01T00:00:00Z".
	CreatedAtTo *string `json:"createdAtTo,omitempty"`

	// Search Matches the document number, the number NRS holds or the IRN by prefix, and the buyer name or TIN anywhere in it. Case-insensitive; `%` and `_` are plain characters. A TIN may be typed with its hyphen, without it, or in groups.
	Search *string `json:"search,omitempty"`

	// SimpleStatus Only documents with this simple status (`simpleStatus`).
	SimpleStatus *ListInvoicesQuerySimpleStatus `json:"simpleStatus,omitempty"`

	// Reporting Only documents at this reporting stage, as the summary cards count them (`needs_attention` = rejected or on hold, not cancelled).
	Reporting *ListInvoicesQueryReporting `json:"reporting,omitempty"`

	// Delivery Only documents with this delivery channel (`reporting.delivery`).
	Delivery *ListInvoicesQueryDelivery `json:"delivery,omitempty"`

	// Credited `true`: documents credited by a credit note that counts against them; `false`: invoices no credit note credits.
	Credited *ListInvoicesQueryCredited `json:"credited,omitempty"`

	// RefundOwed `true`: documents on which a refund is still owed to the buyer; `false`: documents on which none is.
	RefundOwed *ListInvoicesQueryRefundOwed `json:"refundOwed,omitempty"`

	// Overdue Only issued invoices still owing (net of credit notes) past their due date today.
	Overdue *ListInvoicesQueryOverdue `json:"overdue,omitempty"`

	// AmountFromMinor Payable amount at least this (minor units).
	AmountFromMinor *float64 `json:"amountFromMinor,omitempty"`

	// AmountToMinor Payable amount at most this (minor units).
	AmountToMinor *float64 `json:"amountToMinor,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`

	SortBy *ListInvoicesQuerySortBy `json:"sortBy,omitempty"`

	SortOrder *ListInvoicesQuerySortOrder `json:"sortOrder,omitempty"`
}

ListInvoicesQuery holds the query parameters of GET /i/v1/invoices.

type ListInvoicesQueryCreatedByType

type ListInvoicesQueryCreatedByType string

ListInvoicesQueryCreatedByType is the type of ListInvoicesQuery.CreatedByType. The API may add values.

const (
	ListInvoicesQueryCreatedByTypeUser    ListInvoicesQueryCreatedByType = "user"
	ListInvoicesQueryCreatedByTypeAPIKey  ListInvoicesQueryCreatedByType = "api_key"
	ListInvoicesQueryCreatedByTypeService ListInvoicesQueryCreatedByType = "service"
	ListInvoicesQueryCreatedByTypeSystem  ListInvoicesQueryCreatedByType = "system"
)

Values of ListInvoicesQueryCreatedByType.

type ListInvoicesQueryCredited

type ListInvoicesQueryCredited string

ListInvoicesQueryCredited is the type of ListInvoicesQuery.Credited. The API may add values.

const (
	ListInvoicesQueryCreditedTrue  ListInvoicesQueryCredited = "true"
	ListInvoicesQueryCreditedFalse ListInvoicesQueryCredited = "false"
)

Values of ListInvoicesQueryCredited.

type ListInvoicesQueryDelivery

type ListInvoicesQueryDelivery string

ListInvoicesQueryDelivery is the type of ListInvoicesQuery.Delivery. The API may add values.

const (
	ListInvoicesQueryDeliveryNRS            ListInvoicesQueryDelivery = "nrs"
	ListInvoicesQueryDeliveryDeliverToBuyer ListInvoicesQueryDelivery = "deliver_to_buyer"
	ListInvoicesQueryDeliverySentEmail      ListInvoicesQueryDelivery = "sent_email"
	ListInvoicesQueryDeliverySharedLink     ListInvoicesQueryDelivery = "shared_link"
	ListInvoicesQueryDeliveryNone           ListInvoicesQueryDelivery = "none"
)

Values of ListInvoicesQueryDelivery.

type ListInvoicesQueryInvoiceType

type ListInvoicesQueryInvoiceType string

ListInvoicesQueryInvoiceType is the type of ListInvoicesQuery.InvoiceType. The API may add values.

const (
	ListInvoicesQueryInvoiceTypeStandard   ListInvoicesQueryInvoiceType = "standard"
	ListInvoicesQueryInvoiceTypeCreditNote ListInvoicesQueryInvoiceType = "credit_note"
	ListInvoicesQueryInvoiceTypeDebitNote  ListInvoicesQueryInvoiceType = "debit_note"
)

Values of ListInvoicesQueryInvoiceType.

type ListInvoicesQueryOverdue

type ListInvoicesQueryOverdue string

ListInvoicesQueryOverdue is the type of ListInvoicesQuery.Overdue. The API may add values.

const (
	ListInvoicesQueryOverdueTrue ListInvoicesQueryOverdue = "true"
)

Values of ListInvoicesQueryOverdue.

type ListInvoicesQueryPaymentStatus

type ListInvoicesQueryPaymentStatus string

ListInvoicesQueryPaymentStatus is the type of ListInvoicesQuery.PaymentStatus. The API may add values.

const (
	ListInvoicesQueryPaymentStatusUnpaid        ListInvoicesQueryPaymentStatus = "unpaid"
	ListInvoicesQueryPaymentStatusPartiallyPaid ListInvoicesQueryPaymentStatus = "partially_paid"
	ListInvoicesQueryPaymentStatusPaid          ListInvoicesQueryPaymentStatus = "paid"
	ListInvoicesQueryPaymentStatusPaymentFailed ListInvoicesQueryPaymentStatus = "payment_failed"
)

Values of ListInvoicesQueryPaymentStatus.

type ListInvoicesQueryRefundOwed

type ListInvoicesQueryRefundOwed string

ListInvoicesQueryRefundOwed is the type of ListInvoicesQuery.RefundOwed. The API may add values.

const (
	ListInvoicesQueryRefundOwedTrue  ListInvoicesQueryRefundOwed = "true"
	ListInvoicesQueryRefundOwedFalse ListInvoicesQueryRefundOwed = "false"
)

Values of ListInvoicesQueryRefundOwed.

type ListInvoicesQueryReporting

type ListInvoicesQueryReporting string

ListInvoicesQueryReporting is the type of ListInvoicesQuery.Reporting. The API may add values.

const (
	ListInvoicesQueryReportingDraft          ListInvoicesQueryReporting = "draft"
	ListInvoicesQueryReportingNotReported    ListInvoicesQueryReporting = "not_reported"
	ListInvoicesQueryReportingInProgress     ListInvoicesQueryReporting = "in_progress"
	ListInvoicesQueryReportingReported       ListInvoicesQueryReporting = "reported"
	ListInvoicesQueryReportingNeedsAttention ListInvoicesQueryReporting = "needs_attention"
)

Values of ListInvoicesQueryReporting.

type ListInvoicesQuerySimpleStatus

type ListInvoicesQuerySimpleStatus string

ListInvoicesQuerySimpleStatus is the type of ListInvoicesQuery.SimpleStatus. The API may add values.

const (
	ListInvoicesQuerySimpleStatusDraft       ListInvoicesQuerySimpleStatus = "draft"
	ListInvoicesQuerySimpleStatusIssued      ListInvoicesQuerySimpleStatus = "issued"
	ListInvoicesQuerySimpleStatusReported    ListInvoicesQuerySimpleStatus = "reported"
	ListInvoicesQuerySimpleStatusTransmitted ListInvoicesQuerySimpleStatus = "transmitted"
	ListInvoicesQuerySimpleStatusDelivered   ListInvoicesQuerySimpleStatus = "delivered"
	ListInvoicesQuerySimpleStatusPaid        ListInvoicesQuerySimpleStatus = "paid"
	ListInvoicesQuerySimpleStatusPartPaid    ListInvoicesQuerySimpleStatus = "part_paid"
	ListInvoicesQuerySimpleStatusCancelled   ListInvoicesQuerySimpleStatus = "cancelled"
)

Values of ListInvoicesQuerySimpleStatus.

type ListInvoicesQuerySortBy

type ListInvoicesQuerySortBy string

ListInvoicesQuerySortBy is the type of ListInvoicesQuery.SortBy. The API may add values.

const (
	ListInvoicesQuerySortByCreatedAt     ListInvoicesQuerySortBy = "createdAt"
	ListInvoicesQuerySortByInvoiceDate   ListInvoicesQuerySortBy = "invoiceDate"
	ListInvoicesQuerySortByInvoiceNumber ListInvoicesQuerySortBy = "invoiceNumber"
	ListInvoicesQuerySortByPayableMinor  ListInvoicesQuerySortBy = "payableMinor"
	ListInvoicesQuerySortByDueDate       ListInvoicesQuerySortBy = "dueDate"
	ListInvoicesQuerySortByTaxMinor      ListInvoicesQuerySortBy = "taxMinor"
)

Values of ListInvoicesQuerySortBy.

type ListInvoicesQuerySortOrder

type ListInvoicesQuerySortOrder string

ListInvoicesQuerySortOrder is the type of ListInvoicesQuery.SortOrder. The API may add values.

const (
	ListInvoicesQuerySortOrderASC  ListInvoicesQuerySortOrder = "ASC"
	ListInvoicesQuerySortOrderDesc ListInvoicesQuerySortOrder = "DESC"
)

Values of ListInvoicesQuerySortOrder.

type ListInvoicesQueryStatus

type ListInvoicesQueryStatus string

ListInvoicesQueryStatus is the type of ListInvoicesQuery.Status. The API may add values.

const (
	ListInvoicesQueryStatusDraft               ListInvoicesQueryStatus = "draft"
	ListInvoicesQueryStatusFinalised           ListInvoicesQueryStatus = "finalised"
	ListInvoicesQueryStatusQueued              ListInvoicesQueryStatus = "queued"
	ListInvoicesQueryStatusSigned              ListInvoicesQueryStatus = "signed"
	ListInvoicesQueryStatusTransmitted         ListInvoicesQueryStatus = "transmitted"
	ListInvoicesQueryStatusAccepted            ListInvoicesQueryStatus = "accepted"
	ListInvoicesQueryStatusRejected            ListInvoicesQueryStatus = "rejected"
	ListInvoicesQueryStatusFailed              ListInvoicesQueryStatus = "failed"
	ListInvoicesQueryStatusCancellationPending ListInvoicesQueryStatus = "cancellation_pending"
	ListInvoicesQueryStatusCancelled           ListInvoicesQueryStatus = "cancelled"
)

Values of ListInvoicesQueryStatus.

type ListIssuedHistoryData

type ListIssuedHistoryData = InboundPageDto

ListIssuedHistoryData is the data of a successful GET /i/v1/issued-history.

type ListIssuedHistoryQuery

type ListIssuedHistoryQuery struct {
	// Seller The seller: a name (substring, any case) or a TIN (prefix). A TIN may be typed with its hyphen, without it, or in groups.
	Seller *string `json:"seller,omitempty"`

	// AccessPoint The seller’s access point (`supplier.app_reference`), exact.
	AccessPoint *string `json:"accessPoint,omitempty"`

	// TransmissionStatus As the gateway reports it, exact.
	TransmissionStatus *string `json:"transmissionStatus,omitempty"`

	// PaymentStatus `overdue`: a due date before today and not paid.
	PaymentStatus *ListIssuedHistoryQueryPaymentStatus `json:"paymentStatus,omitempty"`

	// IssueDateFrom Inclusive.
	// Example: "2026-09-01".
	IssueDateFrom *string `json:"issueDateFrom,omitempty"`

	// IssueDateTo Inclusive.
	// Example: "2026-09-30".
	IssueDateTo *string `json:"issueDateTo,omitempty"`

	// ReceivedFrom Inclusive (an instant or a day).
	// Example: "2026-09-01T00:00:00Z".
	ReceivedFrom *string `json:"receivedFrom,omitempty"`

	// ReceivedTo Exclusive for an instant; a calendar day includes that whole day.
	// Example: "2026-10-01T00:00:00Z".
	ReceivedTo *string `json:"receivedTo,omitempty"`

	// AmountMin Payable amount, MAJOR units, inclusive.
	// Example: "1000.00".
	AmountMin *string `json:"amountMin,omitempty"`

	// AmountMax Payable amount, MAJOR units, inclusive.
	// Example: "50000".
	AmountMax *string `json:"amountMax,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	// Q Seller name or TIN, IRN, or the seller’s invoice number (substring, any case). A TIN may be typed with its hyphen, without it, or in groups.
	Q *string `json:"q,omitempty"`

	// TaxID One of `taxpayer.taxIds` (the organisation’s own tax ids in this mode); any other is 400.
	TaxID *string `json:"taxId,omitempty"`

	// Sort Default `-receivedAt`; with `tier=history`, `-issueDate` (a history row’s `receivedAt` is when the access point imported it).
	Sort *ListIssuedHistoryQuerySort `json:"sort,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListIssuedHistoryQuery holds the query parameters of GET /i/v1/issued-history.

type ListIssuedHistoryQueryPaymentStatus

type ListIssuedHistoryQueryPaymentStatus string

ListIssuedHistoryQueryPaymentStatus is the type of ListIssuedHistoryQuery.PaymentStatus. The API may add values.

const (
	ListIssuedHistoryQueryPaymentStatusPaid     ListIssuedHistoryQueryPaymentStatus = "paid"
	ListIssuedHistoryQueryPaymentStatusUnpaid   ListIssuedHistoryQueryPaymentStatus = "unpaid"
	ListIssuedHistoryQueryPaymentStatusPartial  ListIssuedHistoryQueryPaymentStatus = "partial"
	ListIssuedHistoryQueryPaymentStatusRejected ListIssuedHistoryQueryPaymentStatus = "rejected"
	ListIssuedHistoryQueryPaymentStatusOverdue  ListIssuedHistoryQueryPaymentStatus = "overdue"
)

Values of ListIssuedHistoryQueryPaymentStatus.

type ListIssuedHistoryQuerySort

type ListIssuedHistoryQuerySort string

ListIssuedHistoryQuerySort is the type of ListIssuedHistoryQuery.Sort. The API may add values.

const (
	ListIssuedHistoryQuerySortDescReceivedAt ListIssuedHistoryQuerySort = "-receivedAt"
	ListIssuedHistoryQuerySortReceivedAt     ListIssuedHistoryQuerySort = "receivedAt"
	ListIssuedHistoryQuerySortIssueDate      ListIssuedHistoryQuerySort = "issueDate"
	ListIssuedHistoryQuerySortDescIssueDate  ListIssuedHistoryQuerySort = "-issueDate"
	ListIssuedHistoryQuerySortAmount         ListIssuedHistoryQuerySort = "amount"
	ListIssuedHistoryQuerySortDescAmount     ListIssuedHistoryQuerySort = "-amount"
)

Values of ListIssuedHistoryQuerySort.

type ListItemsItem

type ListItemsItem = ItemViewDto

ListItemsItem is one element of the page GET /i/v1/items answers.

type ListItemsQuery

type ListItemsQuery struct {
	// Q Case-insensitive substring over name, description, sku, hsnCode, serviceCode.
	Q *string `json:"q,omitempty"`

	ItemType *ListItemsQueryItemType `json:"itemType,omitempty"`

	// Archived `false` non-archived (default), `true` archived only, `all` both.
	Archived *ListItemsQueryArchived `json:"archived,omitempty"`

	Sort *ListItemsQuerySort `json:"sort,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListItemsQuery holds the query parameters of GET /i/v1/items.

type ListItemsQueryArchived

type ListItemsQueryArchived string

ListItemsQueryArchived is the type of ListItemsQuery.Archived. The API may add values.

const (
	ListItemsQueryArchivedFalse ListItemsQueryArchived = "false"
	ListItemsQueryArchivedTrue  ListItemsQueryArchived = "true"
	ListItemsQueryArchivedAll   ListItemsQueryArchived = "all"
)

Values of ListItemsQueryArchived.

type ListItemsQueryItemType

type ListItemsQueryItemType string

ListItemsQueryItemType is the type of ListItemsQuery.ItemType. The API may add values.

const (
	ListItemsQueryItemTypeGoods   ListItemsQueryItemType = "goods"
	ListItemsQueryItemTypeService ListItemsQueryItemType = "service"
)

Values of ListItemsQueryItemType.

type ListItemsQuerySort

type ListItemsQuerySort string

ListItemsQuerySort is the type of ListItemsQuery.Sort. The API may add values.

const (
	ListItemsQuerySortDescUseCount   ListItemsQuerySort = "-useCount"
	ListItemsQuerySortName           ListItemsQuerySort = "name"
	ListItemsQuerySortDescLastUsedAt ListItemsQuerySort = "-lastUsedAt"
)

Values of ListItemsQuerySort.

type ListLedgerEntriesItem

type ListLedgerEntriesItem = LedgerEntryDto

ListLedgerEntriesItem is one element of the page GET /b/v1/transactions answers.

type ListLedgerEntriesQuery

type ListLedgerEntriesQuery struct {
	// Page Page number (1-based).
	Page *float64 `json:"page,omitempty"`

	// Limit Items per page.
	Limit *float64 `json:"limit,omitempty"`

	Type *ListLedgerEntriesQueryType `json:"type,omitempty"`

	// Group Only the entries of one family: `spend` (a charge with its hold and release), `refund`, `purchase`, `plan` (plan allocations), `allowance` (the sandbox allowance), `transfer`, `pool` (the credit pool), `adjustment`, `expiry` or `reversal` (payment reversals and debt settlements). Combined with `type`, both must match.
	Group *ListLedgerEntriesQueryGroup `json:"group,omitempty"`

	// Holds `show` lists every entry as written. `collapse` leaves out the `hold` and `hold_release` entries of a hold that has settled, so a charge taken through a hold reads once (its `hold` field keeps what was reserved); a hold still open stays in the list. `total` counts what is listed.
	Holds *ListLedgerEntriesQueryHolds `json:"holds,omitempty"`

	// Mode Defaults to the token's mode; API keys may only name their own (403 BIZ108).
	Mode *ListLedgerEntriesQueryMode `json:"mode,omitempty"`

	// StartDate Example: "2026-09-01T00:00:00Z".
	StartDate *string `json:"startDate,omitempty"`

	// EndDate Example: "2026-09-30T23:59:59Z".
	EndDate *string `json:"endDate,omitempty"`

	// CostCode Example: "INVOICE_CREATE".
	CostCode *string `json:"costCode,omitempty"`

	// Reference Exact business reference of the entry (no prefix or wildcard match).
	// Example: "invoice.create:018f2b4c-6a1e-7c3d-9e2f-0a1b2c3d4e5f".
	Reference *string `json:"reference,omitempty"`
}

ListLedgerEntriesQuery holds the query parameters of GET /b/v1/transactions.

type ListLedgerEntriesQueryGroup

type ListLedgerEntriesQueryGroup string

ListLedgerEntriesQueryGroup is the type of ListLedgerEntriesQuery.Group. The API may add values.

const (
	ListLedgerEntriesQueryGroupSpend      ListLedgerEntriesQueryGroup = "spend"
	ListLedgerEntriesQueryGroupRefund     ListLedgerEntriesQueryGroup = "refund"
	ListLedgerEntriesQueryGroupPurchase   ListLedgerEntriesQueryGroup = "purchase"
	ListLedgerEntriesQueryGroupPlan       ListLedgerEntriesQueryGroup = "plan"
	ListLedgerEntriesQueryGroupAllowance  ListLedgerEntriesQueryGroup = "allowance"
	ListLedgerEntriesQueryGroupTransfer   ListLedgerEntriesQueryGroup = "transfer"
	ListLedgerEntriesQueryGroupPool       ListLedgerEntriesQueryGroup = "pool"
	ListLedgerEntriesQueryGroupAdjustment ListLedgerEntriesQueryGroup = "adjustment"
	ListLedgerEntriesQueryGroupExpiry     ListLedgerEntriesQueryGroup = "expiry"
	ListLedgerEntriesQueryGroupReversal   ListLedgerEntriesQueryGroup = "reversal"
)

Values of ListLedgerEntriesQueryGroup.

type ListLedgerEntriesQueryHolds

type ListLedgerEntriesQueryHolds string

ListLedgerEntriesQueryHolds is the type of ListLedgerEntriesQuery.Holds. The API may add values.

const (
	ListLedgerEntriesQueryHoldsShow     ListLedgerEntriesQueryHolds = "show"
	ListLedgerEntriesQueryHoldsCollapse ListLedgerEntriesQueryHolds = "collapse"
)

Values of ListLedgerEntriesQueryHolds.

type ListLedgerEntriesQueryMode

type ListLedgerEntriesQueryMode string

ListLedgerEntriesQueryMode is the type of ListLedgerEntriesQuery.Mode. The API may add values.

const (
	ListLedgerEntriesQueryModeSandbox ListLedgerEntriesQueryMode = "sandbox"
	ListLedgerEntriesQueryModeLive    ListLedgerEntriesQueryMode = "live"
)

Values of ListLedgerEntriesQueryMode.

type ListLedgerEntriesQueryType

type ListLedgerEntriesQueryType string

ListLedgerEntriesQueryType is the type of ListLedgerEntriesQuery.Type. The API may add values.

const (
	ListLedgerEntriesQueryTypeGrantPlan       ListLedgerEntriesQueryType = "grant_plan"
	ListLedgerEntriesQueryTypeGrantPurchase   ListLedgerEntriesQueryType = "grant_purchase"
	ListLedgerEntriesQueryTypeGrantAllowance  ListLedgerEntriesQueryType = "grant_allowance"
	ListLedgerEntriesQueryTypeGrantAdjustment ListLedgerEntriesQueryType = "grant_adjustment"
	ListLedgerEntriesQueryTypeCharge          ListLedgerEntriesQueryType = "charge"
	ListLedgerEntriesQueryTypeHold            ListLedgerEntriesQueryType = "hold"
	ListLedgerEntriesQueryTypeHoldRelease     ListLedgerEntriesQueryType = "hold_release"
	ListLedgerEntriesQueryTypeRefund          ListLedgerEntriesQueryType = "refund"
	ListLedgerEntriesQueryTypeClawback        ListLedgerEntriesQueryType = "clawback"
	ListLedgerEntriesQueryTypeAdjustmentDebit ListLedgerEntriesQueryType = "adjustment_debit"
	ListLedgerEntriesQueryTypeExpiry          ListLedgerEntriesQueryType = "expiry"
	ListLedgerEntriesQueryTypeDebtSettlement  ListLedgerEntriesQueryType = "debt_settlement"
	ListLedgerEntriesQueryTypeTransferOut     ListLedgerEntriesQueryType = "transfer_out"
	ListLedgerEntriesQueryTypeTransferIn      ListLedgerEntriesQueryType = "transfer_in"
	ListLedgerEntriesQueryTypePoolOut         ListLedgerEntriesQueryType = "pool_out"
	ListLedgerEntriesQueryTypePoolIn          ListLedgerEntriesQueryType = "pool_in"
	ListLedgerEntriesQueryTypePoolReturnOut   ListLedgerEntriesQueryType = "pool_return_out"
	ListLedgerEntriesQueryTypePoolReturnIn    ListLedgerEntriesQueryType = "pool_return_in"
)

Values of ListLedgerEntriesQueryType.

type ListPaymentsItem

type ListPaymentsItem = PaymentDto

ListPaymentsItem is one element of the page GET /b/v1/payments/history answers.

type ListPaymentsQuery

type ListPaymentsQuery struct {
	// Page Page number (1-based).
	Page *float64 `json:"page,omitempty"`

	// Limit Items per page.
	Limit *float64 `json:"limit,omitempty"`

	Status *ListPaymentsQueryStatus `json:"status,omitempty"`

	Kind *ListPaymentsQueryKind `json:"kind,omitempty"`
}

ListPaymentsQuery holds the query parameters of GET /b/v1/payments/history.

type ListPaymentsQueryKind

type ListPaymentsQueryKind string

ListPaymentsQueryKind is the type of ListPaymentsQuery.Kind. The API may add values.

const (
	ListPaymentsQueryKindCreditPurchase ListPaymentsQueryKind = "credit_purchase"
	ListPaymentsQueryKindSubscription   ListPaymentsQueryKind = "subscription"
	ListPaymentsQueryKindRenewal        ListPaymentsQueryKind = "renewal"
)

Values of ListPaymentsQueryKind.

type ListPaymentsQueryStatus

type ListPaymentsQueryStatus string

ListPaymentsQueryStatus is the type of ListPaymentsQuery.Status. The API may add values.

const (
	ListPaymentsQueryStatusPending           ListPaymentsQueryStatus = "pending"
	ListPaymentsQueryStatusSucceeded         ListPaymentsQueryStatus = "succeeded"
	ListPaymentsQueryStatusFailed            ListPaymentsQueryStatus = "failed"
	ListPaymentsQueryStatusExpired           ListPaymentsQueryStatus = "expired"
	ListPaymentsQueryStatusPartiallyRefunded ListPaymentsQueryStatus = "partially_refunded"
	ListPaymentsQueryStatusRefunded          ListPaymentsQueryStatus = "refunded"
	ListPaymentsQueryStatusDisputed          ListPaymentsQueryStatus = "disputed"
	ListPaymentsQueryStatusChargedBack       ListPaymentsQueryStatus = "charged_back"
)

Values of ListPaymentsQueryStatus.

type ListSandboxTransactionsItem

type ListSandboxTransactionsItem = LedgerEntryDto

ListSandboxTransactionsItem is one element of the page GET /b/v1/sandbox/transactions answers.

type ListSandboxTransactionsQuery

type ListSandboxTransactionsQuery struct {
	// Page Page number (1-based).
	Page *float64 `json:"page,omitempty"`

	// Limit Items per page.
	Limit *float64 `json:"limit,omitempty"`

	Type *ListSandboxTransactionsQueryType `json:"type,omitempty"`

	// Group Only the entries of one family: `spend` (a charge with its hold and release), `refund`, `purchase`, `plan` (plan allocations), `allowance` (the sandbox allowance), `transfer`, `pool` (the credit pool), `adjustment`, `expiry` or `reversal` (payment reversals and debt settlements). Combined with `type`, both must match.
	Group *ListSandboxTransactionsQueryGroup `json:"group,omitempty"`

	// Holds `show` lists every entry as written. `collapse` leaves out the `hold` and `hold_release` entries of a hold that has settled, so a charge taken through a hold reads once (its `hold` field keeps what was reserved); a hold still open stays in the list. `total` counts what is listed.
	Holds *ListSandboxTransactionsQueryHolds `json:"holds,omitempty"`

	// StartDate Example: "2026-09-01T00:00:00Z".
	StartDate *string `json:"startDate,omitempty"`

	// EndDate Example: "2026-09-30T23:59:59Z".
	EndDate *string `json:"endDate,omitempty"`

	// CostCode Example: "INVOICE_CREATE".
	CostCode *string `json:"costCode,omitempty"`

	// Reference Exact business reference of the entry (no prefix or wildcard match).
	// Example: "invoice.create:018f2b4c-6a1e-7c3d-9e2f-0a1b2c3d4e5f".
	Reference *string `json:"reference,omitempty"`
}

ListSandboxTransactionsQuery holds the query parameters of GET /b/v1/sandbox/transactions.

type ListSandboxTransactionsQueryGroup

type ListSandboxTransactionsQueryGroup string

ListSandboxTransactionsQueryGroup is the type of ListSandboxTransactionsQuery.Group. The API may add values.

const (
	ListSandboxTransactionsQueryGroupSpend      ListSandboxTransactionsQueryGroup = "spend"
	ListSandboxTransactionsQueryGroupRefund     ListSandboxTransactionsQueryGroup = "refund"
	ListSandboxTransactionsQueryGroupPurchase   ListSandboxTransactionsQueryGroup = "purchase"
	ListSandboxTransactionsQueryGroupPlan       ListSandboxTransactionsQueryGroup = "plan"
	ListSandboxTransactionsQueryGroupAllowance  ListSandboxTransactionsQueryGroup = "allowance"
	ListSandboxTransactionsQueryGroupTransfer   ListSandboxTransactionsQueryGroup = "transfer"
	ListSandboxTransactionsQueryGroupPool       ListSandboxTransactionsQueryGroup = "pool"
	ListSandboxTransactionsQueryGroupAdjustment ListSandboxTransactionsQueryGroup = "adjustment"
	ListSandboxTransactionsQueryGroupExpiry     ListSandboxTransactionsQueryGroup = "expiry"
	ListSandboxTransactionsQueryGroupReversal   ListSandboxTransactionsQueryGroup = "reversal"
)

Values of ListSandboxTransactionsQueryGroup.

type ListSandboxTransactionsQueryHolds

type ListSandboxTransactionsQueryHolds string

ListSandboxTransactionsQueryHolds is the type of ListSandboxTransactionsQuery.Holds. The API may add values.

const (
	ListSandboxTransactionsQueryHoldsShow     ListSandboxTransactionsQueryHolds = "show"
	ListSandboxTransactionsQueryHoldsCollapse ListSandboxTransactionsQueryHolds = "collapse"
)

Values of ListSandboxTransactionsQueryHolds.

type ListSandboxTransactionsQueryType

type ListSandboxTransactionsQueryType string

ListSandboxTransactionsQueryType is the type of ListSandboxTransactionsQuery.Type. The API may add values.

const (
	ListSandboxTransactionsQueryTypeGrantPlan       ListSandboxTransactionsQueryType = "grant_plan"
	ListSandboxTransactionsQueryTypeGrantPurchase   ListSandboxTransactionsQueryType = "grant_purchase"
	ListSandboxTransactionsQueryTypeGrantAllowance  ListSandboxTransactionsQueryType = "grant_allowance"
	ListSandboxTransactionsQueryTypeGrantAdjustment ListSandboxTransactionsQueryType = "grant_adjustment"
	ListSandboxTransactionsQueryTypeCharge          ListSandboxTransactionsQueryType = "charge"
	ListSandboxTransactionsQueryTypeHold            ListSandboxTransactionsQueryType = "hold"
	ListSandboxTransactionsQueryTypeHoldRelease     ListSandboxTransactionsQueryType = "hold_release"
	ListSandboxTransactionsQueryTypeRefund          ListSandboxTransactionsQueryType = "refund"
	ListSandboxTransactionsQueryTypeClawback        ListSandboxTransactionsQueryType = "clawback"
	ListSandboxTransactionsQueryTypeAdjustmentDebit ListSandboxTransactionsQueryType = "adjustment_debit"
	ListSandboxTransactionsQueryTypeExpiry          ListSandboxTransactionsQueryType = "expiry"
	ListSandboxTransactionsQueryTypeDebtSettlement  ListSandboxTransactionsQueryType = "debt_settlement"
	ListSandboxTransactionsQueryTypeTransferOut     ListSandboxTransactionsQueryType = "transfer_out"
	ListSandboxTransactionsQueryTypeTransferIn      ListSandboxTransactionsQueryType = "transfer_in"
	ListSandboxTransactionsQueryTypePoolOut         ListSandboxTransactionsQueryType = "pool_out"
	ListSandboxTransactionsQueryTypePoolIn          ListSandboxTransactionsQueryType = "pool_in"
	ListSandboxTransactionsQueryTypePoolReturnOut   ListSandboxTransactionsQueryType = "pool_return_out"
	ListSandboxTransactionsQueryTypePoolReturnIn    ListSandboxTransactionsQueryType = "pool_return_in"
)

Values of ListSandboxTransactionsQueryType.

type ListSellersItem

type ListSellersItem = SellerViewDto

ListSellersItem is one element of the page GET /i/v1/sellers answers.

type ListSellersQuery

type ListSellersQuery struct {
	// Search Name, legal name or tax id. A tax id may be typed with its hyphen, without it, or in groups.
	Search *string `json:"search,omitempty"`

	Page *float64 `json:"page,omitempty"`

	Limit *float64 `json:"limit,omitempty"`
}

ListSellersQuery holds the query parameters of GET /i/v1/sellers.

type ListSubscriptionRenewalsItem

type ListSubscriptionRenewalsItem = SubscriptionPeriodDto

ListSubscriptionRenewalsItem is one element of the page GET /b/v1/subscriptions/renewals answers.

type ListSubscriptionRenewalsQuery

type ListSubscriptionRenewalsQuery struct {
	// Page Page number (1-based).
	Page *float64 `json:"page,omitempty"`

	// Limit Items per page.
	Limit *float64 `json:"limit,omitempty"`

	// SubscriptionID Only this subscription’s periods (must be the caller’s).
	SubscriptionID *string `json:"subscriptionId,omitempty"`
}

ListSubscriptionRenewalsQuery holds the query parameters of GET /b/v1/subscriptions/renewals.

type ListSubscriptionsItem

type ListSubscriptionsItem = SubscriptionDto

ListSubscriptionsItem is one element of the page GET /b/v1/subscriptions/history answers.

type ListSubscriptionsQuery

type ListSubscriptionsQuery struct {
	// Page Page number (1-based).
	Page *float64 `json:"page,omitempty"`

	// Limit Items per page.
	Limit *float64 `json:"limit,omitempty"`
}

ListSubscriptionsQuery holds the query parameters of GET /b/v1/subscriptions/history.

type ListUsedItemCodesItem

type ListUsedItemCodesItem = UsedCodeDto

ListUsedItemCodesItem is one element of the page GET /i/v1/invoices/codes/used answers.

type ListUsedItemCodesQuery

type ListUsedItemCodesQuery struct {
	// Type goods → HS codes; service → service codes.
	Type ListUsedItemCodesQueryType `json:"type"`

	Limit *float64 `json:"limit,omitempty"`
}

ListUsedItemCodesQuery holds the query parameters of GET /i/v1/invoices/codes/used.

type ListUsedItemCodesQueryType

type ListUsedItemCodesQueryType string

ListUsedItemCodesQueryType is the type of ListUsedItemCodesQuery.Type. The API may add values.

const (
	ListUsedItemCodesQueryTypeGoods   ListUsedItemCodesQueryType = "goods"
	ListUsedItemCodesQueryTypeService ListUsedItemCodesQueryType = "service"
)

Values of ListUsedItemCodesQueryType.

type ListWebhookDeliveriesItem

type ListWebhookDeliveriesItem = WebhookDeliveryDto

ListWebhookDeliveriesItem is one element of the page GET /n/v1/webhook-deliveries answers.

type ListWebhookDeliveriesQuery

type ListWebhookDeliveriesQuery struct {
	Page *int64 `json:"page,omitempty"`

	Limit *int64 `json:"limit,omitempty"`

	EndpointID *string `json:"endpointId,omitempty"`

	Status *ListWebhookDeliveriesQueryStatus `json:"status,omitempty"`

	// Type Example: "invoice.signed".
	Type *string `json:"type,omitempty"`
}

ListWebhookDeliveriesQuery holds the query parameters of GET /n/v1/webhook-deliveries.

type ListWebhookDeliveriesQueryStatus

type ListWebhookDeliveriesQueryStatus string

ListWebhookDeliveriesQueryStatus is the type of ListWebhookDeliveriesQuery.Status. The API may add values.

const (
	ListWebhookDeliveriesQueryStatusPending    ListWebhookDeliveriesQueryStatus = "pending"
	ListWebhookDeliveriesQueryStatusDelivering ListWebhookDeliveriesQueryStatus = "delivering"
	ListWebhookDeliveriesQueryStatusRetrying   ListWebhookDeliveriesQueryStatus = "retrying"
	ListWebhookDeliveriesQueryStatusDelivered  ListWebhookDeliveriesQueryStatus = "delivered"
	ListWebhookDeliveriesQueryStatusFailed     ListWebhookDeliveriesQueryStatus = "failed"
)

Values of ListWebhookDeliveriesQueryStatus.

type ListWebhookEndpointsItem

type ListWebhookEndpointsItem = WebhookEndpointDto

ListWebhookEndpointsItem is one element of the page GET /n/v1/webhook-endpoints answers.

type ListWebhookEventTypesItem

type ListWebhookEventTypesItem = WebhookEventTypeDto

ListWebhookEventTypesItem is one element of the page GET /n/v1/webhook-event-types answers.

type ListWebhookEventsItem

type ListWebhookEventsItem = WebhookEventDto

ListWebhookEventsItem is one element of the page GET /n/v1/webhook-events answers.

type ListWebhookEventsQuery

type ListWebhookEventsQuery struct {
	Page *int64 `json:"page,omitempty"`

	Limit *int64 `json:"limit,omitempty"`

	// Type Example: "invoice.signed".
	Type *string `json:"type,omitempty"`

	From *string `json:"from,omitempty"`

	To *string `json:"to,omitempty"`
}

ListWebhookEventsQuery holds the query parameters of GET /n/v1/webhook-events.

type LiveUsageDto

type LiveUsageDto struct {
	Available int64 `json:"available"`

	Held int64 `json:"held"`

	Window *AllocationWindowDto `json:"window"`
}

LiveUsageDto is `billing.LiveUsageDto`.

type LoadOlderInboundInvoicesData

type LoadOlderInboundInvoicesData = InboundLoadOlderDto

LoadOlderInboundInvoicesData is the data of a successful POST /i/v1/inbound-invoices/load-older.

type LookupTaxIdData

type LookupTaxIdData = TaxIdLookupDto

LookupTaxIdData is the data of a successful GET /i/v1/invoices/lookup/tax-id/{value}.

type LookupTaxIdQuery

type LookupTaxIdQuery struct {
	Type *LookupTaxIdQueryType `json:"type,omitempty"`
}

LookupTaxIdQuery holds the query parameters of GET /i/v1/invoices/lookup/tax-id/{value}.

type LookupTaxIdQueryType

type LookupTaxIdQueryType string

LookupTaxIdQueryType is the type of LookupTaxIdQuery.Type. The API may add values.

const (
	LookupTaxIdQueryTypeTIN     LookupTaxIdQueryType = "tin"
	LookupTaxIdQueryTypeRn      LookupTaxIdQueryType = "rn"
	LookupTaxIdQueryTypeForeign LookupTaxIdQueryType = "foreign"
)

Values of LookupTaxIdQueryType.

type Mode

type Mode string

Mode is the key's mode: `sk_test_…` is ModeSandbox, `sk_live_…` is ModeLive, on the same host.

const (
	// ModeSandbox is the mode of an `sk_test_` key.
	ModeSandbox Mode = "sandbox"
	// ModeLive is the mode of an `sk_live_` key.
	ModeLive Mode = "live"
)

func ModeOfAPIKey

func ModeOfAPIKey(apiKey string) (Mode, error)

ModeOfAPIKey returns the mode a key belongs to, or a *ConfigError for a malformed key (never echoing it).

type MonthBucketDto

type MonthBucketDto struct {
	Count float64 `json:"count"`

	// GrossPayableMinor MINOR units, reporting currency.
	GrossPayableMinor float64 `json:"grossPayableMinor"`

	// Month Example: "2026-09".
	Month string `json:"month"`

	InputVATMinor float64 `json:"inputVatMinor"`
}

MonthBucketDto is `invoice.MonthBucketDto`.

type NextExpiryDto

type NextExpiryDto struct {
	// Credits Credits in the soonest-expiring lot(s).
	Credits int64 `json:"credits"`

	At string `json:"at"`
}

NextExpiryDto is `billing.NextExpiryDto`.

type NotFoundError

type NotFoundError struct{ *APIError }

NotFoundError is 404: the resource does not exist or is not this organisation's (`RES001`).

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type NotePreviewLineDto

type NotePreviewLineDto struct {
	LineNo int64 `json:"lineNo"`

	// CreditsLineNo The original line it credits.
	CreditsLineNo *int64 `json:"creditsLineNo"`

	Description string `json:"description"`

	// Quantity Example: "2.000000".
	Quantity string `json:"quantity"`

	// UnitPrice Example: "50000.0000".
	UnitPrice string `json:"unitPrice"`

	// LineNetMinor Integer minor units.
	LineNetMinor int64 `json:"lineNetMinor"`

	// LineTaxMinor Integer minor units.
	LineTaxMinor int64 `json:"lineTaxMinor"`

	// LineTotalMinor Integer minor units.
	LineTotalMinor int64 `json:"lineTotalMinor"`
}

NotePreviewLineDto is `invoice.NotePreviewLineDto`.

type NotePreviewTotalsDto

type NotePreviewTotalsDto struct {
	// TaxExclusiveMinor Integer minor units.
	TaxExclusiveMinor int64 `json:"taxExclusiveMinor"`

	// TaxMinor Integer minor units.
	TaxMinor int64 `json:"taxMinor"`

	// PayableMinor Integer minor units.
	PayableMinor int64 `json:"payableMinor"`
}

NotePreviewTotalsDto is `invoice.NotePreviewTotalsDto`.

type NotificationApiPaginationMetaDto

type NotificationApiPaginationMetaDto struct {
	// Total Example: 137.
	Total float64 `json:"total"`

	// Page 1-based page number.
	// Example: 1.
	Page float64 `json:"page"`

	// PageSize Items per page (the `limit` query parameter).
	// Example: 20.
	PageSize float64 `json:"pageSize"`

	// TotalPages `ceil(total / pageSize)`; an empty set is 0 pages.
	// Example: 7.
	TotalPages float64 `json:"totalPages"`

	// HasNext Example: true.
	HasNext bool `json:"hasNext"`

	// HasPrevious Example: false.
	HasPrevious bool `json:"hasPrevious"`

	NextPage *string `json:"nextPage,omitempty"`

	PreviousPage *string `json:"previousPage,omitempty"`

	CurrentPage *string `json:"currentPage,omitempty"`
}

NotificationApiPaginationMetaDto is `notification.ApiPaginationMetaDto`.

type NotificationApiSuccessMetaDto

type NotificationApiSuccessMetaDto struct {
	// StatusCode Example: 200.
	StatusCode float64 `json:"statusCode"`

	// Success Example: true.
	Success bool `json:"success"`

	// Message Copy for humans. Never branch on it.
	// Example: "Success".
	Message string `json:"message"`

	Errors []map[string]string `json:"errors"`

	// Timestamp Example: "2026-09-29T10:00:00.000Z".
	Timestamp string `json:"timestamp"`

	// RequestID This service’s request id (also the `x-request-id` header) — quote it in a bug report.
	RequestID string `json:"requestId"`

	// Pagination Present on list responses.
	Pagination *NotificationApiPaginationMetaDto `json:"pagination,omitempty"`
}

NotificationApiSuccessMetaDto is `notification.ApiSuccessMetaDto`.

type Option

type Option func(*clientConfig)

Option configures New and NewHttpClient.

func WithAssertMode

func WithAssertMode(mode Mode) Option

WithAssertMode makes New fail unless the key is of this mode, so a deployment refuses to start with a key of the other mode.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL overrides the API host (advanced: a local gateway in development). The default is the production gateway for both modes; never switch hosts by mode.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient sends with this *http.Client (its own Timeout is not needed: the SDK bounds each attempt).

func WithHeaders

func WithHeaders(h map[string]string) Option

WithHeaders adds headers sent on every request. `Authorization` cannot be overridden.

func WithRetry

func WithRetry(r RetryConfig) Option

WithRetry sets the retry behaviour.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the request timeout (default 30 s). It bounds each attempt, headers and body.

func WithTransport

func WithTransport(t Transport) Option

WithTransport sends with this Transport (a recorder in tests, a wrapped client in production).

type OrganizationProfileResponseDto

type OrganizationProfileResponseDto struct {
	ID string `json:"id"`

	Name string `json:"name"`

	LegalName *string `json:"legalName"`

	// TIN Normalised TIN, set only by a verification.
	TIN *string `json:"tin"`

	TINStatus OrganizationProfileResponseDtoTINStatus `json:"tinStatus"`

	TINVerifiedAt *string `json:"tinVerifiedAt"`

	// Country Example: "NG".
	Country string `json:"country"`

	ContactEmail *string `json:"contactEmail"`

	// ContactPhone Example: "+2348012345678".
	ContactPhone *string `json:"contactPhone"`

	PhoneVerified bool `json:"phoneVerified"`

	Website *string `json:"website"`

	Address *AddressResponseDto `json:"address"`

	// LogoURL Public URL of the organisation logo, or null when none is set.
	LogoURL *string `json:"logoUrl"`

	OnboardingCompletedAt *string `json:"onboardingCompletedAt"`

	LiveStatus OrganizationProfileResponseDtoLiveStatus `json:"liveStatus"`

	CreatedAt string `json:"createdAt"`

	// Type Derived from the parent; never stored.
	Type OrganizationProfileResponseDtoType `json:"type"`

	ParentOrganizationID *string `json:"parentOrganizationId"`

	// SellerCode The seller code every document number of this organisation carries (3 to 5 capital letters, unique).
	// Example: "EKA".
	SellerCode string `json:"sellerCode"`

	// SellerCodeLocked True once the first document has been numbered under the seller code; it can no longer be changed.
	SellerCodeLocked bool `json:"sellerCodeLocked"`
}

OrganizationProfileResponseDto is `auth.OrganizationProfileResponseDto`.

type OrganizationProfileResponseDtoLiveStatus

type OrganizationProfileResponseDtoLiveStatus string

OrganizationProfileResponseDtoLiveStatus is the type of OrganizationProfileResponseDto.LiveStatus. The API may add values.

const (
	OrganizationProfileResponseDtoLiveStatusNotRequested  OrganizationProfileResponseDtoLiveStatus = "not_requested"
	OrganizationProfileResponseDtoLiveStatusPendingReview OrganizationProfileResponseDtoLiveStatus = "pending_review"
	OrganizationProfileResponseDtoLiveStatusApproved      OrganizationProfileResponseDtoLiveStatus = "approved"
	OrganizationProfileResponseDtoLiveStatusRejected      OrganizationProfileResponseDtoLiveStatus = "rejected"
	OrganizationProfileResponseDtoLiveStatusRevoked       OrganizationProfileResponseDtoLiveStatus = "revoked"
)

Values of OrganizationProfileResponseDtoLiveStatus.

type OrganizationProfileResponseDtoTINStatus

type OrganizationProfileResponseDtoTINStatus string

OrganizationProfileResponseDtoTINStatus is the type of OrganizationProfileResponseDto.TINStatus. The API may add values.

const (
	OrganizationProfileResponseDtoTINStatusUnverified  OrganizationProfileResponseDtoTINStatus = "unverified"
	OrganizationProfileResponseDtoTINStatusPending     OrganizationProfileResponseDtoTINStatus = "pending"
	OrganizationProfileResponseDtoTINStatusVerified    OrganizationProfileResponseDtoTINStatus = "verified"
	OrganizationProfileResponseDtoTINStatusFailed      OrganizationProfileResponseDtoTINStatus = "failed"
	OrganizationProfileResponseDtoTINStatusUnavailable OrganizationProfileResponseDtoTINStatus = "unavailable"
)

Values of OrganizationProfileResponseDtoTINStatus.

type OrganizationProfileResponseDtoType

type OrganizationProfileResponseDtoType string

OrganizationProfileResponseDtoType is the type of OrganizationProfileResponseDto.Type. The API may add values.

const (
	OrganizationProfileResponseDtoTypePrimary   OrganizationProfileResponseDtoType = "primary"
	OrganizationProfileResponseDtoTypeSecondary OrganizationProfileResponseDtoType = "secondary"
)

Values of OrganizationProfileResponseDtoType.

type OrganizationService

type OrganizationService struct {
	// contains filtered or unexported fields
}

OrganizationService is the key's organisation (`/a/v1/organizations`): its profile and readiness. Read-only for an API key.

func (*OrganizationService) Get

Get is the organisation's profile; orgID must be the key's own organisation (404 otherwise; `organization.read`).

func (*OrganizationService) GetReadiness

GetReadiness is the onboarding checklist, the live-access status and the next step (`organization.read`).

type OutputService

type OutputService struct {
	// contains filtered or unexported fields
}

OutputService is output (`/i/v1/invoices/:id/download|send`): the invoice PDF and sending it to the buyer.

func (*OutputService) DownloadPDF

func (s *OutputService) DownloadPDF(ctx context.Context, id string, opts ...RequestOption) (*BinaryResponse, error)

DownloadPDF is the invoice PDF itself (`invoice.download_pdf`; same route with `Accept: application/pdf`; charged as one download). Sends an `Idempotency-Key`, like GetDownloadLink.

func (s *OutputService) GetDownloadLink(ctx context.Context, id string, opts ...RequestOption) (*DownloadInvoiceData, error)

GetDownloadLink is a short-lived download link to the invoice PDF (`invoice.download_pdf`; charged as one download). Sends an `Idempotency-Key`, so an SDK retry is not charged twice; the backend binds a key to the invoice it first downloaded (reusing it for another invoice is 409 `BIZ107`).

func (*OutputService) Send

func (s *OutputService) Send(ctx context.Context, id string, params *SendInvoiceBody, opts ...RequestOption) (*SendInvoiceData, error)

Send emails the invoice to the buyer's address on record (`invoice.send_to_buyer`; 202 = queued). In sandbox no email leaves; `ShareURL` previews the PDF. Sends an `Idempotency-Key`.

type OutputTaxTotalDto

type OutputTaxTotalDto struct {
	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// InvoicesTaxMinor Tax of the registered invoices. Integer minor units.
	InvoicesTaxMinor int64 `json:"invoicesTaxMinor"`

	// CreditNotesTaxMinor Tax of the registered credit notes. Integer minor units.
	CreditNotesTaxMinor int64 `json:"creditNotesTaxMinor"`

	// NetTaxMinor Invoices’ tax less credit notes’ tax; negative when credits exceed sales. Integer minor units.
	NetTaxMinor int64 `json:"netTaxMinor"`
}

OutputTaxTotalDto is `invoice.OutputTaxTotalDto`.

type OverviewAlertsDto

type OverviewAlertsDto struct {
	FailedInvoices int64 `json:"failedInvoices"`

	UnverifiedSellers int64 `json:"unverifiedSellers"`

	UnverifiedBuyers int64 `json:"unverifiedBuyers"`
}

OverviewAlertsDto is `invoice.OverviewAlertsDto`.

type OverviewCollectionsDto

type OverviewCollectionsDto struct {
	Outstanding []CurrencyAmountDto `json:"outstanding"`

	OverdueCount int64 `json:"overdueCount"`
}

OverviewCollectionsDto is `invoice.OverviewCollectionsDto`.

type OverviewCurrencyValueDto

type OverviewCurrencyValueDto struct {
	// Currency Example: "NGN".
	Currency string `json:"currency"`

	// ValueMinor Integer minor units.
	ValueMinor int64 `json:"valueMinor"`

	Count int64 `json:"count"`
}

OverviewCurrencyValueDto is `invoice.OverviewCurrencyValueDto`.

type OverviewKpisDto

type OverviewKpisDto struct {
	Volume OverviewVolumeKpiDto `json:"volume"`

	SuccessRate OverviewSuccessRateKpiDto `json:"successRate"`

	ValueProcessed OverviewValueProcessedKpiDto `json:"valueProcessed"`

	AvgProcessingTime OverviewProcessingTimeKpiDto `json:"avgProcessingTime"`
}

OverviewKpisDto is `invoice.OverviewKpisDto`.

type OverviewPaymentStatusDto

type OverviewPaymentStatusDto struct {
	Unpaid int64 `json:"unpaid"`

	PartiallyPaid int64 `json:"partiallyPaid"`

	Paid int64 `json:"paid"`

	Overdue int64 `json:"overdue"`
}

OverviewPaymentStatusDto is `invoice.OverviewPaymentStatusDto`.

type OverviewProcessingTimeKpiDto

type OverviewProcessingTimeKpiDto struct {
	Seconds *float64 `json:"seconds"`

	DeltaSeconds *float64 `json:"deltaSeconds"`
}

OverviewProcessingTimeKpiDto is `invoice.OverviewProcessingTimeKpiDto`.

type OverviewReadinessDto

type OverviewReadinessDto struct {
	Sellers int64 `json:"sellers"`

	SellersVerified int64 `json:"sellersVerified"`

	Buyers int64 `json:"buyers"`

	BuyersVerified int64 `json:"buyersVerified"`
}

OverviewReadinessDto is `invoice.OverviewReadinessDto`.

type OverviewSuccessRateKpiDto

type OverviewSuccessRateKpiDto struct {
	Value float64 `json:"value"`

	// DeltaPp Change on the previous window, percentage points.
	DeltaPp *float64 `json:"deltaPp"`

	Spark []float64 `json:"spark"`
}

OverviewSuccessRateKpiDto is `invoice.OverviewSuccessRateKpiDto`.

type OverviewTrendPointDto

type OverviewTrendPointDto struct {
	// Date Example: "2026-09-30".
	Date string `json:"date"`

	Created int64 `json:"created"`

	Submitted int64 `json:"submitted"`

	Accepted int64 `json:"accepted"`

	Failed int64 `json:"failed"`

	SuccessRate float64 `json:"successRate"`
}

OverviewTrendPointDto is `invoice.OverviewTrendPointDto`.

type OverviewValueProcessedKpiDto

type OverviewValueProcessedKpiDto struct {
	// PrimaryCurrency Example: "NGN".
	PrimaryCurrency *string `json:"primaryCurrency"`

	// PrimaryValueMinor Integer minor units.
	PrimaryValueMinor int64 `json:"primaryValueMinor"`

	DeltaPct *float64 `json:"deltaPct"`

	ByCurrency []OverviewCurrencyValueDto `json:"byCurrency"`

	// SparkMinor Integer minor units.
	SparkMinor []int64 `json:"sparkMinor"`
}

OverviewValueProcessedKpiDto is `invoice.OverviewValueProcessedKpiDto`.

type OverviewVolumeKpiDto

type OverviewVolumeKpiDto struct {
	Value int64 `json:"value"`

	// DeltaPct Percent change on the previous window.
	DeltaPct *float64 `json:"deltaPct"`

	Spark []int64 `json:"spark"`
}

OverviewVolumeKpiDto is `invoice.OverviewVolumeKpiDto`.

type OverviewWindowDto

type OverviewWindowDto struct {
	Days int64 `json:"days"`

	Start string `json:"start"`

	End string `json:"end"`
}

OverviewWindowDto is `invoice.OverviewWindowDto`.

type Page

type Page[T any] struct {
	Data       []T
	Pagination PaginationMeta
	// RequestID is the request id of the answer.
	RequestID string
}

Page is a list answer: the items and `meta.pagination`.

type Paginated

type Paginated[D any] struct {
	Data       D
	Pagination *PaginationMeta
	// RequestID is the request id of the answer.
	RequestID string
}

Paginated is an answer whose `data` is an object that also carries `meta.pagination` (received invoices, issued history): `Data.Items` holds the page.

type PaginationMeta

type PaginationMeta struct {
	Total int64 `json:"total"`
	// Page is the 1-based page number.
	Page int64 `json:"page"`
	// PageSize is the number of items per page (the `limit` query parameter).
	PageSize int64 `json:"pageSize"`
	// TotalPages is `ceil(total / pageSize)`; an empty set is 0 pages.
	TotalPages   int64  `json:"totalPages"`
	HasNext      bool   `json:"hasNext"`
	HasPrevious  bool   `json:"hasPrevious"`
	NextPage     string `json:"nextPage,omitempty"`
	PreviousPage string `json:"previousPage,omitempty"`
	CurrentPage  string `json:"currentPage,omitempty"`
}

PaginationMeta is `meta.pagination` on a list answer (wire names in the json tags).

type PartyAddressDto

type PartyAddressDto struct {
	Line1 string `json:"line1"`

	// Line2 Left out when not recorded.
	Line2 *string `json:"line2,omitempty"`

	City string `json:"city"`

	// State Left out when not recorded.
	State *string `json:"state,omitempty"`

	// Lga Local government area; left out when not recorded.
	Lga *string `json:"lga,omitempty"`

	// PostalCode Left out when not recorded.
	PostalCode *string `json:"postalCode,omitempty"`

	// Country ISO 3166-1 alpha-2.
	// Example: "NG".
	Country string `json:"country"`
}

PartyAddressDto is `invoice.PartyAddressDto`.

type PaymentBreakdownDto

type PaymentBreakdownDto struct {
	Paid AmountBucketDto `json:"paid"`

	Unpaid AmountBucketDto `json:"unpaid"`

	Partial AmountBucketDto `json:"partial"`

	Rejected AmountBucketDto `json:"rejected"`

	// Unknown No payment status known yet.
	Unknown AmountBucketDto `json:"unknown"`

	// Overdue Overlaps the others: due before today and not paid.
	Overdue AmountBucketDto `json:"overdue"`
}

PaymentBreakdownDto is `invoice.PaymentBreakdownDto`.

type PaymentDetailDto

type PaymentDetailDto struct {
	PaymentID string `json:"paymentId"`

	Kind PaymentDetailDtoKind `json:"kind"`

	Status PaymentDetailDtoStatus `json:"status"`

	// StatusReason Example: "amount_mismatch".
	StatusReason *string `json:"statusReason"`

	Provider PaymentDetailDtoProvider `json:"provider"`

	// ProviderReference The provider's reference for the latest checkout attempt, as the provider's receipt shows it (Paystack `<paymentId>.<attempt>`, a Stripe checkout session id); null until a checkout was started. An identifier, never a secret.
	// Example: "01a0fc8a-c3ec-7079-8cb9-83f91d186a69.1".
	ProviderReference *string `json:"providerReference"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	Currency PaymentDetailDtoCurrency `json:"currency"`

	// Credits Credits a credit purchase grants; null otherwise.
	Credits *int64 `json:"credits"`

	// RefundedMinor Integer minor units refunded so far.
	RefundedMinor int64 `json:"refundedMinor"`

	SubscriptionID *string `json:"subscriptionId"`

	CreatedAt string `json:"createdAt"`

	SettledAt *string `json:"settledAt"`

	// CheckoutURL Present only while status is pending; absent otherwise.
	CheckoutURL *string `json:"checkoutUrl,omitempty"`
}

PaymentDetailDto is `billing.PaymentDetailDto`.

type PaymentDetailDtoCurrency

type PaymentDetailDtoCurrency string

PaymentDetailDtoCurrency is the type of PaymentDetailDto.Currency. The API may add values.

const (
	PaymentDetailDtoCurrencyNGN PaymentDetailDtoCurrency = "NGN"
	PaymentDetailDtoCurrencyUSD PaymentDetailDtoCurrency = "USD"
)

Values of PaymentDetailDtoCurrency.

type PaymentDetailDtoKind

type PaymentDetailDtoKind string

PaymentDetailDtoKind is the type of PaymentDetailDto.Kind. The API may add values.

const (
	PaymentDetailDtoKindCreditPurchase PaymentDetailDtoKind = "credit_purchase"
	PaymentDetailDtoKindSubscription   PaymentDetailDtoKind = "subscription"
	PaymentDetailDtoKindRenewal        PaymentDetailDtoKind = "renewal"
)

Values of PaymentDetailDtoKind.

type PaymentDetailDtoProvider

type PaymentDetailDtoProvider string

PaymentDetailDtoProvider is the type of PaymentDetailDto.Provider. The API may add values.

const (
	PaymentDetailDtoProviderPaystack PaymentDetailDtoProvider = "paystack"
	PaymentDetailDtoProviderStripe   PaymentDetailDtoProvider = "stripe"
)

Values of PaymentDetailDtoProvider.

type PaymentDetailDtoStatus

type PaymentDetailDtoStatus string

PaymentDetailDtoStatus is the type of PaymentDetailDto.Status. The API may add values.

const (
	PaymentDetailDtoStatusPending           PaymentDetailDtoStatus = "pending"
	PaymentDetailDtoStatusSucceeded         PaymentDetailDtoStatus = "succeeded"
	PaymentDetailDtoStatusFailed            PaymentDetailDtoStatus = "failed"
	PaymentDetailDtoStatusExpired           PaymentDetailDtoStatus = "expired"
	PaymentDetailDtoStatusPartiallyRefunded PaymentDetailDtoStatus = "partially_refunded"
	PaymentDetailDtoStatusRefunded          PaymentDetailDtoStatus = "refunded"
	PaymentDetailDtoStatusDisputed          PaymentDetailDtoStatus = "disputed"
	PaymentDetailDtoStatusChargedBack       PaymentDetailDtoStatus = "charged_back"
)

Values of PaymentDetailDtoStatus.

type PaymentDto

type PaymentDto struct {
	PaymentID string `json:"paymentId"`

	Kind PaymentDtoKind `json:"kind"`

	Status PaymentDtoStatus `json:"status"`

	// StatusReason Example: "amount_mismatch".
	StatusReason *string `json:"statusReason"`

	Provider PaymentDtoProvider `json:"provider"`

	// ProviderReference The provider's reference for the latest checkout attempt, as the provider's receipt shows it (Paystack `<paymentId>.<attempt>`, a Stripe checkout session id); null until a checkout was started. An identifier, never a secret.
	// Example: "01a0fc8a-c3ec-7079-8cb9-83f91d186a69.1".
	ProviderReference *string `json:"providerReference"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	Currency PaymentDtoCurrency `json:"currency"`

	// Credits Credits a credit purchase grants; null otherwise.
	Credits *int64 `json:"credits"`

	// RefundedMinor Integer minor units refunded so far.
	RefundedMinor int64 `json:"refundedMinor"`

	SubscriptionID *string `json:"subscriptionId"`

	CreatedAt string `json:"createdAt"`

	SettledAt *string `json:"settledAt"`
}

PaymentDto is `billing.PaymentDto`.

type PaymentDtoCurrency

type PaymentDtoCurrency string

PaymentDtoCurrency is the type of PaymentDto.Currency. The API may add values.

const (
	PaymentDtoCurrencyNGN PaymentDtoCurrency = "NGN"
	PaymentDtoCurrencyUSD PaymentDtoCurrency = "USD"
)

Values of PaymentDtoCurrency.

type PaymentDtoKind

type PaymentDtoKind string

PaymentDtoKind is the type of PaymentDto.Kind. The API may add values.

const (
	PaymentDtoKindCreditPurchase PaymentDtoKind = "credit_purchase"
	PaymentDtoKindSubscription   PaymentDtoKind = "subscription"
	PaymentDtoKindRenewal        PaymentDtoKind = "renewal"
)

Values of PaymentDtoKind.

type PaymentDtoProvider

type PaymentDtoProvider string

PaymentDtoProvider is the type of PaymentDto.Provider. The API may add values.

const (
	PaymentDtoProviderPaystack PaymentDtoProvider = "paystack"
	PaymentDtoProviderStripe   PaymentDtoProvider = "stripe"
)

Values of PaymentDtoProvider.

type PaymentDtoStatus

type PaymentDtoStatus string

PaymentDtoStatus is the type of PaymentDto.Status. The API may add values.

const (
	PaymentDtoStatusPending           PaymentDtoStatus = "pending"
	PaymentDtoStatusSucceeded         PaymentDtoStatus = "succeeded"
	PaymentDtoStatusFailed            PaymentDtoStatus = "failed"
	PaymentDtoStatusExpired           PaymentDtoStatus = "expired"
	PaymentDtoStatusPartiallyRefunded PaymentDtoStatus = "partially_refunded"
	PaymentDtoStatusRefunded          PaymentDtoStatus = "refunded"
	PaymentDtoStatusDisputed          PaymentDtoStatus = "disputed"
	PaymentDtoStatusChargedBack       PaymentDtoStatus = "charged_back"
)

Values of PaymentDtoStatus.

type PaymentStatusDto

type PaymentStatusDto struct {
	// Status unpaid is local only (refused once anything was reported); payment_failed follows an accepted part or full payment.
	Status PaymentStatusDtoStatus `json:"status"`

	// AmountMinor Integer minor units; required for partially_paid: the TOTAL received to date (cumulative), not the installment.
	AmountMinor *int64 `json:"amountMinor,omitempty"`

	Reference *string `json:"reference,omitempty"`

	Note *string `json:"note,omitempty"`
}

PaymentStatusDto is `invoice.PaymentStatusDto`.

type PaymentStatusDtoStatus

type PaymentStatusDtoStatus string

PaymentStatusDtoStatus is the type of PaymentStatusDto.Status. The API may add values.

const (
	PaymentStatusDtoStatusUnpaid        PaymentStatusDtoStatus = "unpaid"
	PaymentStatusDtoStatusPartiallyPaid PaymentStatusDtoStatus = "partially_paid"
	PaymentStatusDtoStatusPaid          PaymentStatusDtoStatus = "paid"
	PaymentStatusDtoStatusPaymentFailed PaymentStatusDtoStatus = "payment_failed"
)

Values of PaymentStatusDtoStatus.

type PaymentsService

type PaymentsService struct {
	// contains filtered or unexported fields
}

PaymentsService is payments (`/b/v1/payments`): read-only for an API key (purchases are made in the dashboard).

func (*PaymentsService) Get

Get is one payment (`billing.payment.read`).

func (*PaymentsService) List

List lists payments, newest first (`billing.payment.read`).

type PermissionError

type PermissionError struct{ *APIError }

PermissionError is 403: the key lacks a capability (`AUTH019`), the route does not accept an API key (`AUTH018`), or a business rule forbids it.

func (*PermissionError) Unwrap

func (e *PermissionError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type PlanChangeDto

type PlanChangeDto struct {
	ID string `json:"id"`

	// Timing `immediate`: paid now by checkout; `period_end`: applied at the period boundary.
	Timing PlanChangeDtoTiming `json:"timing"`

	Status PlanChangeDtoStatus `json:"status"`

	// FromPlanCode Example: "starter".
	FromPlanCode string `json:"fromPlanCode"`

	FromInterval PlanChangeDtoFromInterval `json:"fromInterval"`

	// ToPlanCode Example: "professional".
	ToPlanCode string `json:"toPlanCode"`

	ToPlanName string `json:"toPlanName"`

	ToInterval PlanChangeDtoToInterval `json:"toInterval"`

	Currency PlanChangeDtoCurrency `json:"currency"`

	// RecurringAmountMinor The new plan’s price per period, integer minor units — what every renewal charges.
	RecurringAmountMinor int64 `json:"recurringAmountMinor"`

	// MonthlyCredits The new plan’s credits per monthly window.
	MonthlyCredits int64 `json:"monthlyCredits"`

	// CreditMinor The value of the paid period’s allocation windows not yet issued, credited against the new price (0 at period end).
	CreditMinor int64 `json:"creditMinor"`

	// AmountDueMinor What the checkout charges (new price less the credit); null for a period-end change.
	AmountDueMinor *int64 `json:"amountDueMinor"`

	// WindowsUnissued Allocation windows of the paid period credited and never issued; null for a period-end change.
	WindowsUnissued *int64 `json:"windowsUnissued"`

	// EffectiveAt The boundary of a period-end change; the settlement instant once a change now is applied; null while it awaits payment.
	EffectiveAt *string `json:"effectiveAt"`

	PaymentID *string `json:"paymentId"`

	// TargetSubscriptionID The subscription a change now activates when its payment settles.
	TargetSubscriptionID *string `json:"targetSubscriptionId"`

	CreatedAt string `json:"createdAt"`
}

PlanChangeDto is `billing.PlanChangeDto`.

type PlanChangeDtoCurrency

type PlanChangeDtoCurrency string

PlanChangeDtoCurrency is the type of PlanChangeDto.Currency. The API may add values.

const (
	PlanChangeDtoCurrencyNGN PlanChangeDtoCurrency = "NGN"
	PlanChangeDtoCurrencyUSD PlanChangeDtoCurrency = "USD"
)

Values of PlanChangeDtoCurrency.

type PlanChangeDtoFromInterval

type PlanChangeDtoFromInterval string

PlanChangeDtoFromInterval is the type of PlanChangeDto.FromInterval. The API may add values.

const (
	PlanChangeDtoFromIntervalMonthly PlanChangeDtoFromInterval = "monthly"
	PlanChangeDtoFromIntervalYearly  PlanChangeDtoFromInterval = "yearly"
)

Values of PlanChangeDtoFromInterval.

type PlanChangeDtoStatus

type PlanChangeDtoStatus string

PlanChangeDtoStatus is the type of PlanChangeDto.Status. The API may add values.

const (
	PlanChangeDtoStatusPendingPayment PlanChangeDtoStatus = "pending_payment"
	PlanChangeDtoStatusScheduled      PlanChangeDtoStatus = "scheduled"
	PlanChangeDtoStatusApplied        PlanChangeDtoStatus = "applied"
	PlanChangeDtoStatusCancelled      PlanChangeDtoStatus = "cancelled"
	PlanChangeDtoStatusExpired        PlanChangeDtoStatus = "expired"
)

Values of PlanChangeDtoStatus.

type PlanChangeDtoTiming

type PlanChangeDtoTiming string

PlanChangeDtoTiming is the type of PlanChangeDto.Timing. The API may add values.

const (
	PlanChangeDtoTimingImmediate PlanChangeDtoTiming = "immediate"
	PlanChangeDtoTimingPeriodEnd PlanChangeDtoTiming = "period_end"
)

Values of PlanChangeDtoTiming.

type PlanChangeDtoToInterval

type PlanChangeDtoToInterval string

PlanChangeDtoToInterval is the type of PlanChangeDto.ToInterval. The API may add values.

const (
	PlanChangeDtoToIntervalMonthly PlanChangeDtoToInterval = "monthly"
	PlanChangeDtoToIntervalYearly  PlanChangeDtoToInterval = "yearly"
)

Values of PlanChangeDtoToInterval.

type PlanChangeQuoteCurrentDto

type PlanChangeQuoteCurrentDto struct {
	// PlanCode Example: "starter".
	PlanCode string `json:"planCode"`

	Interval PlanChangeQuoteCurrentDtoInterval `json:"interval"`

	// AmountMinor The current price per period, integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	PeriodEnd *string `json:"periodEnd"`
}

PlanChangeQuoteCurrentDto is `billing.PlanChangeQuoteCurrentDto`.

type PlanChangeQuoteCurrentDtoInterval

type PlanChangeQuoteCurrentDtoInterval string

PlanChangeQuoteCurrentDtoInterval is the type of PlanChangeQuoteCurrentDto.Interval. The API may add values.

const (
	PlanChangeQuoteCurrentDtoIntervalMonthly PlanChangeQuoteCurrentDtoInterval = "monthly"
	PlanChangeQuoteCurrentDtoIntervalYearly  PlanChangeQuoteCurrentDtoInterval = "yearly"
)

Values of PlanChangeQuoteCurrentDtoInterval.

type PlanChangeQuoteDto

type PlanChangeQuoteDto struct {
	SubscriptionID string `json:"subscriptionId"`

	Current PlanChangeQuoteCurrentDto `json:"current"`

	Target PlanChangeQuoteTargetDto `json:"target"`

	Immediate PlanChangeQuoteImmediateDto `json:"immediate"`

	PeriodEnd PlanChangeQuotePeriodEndDto `json:"periodEnd"`
}

PlanChangeQuoteDto is `billing.PlanChangeQuoteDto`.

type PlanChangeQuoteImmediateDto

type PlanChangeQuoteImmediateDto struct {
	Available bool `json:"available"`

	// Reason Why a change now is not available; null when it is.
	Reason *PlanChangeQuoteImmediateDtoReason `json:"reason"`

	// RetryAt `window_boundary_near` only: the instant after which a new quote can be given.
	RetryAt *string `json:"retryAt"`

	// CreditMinor The value of the paid period’s unissued allowance windows.
	CreditMinor int64 `json:"creditMinor"`

	// AmountDueMinor The new price less the credit — what the checkout would charge (negative: the change is available at period end only).
	AmountDueMinor int64 `json:"amountDueMinor"`

	WindowsUnissued int64 `json:"windowsUnissued"`

	WindowsInPeriod int64 `json:"windowsInPeriod"`

	// QuoteValidSeconds How long the checkout of this quote stays payable, in seconds.
	QuoteValidSeconds int64 `json:"quoteValidSeconds"`
}

PlanChangeQuoteImmediateDto is `billing.PlanChangeQuoteImmediateDto`.

type PlanChangeQuoteImmediateDtoReason

type PlanChangeQuoteImmediateDtoReason string

PlanChangeQuoteImmediateDtoReason is the type of PlanChangeQuoteImmediateDto.Reason. The API may add values.

const (
	PlanChangeQuoteImmediateDtoReasonFeatureDisabled    PlanChangeQuoteImmediateDtoReason = "feature_disabled"
	PlanChangeQuoteImmediateDtoReasonFreeSubscription   PlanChangeQuoteImmediateDtoReason = "free_subscription"
	PlanChangeQuoteImmediateDtoReasonSamePlan           PlanChangeQuoteImmediateDtoReason = "same_plan"
	PlanChangeQuoteImmediateDtoReasonCurrencyChange     PlanChangeQuoteImmediateDtoReason = "currency_change"
	PlanChangeQuoteImmediateDtoReasonPeriodEndOnly      PlanChangeQuoteImmediateDtoReason = "period_end_only"
	PlanChangeQuoteImmediateDtoReasonWindowBoundaryNear PlanChangeQuoteImmediateDtoReason = "window_boundary_near"
	PlanChangeQuoteImmediateDtoReasonPaymentNotClear    PlanChangeQuoteImmediateDtoReason = "payment_not_clear"
	PlanChangeQuoteImmediateDtoReasonNotActive          PlanChangeQuoteImmediateDtoReason = "not_active"
	PlanChangeQuoteImmediateDtoReasonCancelScheduled    PlanChangeQuoteImmediateDtoReason = "cancel_scheduled"
	PlanChangeQuoteImmediateDtoReasonCheckoutInProgress PlanChangeQuoteImmediateDtoReason = "checkout_in_progress"
)

Values of PlanChangeQuoteImmediateDtoReason.

type PlanChangeQuotePeriodEndDto

type PlanChangeQuotePeriodEndDto struct {
	Available bool `json:"available"`

	// Reason Why a change at period end is not available; null when it is.
	Reason *PlanChangeQuotePeriodEndDtoReason `json:"reason"`

	// EffectiveAt The boundary the change would take effect at; null when not available.
	EffectiveAt *string `json:"effectiveAt"`
}

PlanChangeQuotePeriodEndDto is `billing.PlanChangeQuotePeriodEndDto`.

type PlanChangeQuotePeriodEndDtoReason

type PlanChangeQuotePeriodEndDtoReason string

PlanChangeQuotePeriodEndDtoReason is the type of PlanChangeQuotePeriodEndDto.Reason. The API may add values.

const (
	PlanChangeQuotePeriodEndDtoReasonFeatureDisabled    PlanChangeQuotePeriodEndDtoReason = "feature_disabled"
	PlanChangeQuotePeriodEndDtoReasonFreeSubscription   PlanChangeQuotePeriodEndDtoReason = "free_subscription"
	PlanChangeQuotePeriodEndDtoReasonSamePlan           PlanChangeQuotePeriodEndDtoReason = "same_plan"
	PlanChangeQuotePeriodEndDtoReasonCurrencyChange     PlanChangeQuotePeriodEndDtoReason = "currency_change"
	PlanChangeQuotePeriodEndDtoReasonPeriodEndOnly      PlanChangeQuotePeriodEndDtoReason = "period_end_only"
	PlanChangeQuotePeriodEndDtoReasonWindowBoundaryNear PlanChangeQuotePeriodEndDtoReason = "window_boundary_near"
	PlanChangeQuotePeriodEndDtoReasonPaymentNotClear    PlanChangeQuotePeriodEndDtoReason = "payment_not_clear"
	PlanChangeQuotePeriodEndDtoReasonNotActive          PlanChangeQuotePeriodEndDtoReason = "not_active"
	PlanChangeQuotePeriodEndDtoReasonCancelScheduled    PlanChangeQuotePeriodEndDtoReason = "cancel_scheduled"
	PlanChangeQuotePeriodEndDtoReasonCheckoutInProgress PlanChangeQuotePeriodEndDtoReason = "checkout_in_progress"
)

Values of PlanChangeQuotePeriodEndDtoReason.

type PlanChangeQuoteTargetDto

type PlanChangeQuoteTargetDto struct {
	// PlanCode Example: "professional".
	PlanCode string `json:"planCode"`

	PlanName string `json:"planName"`

	Interval PlanChangeQuoteTargetDtoInterval `json:"interval"`

	// RecurringAmountMinor The new plan’s price per period, integer minor units.
	RecurringAmountMinor int64 `json:"recurringAmountMinor"`

	Currency PlanChangeQuoteTargetDtoCurrency `json:"currency"`

	// MonthlyCredits The new plan’s credits per monthly window.
	MonthlyCredits int64 `json:"monthlyCredits"`
}

PlanChangeQuoteTargetDto is `billing.PlanChangeQuoteTargetDto`.

type PlanChangeQuoteTargetDtoCurrency

type PlanChangeQuoteTargetDtoCurrency string

PlanChangeQuoteTargetDtoCurrency is the type of PlanChangeQuoteTargetDto.Currency. The API may add values.

const (
	PlanChangeQuoteTargetDtoCurrencyNGN PlanChangeQuoteTargetDtoCurrency = "NGN"
	PlanChangeQuoteTargetDtoCurrencyUSD PlanChangeQuoteTargetDtoCurrency = "USD"
)

Values of PlanChangeQuoteTargetDtoCurrency.

type PlanChangeQuoteTargetDtoInterval

type PlanChangeQuoteTargetDtoInterval string

PlanChangeQuoteTargetDtoInterval is the type of PlanChangeQuoteTargetDto.Interval. The API may add values.

const (
	PlanChangeQuoteTargetDtoIntervalMonthly PlanChangeQuoteTargetDtoInterval = "monthly"
	PlanChangeQuoteTargetDtoIntervalYearly  PlanChangeQuoteTargetDtoInterval = "yearly"
)

Values of PlanChangeQuoteTargetDtoInterval.

type PlanLimitsDto

type PlanLimitsDto struct {
	// Organizations Organisations one account may run: its main organisation plus its secondary organisations. Null: unlimited.
	// Example: 3.
	Organizations *int64 `json:"organizations"`

	// MembersPerOrganization Team members per organisation, counting pending invitations. Null: unlimited.
	// Example: 10.
	MembersPerOrganization *int64 `json:"membersPerOrganization"`

	// Buyers Saved buyers per organisation. Null: unlimited.
	// Example: 500.
	Buyers *int64 `json:"buyers"`

	// Invoices Invoices. Null on every plan: credits govern invoices.
	Invoices *int64 `json:"invoices"`
}

PlanLimitsDto is `billing.PlanLimitsDto`.

type PreviewSubscriptionPlanChangeData

type PreviewSubscriptionPlanChangeData = PlanChangeQuoteDto

PreviewSubscriptionPlanChangeData is the data of a successful GET /b/v1/subscriptions/{id}/change-plan/preview.

type PreviewSubscriptionPlanChangeQuery

type PreviewSubscriptionPlanChangeQuery struct {
	// NewPlanCode Example: "professional".
	NewPlanCode string `json:"newPlanCode"`

	// Interval The new billing interval; absent keeps the subscription’s.
	Interval *PreviewSubscriptionPlanChangeQueryInterval `json:"interval,omitempty"`
}

PreviewSubscriptionPlanChangeQuery holds the query parameters of GET /b/v1/subscriptions/{id}/change-plan/preview.

type PreviewSubscriptionPlanChangeQueryInterval

type PreviewSubscriptionPlanChangeQueryInterval string

PreviewSubscriptionPlanChangeQueryInterval is the type of PreviewSubscriptionPlanChangeQuery.Interval. The API may add values.

const (
	PreviewSubscriptionPlanChangeQueryIntervalMonthly PreviewSubscriptionPlanChangeQueryInterval = "monthly"
	PreviewSubscriptionPlanChangeQueryIntervalYearly  PreviewSubscriptionPlanChangeQueryInterval = "yearly"
)

Values of PreviewSubscriptionPlanChangeQueryInterval.

type PreviousKeyDto

type PreviousKeyDto struct {
	// CertificateFingerprint SHA-256 of the retired certificate, hex.
	CertificateFingerprint string `json:"certificateFingerprint"`

	RetiredAt *string `json:"retiredAt"`
}

PreviousKeyDto is `invoice.PreviousKeyDto`.

type QueryInvoiceStatusData

type QueryInvoiceStatusData = QueryStatusDto

QueryInvoiceStatusData is the data of a successful POST /i/v1/invoices/{id}/query-status.

type QueryStatusDto

type QueryStatusDto struct {
	InvoiceID string `json:"invoiceId"`

	Status QueryStatusDtoStatus `json:"status"`

	AuthorityState *QueryStatusDtoAuthorityState `json:"authorityState"`

	// AuthorityReference The IRN, once assigned.
	AuthorityReference *string `json:"authorityReference"`

	ParkReason *string `json:"parkReason"`

	LastSyncedAt *string `json:"lastSyncedAt"`

	Submissions []SubmissionViewDto `json:"submissions"`

	// Authority What the tax authority answered.
	Authority AuthorityStatusDto `json:"authority"`
}

QueryStatusDto is `invoice.QueryStatusDto`.

type QueryStatusDtoAuthorityState

type QueryStatusDtoAuthorityState string

QueryStatusDtoAuthorityState is the type of QueryStatusDto.AuthorityState. The API may add values.

const (
	QueryStatusDtoAuthorityStateQueued      QueryStatusDtoAuthorityState = "queued"
	QueryStatusDtoAuthorityStateHandedOff   QueryStatusDtoAuthorityState = "handed_off"
	QueryStatusDtoAuthorityStateRegistered  QueryStatusDtoAuthorityState = "registered"
	QueryStatusDtoAuthorityStateTransmitted QueryStatusDtoAuthorityState = "transmitted"
	QueryStatusDtoAuthorityStateDelivered   QueryStatusDtoAuthorityState = "delivered"
	QueryStatusDtoAuthorityStateRejected    QueryStatusDtoAuthorityState = "rejected"
	QueryStatusDtoAuthorityStateParked      QueryStatusDtoAuthorityState = "parked"
	QueryStatusDtoAuthorityStateWithdrawn   QueryStatusDtoAuthorityState = "withdrawn"
)

Values of QueryStatusDtoAuthorityState.

type QueryStatusDtoStatus

type QueryStatusDtoStatus string

QueryStatusDtoStatus is the type of QueryStatusDto.Status. The API may add values.

const (
	QueryStatusDtoStatusDraft               QueryStatusDtoStatus = "draft"
	QueryStatusDtoStatusFinalised           QueryStatusDtoStatus = "finalised"
	QueryStatusDtoStatusQueued              QueryStatusDtoStatus = "queued"
	QueryStatusDtoStatusSigned              QueryStatusDtoStatus = "signed"
	QueryStatusDtoStatusTransmitted         QueryStatusDtoStatus = "transmitted"
	QueryStatusDtoStatusAccepted            QueryStatusDtoStatus = "accepted"
	QueryStatusDtoStatusRejected            QueryStatusDtoStatus = "rejected"
	QueryStatusDtoStatusFailed              QueryStatusDtoStatus = "failed"
	QueryStatusDtoStatusCancellationPending QueryStatusDtoStatus = "cancellation_pending"
	QueryStatusDtoStatusCancelled           QueryStatusDtoStatus = "cancelled"
)

Values of QueryStatusDtoStatus.

type RateLimitError

type RateLimitError struct{ *APIError }

RateLimitError is 429: rate limited (`SYS005`). RetryAfter holds the seconds to wait.

func (*RateLimitError) Unwrap

func (e *RateLimitError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type RawResponse

type RawResponse struct {
	Status int
	// Data is the envelope's `data` (or the whole body when it was not the envelope); nil on 204 or an empty body.
	Data json.RawMessage
	// Meta is the envelope's `meta`, when the body was the envelope.
	Meta *ResponseMeta
	// RequestID is `meta.requestId`, falling back to the `x-request-id` header.
	RequestID string
	Header    http.Header
	// Binary is set for a binary answer (Call.Binary and a non-JSON content type).
	Binary *BinaryResponse
}

RawResponse is a successful answer as the transport hands it to the services: the envelope's `data` still as JSON, its `meta`, the status and headers, or the binary file.

type ReadinessChecklistResponseDto

type ReadinessChecklistResponseDto struct {
	TIN ReadinessTinResponseDto `json:"tin"`

	ContactInfoComplete bool `json:"contactInfoComplete"`

	PhoneVerified bool `json:"phoneVerified"`

	TermsAccepted ReadinessTermsResponseDto `json:"termsAccepted"`

	OnboardingCompleted bool `json:"onboardingCompleted"`
}

ReadinessChecklistResponseDto is `auth.ReadinessChecklistResponseDto`.

type ReadinessResponseDto

type ReadinessResponseDto struct {
	Checklist ReadinessChecklistResponseDto `json:"checklist"`

	LiveStatus ReadinessResponseDtoLiveStatus `json:"liveStatus"`

	ProductionModeEnabled bool `json:"productionModeEnabled"`

	LiveEnabled bool `json:"liveEnabled"`

	NextStep ReadinessResponseDtoNextStep `json:"nextStep"`
}

ReadinessResponseDto is `auth.ReadinessResponseDto`.

type ReadinessResponseDtoLiveStatus

type ReadinessResponseDtoLiveStatus string

ReadinessResponseDtoLiveStatus is the type of ReadinessResponseDto.LiveStatus. The API may add values.

const (
	ReadinessResponseDtoLiveStatusNotRequested  ReadinessResponseDtoLiveStatus = "not_requested"
	ReadinessResponseDtoLiveStatusPendingReview ReadinessResponseDtoLiveStatus = "pending_review"
	ReadinessResponseDtoLiveStatusApproved      ReadinessResponseDtoLiveStatus = "approved"
	ReadinessResponseDtoLiveStatusRejected      ReadinessResponseDtoLiveStatus = "rejected"
	ReadinessResponseDtoLiveStatusRevoked       ReadinessResponseDtoLiveStatus = "revoked"
)

Values of ReadinessResponseDtoLiveStatus.

type ReadinessResponseDtoNextStep

type ReadinessResponseDtoNextStep string

ReadinessResponseDtoNextStep is the type of ReadinessResponseDto.NextStep. The API may add values.

const (
	ReadinessResponseDtoNextStepVerifyTIN      ReadinessResponseDtoNextStep = "verify_tin"
	ReadinessResponseDtoNextStepContactInfo    ReadinessResponseDtoNextStep = "contact_info"
	ReadinessResponseDtoNextStepVerifyPhone    ReadinessResponseDtoNextStep = "verify_phone"
	ReadinessResponseDtoNextStepComplete       ReadinessResponseDtoNextStep = "complete"
	ReadinessResponseDtoNextStepAwaitingReview ReadinessResponseDtoNextStep = "awaiting_review"
	ReadinessResponseDtoNextStepRejected       ReadinessResponseDtoNextStep = "rejected"
	ReadinessResponseDtoNextStepRevoked        ReadinessResponseDtoNextStep = "revoked"
	ReadinessResponseDtoNextStepLive           ReadinessResponseDtoNextStep = "live"
	ReadinessResponseDtoNextStepLiveClosed     ReadinessResponseDtoNextStep = "live_closed"
)

Values of ReadinessResponseDtoNextStep.

type ReadinessTermsResponseDto

type ReadinessTermsResponseDto struct {
	At *string `json:"at"`

	Version *string `json:"version"`
}

ReadinessTermsResponseDto is `auth.ReadinessTermsResponseDto`.

type ReadinessTinResponseDto

type ReadinessTinResponseDto struct {
	Status ReadinessTinResponseDtoStatus `json:"status"`

	VerifiedAt *string `json:"verifiedAt"`
}

ReadinessTinResponseDto is `auth.ReadinessTinResponseDto`.

type ReadinessTinResponseDtoStatus

type ReadinessTinResponseDtoStatus string

ReadinessTinResponseDtoStatus is the type of ReadinessTinResponseDto.Status. The API may add values.

const (
	ReadinessTinResponseDtoStatusUnverified  ReadinessTinResponseDtoStatus = "unverified"
	ReadinessTinResponseDtoStatusPending     ReadinessTinResponseDtoStatus = "pending"
	ReadinessTinResponseDtoStatusVerified    ReadinessTinResponseDtoStatus = "verified"
	ReadinessTinResponseDtoStatusFailed      ReadinessTinResponseDtoStatus = "failed"
	ReadinessTinResponseDtoStatusUnavailable ReadinessTinResponseDtoStatus = "unavailable"
)

Values of ReadinessTinResponseDtoStatus.

type RecordInvoicePaymentBody

type RecordInvoicePaymentBody = PaymentStatusDto

RecordInvoicePaymentBody is the request body of PATCH /i/v1/invoices/{id}/payment-status.

type RecordInvoicePaymentData

type RecordInvoicePaymentData = InvoiceViewDto

RecordInvoicePaymentData is the data of a successful PATCH /i/v1/invoices/{id}/payment-status.

type RedeliverWebhookDeliveryData

type RedeliverWebhookDeliveryData = WebhookDeliveryDto

RedeliverWebhookDeliveryData is the data of a successful POST /n/v1/webhook-deliveries/{id}/redeliver.

type RedeliverWebhookEventBody

type RedeliverWebhookEventBody = RedeliverWebhookEventDto

RedeliverWebhookEventBody is the request body of POST /n/v1/webhook-events/{id}/redeliver.

type RedeliverWebhookEventData

type RedeliverWebhookEventData = WebhookDeliveryDto

RedeliverWebhookEventData is the data of a successful POST /n/v1/webhook-events/{id}/redeliver.

type RedeliverWebhookEventDto

type RedeliverWebhookEventDto struct {
	// EndpointID One of the organisation’s endpoints in the caller’s mode.
	EndpointID string `json:"endpointId"`
}

RedeliverWebhookEventDto is `notification.RedeliverWebhookEventDto`.

type ReferenceService

type ReferenceService struct {
	// contains filtered or unexported fields
}

ReferenceService is invoice reference (`/i/v1/invoices/hsn-codes|resources|lookup|validate`): code lists, tax-id lookup and the dry-run validation with the tax authority.

func (*ReferenceService) GetResource

func (s *ReferenceService) GetResource(ctx context.Context, listType string, opts ...RequestOption) (*GetInvoiceReferenceListData, error)

GetResource is one code list's items, e.g. `currencies`, `tax-categories` (`reference.read`; free; 404 for a type not served).

func (*ReferenceService) ListHsCodeCategories

func (s *ReferenceService) ListHsCodeCategories(ctx context.Context, opts ...RequestOption) ([]ListHsCodeCategoriesItem, error)

ListHsCodeCategories lists the HS code category names (`reference.read`; free).

func (*ReferenceService) ListHsCodes

func (s *ReferenceService) ListHsCodes(ctx context.Context, query *ListHsCodesQuery, opts ...RequestOption) (*Page[ListHsCodesItem], error)

ListHsCodes lists HS codes of the jurisdiction (`reference.read`; free).

func (*ReferenceService) ListResources

ListResources lists the jurisdiction's reference code lists (`reference.read`; free).

func (*ReferenceService) LookupTaxID

func (s *ReferenceService) LookupTaxID(ctx context.Context, value string, query *LookupTaxIdQuery, opts ...RequestOption) (*LookupTaxIdData, error)

LookupTaxID looks up a tax id with the provider (`tax_id.lookup`; charged, refunded when it could not answer). Sends an `Idempotency-Key`, so an SDK retry is not charged twice.

func (*ReferenceService) ValidateInvoice

func (s *ReferenceService) ValidateInvoice(ctx context.Context, params *ValidateInvoiceBody, opts ...RequestOption) (*ValidateInvoiceData, error)

ValidateInvoice validates a document with the tax authority without storing it (`invoice.validate`; charged, refunded when it could not answer). 200 whether valid or not. Sends an `Idempotency-Key`.

type RenumberInvoiceData

type RenumberInvoiceData = SubmitAnswerDto

RenumberInvoiceData is the data of a successful POST /i/v1/invoices/{id}/renumber.

type ReopenInvoiceData

type ReopenInvoiceData = InvoiceViewDto

ReopenInvoiceData is the data of a successful POST /i/v1/invoices/{id}/reopen.

type RequestOption

type RequestOption func(*RequestOptions)

RequestOption configures one call.

func WithIdempotencyKey

func WithIdempotencyKey(key string) RequestOption

WithIdempotencyKey sets the `Idempotency-Key` of a write that accepts one (8–128 of `A–Z a–z 0–9 _ -`).

func WithMaxRetries

func WithMaxRetries(n int) RequestOption

WithMaxRetries sets the maximum retries of this request (0 disables them).

func WithRequestHeaders

func WithRequestHeaders(h map[string]string) RequestOption

WithRequestHeaders adds headers to this request. `Authorization` cannot be overridden.

func WithRequestTimeout

func WithRequestTimeout(d time.Duration) RequestOption

WithRequestTimeout sets the timeout of this request.

type RequestOptions

type RequestOptions struct {
	// Timeout for this request (headers and body of each attempt).
	Timeout time.Duration
	// Headers are extra headers for this request. `Authorization` cannot be overridden.
	Headers map[string]string
	// IdempotencyKey is the `Idempotency-Key` for a write that accepts one (8–128 of `A–Z a–z 0–9 _ -`).
	// When omitted on such a write the SDK generates one, so its own retries are never charged twice;
	// pass your own to make a retry across process restarts safe. Ignored by routes that do not accept a key.
	IdempotencyKey string
	// MaxRetries is the maximum retries for this request (overrides the client's RetryConfig.MaxRetries).
	MaxRetries *int
}

RequestOptions are the per-request options every service method takes as trailing RequestOption values: WithRequestTimeout, WithRequestHeaders, WithIdempotencyKey, WithMaxRetries.

type ResponseMeta

type ResponseMeta struct {
	StatusCode int  `json:"statusCode"`
	Success    bool `json:"success"`
	// Message is copy for humans. Never branch on it.
	Message   string           `json:"message"`
	Errors    []map[string]any `json:"errors"`
	Timestamp string           `json:"timestamp"`
	// RequestID is the request id (also the `x-request-id` header).
	RequestID string `json:"requestId"`
	// Pagination is present on list answers.
	Pagination *PaginationMeta `json:"pagination,omitempty"`
}

ResponseMeta is `meta` of a successful answer.

type RetryAnswerDto

type RetryAnswerDto struct {
	Invoice InvoiceViewDto `json:"invoice"`

	Submission SubmissionViewDto `json:"submission"`
}

RetryAnswerDto is `invoice.RetryAnswerDto`.

type RetryConfig

type RetryConfig struct {
	// MaxRetries is the number of retries after the first attempt (default 2; Ptr(0) disables). Only
	// requests that are safe to repeat are retried: GET, PUT and DELETE, and writes that carry an
	// `Idempotency-Key`. Retried on a network error, a timeout, 408, 429 and 5xx.
	MaxRetries *int
	// BaseDelay is the first backoff delay (default 500 ms); it doubles each retry, with jitter.
	BaseDelay time.Duration
	// MaxDelay is the ceiling of one backoff delay (default 8 s).
	MaxDelay time.Duration
	// MaxRetryAfter is the longest `Retry-After` the SDK will wait on 429/503 before retrying
	// (default 60 s). A longer one is returned at once, as the error with RetryAfter set.
	MaxRetryAfter time.Duration
}

RetryConfig is the retry behaviour. A nil MaxRetries and zero durations keep the defaults.

type RetryInvoiceSubmissionData

type RetryInvoiceSubmissionData = RetryAnswerDto

RetryInvoiceSubmissionData is the data of a successful POST /i/v1/invoices/{id}/retry.

type ReviseInvoiceData

type ReviseInvoiceData = InvoiceViewDto

ReviseInvoiceData is the data of a successful POST /i/v1/invoices/{id}/revise.

type RevokeInvoiceShareLinkData

type RevokeInvoiceShareLinkData = ShareLinkViewDto

RevokeInvoiceShareLinkData is the data of a successful DELETE /i/v1/invoices/{id}/share-links/{linkId}.

type SandboxBalanceDto

type SandboxBalanceDto struct {
	Available int64 `json:"available"`

	Held int64 `json:"held"`
}

SandboxBalanceDto is `billing.SandboxBalanceDto`.

type SandboxService

type SandboxService struct {
	// contains filtered or unexported fields
}

SandboxService is the sandbox ledger (`/b/v1/sandbox`). A live key is refused with 403 `BIZ108`.

func (*SandboxService) GetUsage

func (s *SandboxService) GetUsage(ctx context.Context, opts ...RequestOption) (*GetSandboxUsageData, error)

GetUsage is this UTC month's free sandbox allowance: granted, used, remaining (`billing.usage.read`).

func (*SandboxService) ListTransactions

ListTransactions is the sandbox ledger's entries, newest first (`billing.ledger.read`).

type SandboxUsageDto

type SandboxUsageDto struct {
	CreditsUsed int64 `json:"creditsUsed"`

	// CreditsLimit This month’s allowance (catalogue `sandbox_monthly`).
	CreditsLimit int64 `json:"creditsLimit"`

	CreditsRemaining int64 `json:"creditsRemaining"`

	// PeriodStart Start of the current UTC month.
	PeriodStart string `json:"periodStart"`

	// PeriodEnd Start of the next UTC month (exclusive end).
	PeriodEnd string `json:"periodEnd"`
}

SandboxUsageDto is `billing.SandboxUsageDto`.

type SearchBuyersItem

type SearchBuyersItem = BuyerViewDto

SearchBuyersItem is one element of the page GET /i/v1/buyers/search answers.

type SearchBuyersQuery

type SearchBuyersQuery struct {
	Q string `json:"q"`

	Limit *float64 `json:"limit,omitempty"`
}

SearchBuyersQuery holds the query parameters of GET /i/v1/buyers/search.

type SearchSellersItem

type SearchSellersItem = SellerViewDto

SearchSellersItem is one element of the page GET /i/v1/sellers/search answers.

type SearchSellersQuery

type SearchSellersQuery struct {
	Q string `json:"q"`

	Limit *float64 `json:"limit,omitempty"`
}

SearchSellersQuery holds the query parameters of GET /i/v1/sellers/search.

type SellerSetupDto

type SellerSetupDto struct {
	Seller SellerViewDto `json:"seller"`

	// AdditionalSellersAvailable Always false: the organisation is the only seller.
	AdditionalSellersAvailable bool `json:"additionalSellersAvailable"`

	TaxIDTypes []TaxIdTypeOptionDto `json:"taxIdTypes"`

	Countries []CountryOptionDto `json:"countries"`
}

SellerSetupDto is `invoice.SellerSetupDto`.

type SellerVerificationStatusDto

type SellerVerificationStatusDto struct {
	TaxIDStatus SellerVerificationStatusDtoTaxIDStatus `json:"taxIdStatus"`

	TaxIDVerifiedAt *string `json:"taxIdVerifiedAt"`
}

SellerVerificationStatusDto is `invoice.SellerVerificationStatusDto`.

type SellerVerificationStatusDtoTaxIDStatus

type SellerVerificationStatusDtoTaxIDStatus string

SellerVerificationStatusDtoTaxIDStatus is the type of SellerVerificationStatusDto.TaxIDStatus. The API may add values.

const (
	SellerVerificationStatusDtoTaxIDStatusUnverified      SellerVerificationStatusDtoTaxIDStatus = "unverified"
	SellerVerificationStatusDtoTaxIDStatusPending         SellerVerificationStatusDtoTaxIDStatus = "pending"
	SellerVerificationStatusDtoTaxIDStatusVerified        SellerVerificationStatusDtoTaxIDStatus = "verified"
	SellerVerificationStatusDtoTaxIDStatusNotFound        SellerVerificationStatusDtoTaxIDStatus = "not_found"
	SellerVerificationStatusDtoTaxIDStatusNameMismatch    SellerVerificationStatusDtoTaxIDStatus = "name_mismatch"
	SellerVerificationStatusDtoTaxIDStatusUnavailable     SellerVerificationStatusDtoTaxIDStatus = "unavailable"
	SellerVerificationStatusDtoTaxIDStatusValidOffNetwork SellerVerificationStatusDtoTaxIDStatus = "valid_off_network"
	SellerVerificationStatusDtoTaxIDStatusChecking        SellerVerificationStatusDtoTaxIDStatus = "checking"
)

Values of SellerVerificationStatusDtoTaxIDStatus.

type SellerViewDto

type SellerViewDto struct {
	ID string `json:"id"`

	// Kind The organisation is its own seller.
	Kind SellerViewDtoKind `json:"kind"`

	LegalName *string `json:"legalName"`

	Name string `json:"name"`

	TaxID *string `json:"taxId"`

	TaxIDType SellerViewDtoTaxIDType `json:"taxIdType"`

	// TaxIDStatus The organisation’s TIN verification status, as recorded in organisation settings.
	TaxIDStatus SellerViewDtoTaxIDStatus `json:"taxIdStatus"`

	TaxIDVerifiedAt *string `json:"taxIdVerifiedAt"`

	// Country Example: "NG".
	Country *string `json:"country"`

	Address *PartyAddressDto `json:"address"`

	Email *string `json:"email"`

	Phone *string `json:"phone"`

	// PartyName The name the seller appears under on its documents and to the tax authority, upper case: the tax authority’s business name while the tax connection is connected, else the verified legal name, else `name`.
	PartyName string `json:"partyName"`

	// NameSource Where `partyName` came from: `nrs`, `tin_check` or `entered`.
	NameSource SellerViewDtoNameSource `json:"nameSource"`
}

SellerViewDto is `invoice.SellerViewDto`.

type SellerViewDtoKind

type SellerViewDtoKind string

SellerViewDtoKind is the type of SellerViewDto.Kind. The API may add values.

const (
	SellerViewDtoKindOrganization SellerViewDtoKind = "organization"
)

Values of SellerViewDtoKind.

type SellerViewDtoNameSource

type SellerViewDtoNameSource string

SellerViewDtoNameSource is the type of SellerViewDto.NameSource. The API may add values.

const (
	SellerViewDtoNameSourceNRS      SellerViewDtoNameSource = "nrs"
	SellerViewDtoNameSourceTINCheck SellerViewDtoNameSource = "tin_check"
	SellerViewDtoNameSourceEntered  SellerViewDtoNameSource = "entered"
)

Values of SellerViewDtoNameSource.

type SellerViewDtoTaxIDStatus

type SellerViewDtoTaxIDStatus string

SellerViewDtoTaxIDStatus is the type of SellerViewDto.TaxIDStatus. The API may add values.

const (
	SellerViewDtoTaxIDStatusUnverified      SellerViewDtoTaxIDStatus = "unverified"
	SellerViewDtoTaxIDStatusPending         SellerViewDtoTaxIDStatus = "pending"
	SellerViewDtoTaxIDStatusVerified        SellerViewDtoTaxIDStatus = "verified"
	SellerViewDtoTaxIDStatusNotFound        SellerViewDtoTaxIDStatus = "not_found"
	SellerViewDtoTaxIDStatusNameMismatch    SellerViewDtoTaxIDStatus = "name_mismatch"
	SellerViewDtoTaxIDStatusUnavailable     SellerViewDtoTaxIDStatus = "unavailable"
	SellerViewDtoTaxIDStatusValidOffNetwork SellerViewDtoTaxIDStatus = "valid_off_network"
	SellerViewDtoTaxIDStatusChecking        SellerViewDtoTaxIDStatus = "checking"
)

Values of SellerViewDtoTaxIDStatus.

type SellerViewDtoTaxIDType

type SellerViewDtoTaxIDType string

SellerViewDtoTaxIDType is the type of SellerViewDto.TaxIDType. The API may add values.

const (
	SellerViewDtoTaxIDTypeTIN     SellerViewDtoTaxIDType = "tin"
	SellerViewDtoTaxIDTypeRn      SellerViewDtoTaxIDType = "rn"
	SellerViewDtoTaxIDTypeForeign SellerViewDtoTaxIDType = "foreign"
	SellerViewDtoTaxIDTypeNone    SellerViewDtoTaxIDType = "none"
)

Values of SellerViewDtoTaxIDType.

type SellersService

type SellersService struct {
	// contains filtered or unexported fields
}

SellersService is sellers (`/i/v1/sellers`): read-only. The organisation is its only seller; creating, editing, deleting or verifying a seller is always 409 `BIZ205`, so the SDK has no method for it.

func (*SellersService) Get

func (s *SellersService) Get(ctx context.Context, id string, opts ...RequestOption) (*GetSellerData, error)

Get gets the seller by id (`seller.read`).

func (*SellersService) GetVerificationStatus

func (s *SellersService) GetVerificationStatus(ctx context.Context, id string, opts ...RequestOption) (*GetSellerVerificationStatusData, error)

GetVerificationStatus is the organisation's TIN status (`seller.read`).

func (*SellersService) List

List is the organisation's seller, as a list of one (`seller.read`).

func (*SellersService) Search

Search is the seller when it matches `Q`, else an empty list (`seller.read`).

type SendInvoiceBody

type SendInvoiceBody = SendInvoiceDto

SendInvoiceBody is the request body of POST /i/v1/invoices/{id}/send.

type SendInvoiceData

type SendInvoiceData = SendResultDto

SendInvoiceData is the data of a successful POST /i/v1/invoices/{id}/send.

type SendInvoiceDto

type SendInvoiceDto struct {
	// Message Example: "Please find our invoice attached.".
	Message *string `json:"message,omitempty"`
}

SendInvoiceDto is `invoice.SendInvoiceDto`.

type SendResultDto

type SendResultDto struct {
	SendID string `json:"sendId"`

	// DeliveryStatus "sent" means queued, not received.
	DeliveryStatus SendResultDtoDeliveryStatus `json:"deliveryStatus"`

	// ShareURL Sandbox only (no email leaves): a presigned link to the PDF for preview.
	ShareURL *string `json:"shareUrl,omitempty"`

	// Replayed Present when an Idempotency-Key replayed.
	Replayed *bool `json:"replayed,omitempty"`
}

SendResultDto is `invoice.SendResultDto`.

type SendResultDtoDeliveryStatus

type SendResultDtoDeliveryStatus string

SendResultDtoDeliveryStatus is the type of SendResultDto.DeliveryStatus. The API may add values.

const (
	SendResultDtoDeliveryStatusSent SendResultDtoDeliveryStatus = "sent"
)

Values of SendResultDtoDeliveryStatus.

type ServerError

type ServerError struct{ *APIError }

ServerError is 5xx: the API or a provider behind it failed (`SYS001`). 503 may carry RetryAfter.

func (*ServerError) Unwrap

func (e *ServerError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type SetupBillingAccountDto

type SetupBillingAccountDto struct {
	ID string `json:"id"`

	OrganizationID string `json:"organizationId"`

	DefaultCurrency SetupBillingAccountDtoDefaultCurrency `json:"defaultCurrency"`

	LowBalanceThreshold int64 `json:"lowBalanceThreshold"`
}

SetupBillingAccountDto is `billing.SetupBillingAccountDto`.

type SetupBillingAccountDtoDefaultCurrency

type SetupBillingAccountDtoDefaultCurrency string

SetupBillingAccountDtoDefaultCurrency is the type of SetupBillingAccountDto.DefaultCurrency. The API may add values.

const (
	SetupBillingAccountDtoDefaultCurrencyNGN SetupBillingAccountDtoDefaultCurrency = "NGN"
	SetupBillingAccountDtoDefaultCurrencyUSD SetupBillingAccountDtoDefaultCurrency = "USD"
)

Values of SetupBillingAccountDtoDefaultCurrency.

type SetupDto

type SetupDto struct {
	Subscription *SubscriptionDto `json:"subscription"`

	BillingAccount SetupBillingAccountDto `json:"billingAccount"`

	Usage SetupUsageDto `json:"usage"`

	// SandboxUsage Absent for a live-mode API key.
	SandboxUsage *SandboxUsageDto `json:"sandboxUsage,omitempty"`

	AvailablePlans []AvailablePlanDto `json:"availablePlans"`
}

SetupDto is `billing.SetupDto`.

type SetupUsageDto

type SetupUsageDto struct {
	Live *LiveUsageDto `json:"live,omitempty"`

	Sandbox *SandboxBalanceDto `json:"sandbox,omitempty"`
}

SetupUsageDto is `billing.SetupUsageDto`.

type ShareLinkCreatorDto

type ShareLinkCreatorDto struct {
	Type ShareLinkCreatorDtoType `json:"type"`

	// ID The user or key id; null for the system.
	ID *string `json:"id"`
}

ShareLinkCreatorDto is `invoice.ShareLinkCreatorDto`.

type ShareLinkCreatorDtoType

type ShareLinkCreatorDtoType string

ShareLinkCreatorDtoType is the type of ShareLinkCreatorDto.Type. The API may add values.

const (
	ShareLinkCreatorDtoTypeUser    ShareLinkCreatorDtoType = "user"
	ShareLinkCreatorDtoTypeAPIKey  ShareLinkCreatorDtoType = "api_key"
	ShareLinkCreatorDtoTypeService ShareLinkCreatorDtoType = "service"
	ShareLinkCreatorDtoTypeSystem  ShareLinkCreatorDtoType = "system"
)

Values of ShareLinkCreatorDtoType.

type ShareLinkViewDto

type ShareLinkViewDto struct {
	ID string `json:"id"`

	InvoiceID string `json:"invoiceId"`

	// URL The full link — on the create answer ONLY (the token exists once); null elsewhere.
	// Example: "https://app.useyona.com/v/sAbc…".
	URL *string `json:"url"`

	ExpiresAt string `json:"expiresAt"`

	MaxViews *float64 `json:"maxViews"`

	// ViewCount Example: 0.
	ViewCount float64 `json:"viewCount"`

	LastViewedAt *string `json:"lastViewedAt"`

	RevokedAt *string `json:"revokedAt"`

	CreatedAt string `json:"createdAt"`

	CreatedBy ShareLinkCreatorDto `json:"createdBy"`
}

ShareLinkViewDto is `invoice.ShareLinkViewDto`.

type ShareLinksService

type ShareLinksService struct {
	// contains filtered or unexported fields
}

ShareLinksService is share links (`/i/v1/invoices/:id/share-links`): public, revocable links to an invoice.

func (*ShareLinksService) Create

Create creates a share link (`invoice.share`).

func (*ShareLinksService) List

List lists an invoice's share links (`invoice.share`).

func (*ShareLinksService) Revoke

func (s *ShareLinksService) Revoke(ctx context.Context, invoiceID, linkID string, opts ...RequestOption) (*RevokeInvoiceShareLinkData, error)

Revoke revokes a share link (`invoice.share`).

type StatementChargeLineDto

type StatementChargeLineDto struct {
	// CostCode Example: "INVOICE_CREATE".
	CostCode string `json:"costCode"`

	Count int64 `json:"count"`

	Credits int64 `json:"credits"`
}

StatementChargeLineDto is `billing.StatementChargeLineDto`.

type StatementDto

type StatementDto struct {
	// Period Example: "2026-09".
	Period string `json:"period"`

	Mode StatementDtoMode `json:"mode"`

	OpeningBalance int64 `json:"openingBalance"`

	ClosingBalance int64 `json:"closingBalance"`

	Grants StatementGrantsDto `json:"grants"`

	Charges []StatementChargeLineDto `json:"charges"`

	Refunds int64 `json:"refunds"`

	Clawbacks int64 `json:"clawbacks"`

	Expired int64 `json:"expired"`

	DebtSettled int64 `json:"debtSettled"`

	// HoldsOutstanding Credits still held at the end of the month.
	HoldsOutstanding int64 `json:"holdsOutstanding"`

	Transfers StatementTransfersDto `json:"transfers"`

	Pool StatementPoolDto `json:"pool"`

	// Payments Live statements only.
	Payments []StatementPaymentDto `json:"payments,omitempty"`
}

StatementDto is `billing.StatementDto`.

type StatementDtoMode

type StatementDtoMode string

StatementDtoMode is the type of StatementDto.Mode. The API may add values.

const (
	StatementDtoModeSandbox StatementDtoMode = "sandbox"
	StatementDtoModeLive    StatementDtoMode = "live"
)

Values of StatementDtoMode.

type StatementGrantsDto

type StatementGrantsDto struct {
	Plan int64 `json:"plan"`

	Purchase int64 `json:"purchase"`

	Allowance int64 `json:"allowance"`

	Adjustment int64 `json:"adjustment"`
}

StatementGrantsDto is `billing.StatementGrantsDto`.

type StatementPaymentDto

type StatementPaymentDto struct {
	PaymentID string `json:"paymentId"`

	Kind StatementPaymentDtoKind `json:"kind"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	Currency StatementPaymentDtoCurrency `json:"currency"`

	Status StatementPaymentDtoStatus `json:"status"`

	SettledAt *string `json:"settledAt"`
}

StatementPaymentDto is `billing.StatementPaymentDto`.

type StatementPaymentDtoCurrency

type StatementPaymentDtoCurrency string

StatementPaymentDtoCurrency is the type of StatementPaymentDto.Currency. The API may add values.

const (
	StatementPaymentDtoCurrencyNGN StatementPaymentDtoCurrency = "NGN"
	StatementPaymentDtoCurrencyUSD StatementPaymentDtoCurrency = "USD"
)

Values of StatementPaymentDtoCurrency.

type StatementPaymentDtoKind

type StatementPaymentDtoKind string

StatementPaymentDtoKind is the type of StatementPaymentDto.Kind. The API may add values.

const (
	StatementPaymentDtoKindCreditPurchase StatementPaymentDtoKind = "credit_purchase"
	StatementPaymentDtoKindSubscription   StatementPaymentDtoKind = "subscription"
	StatementPaymentDtoKindRenewal        StatementPaymentDtoKind = "renewal"
)

Values of StatementPaymentDtoKind.

type StatementPaymentDtoStatus

type StatementPaymentDtoStatus string

StatementPaymentDtoStatus is the type of StatementPaymentDto.Status. The API may add values.

const (
	StatementPaymentDtoStatusPending           StatementPaymentDtoStatus = "pending"
	StatementPaymentDtoStatusSucceeded         StatementPaymentDtoStatus = "succeeded"
	StatementPaymentDtoStatusFailed            StatementPaymentDtoStatus = "failed"
	StatementPaymentDtoStatusExpired           StatementPaymentDtoStatus = "expired"
	StatementPaymentDtoStatusPartiallyRefunded StatementPaymentDtoStatus = "partially_refunded"
	StatementPaymentDtoStatusRefunded          StatementPaymentDtoStatus = "refunded"
	StatementPaymentDtoStatusDisputed          StatementPaymentDtoStatus = "disputed"
	StatementPaymentDtoStatusChargedBack       StatementPaymentDtoStatus = "charged_back"
)

Values of StatementPaymentDtoStatus.

type StatementPoolDto

type StatementPoolDto struct {
	// Out Paid for children (`pool_out`).
	Out int64 `json:"out"`

	// ReturnedIn Unused pool credits back from children (`pool_return_in`).
	ReturnedIn int64 `json:"returnedIn"`

	// In Funded by the parent (`pool_in`).
	In int64 `json:"in"`

	// ReturnedOut Unused pool credits given back (`pool_return_out`).
	ReturnedOut int64 `json:"returnedOut"`
}

StatementPoolDto is `billing.StatementPoolDto`.

type StatementTransfersDto

type StatementTransfersDto struct {
	// In Received from a relative (`transfer_in`).
	In int64 `json:"in"`

	// Out Sent to a relative (`transfer_out`).
	Out int64 `json:"out"`
}

StatementTransfersDto is `billing.StatementTransfersDto`.

type StatementsService

type StatementsService struct {
	// contains filtered or unexported fields
}

StatementsService is monthly statements (`/b/v1/statements`).

func (*StatementsService) Get

Get is one UTC month (`YYYY-MM`) of the key's own mode's ledger (`billing.statement.read`).

type StatisticsWindowDto

type StatisticsWindowDto struct {
	From string `json:"from"`

	// To Exclusive.
	To string `json:"to"`
}

StatisticsWindowDto is `invoice.StatisticsWindowDto`.

type SubmissionBillingDto

type SubmissionBillingDto struct {
	// State The state of the submission’s charge.
	State SubmissionBillingDtoState `json:"state"`
}

SubmissionBillingDto is `invoice.SubmissionBillingDto`.

type SubmissionBillingDtoState

type SubmissionBillingDtoState string

SubmissionBillingDtoState is the type of SubmissionBillingDto.State. The API may add values.

const (
	SubmissionBillingDtoStateHeld        SubmissionBillingDtoState = "held"
	SubmissionBillingDtoStateCaptured    SubmissionBillingDtoState = "captured"
	SubmissionBillingDtoStateReleased    SubmissionBillingDtoState = "released"
	SubmissionBillingDtoStateCaptureLost SubmissionBillingDtoState = "capture_lost"
	SubmissionBillingDtoStateNotCharged  SubmissionBillingDtoState = "not_charged"
)

Values of SubmissionBillingDtoState.

type SubmissionRejectReasonDto

type SubmissionRejectReasonDto struct {
	// Code The tax authority’s code.
	Code string `json:"code"`

	// Field The field the authority named, when it named one.
	Field *string `json:"field,omitempty"`

	Message string `json:"message"`
}

SubmissionRejectReasonDto is `invoice.SubmissionRejectReasonDto`.

type SubmissionStatusDto

type SubmissionStatusDto struct {
	InvoiceID string `json:"invoiceId"`

	Status SubmissionStatusDtoStatus `json:"status"`

	AuthorityState *SubmissionStatusDtoAuthorityState `json:"authorityState"`

	// AuthorityReference The IRN, once assigned.
	AuthorityReference *string `json:"authorityReference"`

	ParkReason *string `json:"parkReason"`

	LastSyncedAt *string `json:"lastSyncedAt"`

	Submissions []SubmissionViewDto `json:"submissions"`
}

SubmissionStatusDto is `invoice.SubmissionStatusDto`.

type SubmissionStatusDtoAuthorityState

type SubmissionStatusDtoAuthorityState string

SubmissionStatusDtoAuthorityState is the type of SubmissionStatusDto.AuthorityState. The API may add values.

const (
	SubmissionStatusDtoAuthorityStateQueued      SubmissionStatusDtoAuthorityState = "queued"
	SubmissionStatusDtoAuthorityStateHandedOff   SubmissionStatusDtoAuthorityState = "handed_off"
	SubmissionStatusDtoAuthorityStateRegistered  SubmissionStatusDtoAuthorityState = "registered"
	SubmissionStatusDtoAuthorityStateTransmitted SubmissionStatusDtoAuthorityState = "transmitted"
	SubmissionStatusDtoAuthorityStateDelivered   SubmissionStatusDtoAuthorityState = "delivered"
	SubmissionStatusDtoAuthorityStateRejected    SubmissionStatusDtoAuthorityState = "rejected"
	SubmissionStatusDtoAuthorityStateParked      SubmissionStatusDtoAuthorityState = "parked"
	SubmissionStatusDtoAuthorityStateWithdrawn   SubmissionStatusDtoAuthorityState = "withdrawn"
)

Values of SubmissionStatusDtoAuthorityState.

type SubmissionStatusDtoStatus

type SubmissionStatusDtoStatus string

SubmissionStatusDtoStatus is the type of SubmissionStatusDto.Status. The API may add values.

const (
	SubmissionStatusDtoStatusDraft               SubmissionStatusDtoStatus = "draft"
	SubmissionStatusDtoStatusFinalised           SubmissionStatusDtoStatus = "finalised"
	SubmissionStatusDtoStatusQueued              SubmissionStatusDtoStatus = "queued"
	SubmissionStatusDtoStatusSigned              SubmissionStatusDtoStatus = "signed"
	SubmissionStatusDtoStatusTransmitted         SubmissionStatusDtoStatus = "transmitted"
	SubmissionStatusDtoStatusAccepted            SubmissionStatusDtoStatus = "accepted"
	SubmissionStatusDtoStatusRejected            SubmissionStatusDtoStatus = "rejected"
	SubmissionStatusDtoStatusFailed              SubmissionStatusDtoStatus = "failed"
	SubmissionStatusDtoStatusCancellationPending SubmissionStatusDtoStatus = "cancellation_pending"
	SubmissionStatusDtoStatusCancelled           SubmissionStatusDtoStatus = "cancelled"
)

Values of SubmissionStatusDtoStatus.

type SubmissionVerificationDto

type SubmissionVerificationDto struct {
	State SubmissionVerificationDtoState `json:"state"`

	CapturedAt *string `json:"capturedAt"`
}

SubmissionVerificationDto is `invoice.SubmissionVerificationDto`.

type SubmissionVerificationDtoState

type SubmissionVerificationDtoState string

SubmissionVerificationDtoState is the type of SubmissionVerificationDto.State. The API may add values.

const (
	SubmissionVerificationDtoStatePending     SubmissionVerificationDtoState = "pending"
	SubmissionVerificationDtoStateCaptured    SubmissionVerificationDtoState = "captured"
	SubmissionVerificationDtoStateUnavailable SubmissionVerificationDtoState = "unavailable"
)

Values of SubmissionVerificationDtoState.

type SubmissionViewDto

type SubmissionViewDto struct {
	SubmissionID string `json:"submissionId"`

	InvoiceID string `json:"invoiceId"`

	// AttemptNo Example: 1.
	AttemptNo int64 `json:"attemptNo"`

	AuthorityState SubmissionViewDtoAuthorityState `json:"authorityState"`

	Status SubmissionViewDtoStatus `json:"status"`

	// AuthorityReference The IRN, once assigned.
	AuthorityReference *string `json:"authorityReference"`

	AuthoritySubmissionID *string `json:"authoritySubmissionId"`

	// ParkReason Why the submission is on hold.
	ParkReason *string `json:"parkReason"`

	RejectReasons []SubmissionRejectReasonDto `json:"rejectReasons"`

	// IssuedAs The identity this submission went out under.
	IssuedAs *InvoiceIssuedAsDto `json:"issuedAs"`

	// Verification The verification artefact’s capture; null when there is none.
	Verification *SubmissionVerificationDto `json:"verification"`

	Billing SubmissionBillingDto `json:"billing"`

	QueuedAt string `json:"queuedAt"`

	HandedOffAt *string `json:"handedOffAt"`

	RegisteredAt *string `json:"registeredAt"`

	TransmittedAt *string `json:"transmittedAt"`

	DeliveredAt *string `json:"deliveredAt"`

	RejectedAt *string `json:"rejectedAt"`

	ParkedAt *string `json:"parkedAt"`

	// AuthorityNote A plain-language note while the submission has waited long for the tax authority to confirm delivery; null otherwise.
	AuthorityNote *string `json:"authorityNote"`

	// AuthorityLastCheckedAt When the tax authority was last asked.
	AuthorityLastCheckedAt *string `json:"authorityLastCheckedAt"`

	// AuthorityNextCheckAt When it will next be asked; null when it will not.
	AuthorityNextCheckAt *string `json:"authorityNextCheckAt"`

	// OffNetworkReason Set when the tax authority registered this submission (reference and verification code issued) and will not send it through its network, because the buyer cannot receive there: `buyer_off_network` (the buyer is not on e-invoicing), `b2c` or `no_buyer_tin` (no buyer tax id). The submission is complete and reported; deliver the invoice to the buyer by email, link or PDF. Null otherwise.
	OffNetworkReason *SubmissionViewDtoOffNetworkReason `json:"offNetworkReason"`

	// DeliveredOffNetworkAt When the tax authority settled the submission off its network; null otherwise.
	DeliveredOffNetworkAt *string `json:"deliveredOffNetworkAt"`

	// CreatedBy Who queued this submission.
	CreatedBy InvoiceActorDto `json:"createdBy"`
}

SubmissionViewDto is `invoice.SubmissionViewDto`.

type SubmissionViewDtoAuthorityState

type SubmissionViewDtoAuthorityState string

SubmissionViewDtoAuthorityState is the type of SubmissionViewDto.AuthorityState. The API may add values.

const (
	SubmissionViewDtoAuthorityStateQueued      SubmissionViewDtoAuthorityState = "queued"
	SubmissionViewDtoAuthorityStateHandedOff   SubmissionViewDtoAuthorityState = "handed_off"
	SubmissionViewDtoAuthorityStateRegistered  SubmissionViewDtoAuthorityState = "registered"
	SubmissionViewDtoAuthorityStateTransmitted SubmissionViewDtoAuthorityState = "transmitted"
	SubmissionViewDtoAuthorityStateDelivered   SubmissionViewDtoAuthorityState = "delivered"
	SubmissionViewDtoAuthorityStateRejected    SubmissionViewDtoAuthorityState = "rejected"
	SubmissionViewDtoAuthorityStateParked      SubmissionViewDtoAuthorityState = "parked"
	SubmissionViewDtoAuthorityStateWithdrawn   SubmissionViewDtoAuthorityState = "withdrawn"
)

Values of SubmissionViewDtoAuthorityState.

type SubmissionViewDtoOffNetworkReason

type SubmissionViewDtoOffNetworkReason string

SubmissionViewDtoOffNetworkReason is the type of SubmissionViewDto.OffNetworkReason. The API may add values.

const (
	SubmissionViewDtoOffNetworkReasonBuyerOffNetwork SubmissionViewDtoOffNetworkReason = "buyer_off_network"
	SubmissionViewDtoOffNetworkReasonB2C             SubmissionViewDtoOffNetworkReason = "b2c"
	SubmissionViewDtoOffNetworkReasonNoBuyerTIN      SubmissionViewDtoOffNetworkReason = "no_buyer_tin"
	SubmissionViewDtoOffNetworkReasonUnspecified     SubmissionViewDtoOffNetworkReason = "unspecified"
)

Values of SubmissionViewDtoOffNetworkReason.

type SubmissionViewDtoStatus

type SubmissionViewDtoStatus string

SubmissionViewDtoStatus is the type of SubmissionViewDto.Status. The API may add values.

const (
	SubmissionViewDtoStatusDraft               SubmissionViewDtoStatus = "draft"
	SubmissionViewDtoStatusFinalised           SubmissionViewDtoStatus = "finalised"
	SubmissionViewDtoStatusQueued              SubmissionViewDtoStatus = "queued"
	SubmissionViewDtoStatusSigned              SubmissionViewDtoStatus = "signed"
	SubmissionViewDtoStatusTransmitted         SubmissionViewDtoStatus = "transmitted"
	SubmissionViewDtoStatusAccepted            SubmissionViewDtoStatus = "accepted"
	SubmissionViewDtoStatusRejected            SubmissionViewDtoStatus = "rejected"
	SubmissionViewDtoStatusFailed              SubmissionViewDtoStatus = "failed"
	SubmissionViewDtoStatusCancellationPending SubmissionViewDtoStatus = "cancellation_pending"
	SubmissionViewDtoStatusCancelled           SubmissionViewDtoStatus = "cancelled"
)

Values of SubmissionViewDtoStatus.

type SubmissionsService

type SubmissionsService struct {
	// contains filtered or unexported fields
}

SubmissionsService is submissions (`/i/v1/invoices/…`): reporting invoices to the tax authority and following them.

func (*SubmissionsService) BatchSubmit

BatchSubmit submits 1–100 invoices, each independently (`invoice.submit`). Not retried by the SDK.

func (*SubmissionsService) CreateAndSubmit

CreateAndSubmit creates an invoice and submits it (`invoice.create` + `invoice.submit`). When the submit is refused the draft is kept and `SubmitRefusal` says why. Sends an `Idempotency-Key`.

func (*SubmissionsService) GetAuthorityCopy

func (s *SubmissionsService) GetAuthorityCopy(ctx context.Context, id string, opts ...RequestOption) (*GetInvoiceAuthorityCopyData, error)

GetAuthorityCopy is the tax authority's own decrypted copy of a registered invoice (`invoice.download_authority_copy`).

func (*SubmissionsService) GetStatus

GetStatus is the submission status as last recorded (`invoice.read`).

func (*SubmissionsService) Issue

Issue issues a draft: finalised and submitted when the organisation reports automatically (202), otherwise finalised and sent to the buyer (200, `NotReportedReason`). Sends an `Idempotency-Key`.

func (*SubmissionsService) QueryStatus

func (s *SubmissionsService) QueryStatus(ctx context.Context, id string, opts ...RequestOption) (*QueryInvoiceStatusData, error)

QueryStatus asks the tax authority now for the invoice's state (`invoice.query_status`). Sends an `Idempotency-Key`.

func (*SubmissionsService) RecordPayment

RecordPayment records a payment against an issued invoice (`invoice.record_payment`). Charged once per status report relayed to the tax authority; a no-op change is free. Not retried by the SDK.

func (*SubmissionsService) Renumber

Renumber gives an invoice whose submission is on hold because the tax authority already holds its number the next number of its series and queues a new submission (`invoice.submit`). Sends an `Idempotency-Key`.

func (*SubmissionsService) Retry

Retry resumes a submission that is on hold, with its existing charge hold (`invoice.retry`; 202).

func (*SubmissionsService) Submit

Submit queues a submission of a finalised invoice (`invoice.submit`; 202, or 200 `Replayed: true` while one is in flight). `Finalise: "true"` finalises a draft first. Sends an `Idempotency-Key`.

type SubmitAnswerDto

type SubmitAnswerDto struct {
	Invoice InvoiceViewDto `json:"invoice"`

	Submission SubmissionViewDto `json:"submission"`

	// Replayed True when the answer is a submission already in flight.
	Replayed bool `json:"replayed"`
}

SubmitAnswerDto is `invoice.SubmitAnswerDto`.

type SubmitInvoiceData

type SubmitInvoiceData = SubmitAnswerDto

SubmitInvoiceData is the data of a successful POST /i/v1/invoices/{id}/submit.

type SubmitInvoiceQuery

type SubmitInvoiceQuery struct {
	// Finalise Finalise a draft and submit it in one step.
	Finalise *SubmitInvoiceQueryFinalise `json:"finalise,omitempty"`
}

SubmitInvoiceQuery holds the query parameters of POST /i/v1/invoices/{id}/submit.

type SubmitInvoiceQueryFinalise

type SubmitInvoiceQueryFinalise string

SubmitInvoiceQueryFinalise is the type of SubmitInvoiceQuery.Finalise. The API may add values.

const (
	SubmitInvoiceQueryFinaliseTrue  SubmitInvoiceQueryFinalise = "true"
	SubmitInvoiceQueryFinaliseFalse SubmitInvoiceQueryFinalise = "false"
)

Values of SubmitInvoiceQueryFinalise.

type SubmitRefusalDto

type SubmitRefusalDto struct {
	// ErrorCode Example: "BIZ204".
	ErrorCode string `json:"errorCode"`

	Message string `json:"message"`
}

SubmitRefusalDto is `invoice.SubmitRefusalDto`.

type SubscriptionDto

type SubscriptionDto struct {
	ID string `json:"id"`

	// PlanCode Example: "starter".
	PlanCode string `json:"planCode"`

	PlanName string `json:"planName"`

	// PlanVersion Catalogue plan version this subscription is priced at.
	PlanVersion int64 `json:"planVersion"`

	Interval SubscriptionDtoInterval `json:"interval"`

	Status SubscriptionDtoStatus `json:"status"`

	// AmountMinor Integer minor units per period (0 for Free).
	AmountMinor int64 `json:"amountMinor"`

	Currency SubscriptionDtoCurrency `json:"currency"`

	MonthlyCredits int64 `json:"monthlyCredits"`

	CurrentPeriodStart *string `json:"currentPeriodStart"`

	CurrentPeriodEnd *string `json:"currentPeriodEnd"`

	CancelAtPeriodEnd bool `json:"cancelAtPeriodEnd"`

	PastDueSince *string `json:"pastDueSince"`

	// GraceEndsAt When the grace period after the missed payment ends (pastDueSince plus the configured grace days); null unless past_due.
	GraceEndsAt *string `json:"graceEndsAt"`

	CreatedAt string `json:"createdAt"`
}

SubscriptionDto is `billing.SubscriptionDto`.

type SubscriptionDtoCurrency

type SubscriptionDtoCurrency string

SubscriptionDtoCurrency is the type of SubscriptionDto.Currency. The API may add values.

const (
	SubscriptionDtoCurrencyNGN SubscriptionDtoCurrency = "NGN"
	SubscriptionDtoCurrencyUSD SubscriptionDtoCurrency = "USD"
)

Values of SubscriptionDtoCurrency.

type SubscriptionDtoInterval

type SubscriptionDtoInterval string

SubscriptionDtoInterval is the type of SubscriptionDto.Interval. The API may add values.

const (
	SubscriptionDtoIntervalMonthly SubscriptionDtoInterval = "monthly"
	SubscriptionDtoIntervalYearly  SubscriptionDtoInterval = "yearly"
)

Values of SubscriptionDtoInterval.

type SubscriptionDtoStatus

type SubscriptionDtoStatus string

SubscriptionDtoStatus is the type of SubscriptionDto.Status. The API may add values.

const (
	SubscriptionDtoStatusPendingPayment SubscriptionDtoStatus = "pending_payment"
	SubscriptionDtoStatusActive         SubscriptionDtoStatus = "active"
	SubscriptionDtoStatusPastDue        SubscriptionDtoStatus = "past_due"
	SubscriptionDtoStatusCancelled      SubscriptionDtoStatus = "cancelled"
	SubscriptionDtoStatusExpired        SubscriptionDtoStatus = "expired"
)

Values of SubscriptionDtoStatus.

type SubscriptionPeriodDto

type SubscriptionPeriodDto struct {
	ID string `json:"id"`

	SubscriptionID string `json:"subscriptionId"`

	PeriodStart string `json:"periodStart"`

	PeriodEnd string `json:"periodEnd"`

	ChargeStatus SubscriptionPeriodDtoChargeStatus `json:"chargeStatus"`

	PaymentID *string `json:"paymentId"`

	// AmountMinor Integer minor units.
	AmountMinor int64 `json:"amountMinor"`

	Currency SubscriptionPeriodDtoCurrency `json:"currency"`

	CreatedAt string `json:"createdAt"`

	SettledAt *string `json:"settledAt"`
}

SubscriptionPeriodDto is `billing.SubscriptionPeriodDto`.

type SubscriptionPeriodDtoChargeStatus

type SubscriptionPeriodDtoChargeStatus string

SubscriptionPeriodDtoChargeStatus is the type of SubscriptionPeriodDto.ChargeStatus. The API may add values.

const (
	SubscriptionPeriodDtoChargeStatusNotRequired SubscriptionPeriodDtoChargeStatus = "not_required"
	SubscriptionPeriodDtoChargeStatusPending     SubscriptionPeriodDtoChargeStatus = "pending"
	SubscriptionPeriodDtoChargeStatusSucceeded   SubscriptionPeriodDtoChargeStatus = "succeeded"
	SubscriptionPeriodDtoChargeStatusFailed      SubscriptionPeriodDtoChargeStatus = "failed"
)

Values of SubscriptionPeriodDtoChargeStatus.

type SubscriptionPeriodDtoCurrency

type SubscriptionPeriodDtoCurrency string

SubscriptionPeriodDtoCurrency is the type of SubscriptionPeriodDto.Currency. The API may add values.

const (
	SubscriptionPeriodDtoCurrencyNGN SubscriptionPeriodDtoCurrency = "NGN"
	SubscriptionPeriodDtoCurrencyUSD SubscriptionPeriodDtoCurrency = "USD"
)

Values of SubscriptionPeriodDtoCurrency.

type SubscriptionsService

type SubscriptionsService struct {
	// contains filtered or unexported fields
}

SubscriptionsService is subscriptions (`/b/v1/subscriptions`): read-only for an API key.

func (*SubscriptionsService) Get

Get is one subscription (`billing.subscription.read`).

func (*SubscriptionsService) GetActive

GetActive is the active or past-due subscription and its allocation window (`billing.subscription.read`).

func (*SubscriptionsService) List

List is every subscription, newest first (`billing.subscription.read`).

func (*SubscriptionsService) ListRenewals

ListRenewals is the billing periods and how each was charged (`billing.subscription.read`).

func (*SubscriptionsService) PreviewPlanChange

PreviewPlanChange is what a plan change would cost now and at period end; writes nothing (`billing.subscription.read`).

type SupplierBucketDto

type SupplierBucketDto struct {
	Count float64 `json:"count"`

	// GrossPayableMinor MINOR units, reporting currency.
	GrossPayableMinor float64 `json:"grossPayableMinor"`

	Name *string `json:"name"`

	TIN *string `json:"tin"`
}

SupplierBucketDto is `invoice.SupplierBucketDto`.

type TaxConnectionService

type TaxConnectionService struct {
	// contains filtered or unexported fields
}

TaxConnectionService is the tax connection (`/i/v1/tax-connection`): the organisation's link to the tax authority.

func (*TaxConnectionService) Get

Get is the connection's state in the key's mode, its key and the next step (`tax_connection.read`).

type TaxIdLookupDto

type TaxIdLookupDto struct {
	// Value Example: "33875194-0001".
	Value string `json:"value"`

	Type TaxIdLookupDtoType `json:"type"`

	Outcome TaxIdLookupDtoOutcome `json:"outcome"`

	// RegisteredName The registered name, when verified.
	RegisteredName *string `json:"registeredName,omitempty"`

	// Reference The provider’s verification reference, when verified.
	Reference *string `json:"reference,omitempty"`
}

TaxIdLookupDto is `invoice.TaxIdLookupDto`.

type TaxIdLookupDtoOutcome

type TaxIdLookupDtoOutcome string

TaxIdLookupDtoOutcome is the type of TaxIdLookupDto.Outcome. The API may add values.

const (
	TaxIdLookupDtoOutcomeVerified TaxIdLookupDtoOutcome = "verified"
	TaxIdLookupDtoOutcomeNotFound TaxIdLookupDtoOutcome = "not_found"
)

Values of TaxIdLookupDtoOutcome.

type TaxIdLookupDtoType

type TaxIdLookupDtoType string

TaxIdLookupDtoType is the type of TaxIdLookupDto.Type. The API may add values.

const (
	TaxIdLookupDtoTypeTIN     TaxIdLookupDtoType = "tin"
	TaxIdLookupDtoTypeRn      TaxIdLookupDtoType = "rn"
	TaxIdLookupDtoTypeForeign TaxIdLookupDtoType = "foreign"
)

Values of TaxIdLookupDtoType.

type TaxIdTypeOptionDto

type TaxIdTypeOptionDto struct {
	Type TaxIdTypeOptionDtoType `json:"type"`

	Description string `json:"description"`

	// Verifiable Whether a tax id of this type can be verified.
	Verifiable bool `json:"verifiable"`
}

TaxIdTypeOptionDto is `invoice.TaxIdTypeOptionDto`.

type TaxIdTypeOptionDtoType

type TaxIdTypeOptionDtoType string

TaxIdTypeOptionDtoType is the type of TaxIdTypeOptionDto.Type. The API may add values.

const (
	TaxIdTypeOptionDtoTypeTIN     TaxIdTypeOptionDtoType = "tin"
	TaxIdTypeOptionDtoTypeRn      TaxIdTypeOptionDtoType = "rn"
	TaxIdTypeOptionDtoTypeForeign TaxIdTypeOptionDtoType = "foreign"
	TaxIdTypeOptionDtoTypeNone    TaxIdTypeOptionDtoType = "none"
)

Values of TaxIdTypeOptionDtoType.

type TaxIdentityViewDto

type TaxIdentityViewDto struct {
	// TaxID In the form the tax authority displays it.
	TaxID string `json:"taxId"`

	ConnectedAt string `json:"connectedAt"`

	RevokedAt *string `json:"revokedAt"`

	RevokedReason *string `json:"revokedReason"`
}

TaxIdentityViewDto is `invoice.TaxIdentityViewDto`.

type TestWebhookEndpointBody

type TestWebhookEndpointBody = TestWebhookEndpointDto

TestWebhookEndpointBody is the request body of POST /n/v1/webhook-endpoints/{id}/test.

type TestWebhookEndpointData

type TestWebhookEndpointData = WebhookTestResultDto

TestWebhookEndpointData is the data of a successful POST /n/v1/webhook-endpoints/{id}/test.

type TestWebhookEndpointDto

type TestWebhookEndpointDto struct {
	// Type Send a sample event of this type; when absent, a `webhook_endpoint.pinged` ping is sent.
	// Example: "invoice.signed".
	Type *string `json:"type,omitempty"`
}

TestWebhookEndpointDto is `notification.TestWebhookEndpointDto`.

type TimeoutError

type TimeoutError struct {
	// Timeout is the deadline that was exceeded.
	Timeout time.Duration
}

TimeoutError means the request did not finish within the timeout (headers and body).

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type TopSuppliersDto

type TopSuppliersDto struct {
	ByAmount []SupplierBucketDto `json:"byAmount"`

	ByCount []SupplierBucketDto `json:"byCount"`
}

TopSuppliersDto is `invoice.TopSuppliersDto`.

type TransactionsService

type TransactionsService struct {
	// contains filtered or unexported fields
}

TransactionsService is the credit ledger (`/b/v1/transactions`).

func (*TransactionsService) Get

Get is one ledger entry (`billing.ledger.read`).

func (*TransactionsService) GetUsageAnalytics

func (s *TransactionsService) GetUsageAnalytics(ctx context.Context, query *GetUsageAnalyticsQuery, opts ...RequestOption) ([]GetUsageAnalyticsItem, error)

GetUsageAnalytics is credits spent per day, week or month (`billing.usage.read`).

func (*TransactionsService) GetUsageByCostCode

func (s *TransactionsService) GetUsageByCostCode(ctx context.Context, query *GetUsageByCostCodeQuery, opts ...RequestOption) ([]GetUsageByCostCodeItem, error)

GetUsageByCostCode is credits spent per cost code, net of refunds (`billing.usage.read`).

func (*TransactionsService) List

List is ledger entries, newest first (`billing.ledger.read`).

type TransmittedByDto

type TransmittedByDto struct {
	// Us A submission of ours registered this IRN: Yona was the access point.
	Us bool `json:"us"`

	// Provider The other access point, when NRS named it; null for ours, and where NRS did not say (history rows today).
	Provider *TransmitterDto `json:"provider"`

	// Label `Yona`, the provider’s name, or `Another provider` when it is not us and NRS did not say who.
	// Example: "Another provider".
	Label string `json:"label"`
}

TransmittedByDto is `invoice.TransmittedByDto`.

type TransmitterDto

type TransmitterDto struct {
	// Reference NRS’s reference for the access point (`app_reference`): a slug, not an id; NRS offers no lookup to a name.
	// Example: "softrust-technologies-limited".
	Reference string `json:"reference"`

	// Name The reference made readable.
	// Example: "Softrust Technologies Limited".
	Name string `json:"name"`
}

TransmitterDto is `invoice.TransmitterDto`.

type Transport

type Transport interface {
	Do(*http.Request) (*http.Response, error)
}

Transport sends one HTTP request; *http.Client satisfies it. Tests inject a recorder.

type UnarchiveItemData

type UnarchiveItemData = ItemViewDto

UnarchiveItemData is the data of a successful POST /i/v1/items/{id}/unarchive.

type UpdateBuyerBody

type UpdateBuyerBody = UpdateBuyerDto

UpdateBuyerBody is the request body of PATCH /i/v1/buyers/{id}.

type UpdateBuyerData

type UpdateBuyerData = BuyerViewDto

UpdateBuyerData is the data of a successful PATCH /i/v1/buyers/{id}.

type UpdateBuyerDto

type UpdateBuyerDto struct {
	Name *string `json:"name,omitempty"`

	LegalName *string `json:"legalName,omitempty"`

	TaxID *string `json:"taxId,omitempty"`

	TaxIDType *UpdateBuyerDtoTaxIDType `json:"taxIdType,omitempty"`

	Email *string `json:"email,omitempty"`

	// Phone E.164.
	Phone *string `json:"phone,omitempty"`

	Address *BuyerAddressDto `json:"address,omitempty"`

	PartyType *UpdateBuyerDtoPartyType `json:"partyType,omitempty"`

	BusinessDescription *string `json:"businessDescription,omitempty"`

	Reference *string `json:"reference,omitempty"`
}

UpdateBuyerDto is `invoice.UpdateBuyerDto`.

type UpdateBuyerDtoPartyType

type UpdateBuyerDtoPartyType string

UpdateBuyerDtoPartyType is the type of UpdateBuyerDto.PartyType. The API may add values.

const (
	UpdateBuyerDtoPartyTypeIndividual  UpdateBuyerDtoPartyType = "individual"
	UpdateBuyerDtoPartyTypeCompany     UpdateBuyerDtoPartyType = "company"
	UpdateBuyerDtoPartyTypePartnership UpdateBuyerDtoPartyType = "partnership"
	UpdateBuyerDtoPartyTypeNonProfit   UpdateBuyerDtoPartyType = "non_profit"
	UpdateBuyerDtoPartyTypeGovernment  UpdateBuyerDtoPartyType = "government"
)

Values of UpdateBuyerDtoPartyType.

type UpdateBuyerDtoTaxIDType

type UpdateBuyerDtoTaxIDType string

UpdateBuyerDtoTaxIDType is the type of UpdateBuyerDto.TaxIDType. The API may add values.

const (
	UpdateBuyerDtoTaxIDTypeTIN     UpdateBuyerDtoTaxIDType = "tin"
	UpdateBuyerDtoTaxIDTypeRn      UpdateBuyerDtoTaxIDType = "rn"
	UpdateBuyerDtoTaxIDTypeForeign UpdateBuyerDtoTaxIDType = "foreign"
	UpdateBuyerDtoTaxIDTypeNone    UpdateBuyerDtoTaxIDType = "none"
)

Values of UpdateBuyerDtoTaxIDType.

type UpdateInvoiceBody

type UpdateInvoiceBody = UpdateInvoiceDto

UpdateInvoiceBody is the request body of PATCH /i/v1/invoices/{id}.

type UpdateInvoiceData

type UpdateInvoiceData = InvoiceViewDto

UpdateInvoiceData is the data of a successful PATCH /i/v1/invoices/{id}.

type UpdateInvoiceDto

type UpdateInvoiceDto struct {
	SellerID *string `json:"sellerId,omitempty"`

	// BuyerID `null` removes the buyer.
	BuyerID *string `json:"buyerId,omitempty"`

	// InvoiceKind Example: "B2C".
	InvoiceKind *string `json:"invoiceKind,omitempty"`

	// InvoiceNumber A document number of this organisation, mode and issue year (channel, seller code, two-digit year, 6 or more digits).
	// Example: "YPLEKA26000042".
	InvoiceNumber *string `json:"invoiceNumber,omitempty"`

	// InvoiceDate Example: "2026-09-30".
	InvoiceDate *string `json:"invoiceDate,omitempty"`

	// IssueTime Example: "14:30:00".
	IssueTime *string `json:"issueTime,omitempty"`

	// DueDate Example: "2026-10-30".
	DueDate *string `json:"dueDate,omitempty"`

	// Currency Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	LineItems []InvoiceLineItemDto `json:"lineItems,omitempty"`

	// AllowanceAmount Document allowance, major units, ≤ 2 decimals.
	AllowanceAmount *Amount `json:"allowanceAmount,omitempty"`

	// ChargeAmount Document charge, major units, ≤ 2 decimals.
	ChargeAmount *Amount `json:"chargeAmount,omitempty"`

	PaymentTerms *string `json:"paymentTerms,omitempty"`

	Notes *string `json:"notes,omitempty"`

	PurchaseOrderReference *string `json:"purchaseOrderReference,omitempty"`

	BuyerReference *string `json:"buyerReference,omitempty"`

	AccountingCost *string `json:"accountingCost,omitempty"`
}

UpdateInvoiceDto is `invoice.UpdateInvoiceDto`.

type UpdateItemBody

type UpdateItemBody = UpdateItemDto

UpdateItemBody is the request body of PATCH /i/v1/items/{id}.

type UpdateItemData

type UpdateItemData = ItemViewDto

UpdateItemData is the data of a successful PATCH /i/v1/items/{id}.

type UpdateItemDto

type UpdateItemDto struct {
	Name *string `json:"name,omitempty"`

	Description *string `json:"description,omitempty"`

	// ItemType Immutable: only the stored value is accepted.
	ItemType *UpdateItemDtoItemType `json:"itemType,omitempty"`

	HSNCode *string `json:"hsnCode,omitempty"`

	ServiceCode *string `json:"serviceCode,omitempty"`

	ProductCategory *string `json:"productCategory,omitempty"`

	UnitCode *string `json:"unitCode,omitempty"`

	UnitPriceMinor *string `json:"unitPriceMinor,omitempty"`

	Currency *string `json:"currency,omitempty"`

	TaxCategory *string `json:"taxCategory,omitempty"`

	SKU *string `json:"sku,omitempty"`
}

UpdateItemDto is `invoice.UpdateItemDto`.

type UpdateItemDtoItemType

type UpdateItemDtoItemType string

UpdateItemDtoItemType is the type of UpdateItemDto.ItemType. The API may add values.

const (
	UpdateItemDtoItemTypeGoods   UpdateItemDtoItemType = "goods"
	UpdateItemDtoItemTypeService UpdateItemDtoItemType = "service"
)

Values of UpdateItemDtoItemType.

type UsageBucketDto

type UsageBucketDto struct {
	// BucketStart UTC bucket start (ISO week for weekly).
	BucketStart string `json:"bucketStart"`

	Credits int64 `json:"credits"`

	Count int64 `json:"count"`
}

UsageBucketDto is `billing.UsageBucketDto`.

type UsedCodeDto

type UsedCodeDto struct {
	// Code Example: "8471.30".
	Code string `json:"code"`

	// Description The most recent line’s product category for this code.
	Description *string `json:"description"`

	// UseCount Invoice lines carrying the code, in every status (drafts and cancelled included).
	// Example: 12.
	UseCount float64 `json:"useCount"`

	// LastUsedAt The most recent invoice’s createdAt.
	LastUsedAt string `json:"lastUsedAt"`
}

UsedCodeDto is `invoice.UsedCodeDto`.

type ValidateInvoiceBody

type ValidateInvoiceBody = ValidateInvoiceDto

ValidateInvoiceBody is the request body of POST /i/v1/invoices/validate.

type ValidateInvoiceData

type ValidateInvoiceData = ValidationResultDto

ValidateInvoiceData is the data of a successful POST /i/v1/invoices/validate.

type ValidateInvoiceDto

type ValidateInvoiceDto struct {
	// InvoiceID Validate a stored invoice (alone).
	InvoiceID *string `json:"invoiceId,omitempty"`

	// SellerID Only the organisation’s own seller id.
	SellerID *string `json:"sellerId,omitempty"`

	BuyerID *string `json:"buyerId,omitempty"`

	// InvoiceKind Example: "B2B".
	InvoiceKind *string `json:"invoiceKind,omitempty"`

	// InvoiceNumber Example: "YPLEKA26000042".
	InvoiceNumber *string `json:"invoiceNumber,omitempty"`

	// InvoiceType Only `standard`: credit notes are not validated here.
	InvoiceType *ValidateInvoiceDtoInvoiceType `json:"invoiceType,omitempty"`

	// InvoiceDate The issue date (required with an invoice body).
	// Example: "2026-09-30".
	InvoiceDate *string `json:"invoiceDate,omitempty"`

	// IssueTime Example: "10:30:00".
	IssueTime *string `json:"issueTime,omitempty"`

	// DueDate Example: "2026-10-30".
	DueDate *string `json:"dueDate,omitempty"`

	// Currency ISO 4217 (required with an invoice body).
	// Example: "NGN".
	Currency *string `json:"currency,omitempty"`

	LineItems []ValidateLineItemDto `json:"lineItems,omitempty"`

	AllowanceAmount *Amount `json:"allowanceAmount,omitempty"`

	ChargeAmount *Amount `json:"chargeAmount,omitempty"`

	PaymentTerms *string `json:"paymentTerms,omitempty"`

	Notes *string `json:"notes,omitempty"`

	PurchaseOrderReference *string `json:"purchaseOrderReference,omitempty"`

	BuyerReference *string `json:"buyerReference,omitempty"`

	AccountingCost *string `json:"accountingCost,omitempty"`
}

ValidateInvoiceDto is `invoice.ValidateInvoiceDto`.

type ValidateInvoiceDtoInvoiceType

type ValidateInvoiceDtoInvoiceType string

ValidateInvoiceDtoInvoiceType is the type of ValidateInvoiceDto.InvoiceType. The API may add values.

const (
	ValidateInvoiceDtoInvoiceTypeStandard ValidateInvoiceDtoInvoiceType = "standard"
)

Values of ValidateInvoiceDtoInvoiceType.

type ValidateLineItemDto

type ValidateLineItemDto struct {
	// ItemID A saved item of the organisation: every omitted field below is filled from it.
	ItemID *string `json:"itemId,omitempty"`

	// Description Required without an itemId.
	Description *string `json:"description,omitempty"`

	ItemName *string `json:"itemName,omitempty"`

	// HSNCode Example: "9983".
	HSNCode *string `json:"hsnCode,omitempty"`

	ProductCategory *string `json:"productCategory,omitempty"`

	// ISICCode The service code.
	ISICCode *string `json:"isicCode,omitempty"`

	ServiceCategory *string `json:"serviceCategory,omitempty"`

	// Quantity > 0, ≤ 6 decimals
	// Example: "2".
	Quantity Amount `json:"quantity"`

	// UnitCode Required without an itemId.
	// Example: "EA".
	UnitCode *string `json:"unitCode,omitempty"`

	// UnitPrice ≥ 0, ≤ 4 decimals, major units. Required without an itemId.
	// Example: "15000.00".
	UnitPrice *Amount `json:"unitPrice,omitempty"`

	// DiscountAmount major units, ≤ 2 decimals
	DiscountAmount *Amount `json:"discountAmount,omitempty"`

	// FeeAmount major units, ≤ 2 decimals
	FeeAmount *Amount `json:"feeAmount,omitempty"`

	// TaxCategory Required without an itemId.
	// Example: "STANDARD_VAT".
	TaxCategory *string `json:"taxCategory,omitempty"`
}

ValidateLineItemDto is `invoice.ValidateLineItemDto`.

type ValidationError

type ValidationError struct{ *APIError }

ValidationError is 400 or 422: a field out of shape or not accepted (`VAL…`).

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap exposes the *APIError to errors.As.

type ValidationFindingDto

type ValidationFindingDto struct {
	// Code Example: "TAX_CATEGORY_UNKNOWN".
	Code string `json:"code"`

	// Field Example: "tax_total[0].tax_subtotal[0].tax_category.id".
	Field *string `json:"field,omitempty"`

	Message string `json:"message"`
}

ValidationFindingDto is `invoice.ValidationFindingDto`.

type ValidationResultDto

type ValidationResultDto struct {
	Valid bool `json:"valid"`

	// PreviewAuthorityReference The reference the authority WOULD mint — a preview, nothing is registered.
	PreviewAuthorityReference *string `json:"previewAuthorityReference,omitempty"`

	Errors []ValidationFindingDto `json:"errors"`
}

ValidationResultDto is `invoice.ValidationResultDto`.

type VerifyBuyerTaxNumberData

type VerifyBuyerTaxNumberData = BuyerVerificationRequestedDto

VerifyBuyerTaxNumberData is the data of a successful POST /i/v1/buyers/{id}/verify-tax-number.

type VerifyOption

type VerifyOption func(*verifyOptions)

VerifyOption configures VerifyWebhook.

func WithNow

func WithNow(unix int64) VerifyOption

WithNow sets "now" in unix seconds (for tests).

func WithTolerance

func WithTolerance(seconds int64) VerifyOption

WithTolerance sets the maximum distance (seconds) between the signature's `t` and now (default 300). Replay protection.

type WebhookDeliveriesService

type WebhookDeliveriesService struct {
	// contains filtered or unexported fields
}

WebhookDeliveriesService is webhook deliveries (`/n/v1/webhook-deliveries`): one per event × endpoint, with its attempts.

func (*WebhookDeliveriesService) Get

Get is one delivery and its attempt log (`webhook.delivery.read`).

func (*WebhookDeliveriesService) List

List lists deliveries by endpoint, status or type (`webhook.delivery.read`).

func (*WebhookDeliveriesService) Redeliver

Redeliver is one more attempt with the stored bytes (`webhook.delivery.redeliver`; 202).

type WebhookDeliveryAttemptDto

type WebhookDeliveryAttemptDto struct {
	AttemptNo float64 `json:"attemptNo"`

	StartedAt string `json:"startedAt"`

	DurationMs float64 `json:"durationMs"`

	Outcome WebhookDeliveryAttemptDtoOutcome `json:"outcome"`

	HTTPStatus *int64 `json:"httpStatus"`

	ErrorClass *WebhookDeliveryAttemptDtoErrorClass `json:"errorClass"`
}

WebhookDeliveryAttemptDto is `notification.WebhookDeliveryAttemptDto`.

type WebhookDeliveryAttemptDtoErrorClass

type WebhookDeliveryAttemptDtoErrorClass string

WebhookDeliveryAttemptDtoErrorClass is the type of WebhookDeliveryAttemptDto.ErrorClass. The API may add values.

const (
	WebhookDeliveryAttemptDtoErrorClassHTTPStatus    WebhookDeliveryAttemptDtoErrorClass = "http_status"
	WebhookDeliveryAttemptDtoErrorClassRedirect      WebhookDeliveryAttemptDtoErrorClass = "redirect"
	WebhookDeliveryAttemptDtoErrorClassTimeout       WebhookDeliveryAttemptDtoErrorClass = "timeout"
	WebhookDeliveryAttemptDtoErrorClassNetwork       WebhookDeliveryAttemptDtoErrorClass = "network"
	WebhookDeliveryAttemptDtoErrorClassTls           WebhookDeliveryAttemptDtoErrorClass = "tls"
	WebhookDeliveryAttemptDtoErrorClassDns           WebhookDeliveryAttemptDtoErrorClass = "dns"
	WebhookDeliveryAttemptDtoErrorClassEgressRefused WebhookDeliveryAttemptDtoErrorClass = "egress_refused"
	WebhookDeliveryAttemptDtoErrorClassGone          WebhookDeliveryAttemptDtoErrorClass = "gone"
)

Values of WebhookDeliveryAttemptDtoErrorClass.

type WebhookDeliveryAttemptDtoOutcome

type WebhookDeliveryAttemptDtoOutcome string

WebhookDeliveryAttemptDtoOutcome is the type of WebhookDeliveryAttemptDto.Outcome. The API may add values.

const (
	WebhookDeliveryAttemptDtoOutcomeOk        WebhookDeliveryAttemptDtoOutcome = "ok"
	WebhookDeliveryAttemptDtoOutcomeRetryable WebhookDeliveryAttemptDtoOutcome = "retryable"
	WebhookDeliveryAttemptDtoOutcomePermanent WebhookDeliveryAttemptDtoOutcome = "permanent"
	WebhookDeliveryAttemptDtoOutcomeTimeout   WebhookDeliveryAttemptDtoOutcome = "timeout"
	WebhookDeliveryAttemptDtoOutcomeRefused   WebhookDeliveryAttemptDtoOutcome = "refused"
)

Values of WebhookDeliveryAttemptDtoOutcome.

type WebhookDeliveryDetailDto

type WebhookDeliveryDetailDto struct {
	ID string `json:"id"`

	EventID string `json:"eventId"`

	EndpointID string `json:"endpointId"`

	Type string `json:"type"`

	Mode WebhookDeliveryDetailDtoMode `json:"mode"`

	Status WebhookDeliveryDetailDtoStatus `json:"status"`

	FailureReason *WebhookDeliveryDetailDtoFailureReason `json:"failureReason"`

	Attempts float64 `json:"attempts"`

	MaxAttempts float64 `json:"maxAttempts"`

	NextAttemptAt *string `json:"nextAttemptAt"`

	LastHTTPStatus *int64 `json:"lastHttpStatus"`

	LastErrorClass *WebhookDeliveryDetailDtoLastErrorClass `json:"lastErrorClass"`

	Test bool `json:"test"`

	CreatedAt string `json:"createdAt"`

	DeliveredAt *string `json:"deliveredAt"`

	FailedAt *string `json:"failedAt"`

	AttemptLog []WebhookDeliveryAttemptDto `json:"attemptLog"`
}

WebhookDeliveryDetailDto is `notification.WebhookDeliveryDetailDto`.

type WebhookDeliveryDetailDtoFailureReason

type WebhookDeliveryDetailDtoFailureReason string

WebhookDeliveryDetailDtoFailureReason is the type of WebhookDeliveryDetailDto.FailureReason. The API may add values.

const (
	WebhookDeliveryDetailDtoFailureReasonAttemptsExhausted WebhookDeliveryDetailDtoFailureReason = "attempts_exhausted"
	WebhookDeliveryDetailDtoFailureReasonEndpointDisabled  WebhookDeliveryDetailDtoFailureReason = "endpoint_disabled"
	WebhookDeliveryDetailDtoFailureReasonGone              WebhookDeliveryDetailDtoFailureReason = "gone"
	WebhookDeliveryDetailDtoFailureReasonURLRefused        WebhookDeliveryDetailDtoFailureReason = "url_refused"
)

Values of WebhookDeliveryDetailDtoFailureReason.

type WebhookDeliveryDetailDtoLastErrorClass

type WebhookDeliveryDetailDtoLastErrorClass string

WebhookDeliveryDetailDtoLastErrorClass is the type of WebhookDeliveryDetailDto.LastErrorClass. The API may add values.

const (
	WebhookDeliveryDetailDtoLastErrorClassHTTPStatus    WebhookDeliveryDetailDtoLastErrorClass = "http_status"
	WebhookDeliveryDetailDtoLastErrorClassRedirect      WebhookDeliveryDetailDtoLastErrorClass = "redirect"
	WebhookDeliveryDetailDtoLastErrorClassTimeout       WebhookDeliveryDetailDtoLastErrorClass = "timeout"
	WebhookDeliveryDetailDtoLastErrorClassNetwork       WebhookDeliveryDetailDtoLastErrorClass = "network"
	WebhookDeliveryDetailDtoLastErrorClassTls           WebhookDeliveryDetailDtoLastErrorClass = "tls"
	WebhookDeliveryDetailDtoLastErrorClassDns           WebhookDeliveryDetailDtoLastErrorClass = "dns"
	WebhookDeliveryDetailDtoLastErrorClassEgressRefused WebhookDeliveryDetailDtoLastErrorClass = "egress_refused"
	WebhookDeliveryDetailDtoLastErrorClassGone          WebhookDeliveryDetailDtoLastErrorClass = "gone"
)

Values of WebhookDeliveryDetailDtoLastErrorClass.

type WebhookDeliveryDetailDtoMode

type WebhookDeliveryDetailDtoMode string

WebhookDeliveryDetailDtoMode is the type of WebhookDeliveryDetailDto.Mode. The API may add values.

const (
	WebhookDeliveryDetailDtoModeSandbox WebhookDeliveryDetailDtoMode = "sandbox"
	WebhookDeliveryDetailDtoModeLive    WebhookDeliveryDetailDtoMode = "live"
)

Values of WebhookDeliveryDetailDtoMode.

type WebhookDeliveryDetailDtoStatus

type WebhookDeliveryDetailDtoStatus string

WebhookDeliveryDetailDtoStatus is the type of WebhookDeliveryDetailDto.Status. The API may add values.

const (
	WebhookDeliveryDetailDtoStatusPending    WebhookDeliveryDetailDtoStatus = "pending"
	WebhookDeliveryDetailDtoStatusDelivering WebhookDeliveryDetailDtoStatus = "delivering"
	WebhookDeliveryDetailDtoStatusRetrying   WebhookDeliveryDetailDtoStatus = "retrying"
	WebhookDeliveryDetailDtoStatusDelivered  WebhookDeliveryDetailDtoStatus = "delivered"
	WebhookDeliveryDetailDtoStatusFailed     WebhookDeliveryDetailDtoStatus = "failed"
)

Values of WebhookDeliveryDetailDtoStatus.

type WebhookDeliveryDto

type WebhookDeliveryDto struct {
	ID string `json:"id"`

	EventID string `json:"eventId"`

	EndpointID string `json:"endpointId"`

	Type string `json:"type"`

	Mode WebhookDeliveryDtoMode `json:"mode"`

	Status WebhookDeliveryDtoStatus `json:"status"`

	FailureReason *WebhookDeliveryDtoFailureReason `json:"failureReason"`

	Attempts float64 `json:"attempts"`

	MaxAttempts float64 `json:"maxAttempts"`

	NextAttemptAt *string `json:"nextAttemptAt"`

	LastHTTPStatus *int64 `json:"lastHttpStatus"`

	LastErrorClass *WebhookDeliveryDtoLastErrorClass `json:"lastErrorClass"`

	Test bool `json:"test"`

	CreatedAt string `json:"createdAt"`

	DeliveredAt *string `json:"deliveredAt"`

	FailedAt *string `json:"failedAt"`
}

WebhookDeliveryDto is `notification.WebhookDeliveryDto`.

type WebhookDeliveryDtoFailureReason

type WebhookDeliveryDtoFailureReason string

WebhookDeliveryDtoFailureReason is the type of WebhookDeliveryDto.FailureReason. The API may add values.

const (
	WebhookDeliveryDtoFailureReasonAttemptsExhausted WebhookDeliveryDtoFailureReason = "attempts_exhausted"
	WebhookDeliveryDtoFailureReasonEndpointDisabled  WebhookDeliveryDtoFailureReason = "endpoint_disabled"
	WebhookDeliveryDtoFailureReasonGone              WebhookDeliveryDtoFailureReason = "gone"
	WebhookDeliveryDtoFailureReasonURLRefused        WebhookDeliveryDtoFailureReason = "url_refused"
)

Values of WebhookDeliveryDtoFailureReason.

type WebhookDeliveryDtoLastErrorClass

type WebhookDeliveryDtoLastErrorClass string

WebhookDeliveryDtoLastErrorClass is the type of WebhookDeliveryDto.LastErrorClass. The API may add values.

const (
	WebhookDeliveryDtoLastErrorClassHTTPStatus    WebhookDeliveryDtoLastErrorClass = "http_status"
	WebhookDeliveryDtoLastErrorClassRedirect      WebhookDeliveryDtoLastErrorClass = "redirect"
	WebhookDeliveryDtoLastErrorClassTimeout       WebhookDeliveryDtoLastErrorClass = "timeout"
	WebhookDeliveryDtoLastErrorClassNetwork       WebhookDeliveryDtoLastErrorClass = "network"
	WebhookDeliveryDtoLastErrorClassTls           WebhookDeliveryDtoLastErrorClass = "tls"
	WebhookDeliveryDtoLastErrorClassDns           WebhookDeliveryDtoLastErrorClass = "dns"
	WebhookDeliveryDtoLastErrorClassEgressRefused WebhookDeliveryDtoLastErrorClass = "egress_refused"
	WebhookDeliveryDtoLastErrorClassGone          WebhookDeliveryDtoLastErrorClass = "gone"
)

Values of WebhookDeliveryDtoLastErrorClass.

type WebhookDeliveryDtoMode

type WebhookDeliveryDtoMode string

WebhookDeliveryDtoMode is the type of WebhookDeliveryDto.Mode. The API may add values.

const (
	WebhookDeliveryDtoModeSandbox WebhookDeliveryDtoMode = "sandbox"
	WebhookDeliveryDtoModeLive    WebhookDeliveryDtoMode = "live"
)

Values of WebhookDeliveryDtoMode.

type WebhookDeliveryDtoStatus

type WebhookDeliveryDtoStatus string

WebhookDeliveryDtoStatus is the type of WebhookDeliveryDto.Status. The API may add values.

const (
	WebhookDeliveryDtoStatusPending    WebhookDeliveryDtoStatus = "pending"
	WebhookDeliveryDtoStatusDelivering WebhookDeliveryDtoStatus = "delivering"
	WebhookDeliveryDtoStatusRetrying   WebhookDeliveryDtoStatus = "retrying"
	WebhookDeliveryDtoStatusDelivered  WebhookDeliveryDtoStatus = "delivered"
	WebhookDeliveryDtoStatusFailed     WebhookDeliveryDtoStatus = "failed"
)

Values of WebhookDeliveryDtoStatus.

type WebhookEndpointDto

type WebhookEndpointDto struct {
	ID string `json:"id"`

	URL string `json:"url"`

	Description *string `json:"description"`

	Mode WebhookEndpointDtoMode `json:"mode"`

	// Events The subscription patterns.
	Events []string `json:"events"`

	// ResolvedTypes The catalogue types the patterns deliver today, under the capabilities of the member who wrote them.
	ResolvedTypes []string `json:"resolvedTypes"`

	Status WebhookEndpointDtoStatus `json:"status"`

	DisabledCause *WebhookEndpointDtoDisabledCause `json:"disabledCause"`

	FailingSince *string `json:"failingSince"`

	ConsecutiveFailures float64 `json:"consecutiveFailures"`

	// PreviousSecretExpiresAt Until when requests also carry a signature for the previous secret.
	PreviousSecretExpiresAt *string `json:"previousSecretExpiresAt"`

	CreatedAt string `json:"createdAt"`

	UpdatedAt string `json:"updatedAt"`
}

WebhookEndpointDto is `notification.WebhookEndpointDto`.

type WebhookEndpointDtoDisabledCause

type WebhookEndpointDtoDisabledCause string

WebhookEndpointDtoDisabledCause is the type of WebhookEndpointDto.DisabledCause. The API may add values.

const (
	WebhookEndpointDtoDisabledCauseConsecutiveFailures WebhookEndpointDtoDisabledCause = "consecutive_failures"
	WebhookEndpointDtoDisabledCauseGone                WebhookEndpointDtoDisabledCause = "gone"
	WebhookEndpointDtoDisabledCauseManual              WebhookEndpointDtoDisabledCause = "manual"
	WebhookEndpointDtoDisabledCauseLiveAccessRevoked   WebhookEndpointDtoDisabledCause = "live_access_revoked"
)

Values of WebhookEndpointDtoDisabledCause.

type WebhookEndpointDtoMode

type WebhookEndpointDtoMode string

WebhookEndpointDtoMode is the type of WebhookEndpointDto.Mode. The API may add values.

const (
	WebhookEndpointDtoModeSandbox WebhookEndpointDtoMode = "sandbox"
	WebhookEndpointDtoModeLive    WebhookEndpointDtoMode = "live"
)

Values of WebhookEndpointDtoMode.

type WebhookEndpointDtoStatus

type WebhookEndpointDtoStatus string

WebhookEndpointDtoStatus is the type of WebhookEndpointDto.Status. The API may add values.

const (
	WebhookEndpointDtoStatusEnabled  WebhookEndpointDtoStatus = "enabled"
	WebhookEndpointDtoStatusDisabled WebhookEndpointDtoStatus = "disabled"
)

Values of WebhookEndpointDtoStatus.

type WebhookEndpointsService

type WebhookEndpointsService struct {
	// contains filtered or unexported fields
}

WebhookEndpointsService is webhook endpoints (`/n/v1/webhook-endpoints`). An API key may read and test them; creating, changing, deleting and rotating an endpoint's secret are done in the dashboard.

func (*WebhookEndpointsService) Get

Get is one endpoint, never its secret (`webhook.endpoint.read`).

func (*WebhookEndpointsService) List

List is the endpoints of the key's organisation and mode; never a secret (`webhook.endpoint.read`).

func (*WebhookEndpointsService) Test

Test sends one test delivery (`"test": true`; never charged; `webhook.endpoint.test`). A nil params sends `{}`.

type WebhookError

type WebhookError struct {
	Message string
}

WebhookError means a webhook request failed signature verification or could not be parsed.

func (*WebhookError) Error

func (e *WebhookError) Error() string

type WebhookEvent

type WebhookEvent struct {
	// ID is the event id: the same across every retry, redelivery and endpoint. Deduplicate on it.
	ID string `json:"id"`
	// Type is a catalogue type, e.g. `invoice.signed`.
	Type WebhookEventType `json:"type"`
	// Version is the version of Data for this type.
	Version int64 `json:"version"`
	// CreatedAt is when the fact happened (not the delivery time), ISO 8601.
	CreatedAt string `json:"createdAt"`
	// Mode is `sandbox` or `live`.
	Mode Mode `json:"mode"`
	// OrganizationID is the organisation the event is about.
	OrganizationID string `json:"organizationId"`
	// Data is the type's payload, still as JSON.
	Data json.RawMessage `json:"data"`
	// Test is present, and true, only on a test delivery.
	Test bool `json:"test,omitempty"`
}

WebhookEvent is the body of a webhook delivery. It is serialised once and every attempt sends the same bytes. Decode Data with DecodeData, or read it as a map with DataMap.

func VerifyWebhook

func VerifyWebhook(payload []byte, headers HeaderGetter, secret string, opts ...VerifyOption) (*WebhookEvent, error)

VerifyWebhook verifies a webhook delivery and returns the parsed event.

Yona signs `t + "." + <the exact bytes of the body>` with HMAC-SHA256 and the endpoint secret, and sends `Yona-Signature: t=<unix seconds>,v1=<hex>`; while a rotated secret overlaps the header carries a second `v1=`. This accepts the delivery when any `v1` matches (constant-time compare) and `t` is within the tolerance. Pass the RAW body: a re-serialised object will not verify. Deduplicate on event.ID: a redelivery carries the same id.

payload is the raw request body; headers the request headers (r.Header); secret the endpoint's signing secret (`whsec_…`) from the dashboard. It returns a *WebhookError when the header is missing or malformed, `t` is outside the tolerance, no signature matches, or the body is not JSON.

http.HandleFunc("/webhooks/yona", func(w http.ResponseWriter, r *http.Request) {
	raw, _ := io.ReadAll(r.Body)
	event, err := einvoice.VerifyWebhook(raw, r.Header, os.Getenv("YONA_WEBHOOK_SECRET"))
	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		return
	}
	if event.Type == einvoice.WebhookEventInvoiceAccepted { … }
	w.WriteHeader(http.StatusOK)
})

func (*WebhookEvent) DataMap

func (e *WebhookEvent) DataMap() map[string]any

DataMap returns the payload as a map, or nil when it is not a JSON object.

func (*WebhookEvent) DecodeData

func (e *WebhookEvent) DecodeData(v any) error

DecodeData unmarshals the payload into v, e.g. a struct with the fields of this type.

type WebhookEventDto

type WebhookEventDto struct {
	// ID The public event id (the envelope `id`).
	ID string `json:"id"`

	Type string `json:"type"`

	Version float64 `json:"version"`

	Scope WebhookEventDtoScope `json:"scope"`

	// Mode Null for an organisation-scoped event.
	Mode *WebhookEventDtoMode `json:"mode"`

	// CreatedAt When the fact happened.
	CreatedAt string `json:"createdAt"`

	// Data The type’s public `data`.
	Data map[string]any `json:"data"`

	Test bool `json:"test"`

	MatchedEndpoints float64 `json:"matchedEndpoints"`

	ReceivedAt string `json:"receivedAt"`
}

WebhookEventDto is `notification.WebhookEventDto`.

type WebhookEventDtoMode

type WebhookEventDtoMode string

WebhookEventDtoMode is the type of WebhookEventDto.Mode. The API may add values.

const (
	WebhookEventDtoModeSandbox WebhookEventDtoMode = "sandbox"
	WebhookEventDtoModeLive    WebhookEventDtoMode = "live"
)

Values of WebhookEventDtoMode.

type WebhookEventDtoScope

type WebhookEventDtoScope string

WebhookEventDtoScope is the type of WebhookEventDto.Scope. The API may add values.

const (
	WebhookEventDtoScopeMode         WebhookEventDtoScope = "mode"
	WebhookEventDtoScopeLive         WebhookEventDtoScope = "live"
	WebhookEventDtoScopeOrganization WebhookEventDtoScope = "organization"
	WebhookEventDtoScopeEndpoint     WebhookEventDtoScope = "endpoint"
)

Values of WebhookEventDtoScope.

type WebhookEventType

type WebhookEventType string

WebhookEventType is a catalogue type, e.g. `invoice.signed`. The catalogue below is as of einvoice-js 0.8.0 (the API's `GET /n/v1/webhook-event-types` is authoritative; new types may arrive, so any other string is accepted too).

const (
	WebhookEventInvoiceCreated                           WebhookEventType = "invoice.created"
	WebhookEventInvoiceUpdated                           WebhookEventType = "invoice.updated"
	WebhookEventInvoiceReopened                          WebhookEventType = "invoice.reopened"
	WebhookEventInvoiceDeleted                           WebhookEventType = "invoice.deleted"
	WebhookEventInvoiceFinalised                         WebhookEventType = "invoice.finalised"
	WebhookEventInvoiceSubmitted                         WebhookEventType = "invoice.submitted"
	WebhookEventInvoiceSigned                            WebhookEventType = "invoice.signed"
	WebhookEventInvoiceTransmitted                       WebhookEventType = "invoice.transmitted"
	WebhookEventInvoiceAccepted                          WebhookEventType = "invoice.accepted"
	WebhookEventInvoiceRejected                          WebhookEventType = "invoice.rejected"
	WebhookEventInvoiceParked                            WebhookEventType = "invoice.parked"
	WebhookEventInvoiceRetryScheduled                    WebhookEventType = "invoice.retry_scheduled"
	WebhookEventInvoiceCancellationRequested             WebhookEventType = "invoice.cancellation_requested"
	WebhookEventInvoiceCancellationReverted              WebhookEventType = "invoice.cancellation_reverted"
	WebhookEventInvoiceCancelled                         WebhookEventType = "invoice.cancelled"
	WebhookEventInvoiceSentToBuyer                       WebhookEventType = "invoice.sent_to_buyer"
	WebhookEventInvoicePaymentStatusUpdated              WebhookEventType = "invoice.payment_status.updated"
	WebhookEventInvoicePaymentStatusReportRefused        WebhookEventType = "invoice.payment_status.report_refused"
	WebhookEventInvoiceBuyerDeliveryFailed               WebhookEventType = "invoice.buyer_delivery_failed"
	WebhookEventInvoiceReceived                          WebhookEventType = "invoice.received"
	WebhookEventBuyerCreated                             WebhookEventType = "buyer.created"
	WebhookEventBuyerUpdated                             WebhookEventType = "buyer.updated"
	WebhookEventBuyerDeleted                             WebhookEventType = "buyer.deleted"
	WebhookEventBuyerTaxIDVerified                       WebhookEventType = "buyer.tax_id.verified"
	WebhookEventBuyerTaxIDVerificationFailed             WebhookEventType = "buyer.tax_id.verification_failed"
	WebhookEventBuyerTaxIDVerificationUnavailable        WebhookEventType = "buyer.tax_id.verification_unavailable"
	WebhookEventSellerCreated                            WebhookEventType = "seller.created"
	WebhookEventSellerUpdated                            WebhookEventType = "seller.updated"
	WebhookEventSellerDeleted                            WebhookEventType = "seller.deleted"
	WebhookEventSellerTaxIDVerified                      WebhookEventType = "seller.tax_id.verified"
	WebhookEventSellerTaxIDVerificationFailed            WebhookEventType = "seller.tax_id.verification_failed"
	WebhookEventSellerTaxIDVerificationUnavailable       WebhookEventType = "seller.tax_id.verification_unavailable"
	WebhookEventTaxConnectionActionRequired              WebhookEventType = "tax_connection.action_required"
	WebhookEventTaxConnectionConnected                   WebhookEventType = "tax_connection.connected"
	WebhookEventTaxConnectionSuspended                   WebhookEventType = "tax_connection.suspended"
	WebhookEventTaxConnectionDisconnected                WebhookEventType = "tax_connection.disconnected"
	WebhookEventTaxConnectionKeyInstalled                WebhookEventType = "tax_connection.key_installed"
	WebhookEventTaxConnectionKeyExpiring                 WebhookEventType = "tax_connection.key_expiring"
	WebhookEventTaxConnectionKeyExpired                  WebhookEventType = "tax_connection.key_expired"
	WebhookEventOrganizationUpdated                      WebhookEventType = "organization.updated"
	WebhookEventOrganizationTaxIDVerified                WebhookEventType = "organization.tax_id.verified"
	WebhookEventOrganizationTaxIDVerificationFailed      WebhookEventType = "organization.tax_id.verification_failed"
	WebhookEventOrganizationTaxIDVerificationUnavailable WebhookEventType = "organization.tax_id.verification_unavailable"
	WebhookEventOrganizationPhoneVerified                WebhookEventType = "organization.phone.verified"
	WebhookEventOrganizationLogoChanged                  WebhookEventType = "organization.logo.changed"
	WebhookEventOrganizationOnboardingCompleted          WebhookEventType = "organization.onboarding_completed"
	WebhookEventOrganizationOwnershipTransferred         WebhookEventType = "organization.ownership_transferred"
	WebhookEventOrganizationLiveAccessRequested          WebhookEventType = "organization.live_access.requested"
	WebhookEventOrganizationLiveAccessApproved           WebhookEventType = "organization.live_access.approved"
	WebhookEventOrganizationLiveAccessRejected           WebhookEventType = "organization.live_access.rejected"
	WebhookEventOrganizationLiveAccessRevoked            WebhookEventType = "organization.live_access.revoked"
	WebhookEventOrganizationClosed                       WebhookEventType = "organization.closed"
	WebhookEventOrganizationChildCreated                 WebhookEventType = "organization.child.created"
	WebhookEventMemberJoined                             WebhookEventType = "member.joined"
	WebhookEventMemberRoleChanged                        WebhookEventType = "member.role_changed"
	WebhookEventMemberSuspended                          WebhookEventType = "member.suspended"
	WebhookEventMemberRestored                           WebhookEventType = "member.restored"
	WebhookEventMemberRemoved                            WebhookEventType = "member.removed"
	WebhookEventInvitationCreated                        WebhookEventType = "invitation.created"
	WebhookEventInvitationResent                         WebhookEventType = "invitation.resent"
	WebhookEventInvitationWithdrawn                      WebhookEventType = "invitation.withdrawn"
	WebhookEventInvitationAccepted                       WebhookEventType = "invitation.accepted"
	WebhookEventInvitationExpired                        WebhookEventType = "invitation.expired"
	WebhookEventInvitationLocked                         WebhookEventType = "invitation.locked"
	WebhookEventRoleCreated                              WebhookEventType = "role.created"
	WebhookEventRoleUpdated                              WebhookEventType = "role.updated"
	WebhookEventRoleDeleted                              WebhookEventType = "role.deleted"
	WebhookEventAPIKeyCreated                            WebhookEventType = "api_key.created"
	WebhookEventAPIKeyRotated                            WebhookEventType = "api_key.rotated"
	WebhookEventAPIKeyUpdated                            WebhookEventType = "api_key.updated"
	WebhookEventAPIKeyRevoked                            WebhookEventType = "api_key.revoked"
	WebhookEventAPIKeyExpired                            WebhookEventType = "api_key.expired"
	WebhookEventAPIKeyFlagged                            WebhookEventType = "api_key.flagged"
	WebhookEventAPIKeyExpiring                           WebhookEventType = "api_key.expiring"
	WebhookEventBillingCreditsGranted                    WebhookEventType = "billing.credits.granted"
	WebhookEventBillingCreditsExpired                    WebhookEventType = "billing.credits.expired"
	WebhookEventBillingCreditsAdjusted                   WebhookEventType = "billing.credits.adjusted"
	WebhookEventBillingChargeSettled                     WebhookEventType = "billing.charge.settled"
	WebhookEventBillingChargeRefused                     WebhookEventType = "billing.charge.refused"
	WebhookEventBillingChargeRefunded                    WebhookEventType = "billing.charge.refunded"
	WebhookEventBillingHoldPlaced                        WebhookEventType = "billing.hold.placed"
	WebhookEventBillingHoldCaptured                      WebhookEventType = "billing.hold.captured"
	WebhookEventBillingHoldReleased                      WebhookEventType = "billing.hold.released"
	WebhookEventBillingCreditsTransferred                WebhookEventType = "billing.credits.transferred"
	WebhookEventBillingPoolDrawn                         WebhookEventType = "billing.pool.drawn"
	WebhookEventBillingPoolReturned                      WebhookEventType = "billing.pool.returned"
	WebhookEventBillingPoolPolicyUpdated                 WebhookEventType = "billing.pool_policy.updated"
	WebhookEventBillingBalanceLow                        WebhookEventType = "billing.balance.low"
	WebhookEventBillingBalanceRecovered                  WebhookEventType = "billing.balance.recovered"
	WebhookEventBillingLowBalanceThresholdUpdated        WebhookEventType = "billing.low_balance_threshold.updated"
	WebhookEventBillingDebtRecorded                      WebhookEventType = "billing.debt.recorded"
	WebhookEventBillingDebtSettled                       WebhookEventType = "billing.debt.settled"
	WebhookEventBillingPaymentInitiated                  WebhookEventType = "billing.payment.initiated"
	WebhookEventBillingPaymentSucceeded                  WebhookEventType = "billing.payment.succeeded"
	WebhookEventBillingPaymentFailed                     WebhookEventType = "billing.payment.failed"
	WebhookEventBillingPaymentExpired                    WebhookEventType = "billing.payment.expired"
	WebhookEventBillingPaymentRefunded                   WebhookEventType = "billing.payment.refunded"
	WebhookEventBillingPaymentDisputed                   WebhookEventType = "billing.payment.disputed"
	WebhookEventBillingPaymentDisputeResolved            WebhookEventType = "billing.payment.dispute_resolved"
	WebhookEventBillingSubscriptionFreeAssigned          WebhookEventType = "billing.subscription.free_assigned"
	WebhookEventBillingSubscriptionActivated             WebhookEventType = "billing.subscription.activated"
	WebhookEventBillingSubscriptionRenewed               WebhookEventType = "billing.subscription.renewed"
	WebhookEventBillingSubscriptionRenewalDue            WebhookEventType = "billing.subscription.renewal_due"
	WebhookEventBillingSubscriptionCancelScheduled       WebhookEventType = "billing.subscription.cancel_scheduled"
	WebhookEventBillingSubscriptionResumed               WebhookEventType = "billing.subscription.resumed"
	WebhookEventBillingSubscriptionCancelled             WebhookEventType = "billing.subscription.cancelled"
	WebhookEventBillingSubscriptionExpired               WebhookEventType = "billing.subscription.expired"
	WebhookEventBillingSubscriptionRenewalFailed         WebhookEventType = "billing.subscription.renewal_failed"
	WebhookEventBillingSubscriptionPlanChanged           WebhookEventType = "billing.subscription.plan_changed"
	WebhookEventBillingSubscriptionPlanChangeScheduled   WebhookEventType = "billing.subscription.plan_change_scheduled"
	WebhookEventBillingSubscriptionPlanChangeCancelled   WebhookEventType = "billing.subscription.plan_change_cancelled"
	WebhookEventBillingSubscriptionTrialEnding           WebhookEventType = "billing.subscription.trial_ending"
	WebhookEventBillingStatementReady                    WebhookEventType = "billing.statement.ready"
	WebhookEventCollectionPaymentReceived                WebhookEventType = "collection.payment.received"
	WebhookEventCollectionPaymentReconciled              WebhookEventType = "collection.payment.reconciled"
	WebhookEventCollectionPaymentApplied                 WebhookEventType = "collection.payment.applied"
	WebhookEventCollectionSettlementUpdated              WebhookEventType = "collection.settlement.updated"
	WebhookEventWebhookEndpointPinged                    WebhookEventType = "webhook_endpoint.pinged"
	WebhookEventWebhookEndpointCreated                   WebhookEventType = "webhook_endpoint.created"
	WebhookEventWebhookEndpointUpdated                   WebhookEventType = "webhook_endpoint.updated"
	WebhookEventWebhookEndpointDeleted                   WebhookEventType = "webhook_endpoint.deleted"
	WebhookEventWebhookEndpointSecretRotated             WebhookEventType = "webhook_endpoint.secret_rotated"
	WebhookEventWebhookEndpointFailing                   WebhookEventType = "webhook_endpoint.failing"
	WebhookEventWebhookEndpointDisabled                  WebhookEventType = "webhook_endpoint.disabled"
	WebhookEventWebhookEndpointEnabled                   WebhookEventType = "webhook_endpoint.enabled"
	WebhookEventWebhookEndpointRecovered                 WebhookEventType = "webhook_endpoint.recovered"
	WebhookEventWebhookEndpointFlagged                   WebhookEventType = "webhook_endpoint.flagged"
)

The event catalogue.

type WebhookEventTypeDto

type WebhookEventTypeDto struct {
	// Type Example: "invoice.signed".
	Type string `json:"type"`

	Version float64 `json:"version"`

	Family string `json:"family"`

	Scope WebhookEventTypeDtoScope `json:"scope"`

	Status WebhookEventTypeDtoStatus `json:"status"`

	// RequiredCapability Example: "invoice.read".
	RequiredCapability string `json:"requiredCapability"`

	// Subscribable Whether the caller holds the capability the type needs.
	Subscribable bool `json:"subscribable"`
}

WebhookEventTypeDto is `notification.WebhookEventTypeDto`.

type WebhookEventTypeDtoScope

type WebhookEventTypeDtoScope string

WebhookEventTypeDtoScope is the type of WebhookEventTypeDto.Scope. The API may add values.

const (
	WebhookEventTypeDtoScopeMode         WebhookEventTypeDtoScope = "mode"
	WebhookEventTypeDtoScopeLive         WebhookEventTypeDtoScope = "live"
	WebhookEventTypeDtoScopeOrganization WebhookEventTypeDtoScope = "organization"
	WebhookEventTypeDtoScopeEndpoint     WebhookEventTypeDtoScope = "endpoint"
)

Values of WebhookEventTypeDtoScope.

type WebhookEventTypeDtoStatus

type WebhookEventTypeDtoStatus string

WebhookEventTypeDtoStatus is the type of WebhookEventTypeDto.Status. The API may add values.

const (
	WebhookEventTypeDtoStatusAvailable     WebhookEventTypeDtoStatus = "available"
	WebhookEventTypeDtoStatusPendingSource WebhookEventTypeDtoStatus = "pending_source"
	WebhookEventTypeDtoStatusInvoice       WebhookEventTypeDtoStatus = "invoice"
	WebhookEventTypeDtoStatusFuture        WebhookEventTypeDtoStatus = "future"
)

Values of WebhookEventTypeDtoStatus.

type WebhookEventTypesService

type WebhookEventTypesService struct {
	// contains filtered or unexported fields
}

WebhookEventTypesService is the webhook event catalogue (`/n/v1/webhook-event-types`).

func (*WebhookEventTypesService) List

List is every event type, with whether this key may subscribe to it.

type WebhookEventsService

type WebhookEventsService struct {
	// contains filtered or unexported fields
}

WebhookEventsService is logged webhook events (`/n/v1/webhook-events`, last 30 days).

func (*WebhookEventsService) Get

Get is one event with its public `Data` (`webhook.delivery.read`).

func (*WebhookEventsService) List

List lists events of the key's mode plus organisation-scoped ones (`webhook.delivery.read`).

func (*WebhookEventsService) Redeliver

Redeliver replays an event to one endpoint (`webhook.delivery.redeliver`; 202).

type WebhookTestResultDto

type WebhookTestResultDto struct {
	DeliveryID string `json:"deliveryId"`

	EventID string `json:"eventId"`

	Type string `json:"type"`

	Test *bool `json:"test,omitempty"`
}

WebhookTestResultDto is `notification.WebhookTestResultDto`.

type WebhooksService

type WebhooksService struct {
	// Endpoints (read and test).
	Endpoints *WebhookEndpointsService
	// Deliveries and redelivery.
	Deliveries *WebhookDeliveriesService
	// Events: logged events and replay.
	Events *WebhookEventsService
	// EventTypes: the event catalogue.
	EventTypes *WebhookEventTypesService
}

WebhooksService is webhooks (`/n/v1`), grouped as the API tags it. Verify deliveries with VerifyWebhook.

Directories

Path Synopsis
examples
errors-and-retries command
@recipe errors-and-retries Errors and safe retries @summary Catch the SDK's typed errors, branch on ErrorCode, quote the RequestID to support, honour RetryAfter, and use idempotency keys so a retried write is never applied or charged twice.
@recipe errors-and-retries Errors and safe retries @summary Catch the SDK's typed errors, branch on ErrorCode, quote the RequestID to support, honour RetryAfter, and use idempotency keys so a retried write is never applied or charged twice.
first-invoice command
@recipe first-invoice Your first invoice @summary Create a buyer and an item, draft an invoice, finalise it, submit it to the tax authority, follow its status and download the PDF and the QR payload.
@recipe first-invoice Your first invoice @summary Create a buyer and an item, draft an invoice, finalise it, submit it to the tax authority, follow its status and download the PDF and the QR payload.
received-invoices command
@recipe received-invoices Received invoices @summary List the invoices other businesses issued to you, filter them, and walk every page with Paginate.
@recipe received-invoices Received invoices @summary List the invoices other businesses issued to you, filter them, and walk every page with Paginate.
sandbox-and-live command
@recipe sandbox-and-live Sandbox and live @summary The key decides the mode: an sk_test_ key works in sandbox and an sk_live_ key in live, on the same host.
@recipe sandbox-and-live Sandbox and live @summary The key decides the mode: an sk_test_ key works in sandbox and an sk_live_ key in live, on the same host.
webhooks command
@recipe webhooks Receive webhooks @summary Verify the Yona-Signature of each delivery over the raw body, dispatch by event type, and inspect deliveries with the SDK.
@recipe webhooks Receive webhooks @summary Verify the Yona-Signature of each delivery over the raw body, dispatch by event type, and inspect deliveries with the SDK.
scripts
export_guides command
examples/<id>/main.go → guides/guides.json, the developer guides the portal shows (ruling R78).
examples/<id>/main.go → guides/guides.json, the developer guides the portal shows (ruling R78).
internal/examples
Package examples runs examples/<id>/main.go as an integrator would: the key comes only from YONA_API_KEY.
Package examples runs examples/<id>/main.go as an integrator would: the key comes only from YONA_API_KEY.
run_examples command
Runs examples/<id>/main.go as an integrator would: the key comes only from YONA_API_KEY.
Runs examples/<id>/main.go as an integrator would: the key comes only from YONA_API_KEY.
smoke_remote command
REMOTE SMOKE: verify your own sandbox setup against the real API.
REMOTE SMOKE: verify your own sandbox setup against the real API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL