# See a sale in seconds with postbacks

> Get each sale in seconds. A network calls your postback URL, AffFast makes the conversion, and a signed webhook tells your server. A sync confirms it.

Page: https://www.afffast.com/guides/sales-in-seconds-postbacks

Postbacks and webhooks

# See a sale in seconds with postbacks

A sync can take minutes to show a new sale. A postback shows the sale in seconds, and a webhook sends it to your own server.

[Start your trial](https://app.afffast.com/signup)

## What it looks like

Webhook events

Sample data

1. conversion.createdpending14:02:11Awin commission €4.20 on /boots-review
2. conversion.status_changedapproved13:47:30Adtraction pending approved
3. commission.changed11:05:02Daisycon 8% 10%
4. payout.createdpaid09:00:14Partner-Ads €312.40

1. Each row is one event. The name is the event type, for example `conversion.created`.
2. A new conversion is `pending` until the network decides. A later event shows the change of the status.
3. Other events, such as a payout, use the same webhook.

## Why this matters

A fast sale signal lets you act while the visitor is still on your mind: thank a reader, update a report or watch a campaign that you just started.

It also lets you check your tracking at once. You make a test sale and you see it in seconds.

## Why most tools cannot tell you

A sync reads the API of a network on a schedule. Between two syncs, a sale is not visible.

A raw postback is only a hint. Without a second check, a lost request or a wrong value gives a wrong number.

A webhook without a signature can come from anyone. Your server needs a way to know that the request is real.

## How AffFast does it

You make a postback source for a connection. AffFast gives you a secret URL. The network calls that URL for each conversion, and AffFast answers `200` at once.

A worker makes a provisional conversion and sends the `conversion.created` event to your webhooks. The requests follow the Standard Webhooks specification, and each one has a signature.

The next sync overwrites the provisional conversion with the data of the network. The same transaction ID is in both, so you never get a duplicate.

## How to do it

1. Make a postback source for a connection with `POST /v1/postback_sources`.
2. Paste `template_url` from the response into the network. The docs show the steps for Awin, Impact, Tradedoubler and other platforms.
3. Make a webhook endpoint with `POST /v1/webhook_endpoints` and choose the events. Save the `whsec_` secret. The API shows it one time.
4. Verify the signature of each request with the secret. The docs have the code.
5. Treat the postback as a hint. The sync of the connection is the source of truth.

Make a postback source and a webhook

Make a postback source

```
curl -X POST https://api.afffast.com/v1/postback_sources \
  -H "Authorization: Bearer $AFFFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "connection": "conn_...", "label": "Awin main" }'
```

Make a webhook endpoint

```
curl -X POST https://api.afffast.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $AFFFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/afffast",
    "events": ["conversion.created", "conversion.status_changed"]
  }'
```

## Learn more

In the docs

- [Postbacks](https://docs.afffast.com/docs/postbacks)
- [Webhooks](https://docs.afffast.com/docs/webhooks)
- [API reference](https://docs.afffast.com/reference)

Features that this guide uses

- [Postbacks](https://www.afffast.com/features/postbacks)
- [Webhooks](https://www.afffast.com/features/webhooks)

## Related guides

- [DestinationsSend your affiliate sales to Google Sheets](https://www.afffast.com/guides/affiliate-sales-to-google-sheets)
- [Click trackingFind which page earns the most](https://www.afffast.com/guides/which-page-earns-most)
- [MCPAsk your affiliate data in Claude](https://www.afffast.com/guides/ask-affiliate-data-in-claude)

## Start your free trial

[See pricing](https://www.afffast.com/pricing)

Free for 14 days. No card needed. Cancel any time.
