Webhooks documentation: events and payloads
This is the technical reference for Cloudfy webhooks. Whenever something happens to an order (PIX generated, payment approved, refund, etc.), Cloudfy sends a POST request to the URL you registered under Webhooks, with a JSON body in the format below. To register the URL, see How do I set up a webhook?.
Download the full documentation (PDF)
Event format
Every event arrives with two top-level fields: type (the event name) and payload (the order data).
{
"type": "PIX_APPROVED",
"payload": { ... }
}Available events
Event (type) | When it fires |
|---|---|
PIX_GENERATED | PIX generated, awaiting payment (status PENDING). |
PIX_APPROVED | PIX paid and approved (status APPROVED). |
PIX_EXPIRED | PIX expired without payment. |
BOLETO_GENERATED | Boleto generated, awaiting payment (status PENDING). |
BOLETO_APPROVED | Boleto paid and approved (status APPROVED). |
CREDIT_CARD_APPROVED | Card payment approved (status APPROVED). |
CREDIT_CARD_REFUSED | Card payment refused (status REFUSED). |
ORDER_REFUNDED | Order refunded (status REFUNDED). |
ORDER_CHARGED_BACK | Order charged back (status CHARGED_BACK). |
CHECKOUT_ABANDONED | Checkout abandoned — the customer filled in their details but did not complete payment. |
Payload fields (order events)
The PIX, boleto and card events share the same payload structure:
| Field | Description |
|---|---|
_id | Order ID. |
value | Order value. |
items[] | List of items, each with product (name, description, img.url) and quantity. |
paymentMethod | Payment method: PIX, BOLETO or CREDIT_CARD. |
payerName | Payer name. |
payerCpf | Payer CPF. |
payerEmail | Payer email. |
phone | Payer phone. |
installments | Number of installments. |
status | Order status: PENDING, APPROVED, REFUSED, REFUNDED or CHARGED_BACK. |
store | Store ID. |
createdAt / updatedAt | Order creation and update dates. |
orderPendingUrl | Pending order link. |
PIX-specific fields
Present in PIX_GENERATED, PIX_APPROVED and PIX_EXPIRED:
qrCode— PIX copy-and-paste code.base64QrCode— QR Code image in base64.pixDueDate— PIX expiry.
Boleto-specific fields
Present in BOLETO_GENERATED and BOLETO_APPROVED:
barCode— barcode.digitableLine— digitable line.externalResourceUrl— link to access the boleto.boletoDueDate— boleto due date.
The shipping object
When there is a delivery address, the payload includes the shipping object with: value, street, neighborhood, city, state, number, cep, type, complement, selectedShippingId, createdAt and updatedAt.
Tracking parameters
Cloudfy automatically captures the parameters sent in the checkout URL and forwards them in the webhook payload.
| URL parameter | Payload field |
|---|---|
utm_source | utmSource |
utm_campaign | utmCampaign |
utm_medium | utmMedium |
utm_content | utmContent |
utm_term | utmTerm |
click_id (Kwai Ads) | kwaiClickId |
ttclid (TikTok Ads) | tiktokClickId |
xcod and subIds may also be sent.
Optional fields
The fields below are optional and may be absent, come as null or as an empty string, depending on how the checkout was accessed:
utmSource, utmCampaign, utmMedium, utmContent, utmTerm, xcod, subIds, kwaiClickId, tiktokClickId, shipping and orderPendingUrl.
Example: PIX_APPROVED
{
"type": "PIX_APPROVED",
"payload": {
"_id": "673a3dca2b11ddfb67e3315c",
"value": 15,
"items": [
{ "product": { "name": "Teclado gamer", "description": "lorem", "img": { "url": "image do produto" } }, "quantity": 1 }
],
"paymentMethod": "PIX",
"payerName": "Sérgio Antonio",
"payerCpf": "087.001.240-10",
"installments": 1,
"status": "APPROVED",
"store": "66f5572e4b28b122deaa9840",
"qrCode": "pixCopiaECola",
"base64QrCode": "imagemDoQrCodeEmBase64",
"pixDueDate": "2024-11-17T19:12:34.724Z",
"phone": "(85) 98902-8127",
"payerEmail": "sergio@gmail.com",
"shipping": { "value": 14.9, "number": 123, "type": "FIXED" },
"orderPendingUrl": "https://..."
}
}The CHECKOUT_ABANDONED event
This event has a different payload — all fields are optional (they may come as undefined):
{
"type": "CHECKOUT_ABANDONED",
"payload": {
"storeId": "66f5572e4b28b122deaa9840",
"document": "632.444.900-93",
"email": "joao@gmail.com",
"fullName": "Joao Silva",
"phone": "(11) 1 1111-1111"
}
}