Herald
OpenapiBilling

Update an entitlement mapping

PATCH
/api/bill/entitlement-mappings/{mappingId}

Authorization

bearer_auth
AuthorizationBearer <token>

In: header

Path Parameters

mappingId*string

Mapping ID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

currency?|

ISO 4217 currency code for the manual price — WeChat mappings only.

enabled?boolean|null
entitlementKey?string|null
pointRules?array<>|

Points distribution rule upsert set owned by this mapping. None ⟺ leave the existing rule set untouched; Some(rules) ⟺ upsert the given rules under this mapping (rules absent from the set are left untouched; disabling requires explicit enabled = false). Non-empty / present triggers the points.manage credit-field permission gate.

price?|

Manual price in minor units — WeChat mappings only (WeChat has no hosted catalog to sync from). Merges into the stored provider_product_info. Rejected for every other provider.

Formatint64
serviceDurationDays?|

Non-renewing service-period length (days). Same 3-state semantics as point_rules: None ⟺ leave unchanged; Some(null) ⟺ clear (only valid when the stored billing_type is not non_renewing); Some(n) ⟺

Formatint64

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/bill/entitlement-mappings/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "billingPeriod": "string",  "billingType": "string",  "createdAt": "string",  "enabled": true,  "entitlementKey": "string",  "externalPriceId": "string",  "externalProductId": "string",  "grantedRoleIds": [    "d7da45c3-cf14-4d32-83d9-df3496b53a96"  ],  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "paymentProvider": "string",  "pointRules": [    {      "bucketId": "1980377d-7926-47e0-9e64-a9d0c746404d",      "displayOrder": 0,      "enabled": true,      "grantMode": "string",      "grantPeriodType": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "pointsAmount": 0,      "quotaWindows": [        {          "key": "string",          "limit": 0,          "windowSeconds": 0        }      ],      "triggerSources": [        "string"      ],      "validityDays": 0    }  ],  "providerProductInfo": null,  "serviceDurationDays": 0,  "syncedAt": "string",  "updatedAt": "string"}
{  "code": "string",  "field": "string",  "message": "string",  "ruleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac"}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "field": "string",  "message": "string",  "ruleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac"}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}