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. Key API Services
  4. Integration
  5. Ecommerce

Hooks

PreviousAssociate TokensNextUsers

Last updated 2 years ago

This module enables integration of other plataforms with the key API

Create a new order on the key API standards

Create a new order on woo commerce standards

Get status from created order

๐Ÿ‘จโ€๐Ÿ’ป
get
Authorizations
Path parameters
companyIdstringRequired
externalOrderIdstringRequired
Responses
200Success
application/json
401
Unauthorized - Integration API key or JWT required
get
GET /integration/ecommerce/hooks/{companyId}/external-order-id/{externalOrderId} HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "externalOrderId": "XPTO-0001",
  "products": [
    {
      "chainId": 1,
      "contractAddress": "0x1a17d9bCbC4b077C69d7f93155408995144A277F",
      "deliveredIn": "2022-08-31T03:53:00.001Z",
      "reason": null,
      "scheduledTo": "2022-08-31T03:50:00.001Z",
      "status": "processing",
      "tokenId": "1",
      "txHash": "0x44d5e936dad202ec600b6a6a5252ef32c0e29bb9a21b179e348d2e8029cc1c86",
      "externalId": "123",
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "reason": null,
  "status": "processing",
  "userStatus": "notFound"
}
  • Create a new order on the key API standards
  • POST/integration/ecommerce/hooks/{companyId}/new-order
  • Create a new order on woo commerce standards
  • POST/integration/ecommerce/hooks/{companyId}/woo-commerce
  • Get status from created order
  • GET/integration/ecommerce/hooks/{companyId}/external-order-id/{externalOrderId}
post
Authorizations
Path parameters
companyIdstringRequired
Body
externalOrderIdstringOptionalExample: XPTO-0001
verificationTypestring ยท enumOptionalDefault: invisiblePossible values:
Responses
201Success
401
Unauthorized - Integration API key or JWT required
post
POST /integration/ecommerce/hooks/{companyId}/new-order HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 185

{
  "user": {
    "email": "john.green@w3block.io",
    "name": "John"
  },
  "products": [
    {
      "externalId": "XPTO-0001-43",
      "description": "Lorem..."
    }
  ],
  "externalOrderId": "XPTO-0001",
  "verificationType": "invisible"
}

No content

post
Path parameters
companyIdstringRequired
Header parameters
x-wc-webhook-signaturestringOptional

Webhook signature

Body
order_keystringRequiredExample: wc_order_602aevefa
statusstringRequired
Responses
201Success
post
POST /integration/ecommerce/hooks/{companyId}/woo-commerce HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 158

{
  "billing": {
    "first_name": "John",
    "email": "john.dee@w3block.io"
  },
  "order_key": "wc_order_602aevefa",
  "line_items": [
    {
      "sku": "NFTXPTO",
      "quantity": 1
    }
  ],
  "status": "text"
}
201Success

No content