Google Data Manager API lists INVALID_COUPON_CODE when a coupon code is not valid. WooCommerce integrations can trigger it by sending an array as one string, joining multiple codes incorrectly, including deleted or empty codes, using display labels instead of stored codes, or replaying an edited order with stale promotion data.
Use this for WooCommerce purchase, refund, and offline conversion events that include coupon or promotion fields in Data Manager API payloads.
Quick answer
Read coupon codes from the order record, preserve the original purchase event ID, normalize one code per API field or supported structure, remove empty values, and keep display names separate from machine values. If a historical coupon was deleted, preserve the order's recorded code but confirm the destination accepts it. Validate before replay and never create a second purchase event to fix promotion metadata.
What to check first
- Capture order ID, event ID, transaction ID, order version, coupon items, stored codes, display labels, discounts, currency, refund state, destination, and error location.
- Compare single, multiple, empty, deleted, expired, Unicode, case, whitespace, encoded, and manually edited coupon cases against the integration's serialization logic.
- Check whether the payload sends an array, comma-joined text, JSON text, promotion name, or code into the field expected by the destination.
- Normalize deterministically, preserve historical order evidence, validate a synthetic event, and quarantine permanent bad rows without changing purchase identity.
- Replay corrected rows with the original transaction and event IDs, then reconcile request status, conversion count, value, currency, and refund adjustments.
Diagnostic table
Use this table to keep the work practical. It connects the symptom to evidence and a verification step.
| Action | Evidence to collect | How to verify |
| Preserve order and event identity | Capture order ID, event ID, transaction ID, order version, coupon items, stored codes, display labels, discounts, currency, refund state, destination, and error location. | Single and multiple coupon test cases serialize as intended. |
| Inspect coupon serialization | Compare single, multiple, empty, deleted, expired, Unicode, case, whitespace, encoded, and manually edited coupon cases against the integration's serialization logic. | Deleted, empty, encoded, and edited coupon controls have documented outcomes. |
| Normalize supported values | Check whether the payload sends an array, comma-joined text, JSON text, promotion name, or code into the field expected by the destination. | Replay uses the original purchase identity and does not duplicate conversion value. |
| Validate one corrected event | Normalize deterministically, preserve historical order evidence, validate a synthetic event, and quarantine permanent bad rows without changing purchase identity. | Request status and reporting show the corrected event with expected value and currency. |
Why this usually happens
- WooCommerce stores coupon line items separately while a mapper may expect one scalar value.
- A deleted coupon can still be valid historical order evidence even though the current coupon post no longer exists.
- Display labels, URL encoding, and case handling can change the value sent to Google.
- Creating a new purchase event to correct one field can duplicate revenue reporting.
Useful command or data shape
Adapt paths, IDs, and privacy handling to the site before running commands or storing data on production.
order_id: 18422
event_id: purchase-18422
raw_coupon_items: ['SUMMER 20', 'VIP']
normalized_coupon_codes: ['SUMMER20', 'VIP']
empty_values_removed: true
error_reason: INVALID_COUPON_CODE
replay_event_id: purchase-18422
deduplication: required
Safe fix order
Do the work in a sequence that makes each result easy to prove. Stop if a step produces new evidence that changes the incident scope.
- Preserve order and event identity
- Inspect coupon serialization
- Normalize supported values
- Validate one corrected event
- Replay and reconcile reporting
Decision rule
If coupon metadata cannot be represented safely, omit the optional coupon field rather than corrupting the purchase or minting a new event ID. Keep value, currency, transaction, consent, and deduplication correct.
What to tell the client or owner
Share order and event IDs, raw coupon items, normalization rules, destination field, error location, test cases, validate result, replay set, deduplication evidence, and reporting reconciliation.
Production verification checklist
- Single and multiple coupon test cases serialize as intended.
- Deleted, empty, encoded, and edited coupon controls have documented outcomes.
- Replay uses the original purchase identity and does not duplicate conversion value.
- Request status and reporting show the corrected event with expected value and currency.
Mistakes to avoid
- Do not join a coupon array with an undocumented delimiter.
- Do not replace historical order evidence with the current coupon catalog.
- Do not generate a new transaction ID for a field correction.
- Do not replay refunds as purchases while testing coupon behavior.
Questions teams ask during testing
Should deleted coupons be removed from historical orders?
No. Preserve the order's historical line items. Decide separately whether the destination coupon field accepts that code or whether the optional field should be omitted.
Can multiple coupon codes be sent as one string?
Only if the destination explicitly defines that representation. Otherwise map the supported structure or choose a deterministic primary field rather than inventing a delimiter.
When HandL WP should help
HandL WP can trace WooCommerce order promotions through the Data Manager payload, fix serialization, protect purchase deduplication, and verify conversion and refund reporting.
If this is active on a production site, fix WooCommerce coupon conversion events.
Related HandL WP guides
Use these related guides when the same issue touches tracking, security, checkout, or crawler visibility.
Helpful references