CouponsMerchantManageResult coupons.merchant-manage-result@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- coupons
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/coupons/merchant-manage-result.v1.json
coupons.merchant-manage-result@1: the answer of every coupons.merchant.manage route on OpenVibe.Coupons: { merchant } with its status (201 for a new merchant or domain).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
merchant | any | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: created
{
"merchant": {
"id": "mer_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"slug": "example-shoes",
"name": "Example Shoes",
"homepage_url": "https://shoes.example.com/",
"url": "https://openvibe.coupons/m/example-shoes",
"domains": [
{
"host": "shoes.example.com",
"include_subdomains": true,
"path_prefix": null
}
],
"active_codes": 2,
"hints": [
"Enter the code in the Promo field at checkout."
],
"status": "active"
}
}Rejected: no-status
{
"merchant": {
"id": "mer_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"slug": "example-shoes",
"name": "Example Shoes",
"homepage_url": "https://shoes.example.com/",
"url": "https://openvibe.coupons/m/example-shoes",
"domains": [
{
"host": "shoes.example.com",
"include_subdomains": true,
"path_prefix": null
}
],
"active_codes": 2,
"hints": [
"Enter the code in the Promo field at checkout."
]
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('coupons.merchant-manage-result@1', value); // { valid, errors: [{ path, message }] }