SimpleTech Labs
WebsiteConsoleAPITwitterTelegram ChannelTelagram Chat
SimplePay
SimplePay
  • Introduction
    • Overview
    • Core concepts
      • Transparency
      • Non-Custodial
      • Direct payments
      • Lowest Fees
    • Protocol
    • Security
      • Collected data
  • GETTING STARTED
    • Create an App
    • Setup Client
      • Widget
    • Setup Server
      • Webhooks
    • No-Code
      • Web and Telegram Store
  • Javascript SDK
    • Introduction
    • Services
      • Cryptocurrency
      • Currency
      • Invoice
  • Components
    • Payment Widget
  • Simple ID
    • Auth.js integration Guide
  • API Documentation
    • Overview
    • Apps
      • Get App Info
      • Dev Mode
    • Wallets
    • Assets
      • Fiat Currency
      • Cryptocurrency
    • Products
    • Invoices
      • Methods
    • Transactions
      • Page 1
    • Billing
  • Referral Program
    • 💰Referral Program Basics
  • Legal
    • 📄Terms of Use
    • 🔏Privacy Policy
    • 🍪Cookies
Powered by GitBook
On this page
  • Entities
  • Currency
  • Methods
  • List currencies

Was this helpful?

  1. Javascript SDK
  2. Services

Currency

Currency API allows merchants to get some information about fiat currencies, that may be used during invoice creation

Entities

Currency

Currency entity represents single fiat currency

Type may be imported as:

import type { Currency } from '@simplepay-ai/api-client';

Type definition:

interface Currency {
    /**
     * Currency ID
     *
     * @example '5e091838-d7bb-4365-a395-84d82d1ac7c2'
     */
    id: string;

    /**
     * Currency symbol (ISO 4217 alphabetic code)
     *
     * @example 'USD'
     * @see https://en.wikipedia.org/wiki/ISO_4217
     */
    symbol: string;

    /**
     * Currency code (ISO 4217 numeric code)
     *
     * @example 840
     * @see https://en.wikipedia.org/wiki/ISO_4217
     */
    code: number;
}

Methods

List currencies

import type { HttpError } from '@simplepay-ai/api-client';

try {
    const currencies = await api.currency.list();

    console.debug(currencies);
} catch (e) {
    if (e instanceof HttpError) {
        const error = e as HttpError;

        console.error(error.code);
    }
}
PreviousCryptocurrencyNextInvoice

Last updated 9 months ago

Was this helpful?

If you require currency that is not in list, we will be glad to help you, feel free to

Request Currency