---
id: change/bcapps/14123
type: change
title: "#14123 [Shopify] Keep gift cards from unverified POS returns on the sales invoice"
summary: Modified Shopify gift card handling on POS unverified returns so they remain on sales invoices rather than being treated as exchange items, preventing empty invoice generation with auto-release enabled.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit shpfy refunds api
  - codeunit shpfy returns api
  - codeunit shpfy import order
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-11-20T00:57:46.522Z"
  flags: []
generated:
  at: "2026-12-01T00:17:57.990Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: ffe26a0f4eb44c2539e183e4f37704564ae74484
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14123
    title: "microsoft/BCApps#14123: [Shopify] Keep gift cards from unverified POS returns on the sales invoice"
    date: "2026-11-17"
    commit: ffe26a0f4eb44c2539e183e4f37704564ae74484
    t: null
    quote: A Shopify POS unverified return can only be refunded to a gift card.
links:
  learn: []
  objects:
    - object/codeunit/30228
    - object/codeunit/30250
    - object/codeunit/30161
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/sales-how-process-sales-returns-orders
      title: Process sales return orders
      label: possibly related
      why: Documents processing sales returns and handling refunds.
      by: model
    - to: https://learn.microsoft.com/dynamics365/business-central/shopify/synchronize-orders
      title: Synchronize and fulfill sales orders
      label: possibly related
      why: Documents Shopify sales order processing and synchronization.
      by: model
number: 14123
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14123
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-17T14:38:13Z"
author: onbuyuka
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 13
  additions: 385
  deletions: 37
  al: 3
apps:
  - Shopify
objects_touched:
  - key: codeunit/30228
    page: codeunit/30228
    type: codeunit
    id: 30228
    name: Shpfy Refunds API
    app: Shopify
    status: modified
  - key: codeunit/30250
    page: codeunit/30250
    type: codeunit
    id: 30250
    name: Shpfy Returns API
    app: Shopify
    status: modified
  - key: codeunit/30161
    page: codeunit/30161
    type: codeunit
    id: 30161
    name: Shpfy Import Order
    app: Shopify
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 601701
systems:
  - integration
quote: A Shopify POS unverified return can only be refunded to a gift card.
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #14123 [Shopify] Keep gift cards from unverified POS returns on the sales invoice

> Modified Shopify gift card handling on POS unverified returns so they remain on sales invoices rather than being treated as exchange items, preventing empty invoice generation with auto-release enabled.

[Pull request](https://github.com/microsoft/BCApps/pull/14123) · merged into `main` (BC30) on 2026-11-17 by onbuyuka · 13 files (+385 -37), 3 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- A gift card on a return with unverified return lines is treated as a regular order line again and invoiced
- Fixes empty sales invoices that failed to release when Auto Release was on
- Is Exchange Item is now set for every line as it is written, replacing MarkExchangeItemOrderLines, so re-importing fixes orders that were flagged by mistake
- Refund import creates no synthetic exchange refund line for these gift cards and removes one left by an earlier import
- Verified returns with exchanges behave as before; 7 tests added
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 30228 "Shpfy Refunds API"](../../objects/codeunit/30228.md), Shopify: modified
- [Codeunit 30250 "Shpfy Returns API"](../../objects/codeunit/30250.md), Shopify: modified
- [Codeunit 30161 "Shpfy Import Order"](../../objects/codeunit/30161.md), Shopify: modified

## Context

- Work items: AB#601701
- Labels: AL: Apps (W1), Team: Integrations
- Systems: integration
- From the description: "A Shopify POS unverified return can only be refunded to a gift card."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Process sales return orders](https://learn.microsoft.com/dynamics365/business-central/sales-how-process-sales-returns-orders) — possibly related: Documents processing sales returns and handling refunds. (model-linked)
- [Synchronize and fulfill sales orders](https://learn.microsoft.com/dynamics365/business-central/shopify/synchronize-orders) — possibly related: Documents Shopify sales order processing and synchronization. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
