Welcome to our new docs! Please keep in mind we are still working on making everything is as accurate as possible. Join us on discord and ask us questions if you are unsure.
DezerX Spartan LogoDezerX Spartan
Services

Activate Service

Activates a pending service, dispatching the creation job and marking associated invoices as paid. Only services with 'pending' status can be activated.

POST
/services/{id}/activate
AuthorizationBearer <token>

Bearer token authentication

In: header

Path Parameters

idinteger

Service ID to activate

Response Body

curl -X POST "https://api.example.com/api/application/services/789/activate"
{
  "success": true,
  "message": "Service activation job has been queued. The service will be activated shortly. 1 unpaid invoice(s) have been marked as paid.",
  "data": {
    "id": 789,
    "owner_id": 123,
    "product_id": 456,
    "category_id": 1,
    "service_name": "VPS Hosting",
    "price": "19.99",
    "billing_cycle": "monthly",
    "status": "pending",
    "due_date": "2024-02-15",
    "notes": "VPS for client project",
    "custom_fields": {
      "custom_fields": [
        {
          "label": "Server Location",
          "value": "US East"
        }
      ],
      "custom_buttons": [
        {
          "label": "Restart Server",
          "action": "restart"
        }
      ]
    },
    "module": "PterodactylService",
    "created_at": "2024-01-15T10:30:00.000000Z",
    "updated_at": "2024-01-15T10:30:00.000000Z",
    "owner": {
      "id": 123,
      "name": "John Doe",
      "email": "john@example.com"
    },
    "product": {
      "id": 456,
      "name": "VPS Hosting"
    },
    "category": {
      "id": 1,
      "name": "Hosting"
    }
  }
}
{
  "success": false,
  "message": "Only pending services can be activated"
}
{
  "error": "Unauthorized",
  "message": "Bearer token required"
}
{
  "error": "Forbidden",
  "message": "Insufficient permissions for this action"
}
{
  "success": false,
  "message": "Service not found"
}

{
  "success": false,
  "message": "Error creating service: Database connection failed"
}