###### tags: `snackco-api-v2`
[ToC]
## MERCHANT APIs
### Perks
- [ ] duplicate `campaigns` schema -> rename to `perks`, `challenges`
- [ ] update `perks` schema
```
CREATE TABLE `perks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text NOT NULL,
`instructions` json NOT NULL,
`termsAndCondition` json NOT NULL,
`merchantId` int(11) NOT NULL,
`redemptionType` int(11) DEFAULT NULL COMMENT 'Values can be 1 = online, 2=store, required only for perks type=2',
`startAt` datetime NOT NULL,
`endAt` datetime NOT NULL,
`banner` json NOT NULL,
`brandLogo` json NOT NULL,
`brandName` varchar(255) NOT NULL,
`brandDescription` text NOT NULL,
`draft` tinyint(4) NOT NULL DEFAULT '0',
`archived` tinyint(4) NOT NULL DEFAULT '0',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`approvedAt` datetime DEFAULT NULL,
`rejectedAt` datetime DEFAULT NULL,
`voucherId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=latin1;
```
#### GET /v2/product/perks?sort=asc
Response:
```javascript=16
{
"success": true,
"data": [
{
"id": 45,
"redemptionType": 2,
"title": "Get 2 months free of unlimited internet access by Omakase Burger",
"startAt": "2022-12-09T15:23:16.000Z",
"endAt": "2022-12-20T07:43:17.000Z",
"banner": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
},
"instructions": [
"Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.",
"Fusce consequat. Nulla nisl. Nunc nisl",
"Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."
],
"termsAndCondition": [
"Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.",
"Fusce consequat. Nulla nisl. Nunc nisl",
"Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."
],
"brand": {
"name": "Omakase Burger",
"description": "Omakase Burger offers cheeseburgers, chicken burgers, fries, beer and more. Bringing you the authentic American burger experience right here in Singapore!",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
},
"draft": false,
"archived": false,
"approvedAt": null,
"rejectedAt": "2022-03-24T14:06:21.000Z",
"createdAt": "2022-03-01T06:31:05.000Z",
"updatedAt": "2022-04-04T07:48:00.000Z",
"voucher": {
"id": 358,
"title": "FREE VOUCHER",
"expirationDate": "2021-09-29T08:39:00.000Z",
"redemptionCode": "JN43J5NCH334",
"maximumQuantity": 0
}, // nullable
"status": 1, // computed
}
]
}
```
#### GET /v2/product/perks/<id>
Response
```javascript=16
{
"success": true,
"data": {
"id": 45,
"redemptionType": 2,
"title": "Get 2 months free of unlimited internet access by Omakase Burger",
"startAt": "2022-12-09T15:23:16.000Z",
"endAt": "2022-12-20T07:43:17.000Z",
"banner": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
},
"instructions": [
"Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.",
"Fusce consequat. Nulla nisl. Nunc nisl",
"Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."
],
"termsAndCondition": [
"Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.",
"Fusce consequat. Nulla nisl. Nunc nisl",
"Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."
],
"brand": {
"name": "Omakase Burger",
"description": "Omakase Burger offers cheeseburgers, chicken burgers, fries, beer and more. Bringing you the authentic American burger experience right here in Singapore!",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
},
"draft": false,
"archived": false,
"approvedAt": null,
"rejectedAt": "2022-03-24T14:06:21.000Z",
"createdAt": "2022-03-01T06:31:05.000Z",
"updatedAt": "2022-04-04T07:48:00.000Z",
"voucher": {
"id": 358,
"title": "FREE VOUCHER",
"expirationDate": "2021-09-29T08:39:00.000Z",
"redemptionCode": "JN43J5NCH334",
"maximumQuantity": 0
}, // nullable
"status": 1, // computed
}
}
```
#### POST /v2/product/perks/upsert
Payload
```javascript=16
{
"id": 2, // if update, otherwise no need pass
"title": "Phasellus sit amet erat. Nulla tempus. Vivamus in felis eu sapien cursus vestibulum. Proin eu mi. Nulla ac enim. In tempor, turpis nec euismod scelerisque, quam turpis adipiscing lorem, vitae mattis nibh ligula nec sem. Duis aliquam convallis nunc. Proin at turpis a pede posuere nonummy. Integer non velit. Donec diam neque, vestibulum eget, vulputate ut, ultrices vel, augue.",
"redemptionType": 1,
"startAt": "2022-12-09 20:53:16",
"endAt": "2022-12-20 13:13:17",
"banner": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
},
"draft": false,
"instructions": ["Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.","Fusce consequat. Nulla nisl. Nunc nisl","Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."],
"termsAndCondition": ["Morbi porttitor lorem id ligula. Suspendisse ornare consequat lectus. In est risus, auctor sed, tristique in, tempus sit amet, sem.","Fusce consequat. Nulla nisl. Nunc nisl","Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa. Donec dapibus. Duis at velit eu est congue elementum."],
"brand": {
"name": "Omakase",
"description": "",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png", // url -> bucketurl + bucketname + fileName
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
}
}
```
### SNACKUp
```
CREATE TABLE `snackups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchantId` int(11) NOT NULL,
`banner` json NOT NULL,
`brandLogo` json NOT NULL,
`brandName` varchar(255) NOT NULL,
`brandDescription` text NOT NULL,
`isActive` tinyint(4) NOT NULL DEFAULT '0',
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deactivatedAt` datetime DEFAULT NULL,
`approvedAt` datetime DEFAULT NULL,
`rejectedAt` datetime DEFAULT NULL,
`draft` tinyint(4) NOT NULL DEFAULT '0',
`startAt` datetime NOT NULL,
`endAt` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
```
#### GET /v2/product/snackups?sort=desc
```javascript=16
{
"success": true,
"data": [
{
"id": 25,
"banner": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
},
"instructions": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"termsAndCondition": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"brand": {
"name": "Omakase",
"description": "",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png", // url -> bucketurl + bucketname + fileName
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
},
"isActive": false,
"deactivatedAt": null,
"approvedAt": null,
"rejectedAt": null,
"draft": true,
"startAt": "2022-03-01T10:00:00.000Z",
"endAt": "2022-12-23T00:00:00.000Z", // min difference is 90 days
"createdAt": "2022-04-21T11:38:03.000Z",
"updatedAt": "2022-04-25T14:09:17.000Z",
"goods": [
{
"goodsCode": "SNACK_CI",
"coverage": 500,
"premium": 0.2
},
{
"goodsCode": "SNACK_Life",
"coverage": 500,
"premium": 0.2
}
],
"status": 3
}
]
}
```
#### GET /v2/product/snackups/<id>
```javascript=16
{
"success": true,
"data": {
"id": 25,
"banner": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
},
"instructions": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"termsAndCondition": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"brand": {
"name": "Omakase",
"description": "",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png", // url -> bucketurl + bucketname + fileName
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
},
"isActive": false,
"deactivatedAt": null,
"approvedAt": null,
"rejectedAt": null,
"draft": true,
"startAt": "2022-03-01T10:00:00.000Z",
"endAt": "2022-12-23T00:00:00.000Z", // min difference is 90 days
"createdAt": "2022-04-21T11:38:03.000Z",
"updatedAt": "2022-04-25T14:09:17.000Z",
"goods": [
{
"goodsCode": "SNACK_CI",
"coverage": 500,
"premium": 0.2
},
{
"goodsCode": "SNACK_Life",
"coverage": 500,
"premium": 0.2
}
],
"status": 3,
"stores": [
{
"id": 1,
"type": 1,
"name": "OB - Orchard",
"storeUrl": "https://www.omakaseburger.com/",
"merchantIdNumber": "1234 5678 9198"
},
{
"id": 2,
"type": 2,
"name": "OB - Orchard",
"postalCode": "469560",
"unitNumber": "#09-09",
"streetName": "348 Bedok Rd.",
"merchantIdNumber": "1234 5678 9198"
}
]
}
}
```
#### POST /v2/product/snackups/upsert
```javascript=16
{
"startAt": "2022-12-09 20:53:16",
"endAt": "2022-12-20 13:13:17",
"banner": {
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png",
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"type": "image/png"
},
"brand": {
"name": "Omakase",
"description": "",
"logo": {
"url": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png", // url -> bucketurl + bucketname + fileName
"type": "image/png",
"fileName": "images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/snackco.admin.sg/images/91447d4b-d9ef-49ec-ad1e-9d054913fa9d_thumbnail.png"
}
},
"instructions": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"termsAndCondition": [
"Download the SNACK app and sign up for an account.",
"Choose a product and select a lifestyle trigger with any visa source.",
"Add your visa card and make sure the visa card is the same one linked with your app.",
"complete the checkout process and you all set!"
],
"goods": [
{
"goodsCode": "SNACK_Life",
"premium": "0.20",
"coverage": "500"
},
{
"goodsCode": "SNACK_CI",
"premium": "0.20",
"coverage": "500"
}
],
"draft": true,
"stores": [
{
"id": 1,
"type": 1,
"name": "OB - Orchard",
"storeUrl": "https://www.omakaseburger.com/",
"merchantIdNumber": "1234 5678 9198" // nullable
},
{
"type": 2,
"name": "OB - Orchard",
"postalCode": "469560",
"unitNumber": "#09-09",
"streetName": "348 Bedok Rd.",
"merchantIdNumber": "1234 5678 9198"
}
]
}
```
### Account
- [ ] update `stores` schema
- [ ] update `merchants` schema
```
CREATE TABLE `stores` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchantId` int(11) NOT NULL,
`type` int(11) NOT NULL COMMENT '1 -> online, Type 2 = outlet',
`name` varchar(255) DEFAULT NULL,
`storeUrl` varchar(255) DEFAULT NULL,
`postalCode` varchar(45) DEFAULT NULL,
`streetName` varchar(255) DEFAULT NULL,
`unitNumber` varchar(100) DEFAULT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`archive` tinyint(4) NOT NULL DEFAULT '0',
`merchantIdNumber` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=618 DEFAULT CHARSET=latin1;
```
#### POST /v2/product/stores/upsert
Physical store payload
```javascript=16
{
"id": 1, // if exist update, otherwise create
"type": 2,
"name": "OB - Orchard",
"postalCode": "469560",
"unitNumber": "#09-09",
"streetName": "348 Bedok Rd.",
"merchantIdNumber": "1234 5678 9198"
}
```
Online store payload
```javascript=16
{
"type": 1,
"name": "OB - Orchard",
"storeUrl": "https://www.omakaseburger.com/",
"merchantIdNumber": "1234 5678 9198"
}
```
#### GET /v2/product/brands
### Merchant
- [ ] Change merchantId to merchantUid
```
CREATE TABLE `merchants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchantUid` NOT NULL varchar(45), // primary key
`contactId` varchar(45) DEFAULT NULL,
`uen` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`businessType` varchar(255) DEFAULT NULL,
`bizFile` varchar(225) DEFAULT NULL,
`acraFile` varchar(225) DEFAULT NULL,
/* Billing address */
`postal` varchar(45) DEFAULT NULL,
`street` varchar(225) DEFAULT NULL,
`unitNumber` varchar(45) DEFAULT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uen_UNIQUE` (`uen`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1;
```
#### GET /v2/user/merchant-profile
- [ ] Change businessTypeId to businessType in the merchant table
- [ ] For signup to pass businessType instead of businessTypeId
- [ ] If address is null, show the billing address popup
```javascript=16
{
"success": true,
"data": {
"merchant": {
"id": 1,
"uen": "1234 5678 9012", // Company registration/UEN no.
"name": "Omakase Burger", // Business registered name
"email": "jdoe@omakaseburger.com",
"businessType": "Restaurant", // the name
"address": {
"postal": "238896",
"street": "181 Orchard Rd.",
"unitNumber": "#04 - 23"
} // nullable
},
"contact": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "jdoe@omakaseburger.com",
"phone": {
"countryCode": "64",
"number": 123456
}
}
}
}
```
#### POST /v2/user/merchant-profile/address
Request
```javascript=16
{
"postal": "238896",
"street": "181 Orchard Rd.",
"unitNumber": "#04 - 23"
}
```
#### PATCH /v2/user/merchant-profile
Request
```javascript=16
{
/*Param for profile update*/
"name": "Omakase Burger",
"uen": "1234 5678 9012",
"businessType": "Food & Restaurant",
/*Param for account settings update*/
"bizFile": "path/to/bizfile.pdf",
"acraFile": "path/to/acra.pdf"
}
```
### Request OTP
#### POST /v2/user/request-otp/<change-password|change-mobile|remove-outlet>
- [ ] preAuthenticate from CIAM challengeToken, public key for the encryption
- [ ] generateOtp from CIAM, send the response to FE
Payload:
```javascript=16
{
"sessionToken": "10001GYy5shz9157Mq0gyFiJR6zSfI2mBj8X8fr2oqO2Ao_gbXpJzDN JELfub5TLgdalAkG3GUacYTWClWIJ_ipxrIv_YCqERZH_yH1VZwbjVEGEhjK65vZEcPIDjLakRoI_R3t 1szmAOKvWj9r0UFG8RWrvq3VaMUU6iSiHi7NtljHdbvpV9KgInadQQpR69gdERlwED79rlDsw8wW4WZTGxuM4w_5U_HOGO vllPYb5JPcM7xv5dbuG20Cep3cbn4phHZX2UtlpEu_8tAIO7KqzvNYuabqhFM7_hTfn2kypi2MWS4UL1R HnkhiJ3mT1JrXuHNGQHv6_UKnjNBI1RQ_UX7zkkWelDewrEZbiy1"
}
```
Response:
```javascript=16
{
"tokenUUID": "MemoryTokenStore:qm3kzYqF26",
"challengeToken": "0001OHSG4R6eawI6PGNnyKTXU0kNL3MVO7tR-wpWxKUPD2Spfjpmelq0O9d embFPkMqyT9zufhrYw",
"mobileNo": "******14(086402)"
}
```
### Change Password
#### POST /v2/user/change-password
- [ ] call the validate otp from CIAM /validateOTP
- [ ] if otp is valid call the /password/change API from CIAM
Payload:
```javascript=16
{
"tokenUUID": "MemoryTokenStore:qm3kzYqF26",
"otp":"107009",
"oldPassword": <encrypted-password>,
"newPassword": <encrypted-password>, // ML encrypted
"sessionToken": "10001GYy5shz9157Mq0gyFiJR6zSfI2mBj8X8fr2oqO2Ao_gbXpJzDN JELfub5TLgdalAkG3GUacYTWClWIJ_ipxrIv_YCqERZH_yH1VZwbjVEGEhjK65vZEcPIDjLakRoI_R3t 1szmAOKvWj9r0UFG8RWrvq3VaMUU6iSiHi7NtljHdbvpV9KgInadQQpR69gdERlwED79rlDsw8wW4WZTGxuM4w_5U_HOGO vllPYb5JPcM7xv5dbuG20Cep3cbn4phHZX2UtlpEu_8tAIO7KqzvNYuabqhFM7_hTfn2kypi2MWS4UL1R HnkhiJ3mT1JrXuHNGQHv6_UKnjNBI1RQ_UX7zkkWelDewrEZbiy1"
}
```
Response:
```javascript=16
{
"success": true,
"data": {
"sessionToken": "10001GYy5shz9157Mq0gyFiJR6zSfI2mBj8X8fr2oqO2Ao_gbXpJzDN JELfub5TLgdalAkG3GUacYTWClWIJ_ipxrIv_YCqERZH_yH1VZwbjVEGEhjK65vZEcPIDjLakRoI_R3t 1szmAOKvWj9r0UFG8RWrvq3VaMUU6iSiHi7NtljHdbvpV9KgInadQQpR69gdERlwED79rlDsw8wW4WZTGxuM4w_5U_HOGO vllPYb5JPcM7xv5dbuG20Cep3cbn4phHZX2UtlpEu_8tAIO7KqzvNYuabqhFM7_hTfn2kypi2MWS4UL1R HnkhiJ3mT1JrXuHNGQHv6_UKnjNBI1RQ_UX7zkkWelDewrEZbiy1"
}
}
```
### Change Mobile Number
- [ ] update mobile number only on ML db
#### POST /v2/user/change-number
Payload
```javascript=16
{
"tokenUUID": "MemoryTokenStore:qm3kzYqF26",
"otp":"107009",
"mobileNo": <encrypted-mobile-no>,
"sessionToken": "10001GYy5shz9157Mq0gyFiJR6zSfI2mBj8X8fr2oqO2Ao_gbXpJzDN JELfub5TLgdalAkG3GUacYTWClWIJ_ipxrIv_YCqERZH_yH1VZwbjVEGEhjK65vZEcPIDjLakRoI_R3t 1szmAOKvWj9r0UFG8RWrvq3VaMUU6iSiHi7NtljHdbvpV9KgInadQQpR69gdERlwED79rlDsw8wW4WZTGxuM4w_5U_HOGO vllPYb5JPcM7xv5dbuG20Cep3cbn4phHZX2UtlpEu_8tAIO7KqzvNYuabqhFM7_hTfn2kypi2MWS4UL1R HnkhiJ3mT1JrXuHNGQHv6_UKnjNBI1RQ_UX7zkkWelDewrEZbiy1"
}
```
### Remove Outlet
#### DELETE /v2/product/remove-outlet
Payload:
```javascript=16
{
"tokenUUID": "MemoryTokenStore:qm3kzYqF26",
"otp":"107009",
"outletId": 1,
"sessionToken": "10001GYy5shz9157Mq0gyFiJR6zSfI2mBj8X8fr2oqO2Ao_gbXpJzDN JELfub5TLgdalAkG3GUacYTWClWIJ_ipxrIv_YCqERZH_yH1VZwbjVEGEhjK65vZEcPIDjLakRoI_R3t 1szmAOKvWj9r0UFG8RWrvq3VaMUU6iSiHi7NtljHdbvpV9KgInadQQpR69gdERlwED79rlDsw8wW4WZTGxuM4w_5U_HOGO vllPYb5JPcM7xv5dbuG20Cep3cbn4phHZX2UtlpEu_8tAIO7KqzvNYuabqhFM7_hTfn2kypi2MWS4UL1R HnkhiJ3mT1JrXuHNGQHv6_UKnjNBI1RQ_UX7zkkWelDewrEZbiy1"
}
```
## ADMIN APIs
### GET /v2/admin/merchants?page=1&numberOfItems=20
- [ ] search criteria can be searched by brand.name || merchant.name || merchant.uen || merchant.email
Response:
```javascript=16
{
"success": true,
"data": {
"items": [
{
"id": 1,
"uen": "1234 5678 9012",
"name": "Omakase Burger",
"email": "jdoe@omakaseburger.com", // company email, login email
"bizFile": null,
"acraFile": null,
"businessType": "Restaurant",
"createdAt": "2021-09-01T07:22:20.000Z",
"updatedAt": "2022-06-28T05:38:51.000Z",
"contact": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "jdoe@omakaseburger.com",
"phoneNumber": 123456,
"countryCode": "64",
"designation": "Marketing",
"postal": "238896",
"street": "181 Orchard Rd.",
"unitNumber": "#04 - 23",
"createdAt": "2021-09-01T07:22:20.000Z",
"updatedAt": "2022-06-28T05:38:52.000Z"
},
"address": {
"postal": "238896",
"street": "181 Orchard Rd.",
"unitNumber": "#04 - 23"
}
}
],
"totalItems": 1,
"numberOfItems": 1,
"page": 1,
"totalPages": 1
}
}
```
### PUT /admin/merchants/update/profile
- [ ] Remove the merchant.email in the payload so it wont be updated. Return error if email is passed.
```
{
"merchant": {
"id": 1,
"name": "test",
"uen": "asa15",
"address": {
"postal": "postal",
"street": "street",
"unitNumber": "unitNumber"
}
},
"contact": {
"id": 1,
"email": "testuser1@test.com",
"firstName": "contactPersonFirstName",
"lastName": "contactPersonLastName",
"phone": {
"number": "123456",
"countryCode": "64"
},
"designation": "contactPersonDesignation",
"address": {
"postal": "postal",
"street": "street",
"unitNumber": "unitNumber"
}
}
}
```
## ADMIN Panel Changes
### Merchant, Brands, Store
- [ ] Remove the column "Status" from Merchant listing page, replace it with `Brand Name`
- [ ] Company email should be disable for edit in the Edit Merchant Detail modal.
- [ ] Remove the `Status` dropdown filter.
- [ ] Add `Brand Name` from Fields dropdown filter
- [ ] Rename the `Brand list` to `Brand details` in the dropdown from `View Details` CTA button, this opens the `Brand Details` modal
- [ ] In the `Brand Details` modal we add `View Outlets` CTA to redirect to Brand Outlets page.
- [ ] In the Outlets page add the name of the brand as a page title, from url query param
- [ ] Remove `Outlet Url` for physical store
- [ ] Add the Merchant Id Number for both stores
- [ ] Remove `Address` for online store
### SNACKUp
- [ ] Add column `Brand Name`, `Title`
- [ ] Remove `Brand Logo`, `Cost Per Transaction`
- [ ] Change the menu title to SNACKUp applications as per Miro
- [ ] Change order of action buttons [ View, Status ]
### Perks
- [ ] Add new page for Perks listing separated from challenge
- [ ] Colums -> [brand, title, redemption type, start-end, status]
- [ ] Apply same status pill colors from SNACKUp
### Challenge
- [ ] Add new page for challenge listing separated from perks
### Other items from CMS
- [ ] Token refresh intermittently does not work, need to investigate @Paul, @Bharthi, @Jahid