Globals

All global methods and utilities can be found at this service module.

Service Methods

Lists all available currencies

Using SDK
// init your sdk as defined in main page of Commerce service
import { W3blockCommerceSDK } from '@w3block/sdk-commerce';
const sdk: W3blockCommerceSDK;
...

const currencies = await sdk.api.globals.listCurrencies({ page: 1, limit: 10 });
console.log('currencies', currencies);

Rest API reference:

get

Lists system available currencies and its supported payment providers

Authorizations
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200
Currencies was successfully got
application/json
get
GET /globals/currencies HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
200

Currencies was successfully got

{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-07-04T00:20:24.781Z",
      "updatedAt": "2025-07-04T00:20:24.781Z",
      "name": "text",
      "crypto": true,
      "symbol": "$",
      "code": "USD",
      "companyId": null,
      "erc20contractAddress": "0x7dd80541ad31078244d9f2b73026a025e70b5484",
      "erc20ChainId": 137,
      "paymentProviders": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "createdAt": "2025-07-04T00:20:24.781Z",
          "updatedAt": "2025-07-04T00:20:24.781Z",
          "currencyId": "123e4567-e89b-12d3-a456-426614174000",
          "paymentProvider": "pagar_me"
        }
      ],
      "configured": true,
      "canProvideCashback": true,
      "decimals": 1
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}

Last updated