W3Block Docs
  • ๐Ÿš€Start here
    • Welcome to the Docs
    • Integrated Blockchains
  • ๐Ÿ‘จโ€๐Ÿ’ปDev Docs
    • API
      • Getting Started
      • Authentication
      • Commerce API services
        • Company Administration
          • Companies (Admin)
          • Assets (Admin)
          • Tags (Admin)
          • Products (Admin)
            • Order Rules (Admin)
          • Orders (Admin)
          • Faq (Admin)
          • Webhooks (Admin)
        • Products
        • Orders
        • Webhooks
        • Faq
        • Globals
      • Key API Services
        • Authentication
        • Companies
        • Tokens
          • Contracts
            • External Contacts
            • Royalty Eligible
          • Categories
            • Subcategories
          • Token Collections
            • Token Editions
          • Metadata
        • Blockchain
        • Cloudinary
        • Integration
          • Ecommerce
            • Associate Tokens
            • Hooks
        • Users
        • Vouchers
  • ๐Ÿ“˜Knowledge Base
    • First Steps
    • FAQ
    • Glossary
Powered by GitBook
On this page
  1. Dev Docs
  2. API
  3. Commerce API services

Globals

PreviousFaqNextKey API Services

Last updated 2 years ago

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-06-01T14:49:32.731Z",
      "updatedAt": "2025-06-01T14:49:32.731Z",
      "name": "text",
      "crypto": true,
      "symbol": "$",
      "code": "USD",
      "companyId": null,
      "erc20contractAddress": "0x7dd80541ad31078244d9f2b73026a025e70b5484",
      "erc20ChainId": 137,
      "paymentProviders": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "createdAt": "2025-06-01T14:49:32.731Z",
          "updatedAt": "2025-06-01T14:49:32.731Z",
          "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"
  }
}
  • Service Methods
  • Lists all available currencies
  • GET/globals/currencies