@extends('layouts.app') @section('title', 'WooCommerce Settings') @section('content')

WooCommerce Integration

Configure WooCommerce API connection and coupon sync settings.

@csrf @method('PUT')

API Connection

Connect to your WooCommerce store using REST API credentials.

Your WooCommerce store URL (without trailing slash)

@error('store_url')

{{ $message }}

@enderror
@error('consumer_key')

{{ $message }}

@enderror
@error('consumer_secret')

{{ $message }}

@enderror

How to get API credentials:

  1. Go to WooCommerce → Settings → Advanced → REST API
  2. Click "Add Key"
  3. Set Description: "Agent Coupon Sync" (or any name you prefer)
  4. Set Permissions: "Read/Write"
  5. Click "Generate API Key"
  6. Copy Consumer Key and Consumer Secret

Webhook Settings

Configure webhook secret for receiving orders from WooCommerce.

Must match the secret configured in WooCommerce webhooks

@error('webhook_secret')

{{ $message }}

@enderror

Webhook URLs for WooCommerce:

Order Created {{ url('/api/webhooks/woocommerce/order') }}
Order Updated {{ url('/api/webhooks/woocommerce/order-updated') }}

Default Coupon Settings

Default settings applied when syncing agent coupons to WooCommerce.

For percentage, enter value (e.g., 5 for 5%)

@error('coupon_discount_amount')

{{ $message }}

@enderror

Cannot be combined with other coupons

Coupon won't apply to items on sale

Automatic Coupon Sync

Automatically sync agent coupons to WooCommerce when agents are created or updated.

When enabled, agent coupons will be automatically created/updated in WooCommerce.

Note: Auto-sync requires valid API credentials. Sync errors are logged to storage/logs/webhook-*.log

@endsection