xyo

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

XYO Financial SDK Go (Golang)

workflow

Go (Golang) Gopher Mascot
Official Gopher Mascot for XYO.Financial Generated by Adobe AI and Imagined by Syniol Limited

This SDK is official XYO.Financial and maintained by Syniol Limited for Go (Golang) Programming Language. The minimum requirement is version: 1.18. It can be utilised for Trial and Premium accounts, given that a valid API key is available to connect to and access the Enrichment services.

Quickstart Guide

First you need to install the XYO SDK for Go (Golang) ecosystem via GitHub.

go get github.com/syniol/xyo-sdk-go

Client is an entry point to use the SDK. You need a valid API Key obtainable from https://xyo.financial/dashboard

package main

import (
	"encoding/json"
	"log"
	"fmt"

	"github.com/syniol/xyo-sdk-go"
)

func main() {
	client := xyo.NewClient(&xyo.ClientConfig{
		APIKey: "YourAPIKeyFromXYO.FinancialDashboard",
	})
}

Enrich a Single Payment Transaction:

package main

import (
	"log"
	"fmt"

	"github.com/syniol/xyo-sdk-go"
)

func main() {
    resp, err := client.EnrichTransaction(&xyo.EnrichmentRequest{
        Content:     "COSTA PICKUP",
        CountryCode: "GB",
    })
    log.Fatal(err)
    
    fmt.Println(resp.Merchant)
    fmt.Println(resp.Description)
    fmt.Println(resp.Categories)
    fmt.Println(resp.Logo)
}

Enrich Payment Transaction Collection (Bulk Enrichment):

package main

import (
	"log"
	"fmt"

	"github.com/syniol/xyo-sdk-go"
)

func main() {
	resp, err := client.EnrichTransactionCollection([]*xyo.EnrichmentRequest{
		{
			Content: 'Costa PickUp',
			CountryCode: 'GB',
		},
		{
			Content: 'STRBUKS GREENWICH',
			CountryCode: 'GB',
		},
	})
	log.Fatal(err)

	fmt.Println(resp.ID)
	fmt.Println(resp.Link)
}

Payment Transaction Collection Status:

package main

import (
	"log"
	"fmt"
)

func main() {
	resp, err := client.EnrichTransactionCollectionStatus(enrichTransactionCollectionResponse.ID)
	log.Fatal(err)

	// EnrichmentCollectionStatus enum: READY, PENDING, FAILED
	fmt.Println(resp)
}
Credits

Copyright © 2025 Syniol Limited. All rights reserved.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Enrichment
}

func NewClient

func NewClient(opt *ClientConfig) Client

NewClient will accept ClientConfig struct where APIKey is defined Client is required to access Enrichment Services through SDK

type ClientConfig

type ClientConfig struct {
	// APIKey can be obtained from client dashboard located at: https://xyo.financial/dashboard
	APIKey string
	// contains filtered or unexported fields
}

ClientConfig should be used to for a Client creation via NewClient method

type EnrichTransactionCollectionResponse

type EnrichTransactionCollectionResponse struct {
	// ID is a work ID for an enrichment request
	ID string `field:"required" json:"id"`
	// Link is a downloadable tar.gz Compressed file
	Link string `field:"required" json:"link"`
}

EnrichTransactionCollectionResponse is a result of bulk enrichment

type Enrichment

type Enrichment interface {
	EnrichTransaction(enrichmentReq *EnrichmentRequest) (*EnrichmentResponse, error)
	EnrichTransactionCollection(enrichmentReq []*EnrichmentRequest) (*EnrichTransactionCollectionResponse, error)
	EnrichTransactionCollectionStatus(ID string) (EnrichmentCollectionStatus, error)
}

type EnrichmentCollectionStatus

type EnrichmentCollectionStatus string

EnrichmentCollectionStatus represents the status of EnrichTransactionCollectionResponse Currently there are three possible associated enum values for the status

const (
	EnrichmentCollectionStatusReady   EnrichmentCollectionStatus = "READY"
	EnrichmentCollectionStatusFailed  EnrichmentCollectionStatus = "FAILED"
	EnrichmentCollectionStatusPending EnrichmentCollectionStatus = "PENDING"
)

type EnrichmentCollectionStatusResponse added in v0.3.0

type EnrichmentCollectionStatusResponse struct {
	// Status could be READY, PENDING, FAILED
	Status EnrichmentCollectionStatus `field:"required" json:"status"`
}

EnrichmentCollectionStatusResponse provides a status of bulk enrichment

type EnrichmentRequest

type EnrichmentRequest struct {
	// Content is a maximum of 128 characters long payment description
	Content string `field:"required" json:"content"`
	// CountryCode ISO 3166-1 alpha-2 (Two characters format)
	CountryCode string `field:"required" json:"countryCode"`
}

EnrichmentRequest is a request data structure used for single and collection enrichment

type EnrichmentResponse

type EnrichmentResponse struct {
	// Merchant is a name of merchant
	Merchant string `field:"required" json:"merchant"`
	// Description A brief description about the merchant
	Description string `field:"required" json:"description"`
	// Categories any type of categories fitting the description of the Merchant
	Categories []string `field:"required" json:"categories"`
	Logo string `field:"required" json:"logo"`
	// Location describes the country, city. This is an optional field that could be null
	Location string `field:"optional" json:"location"`
	// Address describes exact address of purchase. This is an optional field that could be null
	Address string `field:"optional" json:"address"`
}

EnrichmentResponse is a result of payment transaction enrichment

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL