Use cases
Dispute handling (POST /v1/invoices/{id}/dispute)
Track a customer dispute compliant with PDP/PPF flows
From September 2026, French e-invoicing mandates a `dispute` status traceable in PDP/PPF flows. Scell.io exposes `POST /api/v1/invoices/{id}/dispute` to open a dispute on an issued invoice: required fields `reason` (enum: `wrong_amount`, `wrong_recipient`, `quality_issue`, `delivery_issue`, `other`), `description` (free text, max 2000 chars), optional attachments. The event is: (1) logged in the immutable audit trail, (2) notified to the issuing tenant via the `invoice.disputed` webhook, (3) propagated to PDP/PPF if the invoice transited there. Companion endpoints: `POST /{id}/dispute/resolve` (amicable resolution), `POST /{id}/dispute/escalate` (escalation).
Key facts
- `POST /api/v1/invoices/{id}/dispute` endpoint
- 5 normalised reasons (wrong_amount, quality_issue...)
- `invoice.disputed` webhook to issuing tenant
- PDP/PPF propagation if applicable
- Companion `resolve` and `escalate` endpoints
- Trace in immutable audit trail
Code example
use Scell\Sdk\ScellClient;
$scell = new ScellClient(getenv('SCELL_SECRET_KEY'));
// Ouvrir un litige sur la facture INV-2026-042
$dispute = $scell->invoices()->dispute('inv_42', [
'reason' => 'wrong_amount',
'description' => 'Le montant facturé est de 1500€ TTC alors que le devis signé indique 1200€ TTC.',
'attachments' => [
['name' => 'devis-signe.pdf', 'content_base64' => base64_encode(file_get_contents('/tmp/devis.pdf'))],
],
]);
echo "Litige #{$dispute->id} ouvert. Statut: {$dispute->status}\n";
// Résolution amiable plus tard
$scell->invoices()->resolveDispute('inv_42', [
'resolution' => 'credit_note_issued',
'credit_note_id' => 'cn_99',
]);