Skip to main content
Sales report automation delivers your transactions to your system on a recurring schedule, without any manual export. Paylead generates an encrypted file, notifies you through a signed Webhook, and lets you download the file through a single-use URL that you decrypt with your own key. This guide describes how the service works and what you set up on your side.

How it works

On a recurring schedule, Paylead exports the transactions accumulated since the previous run into a secure file, then notifies your endpoint. You verify the notification, download the file, and decrypt it.

Key points

  • Each report covers the period since the previous generation: a daily schedule delivers the previous day’s transactions, a monthly schedule delivers roughly the last 30 days. The exact window is the period field in the Webhook payload.
  • By default it is generated once a day at 09:00, Europe/Paris time (UTC+1, or UTC+2 during daylight saving time). The trigger time and the frequency are both configurable.
  • The file is encrypted with your PGP public key (asymmetric encryption), so only you can decrypt it.
  • The Webhook can be signed with HMAC-SHA256 (optional, strongly recommended) so you can verify its authenticity.
  • The download URL is single-use and expires after 24 hours.
Before you start, you need:
  • An HTTPS endpoint that can receive Webhooks (POST requests with a JSON body).
  • The ability to generate a PGP key pair and decrypt PGP files.

The Webhook

Method and endpoint

Paylead sends an HTTP POST request to the Webhook URL you provide.

Payload

The request body is a JSON object.
string
Event type. Always sales_report.
string
Pre-signed URL used to download the report file.
string
Type of the delivered file. Always application/pgp-encrypted.
string
Type of the file once decrypted. Always text/csv.
array
List of the CSV column names, in order.
object
Period covered by the report.
string
Reference of the Brand covered by the report.
string
Expiration timestamp of the pre-signed URL.

Authentication with HMAC

Signing Webhooks with HMAC-SHA256 is optional.
Paylead strongly recommends enabling HMAC signing. It lets you confirm that each Webhook was sent by Paylead and was not tampered with in transit.
When signing is enabled, each request carries a signature of the request body in the following header:
Verify this signature on every Webhook you receive, using the shared HMAC secret key that Paylead provides.
Encode the secret to bytes as UTF-8 to obtain the verification key. Do not base64-decode it, even though its format may look like base64.
The following example verifies a signature in Python. The values are illustrative.

Retry policy

Any 2xx response is treated as a successful delivery. On failure, Paylead retries the request up to 8 times with exponential backoff (1 minute to 1 hour) for the status codes below. All other error codes are not retried.

Report file format

The delivered file is a PGP-encrypted CSV. Each row is one commissioned transaction, with the Brand, the Cashback strategy, the Campaign, and the resulting merchant cost. Once decrypted, it contains the following columns.

Set up the integration

Setup is a one-time exchange: you send Paylead an encryption key and an endpoint, Paylead sends you a signing secret, and you implement the verification and decryption steps. The delivery schedule (trigger time) and frequency are agreed with Paylead during setup; the defaults are once a day at 09:00 Europe/Paris.

What you provide to Paylead

What Paylead provides

Checklist

To send to Paylead:
  • PGP public key (ASCII-armored .asc, Ed25519 or RSA-4096, capability [E], validity 1 year or more).
  • Webhook endpoint URL (HTTPS).
To validate on your side:
  • If HMAC signing is enabled (recommended): verify the signature in the X-paylead-signature-256 header.
  • Respond with an HTTP 2xx code on correct receipt.
  • Decrypt the PGP files with your private key.

Notes

Download window. The pre-signed URL is no longer accessible after 24 hours. Retrieve the file within this window.
Key rotation. If you renew your PGP key pair, provide the new public key to Paylead in advance, so delivery stays continuous before the old key expires.