Odoo discount codes working on shopify

Odoo discount codes working on shopify

bCODE
Visitor
2 0 0

Hi Community,

 

My store is currently connected to Odoo 15 (I know it's a bit outdated), and I'm trying to create an omnichannel experience for my customers on how they redeem their gift cards. Currently, we create the codes on Odoo, and they can be redeemed in our stores on their POS module, but you can't use them on the Shopify store despite the store being connected to the same Odoo system where it gets its inventory, prices, quantity, etc., from.

After conducting a couple of tests, I noticed that the codes generated on Shopify work for purchases made on the Shopify store, and Odoo recognizes them as "Shopify Discount" and deducts the value of the discount generated from Shopify. This poses an issue, as Odoo doesn't show the code used, and the code generated on Shopify cannot be used on the Odoo POS module. Also, this opens us to liability, as codes can now be created from two different sources, and there's no absolute control.

What I'm trying to achieve is that codes are generated on Odoo and can be used once on either POS terminals or on the Shopify store. When used on Shopify, Shopify queries Odoo for the validity of the code, and if valid, applies it to the transaction, and Odoo also recognizes the use of this code.

 

Reply 1 (1)

StevenT_A7
Explorer
155 13 16

Hi @bCODE ,

 

If i am not wrong you're looking to centralize gift card code generation and validation in Odoo 15, ensuring single-use omnichannel redemption across both Shopify (online) and Odoo POS (in-store).

 

So the Best possible will be :-

 

1. Centralize Code Creation in Odoo

  • Use Odoo's native gift card functionality or a custom module to create unique, single-use codes.
  • Store metadata like balance, expiration, and status (used/unused).

 

2. Create an API Layer on Odoo

  • Develop or enable an Odoo REST API (can use odoo-rest-framework or a custom controller) to:
  • Check gift card validity
  • Mark a gift card as "used" once redeemed

 

3. Shopify Middleware App or Script

  1. Use a custom Shopify app or a Shopify Function (Shopify Plus) or Script (with Shopify Scripts) to:
  2. Intercept the gift card or discount code at checkout
  3. Call Odoo’s API to validate the code

If valid:

  1. Apply a discount equivalent to the gift card value
  2. Notify Odoo to mark the code as used

If invalid or already used:

  1. Reject the code

4. POS Compatibility

  • On the POS side (Odoo), nothing changes—you already redeem codes manually or via Odoo’s built-in validation.

 

5. Optional Logging & Sync

  • Maintain a log in Odoo of all redemptions (channel, date, amount) for audit and liability control.

 

Tech Stack Used:-

  • Odoo 15: Extend with a simple API endpoint via a controller.
  • Shopify: Needs a custom app (can be hosted on your own server or via Shopify App Bridge).
  • If you're on Shopify Plus, consider using Shopify Functions or Checkout UI Extensions.

Please let me know if you need any other further clarifications .

Thanks 

Steven Taylor
302-260-8345