Skip to content

syniol/xyo-sdk-cpp

Repository files navigation

XYO.Financial SDK for C++

workflow workflow

C++ Mascot for XYO.Financial
C++ Mascot for XYO.Financial Generated by Gemini and Imagined by Syniol Limited

The official C++17 SDK for the XYO.Financial transaction enrichment API. A valid API key is available from the XYO dashboard.

Requirements

  • A C++17 compiler
  • CMake 3.16 or newer
  • libcurl

Build and test

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

Usage

#include <xyo/client.hpp>

#include <iostream>

int main() {
  xyo::Client client({"YourAPIKeyFromXYO.FinancialDashboard"});

  auto result = client.enrich_transaction({"COSTA PICKUP", "GB"});
  std::cout << result.merchant << '\n';

  auto bulk = client.enrich_transaction_collection({
      {"COSTA PICKUP", "GB"},
      {"STRBUKS GREENWICH", "GB"},
  });
  auto status = client.enrich_transaction_collection_status(bulk.id);
  std::cout << xyo::to_string(status) << '\n';
}

Requests that fail at the transport layer, return a non-200 status, or contain an invalid response throw xyo::Error. location and address are represented as std::optional<std::string> because the service may return JSON null.

Installation & Integration

The C++ SDK can be integrated into your project using one of the following methods.

1. Conan 2 (Recommended)

Since this package is currently distributed via source (and not yet hosted on a public remote), you must first build and install it into your local Conan cache:

git clone https://github.com/syniol/xyo-sdk-cpp.git
cd xyo-sdk-cpp
conan create . --build=missing

Once installed locally, you can add the SDK to your dependencies in your project's conanfile.txt or conanfile.py:

[requires]
xyo-sdk-cpp/1.1.0

Then, install it in your project as usual:

conan install . --build=missing

2. vcpkg

Install the package via vcpkg:

vcpkg install xyo-sdk-cpp

3. CMake FetchContent (Fallback)

You can include the SDK directly in your CMakeLists.txt without pre-installing package managers:

include(FetchContent)
FetchContent_Declare(
  xyo-sdk-cpp
  GIT_REPOSITORY https://github.com/syniol/xyo-sdk-cpp.git
  GIT_TAG        v1.1.0
)
FetchContent_MakeAvailable(xyo-sdk-cpp)

Consuming in CMake

In your project's CMakeLists.txt, link against the target:

find_package(XYOSDK CONFIG REQUIRED)
target_link_libraries(my_application PRIVATE XYO::SDK)

Thread Safety

The Client class is thread-safe and can be safely shared across multiple threads. The default built-in CurlTransport manages request handles independently on a per-call basis. If a custom HttpTransport is provided, it must be thread-safe if the Client is used concurrently.

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Copyright © 2025 Syniol Limited.

About

an Official XYO Financial SDK for C++ Language

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages