Currency

Currencies around the world

Table name: currencies

Description: To deal with money (pricing, payment,...)

Model

use SaasReady\Models\Currency;

findByCode

Quickly retrieve the Currency instance by using CurrencyCode

use SaasReady\Constants\CurrencyCode;

Currency::findByCode(CurrencyCode::UNITED_STATES_DOLLAR);
Currency::findByCode(CurrencyCode::tryFrom('VND'));

The CurrencyCode Enum

Contains every CurrencyCode around the world.

use SaasReady\Constants\CurrencyCode;

Response Entity

type Currency = {
    uuid: string;
    code: string;
    name: string;
    symbol: string;
    decimal_separator: string;
    thousands_separator: string;
    space_after_symbol: boolean;
    is_active: boolean; // v1.0.1
    created_at: string;
    updated_at: string;
    activated_at: string; // v1.0.1
}

Endpoints

[GET] saas/currencies

Get a list of Currencies

Request payload:

Response payload:

[GET] saas/currencies/{currencyUuid}

Get single Currency

Response payload:

[POST] saas/currencies

Create a new Currency

Request payload:

Response payload:

[PUT] saas/currencies/{currencyUuid}

Update an existing Currency

Request payload:

Response payload:

[DELETE] saas/currencies/{currencyUuid}

Delete an existing Currency (soft)

Response payload:

Helper Commands

Activate a Currency (v1.0.1+)

Deactivate a Currency (v1.0.1+)

Last updated