Orders (Admin)

Orders are always created by some user who want to purchase some product. So, in terms of order administration, we only have data visualisation and the possibility to cancel or force deliver of some order.

Order Model (Example)
{
  "id": "string",
  "createdAt": "2022-11-04T12:56:48.255Z",
  "updatedAt": "2022-11-04T12:56:48.255Z",
  "companyId": "string",
  "userId": "string",
  "destinationWalletAddress": "string",
  "addressId": "string",
  "address": null,
  "currencyId": "string",
  "currencyAmount": "string",
  "products": [
    ...
  ],
  "status": "pending",
  "paymentProvider": "pagar_me",
  "providerTransactionId": "za_1012skak1",
  "paymentMethod": "credit_card",
  "paymentInfo": {
    "paymentUrl": "https://example.com/order/1/pay"
  },
  "deliverDate": "2022-11-04T12:56:48.255Z",
  "expiresIn": "2022-11-04T12:56:48.255Z",
  "gasFee": "string",
  "clientServiceFee": "string",
  "companyServiceFee": "string",
}

Solving failed orders

When we have some kind of trouble in the token transfer, the order will be moved to a "failed" status. With that status, an administrator need to solve this fail situation with 2 alternatives:

  • Cancel the order: It will cancel the order payment and unlock the order product to be purchased again from an other user

  • Try to deliver again: The system will retry product deliver. It is very common to do if the operator wallet address of the company have no funds to transfer token when the order failed.

Service Methods

Lists all company orders

Rest API reference:

get

List orders

Authorizations
Path parameters
companyIdstringRequired
Query parameters
createdAtstringOptionalExample: 2022-01-30T10:30:40-03:00
sortBystring[]Optional
orderBystring · enumOptionalPossible values:
pagenumberOptionalDefault: 1Example: 1
limitnumberOptionalDefault: 10Example: 10
searchstringOptional
createdFromstring · date-timeOptional
createdUntilstring · date-timeOptional
userIdstring · uuidOptional
currencyIdstring · uuidOptional
paymentMethodstring · enumOptionalExample: pixPossible values:
paymentProviderstring · enumOptionalExample: stripePossible values:
utmCampaignstringOptionalExample: super_sales
productIdstring · uuidOptional
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/orders HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-07-14T22:39:02.221Z",
      "updatedAt": "2025-07-14T22:39:02.221Z",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "company": {},
      "userId": "123e4567-e89b-12d3-a456-426614174000",
      "user": {},
      "destinationWalletAddress": "text",
      "addressId": "123e4567-e89b-12d3-a456-426614174000",
      "address": {},
      "status": "pending",
      "deliverDate": "2025-07-14T22:39:02.221Z",
      "expiresIn": "2025-07-14T22:39:02.221Z",
      "deliverId": "B61JHC",
      "products": [
        {}
      ],
      "payments": [
        {}
      ]
    }
  ],
  "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"
  }
}

Cancels some company order

Rest API reference:

patch

Cancel an order

Authorizations
Path parameters
companyIdstringRequired
orderIdstringRequired
Responses
204Success
patch
PATCH /admin/companies/{companyId}/orders/{orderId}/cancel HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

Force deliver of some company order (it will also force a deliver retry)

Rest API reference:

patch

Force delivery of order token

Authorizations
Path parameters
companyIdstringRequired
orderIdstringRequired
Responses
204Success
patch
PATCH /admin/companies/{companyId}/orders/{orderId}/force-deliver HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*

No content

Last updated