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
  4. Company Administration

Companies (Admin)

Companies informations inside W3block ecosystem is maintained by the ID service. Here, you can only change companies configurations about the commerce service. Available configurations:

  • Payment providers: You can enable and configure some available payment providers such as paypal, pagar.me and stripe.

  • Deliver delays: You can configure how much time you want to wait until transfer token to the client/user after the payment was approved. This is very useful since credit card payments can be easier cancelled 3 days after payment was completed. You can specify that for each payment type as PIX, credit card, or transfer.

  • Logo: You can change company logo from our lightweight commerce front-end

  • Banners: You can change home-page banners from our lightweight commerce front-end

Payment

1. Payment Distribution (Fees and income)

Every order transaction is divided in 3 parts:

  • Service Fee: This fee is the W3Block transaction part, it can be paid from client, company or both depending of the W3Block contract

  • Gas Fee: This fee is used to pay blockchain transactions under the tokens transfer

  • Company Income: Is the rest of the money that will be directly transferred to the company

2. Payment Splitting to Separate Service Fee, Gas Fee and Company Income

Stripe payment provider has a native payment splitting functionality which transfer to W3block the service fee and transactions gas fees automatically without the need of the company to receive and/or declare that income.

Other payment providers can also offer that functionality, but that's under construction

Company Configuration Model (Example)
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "createdAt": "2022-11-03T22:33:20.215Z",
  "updatedAt": "2022-11-03T22:33:20.215Z",
  "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "company": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "createdAt": "2022-11-03T22:33:20.215Z",
    "updatedAt": "2022-11-03T22:33:20.215Z",
    "name": "W3Block testing company"
  },
  "banners": [
    {
      "text": "Banner description",
      "buttonText": "Click",
      "buttonLink": "https://w3block.io",
      "image": {
        "thumb": "https://dummyimage.com/200x200/fff/000",
        "original": "https://dummyimage.com/600x400/fff/000",
        "assetId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      }
    }
  ],
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "domain": "string",
  "logo": "string",
  "operatorWalletAddress": "string",
  "paymentProviders": [],
  "clientServiceFeePercentage": 0,
  "companyServiceFeePercentage": 0
}

Service Methods

Gets company configurations

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

const companyId = '<Your companyId/TenantId>';
const configurations = await sdk.api.admin.getCompanyConfigurations(companyId);
console.log('configurations', configurations);

Rest API reference:

Updates some company configurations

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

const companyId = '<Your companyId/TenantId>';
await sdk.api.admin.updateCompanyConfigurations(companyId, {
      deliverDelays: [
            {
                  paymentMethod: PaymentMethod.CreditCard,
                  delay: 0,
            }
      ],
});

Rest API reference:

Set a specific payment provider to be used into some currency

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

const companyId = '<Your companyId/TenantId>';
const currencyId = '<currencyId>';
await sdk.api.admin.setCompanyCurrencyPaymentProvider(companyId, currencyId, {
      paymentProvider: PaymentProviderEnum.Stripe
});

Rest API reference:

Configures Pagar.me payment provider

Rest API reference:

Configures Paypal payment provider

Rest API reference:

Request Stripe payment provider configuration

Rest API reference:

Finish stripe payment provider configuration

Rest API reference:

Refresh stripe payment provider configuration

Rest API reference:

Deletes some payment provider configuration

Rest API reference:

PreviousCompany AdministrationNextAssets (Admin)

Last updated 2 years ago

๐Ÿ‘จโ€๐Ÿ’ป
get

Gets company configurations

Authorizations
Path parameters
companyIdstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/configurations HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:12.883Z",
  "updatedAt": "2025-06-01T14:49:12.883Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:12.883Z",
    "updatedAt": "2025-06-01T14:49:12.883Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}
patch

Finish connection of Stripe payment provider configuration

Authorizations
Path parameters
companyIdstringRequired
Responses
204Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations/providers/stripe/finish-connection HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

delete

Deletes some company payment provider configuration

Authorizations
Path parameters
companyIdstringRequired
providerstring ยท enumRequiredExample: pagar_mePossible values:
Responses
204Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
delete
DELETE /admin/companies/{companyId}/configurations/providers/{provider} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

  • Payment
  • Service Methods
  • Gets company configurations
  • GET/admin/companies/{companyId}/configurations
  • Updates some company configurations
  • PATCH/admin/companies/{companyId}/configurations
  • Set a specific payment provider to be used into some currency
  • Configures Pagar.me payment provider
  • PATCH/admin/companies/{companyId}/configurations/providers/pagar-me
  • Configures Paypal payment provider
  • PATCH/admin/companies/{companyId}/configurations/providers/paypal
  • Request Stripe payment provider configuration
  • PATCH/admin/companies/{companyId}/configurations/providers/stripe
  • Finish stripe payment provider configuration
  • PATCH/admin/companies/{companyId}/configurations/providers/stripe/finish-connection
  • Refresh stripe payment provider configuration
  • PATCH/admin/companies/{companyId}/configurations/providers/stripe/refresh-connection
  • Deletes some payment provider configuration
  • DELETE/admin/companies/{companyId}/configurations/providers/{provider}
patch

Updates company configurations

Authorizations
Path parameters
companyIdstringRequired
Body
clientServiceFeePercentagenumberOptionalDefault: 0Example: 0
resaleFeePercentagenumberOptionalDefault: 0Example: 0
disableGasBillingbooleanOptionalDefault: false
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "deliverDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "clientServiceFeePercentage": 0,
  "resaleFeePercentage": 0,
  "disableGasBilling": false
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:12.883Z",
  "updatedAt": "2025-06-01T14:49:12.883Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:12.883Z",
    "updatedAt": "2025-06-01T14:49:12.883Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}
patch

Configures/Refresh configuration of Pagar.me payment provider in the company

Authorizations
Path parameters
companyIdstringRequired
Body
secretKeystringRequired
checkoutExpireTimenumberOptional
successUrlstringOptional
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations/providers/pagar-me HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 63

{
  "secretKey": "text",
  "checkoutExpireTime": 1,
  "successUrl": "text"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:12.883Z",
  "updatedAt": "2025-06-01T14:49:12.883Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:12.883Z",
    "updatedAt": "2025-06-01T14:49:12.883Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}
patch

Configures/Refresh configuration of Paypal payment provider in the company

Authorizations
Path parameters
companyIdstringRequired
Body
secretstringRequired
clientIdstring ยท uuidRequired
urlstringRequired
checkoutExpireTimenumberOptional
successUrlstringOptional
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations/providers/paypal HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "secret": "text",
  "clientId": "123e4567-e89b-12d3-a456-426614174000",
  "url": "text",
  "checkoutExpireTime": 1,
  "successUrl": "text"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:12.883Z",
  "updatedAt": "2025-06-01T14:49:12.883Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:12.883Z",
    "updatedAt": "2025-06-01T14:49:12.883Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}
patch

Configures/Refresh configuration of stripe payment provider in the company

Authorizations
Path parameters
companyIdstringRequired
Body
secretstringRequired
publicKeystringRequired
minPaymentPricenumberOptionalExample: 50
checkoutExpireTimenumberOptional
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations/providers/stripe HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 80

{
  "secret": "text",
  "publicKey": "text",
  "minPaymentPrice": 50,
  "checkoutExpireTime": 1
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:12.883Z",
  "updatedAt": "2025-06-01T14:49:12.883Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:12.883Z",
    "updatedAt": "2025-06-01T14:49:12.883Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}
patch

Refresh Stripe payment provider connection

Authorizations
Path parameters
companyIdstringRequired
Body
successConnectUrlstringRequired
refreshConnectUrlstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/configurations/providers/stripe/refresh-connection HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "successConnectUrl": "text",
  "refreshConnectUrl": "text"
}
{
  "url": "text"
}