Create a rental
Create a rental after your customer completes checkout.
Endpoint
POST https://unlimitedplug.com/api/v1/rentals
This request uses credits from the account that owns the API key.
Example request
cURL
curl -X POST https://unlimitedplug.com/api/v1/rentals \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: YOUR_UNIQUE_ORDER_REFERENCE" \
-H "Content-Type: application/json" \
-d '{
"project_slug": "YOUR_PROJECT_SLUG",
"duration_type": "monthly",
"duration_value": 1,
"customer_name": "Customer Name",
"customer_email": "[email protected]"
}'Request fields
| Field | Required | Description |
|---|---|---|
project_slug | Yes | The slug of an active rentable project. |
duration_type | Yes | One of daily, weekly, monthly, or yearly. |
duration_value | Yes | A whole number from 1 to 365. |
customer_name | Yes | The customer's name. |
customer_email | Yes | The customer's email address. |
Successful response
The response includes the initial login details for the rented project. Your server should send the admin email, temporary password, and admin URL to your customer through a private channel. Do not show these details in a public page or expose them in browser code.
JSON shape
{
"success": true,
"data": {
"rental_id": "RENTAL_ID",
"admin_email": "[email protected]",
"admin_password": "INITIAL_PASSWORD",
"admin_url": "https://rented-project.example/login",
"expires_at": "EXPIRY_TIME",
"status": "active"
}
}Change the password after signing in
The customer should sign in with the initial details, then change the password from the rented service's account or security settings. Tell the customer to choose a strong private password and never share it with anyone.