API Server-to-Server (EN)

Technical documentation for Server-to-Server (S2S) integration to notify Powerspace of generated conversions.

Key Information:

  • Base URL: https://a.pwspace.com
  • Method: GET
  • Format: Query string parameters
  • ClickID provided by Powerspace in Query String following an ad click

1. Overview

The Powerspace Server-to-Server (S2S) API allows advertisers to notify conversions generated following an advertising click in real-time. Two types of conversions are supported:

  • Lead: Generation of a qualified prospect
  • Order: Completion of an order with value
📘

How it works

When a user clicks on your Powerspace advertisement, they are redirected to your site with a unique clickId parameter. This parameter must be preserved and used to notify conversions via the S2S API.


2. Conversion Flow

Step 1: Ad Click

The user clicks on your Powerspace advertisement and arrives on your site with the URL:

https://your-site.com/landing?clickId=abc123xyz789&utm_source=powerspace

Step 2: Click ID Preservation

Your site must preserve the clickId (cookie, session, database) to associate it with user actions.

Step 3: Conversion Notification

When a conversion occurs, call the corresponding S2S API with the preserved clickId.


3. Available Endpoints

Lead Notification

GET https://a.pwspace.com/ld?qci={clickId}

Notifies the generation of a lead (qualified prospect).

Parameters:

NameTypeRequiredDescription
qcistring✅ YesClick ID provided by Powerspace during initial click

Order Notification

GET https://a.pwspace.com/ord?qci={clickId}&ov={order-value}

Notifies the completion of an order with its value.

Parameters:

NameTypeRequiredDescription
qcistring✅ YesClick ID provided by Powerspace during initial click
ovfloat🟡 RecommendedOrder value (e.g., 49.99, 125.50)
📘

Importance of order value

Although optional, the ov (order value) parameter is strongly recommended. It allows the value to be reported in your Powerspace statistics and optimize the management of your advertising campaigns.


4. Implementation Examples

Lead Scenario

# User subscribes to your newsletter
curl "https://a.pwspace.com/ld?qci=abc123xyz789"

Order Scenario

# User completes a purchase of €89.99
curl "https://a.pwspace.com/ord?qci=abc123xyz789&ov=89.99"

PHP - Complete Management

<?php
// 1. Retrieve clickId upon site arrival
if (isset($_GET['clickId'])) {
    $_SESSION['powerspace_click_id'] = $_GET['clickId'];
}

// 2. Lead notification
function notifyLead($clickId) {
    $url = "https://a.pwspace.com/ld?qci=" . urlencode($clickId);
    file_get_contents($url);
}

// 3. Order notification
function notifyOrder($clickId, $orderValue) {
    $url = "https://a.pwspace.com/ord?qci=" . urlencode($clickId) . "&ov=" . $orderValue;
    file_get_contents($url);
}

// Usage example
if (isset($_SESSION['powerspace_click_id'])) {
    // Lead generated
    notifyLead($_SESSION['powerspace_click_id']);
    
    // Or order completed
    notifyOrder($_SESSION['powerspace_click_id'], 129.99);
}
?>

Python - Server Integration

import requests
from urllib.parse import urlencode

def notify_lead(click_id):
    """Notify a generated lead"""
    url = f"https://a.pwspace.com/ld?qci={click_id}"
    try:
        response = requests.get(url, timeout=5)
        return response.status_code == 200
    except requests.RequestException:
        return False

def notify_order(click_id, order_value):
    """Notify a completed order"""
    params = {'qci': click_id, 'ov': order_value}
    url = f"https://a.pwspace.com/ord?{urlencode(params)}"
    try:
        response = requests.get(url, timeout=5)
        return response.status_code == 200
    except requests.RequestException:
        return False

# Usage example
click_id = "abc123xyz789"
notify_lead(click_id)
notify_order(click_id, 89.99)

5. Best Practices

Click ID Management

  • Preserve the clickId as soon as the user arrives
  • Associate it with the session or user profile
  • Persist it in database for delayed conversions
  • Clean up old clickIds (expiration ~30 days)

API Calls

  • Call immediately after conversion
  • Handle timeouts (5 seconds max recommended)
  • Don't block user experience on failure
  • Log calls for debugging

Order Value

  • Always send the actual order value
  • Use decimal format (e.g., 49.99, not 4999)
  • Exclude shipping costs if requested
  • Include taxes according to your configuration

6. Debugging and Monitoring

Call Verification

  • Log all S2S calls with timestamp
  • Monitor call success rate
  • Alert on repeated failures

Development Testing

# Test with a fictitious clickId
curl "https://a.pwspace.com/ld?qci=test_click_id_123"
curl "https://a.pwspace.com/ord?qci=test_click_id_123&ov=99.99"

7. Integration Checklist

  • ✅ Retrieve and store clickId from URL
  • ✅ Preserve clickId throughout user session
  • ✅ Lead call when generating a prospect
  • ✅ Order call with value when completing an order
  • ✅ Handle timeouts and network errors
  • ✅ Log calls for monitoring
  • ✅ Test in development environment
  • ✅ Validate in production with real conversions

Technical Support

For any questions about S2S integration:

  • Documentation: This page
  • Support: Contact your Powerspace account manager