Skip to content

ETL: sync PEC validation results into a CRM via webhook #27

@francescobianco

Description

@francescobianco

Context

Several teams run nightly jobs that validate PEC addresses and push the results into their CRM (HubSpot, Salesforce, custom). The current SDK makes the API call straightforward but the surrounding ETL glue is always written from scratch.

Typical integration code

$client = new Client($token);

foreach ($contacts as $contact) {
    $raw = $client->get('https://pec.openapi.com/check', [
        'pec' => $contact['email']
    ]);
    $result = json_decode($raw, true);

    if ($result['valid'] === true) {
        $crm->updateContact($contact['id'], ['pec_verified' => true]);
    }
}

What's missing

  • No structured response object — consumers always json_decode manually.
  • No event/hook to plug into after each item is processed.
  • No dry-run mode for testing the pipeline without hitting the API.

Open questions

  • Would a response DTO or a ResponseInterface be welcome, or is raw JSON preferred to keep the SDK agnostic?
  • Should the SDK ship with a PipelineRunner helper, or is that out of scope?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions