Order Rules (Admin)
Product order rules can be used to allow and block a user to purchase some products depending on some situations:
Time: You can define some order rule to allow user of purchasing only in some specific time range
Purchase Limit: You can define how much tokens the user can purchase
The permission to purchase is defined by some whitelist which can be created inside the ID service. That whitelists can be linked into each order rule and defines if some user can or not purchase some product.
Whitelists can specify users by email, wallet address or users who owns some token.
Service Methods
Creates some order rule inside a company product
Rest API reference:
post
Authorizations
Path parameters
companyIdstringRequired
productIdstringRequired
Body
startAtstring · date-timeOptional
endAtstring · date-timeOptional
purchaseLimitnumberOptional
whitelistIdstring · uuidOptionalDefault:
null
Responses
201Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
post
POST /admin/companies/{companyId}/products/{productId}/order-rules HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"startAt": null,
"endAt": null,
"purchaseLimit": null,
"whitelistId": "123e4567-e89b-12d3-a456-426614174000"
}
No content
Lists all orders rules from some company product
Rest API reference:
get
Authorizations
Path parameters
companyIdstringRequired
productIdstringRequired
Query parameters
pagenumberOptionalDefault:
1
limitnumberOptionalDefault:
10
searchstringOptional
sortBystring · enumOptionalExample:
createdAt
Possible values: orderBystring · enumOptionalPossible values:
Responses
200Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/products/{productId}/order-rules HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Gets one specific product order rule by id
Rest API reference:
get
Authorizations
Path parameters
companyIdstringRequired
productIdstringRequired
orderRuleIdstringRequired
Responses
200Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/products/{productId}/order-rules/{orderRuleId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Updates some specific product order rule
Rest API reference:
patch
Authorizations
Path parameters
companyIdstringRequired
productIdstringRequired
orderRuleIdstringRequired
Body
startAtstring · date-timeOptional
endAtstring · date-timeOptional
purchaseLimitnumberOptional
whitelistIdstring · uuidOptionalDefault:
null
Responses
200Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/products/{productId}/order-rules/{orderRuleId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"startAt": null,
"endAt": null,
"purchaseLimit": null,
"whitelistId": "123e4567-e89b-12d3-a456-426614174000"
}
No content
Deletes some specific product order rule
Rest API reference:
delete
Authorizations
Path parameters
companyIdstringRequired
productIdstringRequired
orderRuleIdstringRequired
Responses
200Success
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
delete
DELETE /admin/companies/{companyId}/products/{productId}/order-rules/{orderRuleId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Last updated