Create a package

Creates a new package.

post
Header parameters
Brand-URLstringRequired

The brand URL of the request. This is used to identify the brand.

Example: YOUR_BRAND_URL
Auth-KeystringRequired

Auth-Key is required to authenticate the request. If missing, the server will return 401 Unauthorized.

Example: YOUR_AUTH_KEY
Body

This class is used to present the package command request data transfer object.

codestring · min: 1Required

The code of the package.

namestring · min: 1Required

The name of the package.

imageURLstring · uri | nullableOptional

The image URL of the package.

patternAvatarURLstring · uri | nullableOptional

The pattern avatar URL of the package.

stylesstring | nullableOptional

The styles of the package. This value is a JSON string.

descriptionstring | nullableOptional

The description of the package.

tagsstring | nullableOptional

The tags of the package.

tierinteger · int32 | nullableOptional

The tier of the package.

zOrderinteger · int64 | nullableOptional

The order of the package.

isDefaultbooleanOptional

Flag to indicate if the package is default. By default, the value is false.

statusstring · enumOptional

This enum is used to define the common status of an object in JFW.

Supported values:

Possible values:
Responses
201

The request was successful.

application/json
post
POST /api/v1/packages HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Auth-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 397

{
  "code": "BASIC001",
  "name": "Basic Package",
  "imageURL": "https://cdn.jframework.io/packages/basic-package.jpg",
  "patternAvatarURL": "https://cdn.jframework.io/packages/basic-pattern.png",
  "styles": "{\"color\":\"#007BFF\",\"layout\":\"grid\"}",
  "description": "This is a basic package suitable for individual users.",
  "tags": "starter,individual,basic",
  "tier": 1,
  "zOrder": 1,
  "isDefault": true,
  "status": "Active"
}
{
  "success": true,
  "statusCode": 201,
  "message": "The request was successful.",
  "data": {
    "id": "sApKpllz4sAplsmzha",
    "code": "CODE",
    "name": "NAME",
    "imageURL": "IMAGE",
    "patternAvatarURL": "https://www.example.com/pattern.jpg",
    "styles": "{\"color\": \"red\"}",
    "description": "DESCRIPTION",
    "tags": "TAGS",
    "isFree": true,
    "tier": 0,
    "zOrder": 1,
    "features": [
      {
        "type": "Function",
        "title": "Feature Title",
        "quantity": 10,
        "value": 10,
        "isUnlimited": false,
        "resetPolicy": 0,
        "customIntervalDays": null,
        "id": "sApKpllz4sAplsmzha",
        "parentBrandId": "Brand_ID",
        "eventId": "Event_ID",
        "code": "Code",
        "name": "Feature Name",
        "unit": "Unit",
        "defaultValue": null,
        "helpURL": null,
        "image": "https://www.example.com/image.jpg",
        "styles": "{\"color\": \"red\"}",
        "description": "Feature Description",
        "tags": "#Tag1, #Tag2",
        "zOrder": 1,
        "status": "Active"
      }
    ],
    "prices": [
      {
        "id": "sApKpllz4sAplsmzha",
        "code": "Code",
        "name": "Name",
        "amount": 10,
        "currency": "USD",
        "description": "Description",
        "checkoutLink": "CheckoutLink",
        "tags": "Tags",
        "packageName": "PackageName",
        "packageId": "PackageId",
        "subscriptionName": "SubscriptionName",
        "subscriptionTypeId": "SubscriptionTypeId",
        "zOrder": 1
      }
    ],
    "isDefault": true,
    "status": "Inactive"
  },
  "errors": []
}

Last updated

Was this helpful?