Skip to content

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

  1. Contact Form 7 / Gravity Forms / custom form posts to admin-ajax or a custom REST route on your WP site.
  2. PHP handler calls Appraiser Flow Public API with AF_API_KEY from wp-config.php or server env.
  3. Map form fields → quote JSON.
  4. Store returned quote_id in 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.ai email forward may be enough.

API base for Try-it: https://staging-api.appraiserflow.ai