Skip to main content
POST
/
merchant
/
metric
/
edit
Edit Merchant Metric
curl --request POST \
  --url https://api.unibee.dev/merchant/metric/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metricId": 123,
  "metricName": "<string>",
  "carryoverProrationEnabled": true,
  "metaData": {},
  "metricDescription": "<string>",
  "prorationRefundEnabled": true,
  "type": 123,
  "unit": "<string>"
}
'
{
  "code": 123,
  "data": {
    "merchantMetric": {
      "aggregationProperty": "<string>",
      "aggregationType": 123,
      "archived": true,
      "carryoverProrationEnabled": true,
      "code": "<string>",
      "createTime": 123,
      "gmtModify": 123,
      "id": 123,
      "merchantId": 123,
      "metaData": {},
      "metricDescription": "<string>",
      "metricName": "<string>",
      "prorationRefundEnabled": true,
      "type": 123,
      "unit": "<string>"
    }
  },
  "merchantId": 123,
  "message": "<string>",
  "redirect": "<string>",
  "requestId": "<string>"
}

Endpoint Overview

POST https://api.unibee.dev/merchant/metric/edit Edit Merchant Metric

Authorization

All UniBee Merchant API requests require authentication via API key.
HeaderRequiredDescription
AuthorizationYesBearer <your_api_key>
Content-TypeYesapplication/json (for request body)

Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

Request body

NameTypeRequiredDescription
carryoverProrationEnabledbooleanNoEnable carryover proration for this metric (default: false when not set)
metaDataobjectNometa_data(json)
metricDescriptionstringNoMetricDescription
metricIdintegerYesMetricId
metricNamestringYesMetricName
prorationRefundEnabledbooleanNoEnable proration refund for this metric (reclaim metric limit on upgrade; default: false when not set)
typeintegerNo1-limit_metered,2-charge_metered,3-charge_recurring,4-limit_recurring
unitstringNounit

Request examples

cURL

curl -X POST "https://api.unibee.dev/merchant/metric/edit" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "carryoverProrationEnabled": false,
  "metaData": {},
  "metricDescription": "",
  "metricId": 0,
  "metricName": "",
  "prorationRefundEnabled": false,
  "type": 0,
  "unit": ""
}'

Sandbox

curl -X POST "https://api-sandbox.unibee.top/merchant/metric/edit" \
  -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "carryoverProrationEnabled": false,
  "metaData": {},
  "metricDescription": "",
  "metricId": 0,
  "metricName": "",
  "prorationRefundEnabled": false,
  "type": 0,
  "unit": ""
}'

Response

Success responses return a JSON envelope with code, data, message, redirect, and requestId. code 0 indicates success.
FieldTypeDescription
codeintegerResponse code. 0 = success
dataobjectResponse payload
data.merchantMetricobject
messagestringHuman-readable message
requestIdstringRequest ID for support

Error handling

HTTP statusMeaning
400Bad request — invalid or missing parameters. Check message in the body.
401Unauthorized — missing or invalid API key.
404Not found — invalid path or resource.
500Server error — retry with backoff.
When code in the response body is non-zero, check message for details. Use requestId when contacting support.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
metricId
integer<int64>
required

MetricId

metricName
string<string>
required

MetricName

carryoverProrationEnabled
boolean<*bool>

Enable carryover proration for this metric (default: false when not set)

metaData
object

meta_data(json)

metricDescription
string<string>

MetricDescription

prorationRefundEnabled
boolean<*bool>

Enable proration refund for this metric (reclaim metric limit on upgrade; default: false when not set)

type
integer<*int>

1-limit_metered,2-charge_metered,3-charge_recurring,4-limit_recurring

unit
string<string>

unit

Response

200 - application/json
code
integer<int>
data
object
merchantId
integer<int64>
message
string<string>
redirect
string<string>
requestId
string<string>