๐Ÿ’ต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);
    }
}

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

Last updated