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 Logo
Services

Update Service Pricing

Update the price of a service. The new price will be applied immediately.

PUT
/api/application/services/{id}/pricing
AuthorizationBearer <token>

Bearer token authentication

In: header

Path Parameters

idinteger

Service ID

pricestring

New price for the service

Response Body

curl -X PUT "https://api.example.com/api/application/services/0/pricing" \
  -H "Content-Type: application/json" \
  -d '{
    "price": "29.99"
  }'
{
  "success": true,
  "message": "Service action completed successfully",
  "data": {
    "id": 1,
    "service_name": "Web Hosting Premium",
    "product_id": 1,
    "category_id": 1,
    "owner_id": 1,
    "extra_owners": null,
    "price": "25.00",
    "original_price": null,
    "coupon_id": null,
    "billing_cycle": "yearly",
    "due_date": "2024-12-31T23:59:59.000000Z",
    "status": "active",
    "module": "HostingModule",
    "config": {
      "domain": "example.com",
      "created_at": "2024-01-01T00:00:00.000000Z",
      "license_id": 1,
      "license_key": "LIC-XXXXXXXX-XXXXXXXX-XXXXXXXX",
      "last_rotated": "2024-01-01T00:00:00.000000Z"
    },
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z",
    "last_reminded": null,
    "owner": {
      "id": 1,
      "name": "user@example.com",
      "email": "user@example.com"
    },
    "product": {
      "id": 1,
      "name": "Premium Hosting"
    },
    "category": {
      "id": 1,
      "name": "Web Hosting"
    }
  }
}
{
  "success": false,
  "message": "Service not found"
}
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "price": [
      "The price field is required."
    ]
  }
}