IBM Support

How to avoid discount amount getting refunded during return

How To


Summary

When a sales order has a discount on it and when return is created against that sales order, the return is created for the original total amount instead of the discounted amount. Because of this, refund amount is greater than the collected amount.

Objective

Objective is to avoid discount amount getting refunded during return

Steps

When a sales order has charges or taxes on it and when return is created against that sales order, the charges and taxes are not automatically copied from the sales order to the return order. The charges and taxes must be passed explicitly when creating the return order. When return order is created automatically from a sales order, ensure to use the user exits such as YFSRecalculateHeaderTaxUE and/or YFSRecalculateLineTaxUE in order to calculate the amount of charges and taxes that is to be applied on the return order.
Key Guidelines:
  1. When there is a charge on the sales order that is refundable, during the return, same amount of charge should be added to the return order.
  2. When there is a charge on the sales order that is non-refundable, during the return, there is no need to add the charge to the return order.
  3. When there is a discount on the sales order, during the return, ensure to collect that amount from the customer in the form of a fee so that system subtracts that amount while refunding the customer.
Ensure that, appropriate charge category and charge name is created under the Reverse Logistics so that the charge can be applied on the return order.
Let us look at an example on how to refund a discounted order.
We are creating simple sales order with an order total of $20.
<MultiApi>
	<API Name="createOrder">
		<Input>
			<Order OrderNo="IBM_S01" EnterpriseCode="IBM_E" SellerOrganizationCode="IBM_E" DocumentType="0001" DraftOrderFlag="N">
				<OrderLines>
					<OrderLine OrderedQty="1" DeliveryMethod="SHP" FulfillmentType="IBM_F" PrimeLineNo="1" SubLineNo="1" ShipNode="IBM_N1">
						<LinePriceInfo IsPriceLocked="Y" UnitPrice="20" />
						<Item ItemID="IBM_I1" UnitOfMeasure="EACH" ProductClass="NEW" />
						<PersonInfoShipTo Country="US" />
					</OrderLine>
				</OrderLines>
				<PaymentMethods>
					<PaymentMethod CreditCardExpDate="2099-12-31" CreditCardNo="IBM_123456789" CreditCardType="VISA" DisplayCreditCardNo="6789" 
					FirstName="IBM_CUSTOMER" PaymentType="CREDIT_CARD">
						<PersonInfoBillTo Country="US" />
						<PaymentDetailsList>
							<PaymentDetails ChargeType="AUTHORIZATION" ProcessedAmount="0" RequestAmount="20" />
						</PaymentDetailsList>
					</PaymentMethod>
				</PaymentMethods>
				<PersonInfoBillTo Country="US" />
			</Order>
		</Input>
	</API>
</MultiApi>
Let us process the initial authorization for the sales order.
<MultiApi>
	<API Name="processOrderPayments">
		<Input>
			<Order DocumentType="0001" EnterpriseCode="IBM_E" OrderNo="IBM_S01" />
		</Input>
	</API>
</MultiApi>
Once the initial authorization is done, let us apply a discount of $5 on the sales order.
<MultiApi>
	<API Name="changeOrder">
		<Input>
			<Order OrderNo="IBM_S01" EnterpriseCode="IBM_E" SellerOrganizationCode="IBM_E" DocumentType="0001" DraftOrderFlag="N">
				<HeaderCharges>
					<HeaderCharge ChargeAmount="5" ChargeCategory="CUSTOMER_APPEASEMENT" ChargeName="APPEASEMENT_DISCOUNT" />
				</HeaderCharges>
				<PersonInfoBillTo Country="US" />
			</Order>
		</Input>
	</API>
</MultiApi>
Let us do processOrderPayments so that reverse authorization of $5 happens on the order. We can then schedule and release order. We can then create and confirm shipment. We can also create invoice and settle the amount. The invoice will be created only for $15 (discounted amount) and not for $20 (original amount).
Charge transaction records
Now we have to create the return order. We can use the user exits such as YFSRecalculateHeaderTaxUE and YFSRecalculateLineTaxUE in order to calculate the amount of charges and taxes that is to be applied on the return order. Also, we have to create respective charge categories and charge names in the Reverse Logistics.
Charge Category for Sales Order:
Charge category for sales order
Charge Category for Return Order:
Charge category for return order
While creating the return order, irrespective of whether we use user exits to find the necessary charge amounts or we pass the charge amounts manually, the input to the createOrder API should have the charges mentioned explicitly.
We shall create a return order by passing $5 as appeasement reversal charge so that it will nullify the discount applied on the sales order.
<MultiApi>
	<API Name="createOrder">
		<Input>
			<Order OrderNo="IBM_S01R1" EnterpriseCode="IBM_E" SellerOrganizationCode="IBM_E" DocumentType="0003" DraftOrderFlag="N" ProcessPaymentOnReturnOrder="N">
				<HeaderCharges>
					<HeaderCharge ChargeAmount="5" ChargeCategory="CUSTOMER_APPEASEMENT" ChargeName="APPEASEMENT_REVERSAL" />
				</HeaderCharges>
				<OrderLines>
					<OrderLine OrderedQty="1" ReturnReason="Test Return" ShipNode="IBM_N1" PrimeLineNo="1" SubLineNo="1">
						<DerivedFrom DocumentType="0001" EnterpriseCode="IBM_E" OrderNo="IBM_S01" PrimeLineNo="1" SubLineNo="1" />
					</OrderLine>
				</OrderLines>
				<PersonInfoBillTo Country="US" />
			</Order>
		</Input>
	</API>
</MultiApi>
Process the return order and initiate the refund. The refund will be created only for $15 (discounted amount) and not for $20 (original amount).
Charge transaction records
Hence we can avoid discount amount getting refunded during return.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGTJF","label":"IBM Sterling Order Management System"},"ARM Category":[{"code":"a8m0z000000cxzmAAA","label":"Payments"}],"ARM Case Number":"TS020192542","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":""},{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management System Software"},"ARM Category":[{"code":"a8m0z000000cy02AAA","label":"Payments"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.0.0;9.0.0;9.1.0;9.2.0;9.2.1;9.3.0;9.4.0;9.5.0"}]

Product Synonym

Sterling OMS; IBM Sterling; Sterling Order Management; IBM OMS

Document Information

Modified date:
29 September 2025

UID

ibm17246286