You may notice that duplicate orders are generated by the system and customers are charged more than once for created orders or subscriptions.
Submit a request to Symphony support, providing examples of the duplicate orders or subscriptions and affected end-customers.
Additionally, you may need to cancel and refund the excessive orders; affected subscription dates can be updated by our Support team in bulk.
This issue may be caused by the long running queries on spprod-offline DB, causing a data lag from the master DB and generating duplicate orders.
Create a SaaS Incident Jira under the SPC project to get this issue fixed.
Once the issue is resolved by SaaS,
- The orders that cannot be canceled from Manage need to be canceled using API.
- Also, check that there are no affected subscriptions and fix the upcoming dates for the affected ones:
- Find all duplicate subscriptions (created during the same day by the Script server).
Change the highlighted date to be 1 or 2 months in the future
select sc.subscription_id, GROUP_CONCAT(sc.order_id), sc.cycle, GROUP_CONCAT(CAST(sc.created AS DATE)), GROUP_CONCAT((select author from SubscriptionTimeline where dataType = 'SubscriptionCycle' and action = 'INSERT' and subscription_id = sc.subscription_id and newVal LIKE '%SUCCEEDED%' and newVal LIKE '%ORDER_PLACED%' and newVal LIKE CONCAT('%', sc.order_id, '%'))) as author, v.site from SubscriptionCycle sc inner join SPOrder o on sc.order_id = o.id inner join Victory v on o.victory_id = v.id inner join Site s on v.site = s.subdomain where sc.reasonCode = 'ORDER_PLACED' and sc.status = 'SUCCEEDED' and sc.created > '2020-01-01 00:00:00' and s.archivedAt = '1970-01-01 00:00:01' group by sc.subscription_id, sc.created having count(sc.created) > 1 and author NOT LIKE '%@%';
Filter only ongoing subscriptions from the subscriptions found in step 1:
select s.id, s.frequency, s.frequencyUnit, ss.nextActionDate, ss.status, s.site
from Subscription s, SubscriptionState ss
where s.id in (<all affected subscription Ids>)
and s.frequency<28 and ss.subscription_id=s.id and ss.status = 'ONGOING';
- Cancel the last (duplicated) order for the affected subscriptions.
You can use Curl or Postman, and use your Symphony manage credentials.
curl -XDELETE -u<user>:<password> -s "https://manage.symphonycommerce.com/org/<brand>/api/v2/subscriptions/<subscription_id>?cancelLastOrder=true"
Using the API below, update the upcoming date (when the subscription will be shipped) for each affected subscription - it should match the initial schedule.
For example, a subscription was shipped on 11/15 and a duplicate order was created on 11/16; if the subscription is shipped every 14 days, the next order date should be 11/28.
curl -XPUT -u<username>:<password> -H 'Content-type: application/json' -s "https://manage.symphonycommerce.com/org/<brand>/api/v1/subscriptions/<subscription-Id>/next-order-date" -d'<YYYY-MM-DD>'