I've created a custom app using Shopify CLI and have my app embedded in Shopify POS.
When I try to add or remove customers to the cart, it's not sending a POST request to the promotions endpoint anymore. (I remember it was functioning well before). I followed all steps according to the doc.
I attached the extension setting of my app. All endpoints are correct (tested via Postman)
I can't find any helpful documents or forums.
What am I wrong? Any advice, very thank you!
This is my posRouter.js
const Router = require("koa-router");
const trackModel = require("../../models/trackModel");
const router = new Router({
prefix: "/pos",
});
function register(app) {
router.post("/promotions", async (ctx) => {
const body = ctx.request.body;
console.log("pos request", body);
ctx.status = 200;
ctx.body = {
type: "simple_action_list",
points_label: "Points balance",
points_balance: "23867",
actions: [
{
type: "flat_discount",
title: "Add $5.00 discount",
description: "-1000 points",
action_id: "123ABC",
value: "5",
},
],
};
});
router.post("/perform_action", async (ctx) => {});
router.post("/revert_action", async (ctx) => {});
app.use(router.routes());
app.use(router.allowedMethods());
}
module.exports = register;