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.

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:

get

Gets company configurations

Authorizations
Path parameters
companyIdstringRequired
Responses
200Success
application/json
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-07-11T22:24:55.687Z",
  "updatedAt": "2025-07-11T22:24:55.687Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-11T22:24:55.687Z",
    "updatedAt": "2025-07-11T22:24:55.687Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}

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:

patch

Updates company configurations

Authorizations
Path parameters
companyIdstringRequired
Body
clientServiceFeePercentagenumberOptionalDefault: 0Example: 0
resaleFeePercentagenumberOptionalDefault: 0Example: 0
disableGasBillingbooleanOptionalDefault: false
Responses
200Success
application/json
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-07-11T22:24:55.687Z",
  "updatedAt": "2025-07-11T22:24:55.687Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-11T22:24:55.687Z",
    "updatedAt": "2025-07-11T22:24:55.687Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}

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:

patch

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

Authorizations
Path parameters
companyIdstringRequired
Body
secretKeystringRequired
checkoutExpireTimenumberOptional
successUrlstringOptional
Responses
200Success
application/json
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-07-11T22:24:55.687Z",
  "updatedAt": "2025-07-11T22:24:55.687Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-11T22:24:55.687Z",
    "updatedAt": "2025-07-11T22:24:55.687Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}

Configures Paypal payment provider

Rest API reference:

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
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-07-11T22:24:55.687Z",
  "updatedAt": "2025-07-11T22:24:55.687Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-11T22:24:55.687Z",
    "updatedAt": "2025-07-11T22:24:55.687Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}

Request Stripe payment provider configuration

Rest API reference:

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
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-07-11T22:24:55.687Z",
  "updatedAt": "2025-07-11T22:24:55.687Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-11T22:24:55.687Z",
    "updatedAt": "2025-07-11T22:24:55.687Z",
    "name": "text"
  },
  "deliveryDelays": [
    {
      "paymentMethod": "credit_card",
      "delay": 259200000
    }
  ],
  "operatorWalletAddress": "text",
  "paymentProviders": [
    []
  ],
  "clientServiceFeePercentage": 1,
  "companyServiceFeePercentage": 1,
  "resaleFeePercentage": 1,
  "disableGasBilling": true,
  "sendPassPdf": true,
  "orderExpirationConfig": {
    "ignorePaymentsAfterExecutionOrder": 1
  }
}

Finish stripe payment provider configuration

Rest API reference:

patch

Finish connection of Stripe payment provider configuration

Authorizations
Path parameters
companyIdstringRequired
Responses
204Success
patch
PATCH /admin/companies/{companyId}/configurations/providers/stripe/finish-connection HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

Refresh stripe payment provider configuration

Rest API reference:

patch

Refresh Stripe payment provider connection

Authorizations
Path parameters
companyIdstringRequired
Body
successConnectUrlstringRequired
refreshConnectUrlstringRequired
Responses
200Success
application/json
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"
}

Deletes some payment provider configuration

Rest API reference:

delete

Deletes some company payment provider configuration

Authorizations
Path parameters
companyIdstringRequired
providerstring · enumRequiredExample: pagar_mePossible values:
Responses
204Success
delete
DELETE /admin/companies/{companyId}/configurations/providers/{provider} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

Last updated