In this topic:

Product Tags

Use product tags to group your products according to your business or reporting needs. For example, with tags, you can organize products that have the same characteristics or those that you need to group to complete a certain task.

Creating product tags

Use the following endpoint and sample payload to create a new product tag:

POST https://example-tract-api.com/billing/2/product-tags

Request

{
  "name": "Product Tag 1",
  "description": "additional information on product tag",
  "priority": 7
}

Response

{
  "id": "484",
  "name": "Product Tag 1",
  "description": "additional information on product tag",
  "priority": 7
}

Retrieving product tags

To retrieve a list of all existing product tags, use the following endpoint:

GET https://example-tract-api.com/billing/2/product-tags

To retrieve the specified product tag by ID, use the following endpoint:

GET https://example-tract-api.com/billing/2/product-tags/{id}

Updating a product tag

To update the product tag, use the following endpoint and indicate parameters that you want to modify:

PUT https://example-tract-api.com/billing/2/product-tags/{id}

Deleting a product tag

To delete the product tag that you no longer need, use the following endpoint:

DELETE https://example-tract-api.com/billing/2/product-tags/{id}

Changing the priority

When needed, you can increase or decrease the priority of product tags.

Note: The priority is changed to the next available one.

Increasing product tag priority

Use the following endpoint to increase the priority of the product tag.

POST https://example-tract-api.com/billing/2/product-tags/{id}/increase-priority

Response: 204

Now, let’s check whether the priority of this product tag has changed:

GET https://example-tract-api.com/billing/2/product-tags/{id}

Response

{
  "id": "484",
  "name": "Product Tag 1",
  "description": "additional information on product tag",
  "priority": 5
}

As you can see, now the priority of our tag has been increased from “7” to “5.”

Decreasing product tag priority

Use the following endpoint to decrease the priority of the product tag.

POST https://example-tract-api.com/billing/2/product-tags/{id}/decrease-priority

Response: 204

Now, let’s check whether the priority of this product tag has been changed:

GET https://example-tract-api.com/billing/2/product-tags/{id}

Response

{
  "id": "484",
  "name": "Product Tag 1",
  "description": "additional information on product tag",
  "priority": 7
}

As you can see, the priority of our tag has been modified back to “7.”

Associating the product tag with a product

To use product tags, you have to associate them with the needed products.

PUT https://example-tract-api.com/billing/2/products/{id}

Request

{
  "product_tags": [
  { 
	"id": "484"
  }
  ]
}

Response

{
  "product_type": "customer-subscription",
  "id": "24362",
  "name": "Product 1",
  "description": "additional information on product",
  "serialized": true,
  "taxable": false,
  "trial": false,
  "short_description": "string",
  "state": "AVAILABLE",
  "requires_agreement": false,
  "default_quantity": 1,
  "product_category": {
      "id": "1406",
      "name": "Product Category"
  },
  "min_service_resources": 0,
  "max_service_resources": 0,
  "trial_override": false,
  "product_tags": [
  {
     "id": "484",
	 "name": "Product Tag 1",
	 "description": "additional information on product tag",
	  "priority": 7
  }
  ],
  "introduction_date": "2018-08-10T03:26:32-05:00",
  "rule_override": false,
  "rule_type": "TAPERED",
  "rule_mode": "ROOT",
  "consume_prepaid_balance": false
}
				

 

Top