Appearance
Recipe: WordPress
Use WordPress as a form host; keep the API key in server-side PHP (options / env), never in page HTML or JS.
Pattern
- Contact Form 7 / Gravity Forms / custom form posts to admin-ajax or a custom REST route on your WP site.
- PHP handler calls Appraiser Flow Public API with
AF_API_KEYfromwp-config.phpor server env. - Map form fields → quote JSON.
- Store returned
quote_idin a custom post meta or CRM plugin.
wp-config.php
php
define('AF_API_BASE', 'https://staging-api.appraiserflow.ai');
define('AF_API_KEY', 'af_test_••••'); // production: af_live_Handler sketch
php
$response = wp_remote_post(AF_API_BASE . '/public/v1/quotes', [
'headers' => [
'Authorization' => 'Bearer ' . AF_API_KEY,
'Content-Type' => 'application/json',
'Idempotency-Key' => $submission_id,
],
'body' => wp_json_encode($payload),
'timeout' => 20,
]);Tips
- Prefer a small custom plugin over putting keys in the theme.
- Use staging key until the mapping is solid.
- For no-code-only shops, Zapier or
orders@{slug}.appraiserflow.aiemail forward may be enough.