Credits

Update Credit Definition

Update an existing credit definition. All fields are optional.

POST
/credits/definitions/{id}/update

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Path Parameters

id*string

Credit definition ID

Match^cred_def_[A-Za-z0-9]+$

Request Body

application/json

name?string
Length1 <= length
description?string
billingDescription?string
applicationType?string
Value in"usage" | "monetary"
scope?string
Value in"component" | "price" | "plan" | "merchant"
planId?string|null
featureId?string|null
featureSlug?string|null
priceId?string|null
priceComponentId?string|null
defaultAmount?integer
Range1 <= value
refillAmount?integer
Range1 <= value
expiryDays?integer
Range1 <= value
refillRrule?string
renewOnBilling?boolean
priority?integer
isActive?boolean

Response Body

application/json

application/json

application/json

curl -X POST "https://api.getlumen.dev/v1/credits/definitions/string/update" \  -H "Content-Type: application/json" \  -d '{}'
{
  "definition": {
    "id": "string",
    "merchantId": "string",
    "name": "string",
    "description": "string",
    "scope": "component",
    "applicationType": "usage",
    "planId": "string",
    "featureId": "string",
    "featureSlug": "string",
    "priceId": "string",
    "priceComponentId": "string",
    "defaultAmount": 0,
    "refillAmount": 0,
    "expiryDays": 0,
    "refillRrule": "string",
    "renewOnBilling": false,
    "billingVisible": false,
    "billingDescription": "string",
    "currency": "string",
    "priority": 0,
    "isActive": true,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Credit definition not found"
}
{
  "error": "Failed to update credit definition"
}