CouponsMerchantManageRequest coupons.merchant-manage-request@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-request.v1.json

coupons.merchant-manage-request@1: bodies of coupons.merchant.manage on OpenVibe.Coupons (staff or a service). POST /api/v1/merchants: { domains, name?, slug?, homepage_url?, description?, status? } (at least one domain rule; a rule on a public suffix is refused; homepage_url must be https; status pending, else active). POST /api/v1/merchants/:id/domains: one domain rule { host, include_subdomains?, path_prefix? } (a rule another merchant holds is 409). POST /api/v1/merchants/:id/status: { status: active | disabled }.

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: create
{
  "name": "Example Shoes",
  "homepage_url": "https://shoes.example.com/",
  "domains": [
    {
      "host": "shoes.example.com"
    }
  ]
}
Valid: disable
{
  "status": "disabled"
}
Rejected: bad
{
  "status": "paused",
  "domains": []
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('coupons.merchant-manage-request@1', value);   // { valid, errors: [{ path, message }] }