Contents
Request Sign-in Link - Plugixa Car Wash
POST /plugixa-carwash/v1/public/account/link
E-mail a one-time sign-in link to a customer. The link works once, for 30 minutes.
Needs the Customer accounts app on. Open to anyone. Rate-limited per visitor address to 5 an hour (bucket carwash_account_link), with the website honeypot.
Note. The answer is the same whether or not the address belongs to a customer, so the route cannot be used to find out who books with you. Only a published customer is sent a link.
Request
POST https://your-site.example/wp-json/plugixa-carwash/v1/public/account/link
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
email |
string |
Yes | The customer’s address. |
page_url |
string |
No | The account page. The link points there with ?pcw_login=<token> added. Only an address on your own site is used; anything else sends the customer to the home page. |
website |
string |
No | The honeypot. Leave it out or empty. |
{
"email": "emma@example.com",
"page_url": "https://your-site.example/my-bookings"
}
Responses
200 OK.
{
"success": true,
"data": {
"sent": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.sent |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_carwash_invalid_email |
email is not a valid address. |
400 |
plugixa_carwash_rejected |
The honeypot is filled in. |
403 |
plugixa_carwash_captcha_failed |
Your CAPTCHA hook refused the request. |
429 |
plugixa_carwash_rate_limited |
This address has used up its requests for the hour. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-carwash/v1/public/account/link" \
-H "Content-Type: application/json" \
-d '{"email":"emma@example.com","page_url":"https://your-site.example/my-bookings"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/public/account/link');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'email' => 'emma@example.com',
'page_url' => 'https://your-site.example/my-bookings',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-carwash/v1/public/account/link', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'emma@example.com',
page_url: 'https://your-site.example/my-bookings',
}),
});
const { data } = await response.json();
Quick Links
Share