> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pagamerican.app/llms.txt
> Use this file to discover all available pages before exploring further.

# UTMify

> Send your approved purchases to UTMify automatically.

UTMify is a sales tracking dashboard that reconciles ad spend against the sales a campaign produced. Connecting it lets the platform push every approved purchase into UTMify on its own, carrying the tracking parameters the checkout captured, so your UTMify dashboard fills in without a manual export.

The mechanism: when a purchase is approved, the platform sends the order to UTMify's orders endpoint as a `POST`, authenticated with the API token you paste into the integration. Nothing is injected into your checkout and no script runs in the buyer's browser.

<Info>
  You need a UTMify account first. The credential that connects the two is generated in UTMify, not in PagAmerican.
</Info>

## How to configure

<Steps>
  <Step title="Generate an API credential in UTMify">
    In your UTMify account, go to **Integrations > Webhooks > API Credentials**, add a credential, and create it. Copy the token it gives you: that token is the only value PagAmerican needs from UTMify.
  </Step>

  <Step title="Open the Utmify app">
    In the PagAmerican dashboard, go to **Integrations** and find the **Utmify** card. Click **Install integration** the first time, or **Manage** if you have connected it before. You land on the UTMify list, which shows every integration you have created, with its **Name**, **Scope**, and **Status**.
  </Step>

  <Step title="Create the integration">
    Click **Create Integration**. Fill in **Name** (an internal label, so you can tell your integrations apart) and paste the credential into **API Token**.
  </Step>

  <Step title="Enable the events">
    Under **Events**, turn on **Purchase approved**. At least one event has to be enabled or the form cannot be saved.
  </Step>

  <Step title="Choose the product scope and save">
    Under **Product Scope**, pick **All products**, **Specific products**, or **Specific offers from a product**, then click **Create**. The integration starts active.
  </Step>
</Steps>

The configuration is per integration, not per product: one integration carries one API token, one set of events, and one product scope. Create as many as you need. A purchase that falls inside two scopes is sent to both.

An integration also belongs to the role you were using when you created it. One created as a producer receives purchases of your own products; one created as an affiliate receives purchases of the offers you promote. If you sell both ways, create one integration under each role.

## Events sent

| Event in the UI       | What the platform delivers       | When it fires                                                    |
| --------------------- | -------------------------------- | ---------------------------------------------------------------- |
| **Purchase approved** | An order with `"status": "paid"` | Every approved purchase, including upsell and downsell purchases |

UTMify does not receive an event name. It receives an order, and the order's `status` is what identifies it, always `paid`.

## What UTMify receives

One approved purchase is one `POST`. This is the body, and it is also what you see behind **View Payload** in the delivery logs:

```json theme={null}
{
  "orderId": "100001",
  "platform": "PagAmerican",
  "paymentMethod": "credit_card",
  "status": "paid",
  "createdAt": "2026-09-01 14:32:10",
  "approvedDate": "2026-09-01 14:32:10",
  "refundedAt": null,
  "customer": {
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "phone": "5551234567",
    "document": null,
    "country": "US",
    "ip": ""
  },
  "products": [
    {
      "id": "10001",
      "name": "Example Product - 6 units",
      "planId": null,
      "planName": "EXAMPLE1",
      "quantity": 1,
      "priceInCents": 10000
    }
  ],
  "trackingParameters": {
    "src": null,
    "sck": null,
    "utm_source": "example-source",
    "utm_campaign": "EXAMPLE-CAMPAIGN",
    "utm_medium": "example-medium",
    "utm_content": "example-content",
    "utm_term": "example-term"
  },
  "commission": {
    "totalPriceInCents": 10000,
    "gatewayFeeInCents": 700,
    "userCommissionInCents": 9300,
    "currency": "USD"
  },
  "isTest": false
}
```

What is worth knowing about those fields:

| Field                       | Description                                                                                                                        |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `orderId`                   | The PagAmerican order the purchase belongs to. An upsell attached to an existing order carries that same order's id                |
| `platform`                  | Always `PagAmerican`                                                                                                               |
| `status`                    | Always `paid`                                                                                                                      |
| `paymentMethod`             | `credit_card` or `paypal`. Any other method is reported as `credit_card`                                                           |
| `createdAt`, `approvedDate` | Both carry the moment the checkout was initialized, in UTC, as `YYYY-MM-DD HH:MM:SS`                                               |
| `refundedAt`                | Always `null`                                                                                                                      |
| `customer.country`          | Always `US`, and `customer.ip` is always empty                                                                                     |
| `products`                  | Always exactly one line, built from the offer the buyer checked out with. `priceInCents` is the total of the purchase's first item |
| `commission`                | Your side of the money (see below)                                                                                                 |
| `trackingParameters`        | The seven keys the checkout captured. A key the link did not carry arrives as `null`                                               |
| `isTest`                    | `false` for live traffic                                                                                                           |

Every amount is an integer in cents: `10000` is \$100.00.

`commission.totalPriceInCents` is the gross item total, `gatewayFeeInCents` is the fee charged on the transaction, and `userCommissionInCents` is your own net: the producer's net on the producer's copy, the affiliate's net on the affiliate's copy.

Only the seven keys shown in `trackingParameters` are forwarded. A custom parameter of your own is dropped, so if you need an identifier to reach UTMify, send it in `src`, `sck`, or one of the `utm_*` parameters. The same rule is described in [Tracking parameters](/integrations/webhooks/overview#tracking-parameters).

## Producer and affiliate copies

When a purchase came through an affiliate, the platform sends it twice: once to the producer's integration and once to the affiliate's. The two bodies are identical except for `commission.userCommissionInCents`, which carries each side's own net. Neither side sees the other's figure.

If the producer and the affiliate happen to paste the same UTMify credential into their integrations, the same order reaches that UTMify account twice.

## Troubleshooting

Every integration in the UTMify list has a **Logs** button that opens **Delivery Logs**, with one row per attempt: **Sent At**, **Event**, **Status**, **Code**, and **Details**. A successful row hides the body behind **View Payload**; a failed one shows the error instead.

### Nothing arrives and there is no log row

A row is written only when a delivery is actually attempted. When the platform decides not to send, nothing is attempted, so there is no row and no error message. **An empty log is the diagnostic, not a sign that the platform is broken.**

The platform skips the delivery silently when:

* the integration's **Status** is inactive
* **Purchase approved** is not enabled on that integration
* the purchase falls outside the integration's **Product Scope**
* the purchase belongs to the other role: a producer's integration does not receive the purchases you made as an affiliate, and an affiliate's does not receive the purchases of products you produce

One more case worth checking on a multi-item cart: with **Specific products** or **Specific offers from a product**, the purchase is matched by its first item. A purchase whose first item sits outside the scope is skipped even when a later item is inside it.

### The log row says Failed

Read the **Code** column:

* `401` or `403`: the API token is wrong, was revoked, or belongs to a different UTMify account. Edit the integration and paste a fresh credential.
* a `5xx`, or no code at all with a timeout in **Details**: UTMify did not answer in time. Each attempt waits at most 5 seconds and is retried up to three times before the delivery is recorded as failed.

A failed delivery is not sent again later. Once the row says Failed, that purchase will not reach UTMify on its own.

### Purchases arrive but no campaign is attributed

`trackingParameters` only ever contains what the checkout link carried. If the buyer reached the checkout through a link with no `utm_*`, `src`, or `sck` values, every key arrives as `null` and UTMify has nothing to attribute the sale to. Fix the links, not the integration.

## FAQ

**Can I send different products to different UTMify accounts?**
Yes. Create one integration per credential and give each its own **Product Scope**. Every integration is checked against every approved purchase, so a purchase inside two scopes is delivered to both.

**Do I have to change my checkout links?**
No. The integration reads the parameters the checkout already captures. To attribute a sale in UTMify, the link that brings the buyer to the checkout has to carry the tracking parameters.

**What happens while the integration is inactive?**
Deliveries stop immediately and nothing is queued. Turning it back on does not backfill the purchases approved while it was off.

**Can I change the API token later?**
Yes. Open the integration, click **Edit**, replace **API Token**, and save. The change applies to the next approved purchase.

<Card title="Need help?" icon="mail" href="mailto:support@pagamerican.com">
  Our team can help you set up your integration: [support@pagamerican.com](mailto:support@pagamerican.com)
</Card>
