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://api.appraiserflow.ai/public/v1');
define('AF_API_KEY', 'af_test_••••'); // or af_live_ from the same production app
// A key created in staging uses https://staging-api.appraiserflow.ai/public/v1 instead.

Handler sketch ​

php
$response = wp_remote_post(AF_API_BASE . '/quotes', [
  'headers' => [
    'Authorization' => 'Bearer ' . AF_API_KEY,
    'Content-Type'  => 'application/json',
    'Idempotency-Key' => $submission_id,
  ],
  'body' => wp_json_encode($payload),
  'timeout' => 20,
]);

A WordPress form should create quotes, not import the whole client database. Database and CRM loads belong on a server job: CRM sync recipe.

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: https://api.appraiserflow.ai/public/v1. Test and live keys created in this environment both use this base.