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

Orders (Admin)

PreviousOrder Rules (Admin)NextFaq (Admin)

Last updated 2 years ago

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:

Cancels some company order

Rest API reference:

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

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
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
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-06-01T14:34:58.855Z",
      "updatedAt": "2025-06-01T14:34:58.855Z",
      "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-06-01T14:34:58.855Z",
      "expiresIn": "2025-06-01T14:34:58.855Z",
      "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"
  }
}
patch

Cancel an order

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

No content

patch

Force delivery of order token

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

No content

  • Solving failed orders
  • Service Methods
  • Lists all company orders
  • GET/admin/companies/{companyId}/orders
  • Cancels some company order
  • PATCH/admin/companies/{companyId}/orders/{orderId}/cancel
  • Force deliver of some company order (it will also force a deliver retry)
  • PATCH/admin/companies/{companyId}/orders/{orderId}/force-deliver