Skip to main content

Order Canceled

Fire the order_canceled event when a confirmed order is canceled or refunded — either fully (the whole order is reversed) or partially (only some line items are returned). This is the negative counterpart of checkout_completed: it lets every connected destination subtract the reversed revenue, keep ROAS reporting accurate, and avoid optimizing toward customers who cancel.

This event can be fired client-side from the browser (e.g. a customer canceling from their account page or an order-status page) or server-side from your order-management webhook. Always include the same stable, unique event.id you used for the original checkout_completed (your order or transaction ID) — DATA Reshape uses it to tie the cancellation back to the original purchase and to deduplicate across destinations.

Like every DATA Reshape event, you push it once and Reshape fans it out to every connected destination with the correct platform-specific name and field mapping — you do not need to fire gtag, fbq, ttq or other tracking function calls in parallel.

  • Google Analytics 4refund (with transaction_id, items, value, currency). A full cancellation refunds the whole transaction; a partial one refunds only the items you include.
  • Other connected destinations — mapped to each destination's cancellation/refund equivalent based on your account's event-mapping configuration (many ad platforms have no native cancel event, in which case it is used as a server-side signal or skipped).
One push, many native events

A single Reshape event can produce one or more native events per destination, with different characteristics depending on each website's destination configuration (active pixels, server endpoints, event-mapping rules).

Required: event.id

This event requires a unique event.id — use the same order/transaction ID as the original checkout_completed. DATA Reshape uses it to match the cancellation to the original purchase and to deduplicate across destinations.

Complete Reference

The order_canceled event accepts the following objects and fields. Required fields must always be present in the payload — everything else is optional but recommended. Include in products only the line items being canceled/refunded (all of them for a full cancellation, a subset for a partial refund). Unlike checkout_completed, there is no payments array — payment instruments are irrelevant to a cancellation. Set event.value to the amount being reversed.

event object required

name string required

info

Use only static value order_canceled for event.name. DATA Reshape maps this to refund (GA4) and to the cancellation/refund equivalent in other connected destinations automatically.

name: "order_canceled"

value number required

info

Amount being reversed — the full order total for a full cancellation, or the refunded portion for a partial refund. This is the value destinations subtract from reported revenue.

value: 299.99

currency string required

info

Currency code for all monetary values in this event (ISO 4217). Use the same currency as the original order.

currency: "USD"

exchange_rate number

info

Custom exchange rate for multi-currency reporting. Default is 1.

exchange_rate: 1

id string required

info

Order or transaction ID from your system — use the same ID as the original checkout_completed. Required for cross-destination deduplication and to match the cancellation to the original purchase.

id: "ord_abc123"

reason string recommended

info

Short, human-readable cancellation reason. Lands in a predictable, queryable place across destinations (e.g. the reason parameter in GA4). Use a consistent vocabulary — e.g. customer_request, out_of_stock, payment_declined, fraud, duplicate.

reason: "customer_request"

context object

url string required-if-applicable

info

Collected automatically for standard websites. Required only for SPA applications where URL changes don't trigger automatic page context updates.

url:"https://example.com/products/prod_abc123?utm_source=example"
warning

URL Parameter Sensitivity: Be mindful of sensitive information in URLs. Query parameters may contain personal identifiers, session tokens, or private information that should be handled according to privacy regulations.

page_type string recommended

info

Type of page (product, home ...)

page_type: "product"

environment string recommended

info

Allowed values: prod, dev

environment: "prod"

products array required

info

The line items being canceled/refunded — every item for a full cancellation, or only the returned items for a partial refund. This populates the items array in the GA4 refund and the per-item breakdown in other connected destinations. View complete Product Object documentation

products[0] object required

id string required

info

Unique product identifier in your system.

id: "prod_abc123"

parent_id string recommended

info

Parent product ID for variants or child products. Defaults to id if not provided.

parent_id: "prod_parent_xyz789"

name string required

info

Product name or title displayed to users.

name: "Example Product Name"

parent_name string

info

Parent product name for variants or child products. Defaults to name if not provided.

parent_name: "Example Parent Product Name"

price_base number required

info

Original or base price before discounts. Always equal to or greater than price.

price_base: 299.99

price number required

info

Current selling price after discounts. Always equal to or less than price_base.

price: 249.99

tax_included boolean required

info

Whether the price includes taxes. Defaults to true if not provided.

tax_included: true

tax_percent number required

info

Tax percentage applied to the product (0-50). If not provided, the site default tax rate will be used (generally the standard rate of the country).

tax_percent: 19

quantity number required

info

Quantity of this product in the context of the event. Defaults to 1 if not provided.

quantity: 2

category string recommended

info

Main product category name

category: "Example Category"

sku string

info

Product SKU (Stock Keeping Unit) for inventory tracking

sku: "sku_abc123"

parent_sku string

info

Parent product SKU for variants or child products. Defaults to sku if not provided.

parent_sku: "sku_parent_xyz789"

gtin string

info

Global Trade Item Number for product identification

gtin: "1234567890123"

mpn string

info

Manufacturer Part Number assigned by the manufacturer

mpn: "MPN-EXAMPLE-001"

ean string

info

European Article Number for product barcoding

ean: "1234567890123"

brand string

info

Product brand or manufacturer name

brand: "Example Brand"

type string

info

Product type. Free-form string (e.g. "simple", "variable", "bundle", "subscription").

type: "simple"

stock_status boolean recommended

info

Product availability (true = in stock, false = out of stock). Defaults to true if not provided.

stock_status: true

stock_location string

info

Physical location or warehouse where product is stored

stock_location: "Example Warehouse"

created_at number

info

Timestamp when product was added to inventory (milliseconds)

created_at: 1748505040077

url string

info

Direct URL to the product page

url: "https://example.com/products/prod_abc123"

parent_url string

info

URL to the parent product page (for variants)

parent_url: "https://example.com/products/prod_parent_xyz789"

image string

info

Main product image URL

image: "https://example.com/cdn/prod_abc123-main.jpg"

images array

info

Array of additional product image URLs

images: [
"https://example.com/cdn/prod_abc123-1.jpg",
"https://example.com/cdn/prod_abc123-2.jpg"
]

categories array

info

Array of category objects with name and id properties

  • name (string, required) - Category name
  • id (string) - Category identifier
categories: [
{ name: "Example Category", id: "cat_abc123" },
{ name: "Example Subcategory", id: "cat_xyz789" }
]

coupons array

info

Array of product-level coupons applied to this product. View complete Coupon Object documentation

coupons[0] (object) - required

name string required

info

Coupon name or code.

name: "EXAMPLE_COUPON"

value number recommended

info

Coupon discount value.

value: 123.99

tax_included boolean recommended

info

Whether coupon value includes taxes

tax_included: true

tax_percent number recommended

info

Tax percentage for the coupon

tax_percent: 21

id string

info

Coupon internal identifier.

id: "cpn_abc123"

type string

info

Coupon type. Free-form string, use consistent naming (e.g. "LOYALTY", "SEASONAL", "FIRST_ORDER", "SHIPPING").

type: "SHIPPING"

currency string required-if-applicable

info

Currency code. Specifies the currency code when it differs from event.currency.

currency: "USD"

exchange_rate number

info

Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.

exchange_rate: 1

properties object recommended

info

Custom product attributes for audience segmentation. Free-form key-value object. Use properties that match your product catalog and business needs.

Product Segmentation

Use the properties object to store custom product attributes, with property names defined by each business as needed, that enable advanced segmentation, personalization, and analytics across your marketing campaigns.

properties: {
color: "space_gray",
storage: "256GB",
memory: "16GB",
connectivity: ["wifi", "bluetooth"],
warranty: "2_years",
energy_rating: "A++",
brand_series: "pro_line"
}

currency string required-if-applicable

info

Currency code. Specifies the currency code when it differs from event.currency.

currency: "USD"

exchange_rate number

info

Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.

exchange_rate: 1

shipping array

info

Shipping methods from the original order. Include only if the shipping cost is part of the reversed amount. View complete Shipping Object documentation

shipping[0] object

name string required

info

Shipping method name

name: "Example Shipping Method"

value number required

info

Shipping cost value

value: 12.99

tax_included boolean recommended

info

Whether shipping cost includes taxes

tax_included: true

tax_percent number recommended

info

Tax percentage for shipping (0-50)

tax_percent: 19

id string

info

Shipping method identifier.

id: "shp_abc123"

type string

info

Shipping type. Free-form string, use consistent naming (e.g. "standard", "express", "next_day", "pickup", "free").

type: "standard"

currency string required-if-applicable

info

Currency code. Specifies the currency code when it differs from event.currency.

currency: "USD"

exchange_rate number

info

Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.

exchange_rate: 1

coupons array

info

Order-level coupons that were applied to the original order. Product-level coupons go inside each product's own coupons array. View complete Coupon Object documentation

coupons[0] object

name string required

info

Coupon name or code.

name: "EXAMPLE_COUPON"

value number recommended

info

Coupon discount value.

value: 123.99

tax_included boolean recommended

info

Whether coupon value includes taxes

tax_included: true

tax_percent number recommended

info

Tax percentage for the coupon

tax_percent: 21

id string

info

Coupon internal identifier.

id: "cpn_abc123"

type string

info

Coupon type. Free-form string, use consistent naming (e.g. "LOYALTY", "SEASONAL", "FIRST_ORDER", "SHIPPING").

type: "SHIPPING"

currency string required-if-applicable

info

Currency code. Specifies the currency code when it differs from event.currency.

currency: "USD"

exchange_rate number

info

Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.

exchange_rate: 1

user object recommended

info

Include user identifiers whenever available — the same user.id (and email/phone) as the original order lets destinations attribute the reversal to the correct customer and audience. View complete User Object documentation

id string recommended

info

Unique customer identifier in your system.

id: "cust_abc123"

email string recommended

info

Customer email address in plaintext. Do not send pre-hashed values — DATA Reshape automatically normalizes and hashes before sending to destinations.

phone string recommended

info

Customer phone number in E.164 format (plaintext). Do not send pre-hashed values — DATA Reshape automatically normalizes and hashes before sending to destinations.

phone: "+10000000000"

first_name string recommended

info

Customer first name

first_name: "Example First Name"

last_name string recommended

info

Customer last name

last_name: "Example Last Name"

country string

info

Country name or ISO country code

country: "US"

region string recommended

info

State, province, or region name

region: "Example Region"

city string recommended

info

City or locality name

city: "Example City"

street string

info

Street address including number

street: "123 Sample Street"

postal_code string

info

Postal code or ZIP code

postal_code: "00000"

orders_total_number number recommended

info

Cumulative number of orders placed by this user

orders_total_number: 5

orders_canceled_number number recommended

info

Cumulative number of orders placed and canceled by this user

orders_canceled_number: 0

orders_total_value number recommended

info

Cumulative lifetime user orders value (decimal format: 2500.50)

orders_total_value: 1234.99

orders_refunded_value number recommended

info

Cumulative lifetime user orders value canceled (decimal format: 2500.50)

orders_refunded_value: 250.99

predicted_value number

info

Predicted lifetime value of a customer for your business

predicted_value: 100.99

created_at number recommended

info

Timestamp in milliseconds since Unix epoch representing the first time the user was recorded

created_at: 1754926521690

properties object recommended

info

Custom Customer Properties Examples

User Segmentation

Use the properties object to store custom user attributes, with property names defined by each business as needed, that enable advanced segmentation, personalization, and analytics across your marketing campaigns.

properties: {
customer_type: "returning",
membership_level: "platinum",
preferred_category: ["electronics", "fashion"],
last_purchase_date: "2024-12-15",
average_order_value: "350.00",
payment_method_preference: "card",
registration_date: "2023-06-15"
}

consent object recommended

info

Customer consent preferences. Drives Consent Mode behavior in GA4, the consent object in Meta CAPI, and limited-data-use flags in TikTok and other destinations. View complete Consent Object documentation

analytics boolean required

info

Indicates the user’s explicit consent regarding the collection and processing of data for analytical purposes, such as performance monitoring, usage statistics, and service optimization.

analytics: true

personalization boolean required

info

Indicates the user’s explicit consent regarding the collection and processing of data for personalization purposes, enabling tailored experiences and content customization.

personalization: true

marketing boolean required

info

Indicates the user’s explicit consent regarding the collection and processing of data for marketing purposes, such as targeted advertising, remarketing, and campaign measurement.

marketing: true

id string

info

Optional consent-record identifier. When present, DATA Reshape can persist or relay the consent decision under this ID — useful when you want each stored decision to be tied to a verifiable reference from your Consent Management Platform (CMP consent ID, IAB TC string hash, internal record ID, etc.). Required when the optional audit-trail persistence feature is enabled on the account.

id: "consent_record_abc123"

Examples

The examples below show how to push order_canceled for a Full Cancellation (the whole order is reversed) and a Partial Refund (only some items are returned), plus a Minimal tab with only the required fields. DATA Reshape transforms any of these payloads into a GA4 refund plus equivalents in other connected destinations — you do not need to write platform-specific code.

window.reshape = window.reshape || [];
reshape.push({
"event": {
"name": "order_canceled",
"value": 134.97,
"currency": "USD",
"exchange_rate": 1,
"id": "ord_abc123",
"reason": "customer_request"
},
"context": {
"url": "https://example.com/account/orders/ord_abc123",
"page_type": "account",
"environment": "prod"
},
"products": [
{
"id": "prod_tshirt_navy_m",
"parent_id": "prod_tshirt_model",
"name": "Example Cotton T-Shirt - Navy / M",
"parent_name": "Example Cotton T-Shirt",
"price_base": 59.99,
"price": 49.99,
"tax_included": true,
"tax_percent": 19,
"quantity": 2,
"category": "Apparel",
"sku": "sku_tshirt_navy_m",
"brand": "Example Brand",
"type": "variable",
"currency": "USD",
"properties": {
"variant": "Navy / M",
"color": "navy",
"size": "M"
}
},
{
"id": "prod_jeans_blue_32",
"parent_id": "prod_jeans_model",
"name": "Example Slim Jeans - Indigo / 32",
"parent_name": "Example Slim Jeans",
"price_base": 89.99,
"price": 79.99,
"tax_included": true,
"tax_percent": 19,
"quantity": 1,
"category": "Apparel",
"sku": "sku_jeans_blue_32",
"brand": "Example Brand",
"type": "variable"
}
],
"shipping": [
{
"name": "Example Standard Shipping",
"value": 9.99,
"tax_included": true,
"tax_percent": 19,
"id": "shp_abc123",
"type": "standard",
"currency": "USD"
}
],
"user": {
"id": "cust_abc123",
"email": "[email protected]",
"phone": "+10000000000",
"country": "US",
"orders_total_number": 3,
"orders_canceled_number": 1
},
"consent": {
"analytics": true,
"personalization": true,
"marketing": true
}
});
Custom properties

Custom properties (event.properties, user.properties, products[*].properties) are fully processed server-side. On browser-side pixels and tags, only a subset may be available. Server-side processing can also enrich the outgoing payload with additional parameters derived from context and data quality.

Best Practices

  • Reuse the original event.id — always send the same order/transaction ID as the original checkout_completed. This is what lets DATA Reshape match the cancellation to the purchase and deduplicate across destinations.
  • Set event.value to the reversed amount — the full total for a full cancellation, or only the refunded portion for a partial refund. This is what destinations subtract from reported revenue.
  • Include only the canceled items in products[] — all line items for a full cancellation, only the returned ones for a partial refund. GA4 refund uses this to reverse the correct line items.
  • Always set reason — a consistent, short cancellation reason (customer_request, out_of_stock, payment_declined, fraud, duplicate, ...) makes cancellations groupable for reporting across destinations.
  • No payments array — payment instruments are irrelevant to a cancellation; unlike checkout_completed, order_canceled does not use payments.
  • Fire client-side OR server-side — a browser push (e.g. from the account/order page) captures browser context; a server-side push from your order-management webhook guarantees the reversal is recorded even if no browser is involved. DATA Reshape deduplicates via event.id.