POST
/dashboard/services/{id}/renew Create renewal invoice
Creates an invoice to renew the service for the specified billing cycle.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
id* | integer | path | The service ID |
Request Body
cyclestringRequiredBilling cycle for renewal
monthlyquarterlysemiannuallyannuallybienniallytrienniallyResponse
200
403
successbooleandataobjectinvoice_idintegerID of the created invoice
Request
curl -X POST "https://api.royalehosting.net/dashboard/services/{id}/renew" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-organization-id: YOUR_ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'Request
const response = await fetch("https://api.royalehosting.net/dashboard/services/{id}/renew", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"cycle": "annually"
}),
});
const data = await response.json();Request
import requests
response = requests.post(
"https://api.royalehosting.net/dashboard/services/{id}/renew",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
}
)
print(response.json())Response
{
"success": true,
"data": {
"invoice_id": 12345
}
}