find_product

Busca um produto na API através do ID.

local product = exports.hydrus:find_product(1)

-- Este exports pode causar um erro se o produto não existir
-- Utilize pcall se não tiver certeza do ID do produto

print(json.encode(product))
{
  "id": 1,
  "category_id": 1,
  "enabled": true,
  "name": "VIP Bronze",
  "price": 50,
  "stock": null,
  "description": "",
  "weight": 1,
  "deleted_at": null,
  "created_at": "2023-11-15T20:35:51.000000Z",
  "updated_at": "2023-11-22T19:05:35.000000Z",
  "store_id": 1,
  "images": [],
  "commands": [
    {
      "id": 218534,
      "on_approve": "group $user_id Bronze",
      "on_chargeback": "ungroup $user_id Bronze",
      "on_expire": "ungroup $user_id Bronze",
      "days": 31,
      "is_overwriteable": true,
      "scope": "plugin",
      "created_at": "2023-11-15T20:37:48.000000Z",
      "updated_at": "2023-11-15T20:37:48.000000Z",
      "parent_type": "Package",
      "parent_id": 188007
    }
  ],
  "variables": [
    {
      "id": 225,
      "package_id": 188007,
      "parent_id": null,
      "name": "Veículo VIP",
      "code": "$vehicle",
      "type": "select",
      "choices": {
        "panto": "Panto",
        "xa21": "XA 21",
        "jester": "Jester"
      },
      "min": null,
      "max": null,
      "pattern": null,
      "created_at": "2023-11-30T23:20:31.000000Z",
      "updated_at": "2024-01-25T03:34:39.000000Z"
    }
  ]
}

Last updated