Open API Information

Overview
Member Management
Member Information
Point Management
Coupon & Privilege
Coupon Wallet
Overview
PRIMO Open API Specification
Global Environments & Base URLs
Authentication & Global Headers
Standard Response Format
Core Global Error Codes
Member Management
Create Member No PII
Bulk Create Member No PII 🜲
Update member partial profile 🜲
Member Information
Get Profile
Get Mask Profile
Get Tier Progress 🜲
Point Management
Get Point Balance
Earn Point
Void Earn Point
Redeem Point
Void Point Redemption
Coupon & Privilege
Verify Coupon
Mark Use Coupon
Redeem and Mark Used 🜲
Coupon Wallet
Get Coupon Wallet 🜲
PRIMO Open API Specification

PRIMO Open API Specification

Welcome to the PRIMO Open API Specification. This unified API gateway allows external platforms, CRM providers, and e-commerce applications to seamlessly integrate with PRIMO's core loyalty and member management engine.

Global Environments & Base URLs

Global Environments & Base URLs

All API requests must be sent over HTTPS and use the following base domains depending on your current integration stage:

Environment Base URL Description
Sandbox / Staging https://api-staging.primo-dev.com For development, testing, and QA purposes.
Production https://api.primo.com For live commercial transactions.
Authentication & Global Headers

Authentication & Global Headers

PRIMO APIs secure endpoints using Bearer Token Authentication. Every request must be submitted with Content-Type: application/json along with the standard header parameters listed below:

Header Key Data Type Required Description
authorization string Y Bearer <your_token_provided_by_primo>
session-id string Y Encrypted session or channel identifier
company-code string Y* Merchant company identification code
brand-code string Y* Merchant brand identification code
branch-code string Y* Merchant branch identification code

*Note: Merchant identity headers (company, brand, branch) are required for all transaction-related endpoints (Points, Coupons, and Privileges).

Standard Response Format

Standard Response Format

To ensure consistency across integrations, all endpoints adhere to a unified JSON response envelope schema:

Success Response Structure (HTTP 200)

{
  "successful": true,
  "errorCode": "00",
  "message": "Success",
  "httpStatus": 200,
  "data": {} 
}

Error Response Structure (HTTP 4xx / 5xx)

{
  "successful": false,
  "errorCode": "06",
  "message": "Validation error",
  "data": null
}
Core Global Error Codes

Core Global Error Codes

Error Code HTTP Status Description
00 200 Operation completed successfully.
03 500 Internal Server Error. Please contact PRIMO support.
06 400 / 404 Validation Error. Check payload fields against constraints.
10 401 Unauthorized. Invalid or expired token.
Create Member No PII

Create member no PII

The CRM provider would need to call this endpoint to create a member without personally identifiable information (PII).

HTTP Request

POST /v1.4/create-member/no-pii

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
birthDate string N Member birth date in YYYY-MM-DD format
acceptedTermId number N Current active term identifier
acceptedConsents array N Accepted consent list
customData object N Additional custom data
remark string N Additional remark

Model: Accepted Consent

Field Name Data Type Required Description
consentId number Y Consent identifier
action string Y Enum: in, out

Sample Request

{ 
  "memberNo": "M0000000001", 
  "birthDate": "1990-01-01", 
  "acceptedTermId": 1, 
  "acceptedConsents": [ 
    { 
      "consentId": 2, 
      "action": "in" 
    }
  ], 
  "customData": { 
    "utm_source": "google", 
    "utm_medium": "cpc" 
  }, 
  "remark": "สมัครผ่าน LINE OA" 
}

HTTP Response

Successful Response

Model: Create Member Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Created member number

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP27", 
  "message": "Member No already existed", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP05 Company not found
OP27 Member No already existed
OP28 Term id is not current or active
OP29 Branch and Brand do not match
OP30 Consent id is not current or active
OP31 Create member failed
Bulk Create Member No PII 🜲

Bulk Create Member No PII

The CRM provider would need to call this endpoint to create multiple members without personally identifiable information (PII).

HTTP Request

POST /v1.3/bulk-create-member/no-pii

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
members array Y List of members to create

Model: Member

Field Name Data Type Required Description
memberNo string Y Member identifier
birthDate string Y Member birth date in YYYY-MM-DD format
branchCode string Y Merchant branch code
brandCode string Y Merchant brand code
companyCode string Y Merchant company code
acceptedTermId number N Current active term identifier
acceptedConsents array N Accepted consent list
customData object N Additional custom data
remark string N Additional remark

Model: Accepted Consent

Field Name Data Type Required Description
consentId number Y Consent identifier
action string Y Enum: in, out

Sample Request

{ 
  "members": [ 
    { 
      "memberNo": "M0000000001", 
      "birthDate": "1990-01-01", 
      "branchCode": "branchA", 
      "brandCode": "brandA", 
      "companyCode": "companyA", 
      "acceptedTermId": 1, 
      "acceptedConsents": [ 
        { 
          "consentId": 1, 
          "action": "in" 
        }
      ], 
      "customData": { 
        "utm_source": "google", 
        "utm_medium": "cpc" 
      }, 
      "remark": "สมัครผ่าน LINE OA" 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Bulk Create Member Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data array Y Response data list

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Created member number
errorCode string Y Response error code
message string Y Response message
data object N Additional response data

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": [ 
    { 
      "memberNo": "M0000000001", 
      "errorCode": "00", 
      "message": "Success", 
      "data": null 
    } 
  ] 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP27", 
  "message": "Member No already existed", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP05 Company not found
OP08 Other Error
OP27 Member No already existed
OP28 Term id is not current or active
OP29 Branch and Brand do not match
OP30 Consent id is not current or active
OP31 Create member failed
06 Validation error
Update member partial profile 🜲

Partial Profile Update

The CRM provider would need to call this endpoint to partially update a member profile.

HTTP Request

PATCH /v1/partial-profile?memberNo={memberNo}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Query Parameters

Field Name Data Type Required Description
memberNo string Y Member number

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
firstNameTh string N First name in Thai
lastNameTh string N Last name in Thai
firstNameEn string N First name in English
lastNameEn string N Last name in English
email string N Member email
birthDate string N Birth date in YYYY-MM-DD format
gender string N Enum: M, F, O
taxpayerId string N Taxpayer ID

Sample Request

{ 
  "firstNameTh": "วี", 
  "lastNameTh": "พรีโม", 
  "firstNameEn": "Vee", 
  "lastNameEn": "Primo", 
  "email": "vee.primo@example.com", 
  "birthDate": "1990-10-01", 
  "gender": "M", 
  "taxpayerId": "1234567890123" 
}

HTTP Response

Successful Response

Model: Partial Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string N First name in Thai
lastNameTh string N Last name in Thai
firstNameEn string N First name in English
lastNameEn string N Last name in English
email string N Member email
birthDate string N Birth date in YYYY-MM-DD format
gender string Y Enum: M, F, O
taxpayerId string N Taxpayer ID

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "firstNameTh": "วี", 
      "lastNameTh": "พรีโม", 
      "firstNameEn": "Vee", 
      "lastNameEn": "Primo", 
      "email": "vee.primo@example.com", 
      "birthDate": "1990-10-01", 
      "gender": "M", 
      "taxpayerId": "1234567890123" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP38 This email is already taken
OP39 Member status is deleted or draft, cannot update
06 Validation error
Get Profile

Get Profile

The CRM provider would need to call this endpoint to get member profile information.

HTTP Request

POST /v1.5/get-profile

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string N First name in Thai
firstNameEn string N First name in English
lastNameTh string N Last name in Thai
lastNameEn string N Last name in English
tiers array Y Member tier information
points array Y Member point information
citizenId string N Citizen ID
passportNo string N Passport number
address object Y Address information
taxpayerId string N Taxpayer ID
phone string N Phone number
email string N Email address
gender string N Gender
birthDate string N Birth date in YYYY-MM-DD format
occupation string N Occupation
occupationDescription string N Occupation description
maritalStatus string N Marital status
income string N Income range
opts array Y Terms and consent information
customData object N Additional custom data
memberStatus string Y Member status: active, deleted, draft
createdAt string Y Created datetime
updatedAt string Y Updated datetime

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupName string Y Tier group name
tierNameTh string Y Tier name in Thai
tierNameEn string N Tier name in English
tierId number Y Tier identifier

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
lastestExpiredDate object Y Latest expired point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expired date in YYYY-MM-DD format
point number Y Expired point amount

Model: Address

Field Name Data Type Required Description
addressFreetext string N Full address
addressNo string N Address number
buildingVillage string N Building or village
district string N District
moo string N Moo
postCode string N Postal code
province string N Province
road string N Road
roomNo string N Room number
soi string N Soi
subDistrict string N Sub district

Model: Opt

Field Name Data Type Required Description
id number Y Consent identifier
type string Y Consent type
slug string Y Consent slug
version string Y Consent version
currentVersion string Y Current version
isMandatory boolean Y Mandatory flag
consentStatus string Y Consent status
grantStatus string Y Grant status
updatedAt string Y Updated datetime
updatedBy string Y Updated by

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "firstNameTh": "วี", 
      "firstNameEn": "Vee", 
      "lastNameTh": "พรีโม", 
      "lastNameEn": "Primo", 
      "phone": "0987654321", 
      "email": "getprofile@example.com", 
      "memberStatus": "active", 
      "createdAt": "2026-03-16T17:39:38+07:00", 
      "updatedAt": "2026-03-16T17:39:38+07:00" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Mask Profile

Get Mark Profile

The CRM provider would need to call this endpoint to get masked member profile information.

HTTP Request

POST /v1.3/get-profile/mask

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Mark Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string N Masked first name in Thai
firstNameEn string N Masked first name in English
lastNameTh string N Masked last name in Thai
lastNameEn string N Masked last name in English
tiers array Y Member tier information
points array Y Member point information
citizenId string N Masked citizen ID
passportNo string N Masked passport number
address object Y Masked address information
taxpayerId string N Masked taxpayer ID
phone string N Masked phone number
email string N Masked email address

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupName string Y Tier group name
tierNameTh string Y Tier name in Thai
tierNameEn string N Tier name in English
tierId number Y Tier identifier

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
lastestExpiredDate object Y Latest expired point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expired date in YYYY-MM-DD format
point number Y Expired point amount

Model: Address

Field Name Data Type Required Description
addressFreetext string N Masked full address
addressNo string N Masked address number
buildingVillage string N Masked building or village
district string N Masked district
moo string N Masked moo
postCode string N Masked postal code
province string N Masked province
road string N Masked road
roomNo string N Masked room number
soi string N Masked soi
subDistrict string N Masked sub district

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "firstNameTh": "ว***", 
      "firstNameEn": "V****", 
      "lastNameTh": "พ****", 
      "lastNameEn": "P****", 
      "citizenId": "6***", 
      "passportNo": "P****", 
      "phone": "*****4321", 
      "email": "h****@****mobi" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Tier Progress 🜲

Get Tier Progress

The CRM provider would need to call this endpoint to get member tier progress information.

HTTP Request

POST /v1/get-tier-progress

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Tier Progress Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
tiers array Y Member tier information
points array Y Member point information

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupNameTh string Y Tier group name in Thai
tierGroupNameEn string Y Tier group name in English
tierNameTh string Y Tier name in Thai
tierNameEn string N Tier name in English
tierExpiredDate string Y Tier expired date in YYYY-MM-DD format
tierId number Y Tier identifier
priority number Y Tier priority
retentionNextTierId number Y Next retention tier ID
retentionNextTierNameTh string Y Next retention tier name in Thai
retentionNextTierNameEn string N Next retention tier name in English
retentionTargetPoints array Y Retention target point information
promotionNextTierId number Y Next promotion tier ID
promotionNextTierNameTh string Y Next promotion tier name in Thai
promotionNextTierNameEn string N Next promotion tier name in English
promotionTargetPoints array Y Promotion target point information

Model: Retention Target Point

Field Name Data Type Required Description
targetPointsForRetention number Y Target points required for retention
pointsForRetention number Y Current retention points
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English

Model: Promotion Target Point

Field Name Data Type Required Description
targetPointsForPromotion number Y Target points required for promotion
pointsForPromotion number Y Current promotion points
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string Y Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string Y Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
listByExpiredDate array Y Point expiration list

Model: Expired Point

Field Name Data Type Required Description
expiredDate string Y Point expiration date in YYYY-MM-DD format
point number Y Point amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "tiers": [ 
        { 
          "tierGroupId": 1, 
          "tierGroupNameTh": "สมาชิก", 
          "tierGroupNameEn": "Membership", 
          "tierNameTh": "Gold", 
          "tierNameEn": "Gold", 
          "tierExpiredDate": "2026-12-31", 
          "tierId": 2, 
          "priority": 1, 
          "retentionNextTierId": 2, 
          "retentionNextTierNameTh": "Gold", 
          "retentionNextTierNameEn": "Gold", 
          "retentionTargetPoints": [ 
            { 
              "values": [ 
                { 
                  "targetPointsForRetention": 5000, 
                  "pointsForRetention": 3200, 
                  "pointCurrencyId": 1, 
                  "pointCurrencyNameTh": "คะแนน", 
                  "pointCurrencyNameEn": "Points" 
                } 
              ] 
            } 
          ], 
          "promotionNextTierId": 3, 
          "promotionNextTierNameTh": "Platinum", 
          "promotionNextTierNameEn": "Platinum", 
          "promotionTargetPoints": [ 
            { 
              "values": [ 
                { 
                  "targetPointsForPromotion": 10000, 
                  "pointsForPromotion": 7500, 
                  "pointCurrencyId": 1, 
                  "pointCurrencyNameTh": "คะแนน", 
                  "pointCurrencyNameEn": "Points" 
                } 
              ] 
            } 
          ] 
        } 
      ], 
      "points": [ 
        { 
          "pointCurrencyId": 1, 
          "pointCurrencyNameTh": "คะแนน", 
          "pointCurrencyNameEn": "Points", 
          "pointBalance": 7500, 
          "listByExpiredDate": [ 
            { 
              "expiredDate": "2026-12-31", 
              "point": 500 
            } 
          ] 
        } 
      ] 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Point Balance

Get Point Balances

The CRM provider would need to call this endpoint to retrieve a member’s point balance information.

HTTP Request

POST /v1.3/points/get-balances

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField string Y Enum: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Point Balances Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Points Data

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointBalance number Y Current point balance
lastestExpiredDate object Y Latest expiring point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expiration date in YYYY-MM-DD format
point number Y Expiring point amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "points": [ 
      { 
        "pointCurrencyId": 1, 
        "pointBalance": 100, 
        "lastestExpiredDate": { 
          "expiredDate": "2020-12-31", 
          "point": 100 
        } 
      } 
    ] 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found

Error Codes

Error Code Description
OP01 Member not found
06 Validation error
Earn Point

Earn Points

The CRM provider would need to call this endpoint to earn points for a member transaction.

HTTP Request

POST /v1.4/points/earn

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value
billNo string Y Bill number
cashCoupon string N Cash coupon code
channelRef string Y Channel reference
currency string Y Currency code
earnableValue number Y Earnable amount value
invoiceNo string N Invoice number
orderId string Y Order identifier
order array Y Order item list
paymentMethod object N Payment method information
reference string N Additional reference
sourceTransactionId string Y External transaction identifier
staffId string Y Staff identifier
transactionDate string Y Transaction date in UTC format (YYYY-MM-DDTHH:mm:ssZ)

Model: Order Item

Field Name Data Type Required Description
itemCode string N Order item code
itemType enum Y Enum: service, product
sku string Y Order item SKU
productSerialNo string N Product serial number
pricePerUnit number Y Price per unit
itemQuantity number Y Item quantity
itemDiscount number Y Item discount amount
orderAmount number Y Order amount
onTopCashDiscount number N Additional cash discount
subtotal number Y Item subtotal
taxOrVat number N Tax or VAT amount
salesAfterTax number Y Sales amount after tax
deliveryCostOrShippingFee number N Delivery or shipping fee
totalAmount number Y Total item amount
pointRedemptionCashBackAmount number N Cashback amount from point redemption

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001", 
  "billNo": "812345678", 
  "channelRef": "yetimall", 
  "currency": "THB", 
  "earnableValue": 530, 
  "orderId": "OR0202303030001", 
  "orders": [ 
    { 
      "itemCode": "productRef", 
      "itemType": "product", 
      "sku": "00001", 
      "pricePerUnit": 100, 
      "itemQuantity": 5, 
      "itemDiscount": 0, 
      "orderAmount": 500, 
      "subtotal": 500, 
      "taxOrVat": 10, 
      "salesAfterTax": 510, 
      "deliveryCostOrShippingFee": 20, 
      "totalAmount": 530, 
      "pointRedemptionCashBackAmount": 0 
    } 
  ], 
  "reference": "Reference", 
  "sourceTransactionId": "primo_19091996", 
  "staffId": "admin01", 
  "transactionDate": "2022-12-31T03:07:45Z" 
}

HTTP Response

Successful Response

Model: Earn Points Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
orderNo string Y Order number
points array Y Point balance information
sourceTransactionId string Y External transaction identifier
transactionId string Y Earn transaction log identifier
transactions array Y Earn transaction details

Model: Point

Field Name Data Type Required Description
balance number Y Point balance
id number Y Point currency identifier
name string Y Point currency name

Model: Transaction

Field Name Data Type Required Description
earningOutcomeType string Y Outcome type: Point or Event
eventId number N Event identifier
eventCode string N Event code
eventNameTh string N Event name in Thai
eventNameEn string N Event name in English
pointCurrencyCode string N Point currency code
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
earnedEventAmount number N Earned event amount
earnedPointAmount number N Earned point amount
redeemedPointAmount number N Redeemed point amount
expiredDate string N Expiration date in YYYY-MM-DD format
sourceTransactionId string Y External transaction identifier
totalAmount number Y Total earned amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "orderNo": "OR0202303030001", 
    "points": [ 
      { 
        "balance": 1500, 
        "id": 1, 
        "name": "primo_point" 
      } 
    ], 
    "sourceTransactionId": "primo_19091996", 
    "transactionId": "6094ec405077595050e6d36e", 
    "transactions": [ 
      { 
        "earningOutcomeType": "Point", 
        "pointCurrencyCode": "POINT", 
        "pointCurrencyNameTh": "คะแนน", 
        "pointCurrencyNameEn": "Points", 
        "earnedPointAmount": 53, 
        "redeemedPointAmount": 0, 
        "expiredDate": "2025-12-31", 
        "sourceTransactionId": "primo_19091996", 
        "totalAmount": 53 
      } 
    ] 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP02", 
  "message": "SourceTransactionId is duplicated in loyalty program", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP02 SourceTransactionId is duplicated in loyalty program
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP07 Point currency not found
OP14 Transaction date occurred before current member tier entry date
06 Validation error
Void Earn Point

Void Earn Point

The CRM provider would need to call this endpoint to void an earned point transaction.

HTTP Request

POST /v1.3/points/void-earn

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField string Y Enum: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value
earnSourceTransactionId string Y Earned transaction ID from external system
earnBillNoOrReceiptNo string Y Earned bill number or receipt number
remark string Y Void remark
staffId string Y Staff identifier
transactionDate string Y Transaction datetime in UTC format (YYYY-MM-DDTHH:mm:ssZ)

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001", 
  "earnSourceTransactionId": "primo_M0000000001", 
  "earnBillNoOrReceiptNo": "primo_19091996", 
  "remark": "void for reject order", 
  "staffId": "admin", 
  "transactionDate": "2022-12-31T03:07:45Z" 
}

HTTP Response

Successful Response

Model: Void Earn Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
earnSourceTransactionId string Y Earned transaction ID from external system
earnBillNoOrReceiptNo string Y Earned bill number or receipt number
totalSpending number Y Total spending amount
remark string Y Void remark
staffId string Y Staff identifier

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "earnSourceTransactionId": "primo_M0000000001", 
    "earnBillNoOrReceiptNo": "primo_19091996", 
    "totalSpending": 20, 
    "remark": "void for reject order", 
    "staffId": "admin" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP13", 
  "message": "Earn transaction not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP03 Branch not found
OP04 Brand not found
OP08 Other Error
OP10 BillNoOrReceiptNo not found
OP11 This transaction is already voided
OP13 Earn transaction not found
Redeem Point

Redeem Points

The CRM provider would need to call this endpoint to create a redeem point transaction.

HTTP Request

POST /v1.3/points/redeem

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
sourceTransactionId string Y Redeem transaction ID from external system
transactionDate string Y Transaction datetime in UTC format (YYYY-MM-DDTHH:mm:ssZ)
redeemPoints array Y Redeem point list
billNo string N Bill number
remark string N Additional remark
channelRef string N Transaction channel reference
staffId string N Staff identifier
ref1 string N First reference
ref2 string N Second reference
ref3 string N Third reference

Model: Redeem Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
value number Y Redeem amount

Sample Request

{ 
  "memberNo": "M0000000001", 
  "sourceTransactionId": "primo_19091996", 
  "transactionDate": "2022-12-31T03:07:45Z", 
  "redeemPoints": [ 
    { 
      "pointCurrencyId": 1, 
      "value": 999 
    } 
  ], 
  "billNo": "812345678", 
  "remark": "redeem_from_yeti_mall", 
  "channelRef": "web_yetimall", 
  "staffId": "admin", 
  "ref1": "ref1", 
  "ref2": "ref2", 
  "ref3": "ref3" 
}

HTTP Response

Successful Response

Model: Redeem Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
redeemPoints array Y Redeemed point list
sourceTransactionId string Y Transaction ID from external system
transactionDate string Y Transaction datetime

Model: Redeemed Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
value number Y Redeemed amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "redeemPoints": [ 
      { 
        "pointCurrencyId": 1, 
        "value": 999 
      } 
    ], 
    "sourceTransactionId": "primo_19091996", 
    "transactionDate": "2022-12-31T03:07:45Z" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP06", 
  "message": "Point not enough", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP02 SourceTransactionId is duplicated in loyalty program
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP06 Point not enough
OP07 Point currency not found
OP08 Other Error
06 Validation error
Void Point Redemption

Void Point Earning

Reverses a previous point redemption transaction and restores the deducted points back to the member's balance.

HTTP Request

POST /v1.3/points/void-redeem

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Request Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
sourceTransactionId string Y Void redeem transaction ID from external system
transactionDate string Y Transaction datetime in YYYY-MM-DDTHH:mm:ssZ format (UTC)
staffId string N Staff identifier
billNo string N Bill or receipt number
remark string N Additional remark
channelRef string N Transaction channel reference

Validation Rules

  • memberNo: Allow characters: A-Z, a-z, 0-9, _, - | Maximum length: 20 | Must not start with - | Must not end with _
  • staffId: Allow characters: A-Z, a-z, 0-9, _, - | Length between 6 - 32 characters
  • transactionDate: Format must be YYYY-MM-DDTHH:mm:ssZ (Example: 2022-12-31T03:05:23Z)

Sample Request

{ 
  "memberNo": "M0000000001", 
  "sourceTransactionId": "primo_20221231", 
  "transactionDate": "2022-12-31T03:05:23Z", 
  "staffId": "admin01", 
  "billNo": "primo_12334324", 
  "remark": "void redeem from portal", 
  "channelRef": "yetimall" 
}

HTTP Response

Successful Response

Model: Void Redeem Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
sourceTransactionId string Y Void redeem transaction ID
transactionDate string Y Void transaction datetime
redeemSourceTransactionId string Y Original redeem transaction ID
remark string N Additional remark

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "sourceTransactionId": "void_20221231", 
    "transactionDate": "2022-12-31T03:05:23Z", 
    "redeemSourceTransactionId": "primo_20221231", 
    "remark": "void redeem from portal" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP11", 
  "message": "This transaction is already voided", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP08 Other Error
OP09 SourceTransactionId not found
OP10 BillNoOrReceiptNo not found
OP11 This transaction is already voided
OP12 Void must occur after transaction date

Validation Errors

[ 
  "[memberNo] should not be empty", 
  "[sourceTransactionId] should not be empty", 
  "[transactionDate] must be a valid datetime", 
  "[transactionDate] should not be empty", 
  "[staffId] should not be empty", 
  "[staffId] must match /regex/ format", 
  "[billNo] should not be empty", 
  "[channelRef] should not be empty", 
  "[remark] should not be empty" 
]
Verify Coupon

Verify Coupon

Verify coupon information for manual verification before mark used transaction

HTTP Request

GET /v1.3/transaction/coupon/verify?code={couponCode}&collectionId={collectionId}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier
source-transaction-id string N Transaction reference identifier
pos-id string N POS identifier

Query Parameters

Field Name Data Type Required Description
collectionId number Y Coupon collection identifier
code string Y Coupon code

Sample Request

GET /v1.3/transaction/coupon/verify?code=PRE-00012UU&collectionId=1

Sample Headers

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412", 
  "source-transaction-id": "abcDEF123HU1Kl", 
  "pos-id": "easy-restaurant" 
}

HTTP Response

Successful Response

Model: Verify Coupon Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Coupon information

Response Data

Field Name Data Type Required Description
couponOutcomeLogId string Y Coupon outcome log identifier
couponId number Y Coupon identifier
code string Y Coupon code
statusId number Y Coupon status identifier
statusName string Y Coupon status name
collectionId number Y Coupon collection identifier
couponTypeId number Y Coupon type identifier
programType string Y Program type
campaignId number Y Campaign identifier
programId number Y Program identifier
programOutcomeConditionId number Y Program outcome condition identifier
campaignOutcomeId number Y Campaign outcome identifier
memberNo string Y Member number
memberId number Y Member identifier
outcomeTransactionLogId string Y Outcome transaction log identifier
expirationDate string Y Coupon expiration datetime
startDate string Y Coupon start datetime
usedAt string | null N Coupon used datetime
redeemedAt string Y Coupon redeemed datetime
couponCollection object Y Coupon collection information
campaign object Y Campaign information

Coupon Status mappings

Status ID Status Name
2 redeemed
3 used
4 expired
5 using-expired

Coupon Type mappings

Coupon Type ID Description
1 Basic Coupon
2 Cash Coupon
3 Discount Coupon
4 Product and Service
5 Premium Product and Service
6 Lucky Draw
7 Mobile Top-up

Program Type mappings

Program Type Description
Mission Mission campaign
Privilege Privilege campaign

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "couponOutcomeLogId": "65b75234cc765cd8dd8cc00e", 
    "couponId": 2131599, 
    "code": "qwert1uDF0MbnnI6", 
    "statusId": 2, 
    "statusName": "redeemed", 
    "collectionId": 6392, 
    "couponTypeId": 1, 
    "programType": "Privilege", 
    "campaignId": 6236, 
    "programId": 4351, 
    "programOutcomeConditionId": 4385, 
    "campaignOutcomeId": 6095, 
    "memberNo": "M0000054307", 
    "memberId": 54307, 
    "outcomeTransactionLogId": "65b75233cc765cd8dd8cc009", 
    "expirationDate": "2024-12-31T16:59:59.000+00:00", 
    "startDate": "2024-01-28T17:00:00.000+00:00", 
    "usedAt": null, 
    "redeemedAt": "2024-01-29T07:22:27.000Z", 
    "couponCollection": { 
      "id": 6392, 
      "name": "Super Coupon", 
      "refCode": "123456", 
      "descriptionTh": "Daily coupon", 
      "descriptionEn": "Daily coupon", 
      "imageTh": null, 
      "imageEn": null, 
      "status": 1, 
      "couponTypeId": 1, 
      "couponTypeNameTh": "คูปองทั่วไป", 
      "couponTypeNameEn": "Basic Coupon" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP32", 
  "message": "Coupon not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP23 Coupon invalid
OP32 Coupon not found
03 Server error
10 Unauthorized

Validation Errors

[ 
  "[collectionId] should not be empty", 
  "[code] should not be empty" 
]
Mark Use Coupon

Mark Used Privilege

Mark a redeemed coupon as used in the loyalty platform.

HTTP Request

POST /v1.3/privileges/mark-used

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier
source-transaction-id string N Transaction reference identifier
pos-id string N POS identifier

Request Body

Field Name Data Type Required Description
memberNo string Y Member number
coupons array Y Coupon list

Coupons Object

Field Name Data Type Required Description
collectionId number Y Coupon collection identifier
code string Y Coupon code

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412", 
  "source-transaction-id": "abcDEF123HU1Kl", 
  "pos-id": "easy-restaurant" 
}

Body:

{ 
  "memberNo": "M0000000001", 
  "coupons": [ 
    { 
      "collectionId": 12, 
      "code": "3ae43345t" 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Mark Used Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
httpStatus number Y HTTP status code
data null Y Always returns null on success

Sample Success Response

{ 
  "errorCode": "00", 
  "successful": true, 
  "message": "Success", 
  "httpStatus": 200, 
  "data": null 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP36", 
  "message": "Coupon has been used", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP32 Coupon not found
OP33 Program outcome markUse not found
OP34 Cannot mark used, coupon not yet start date
OP35 Cannot mark used, coupon expired
OP36 Coupon has been used
03 Server error
10 Unauthorized

Validation Errors

[ 
  "[memberNo] must be a string", 
  "[memberNo] should not be empty", 
  "[coupons] must contain at least 1 elements", 
  "[coupons] must be an array", 
  "[collectionId] must be a number conforming to the specified constraints", 
  "[collectionId] should not be empty", 
  "[code] must be a string", 
  "[code] should not be empty" 
]
Redeem and Mark Used 🜲

Redeem and Mark Used Privilege

Redeem a privilege and immediately mark the coupon as used in a single transaction.

HTTP Request

POST /v1.3/privileges/redeem-and-mark-use

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Request Body

Field Name Data Type Required Description
memberNo string Y Member number
programOutcomeConditions array Y Program outcome conditions list

Program Outcome Conditions Object

Field Name Data Type Required Description
id number Y Program outcome condition identifier
amount number Y Redeem amount

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412" 
}

Body:

{ 
  "memberNo": "M0000000001", 
  "programOutcomeConditions": [ 
    { 
      "id": 1, 
      "amount": 1 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Redeem and Mark Used Response

Field Name Data Type Required Description
memberNo string Y Member number
programOutcomeConditions array Y Program outcome conditions result

Program Outcome Conditions Response Object

Field Name Data Type Required Description
id number Y Program outcome condition identifier
amount number Y Redeem amount
sourceTransactionId string Y Redeem source transaction identifier
sourceTransactionDate string Y Redeem transaction datetime
redeemData object Y Redeem transaction result

Redeem Data Object

Field Name Data Type Required Description
successful boolean Y Redeem transaction status
code string Y Response code
message string Y Response message

Sample Success Response

{ 
  "memberNo": "M0000000123", 
  "programOutcomeConditions": [ 
    { 
      "id": 12, 
      "amount": 1, 
      "sourceTransactionId": "M0000000123230425160053631nalksdnkjbkjbnlkbasd", 
      "sourceTransactionDate": "2023-04-25T16:01:23Z", 
      "redeemData": { 
        "successful": true, 
        "code": "00", 
        "message": "success" 
      } 
    } 
  ] 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP03", 
  "message": "Branch not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP32 Coupon not found
OP33 Program outcome markUse not found
OP34 Cannot mark used, coupon not yet start date
OP35 Cannot mark used, coupon expired
OP36 Coupon has been used
03 Server error
10 Unauthorized

Validation Errors

[ 
  "id should not be empty", 
  "id must be a number conforming to the specified constraints", 
  "id must not be less than 1", 
  "amount should not be empty", 
  "amount must be a number conforming to the specified constraints", 
  "amount must not be less than 1" 
]
Get Coupon Wallet 🜲

Get Coupon Wallet by Member

Retrieve a specific coupon wallet detail for a member by using memberNo and outcomeTransactionLogId.

HTTP Request

GET /v1/member/wallet?memberNo={memberNo}&outcomeTransactionLogId={outcomeTransactionLogId}&isIncludeOutlet={isIncludeOutlet}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Query Parameters

Field Name Data Type Required Description
memberNo string Y Member number
outcomeTransactionLogId string Y Outcome transaction log identifier
isIncludeOutlet boolean N Include coupon outlet information in response (true / false)

Sample Request

GET /v1/member/wallet?memberNo=M0000000001&outcomeTransactionLogId=681470e89f026b21e8b167fa&isIncludeOutlet=false

Sample Headers

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "session-id": "ES12qe213eqW2412" 
}

HTTP Response

Successful Response

Model: Get Coupon Wallet Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
httpStatus number Y HTTP status code
data object Y Coupon wallet information

Response Data Details

Coupon

Field Name Data Type Required Description
code string Y Coupon code
collectionId number Y Coupon collection identifier
couponId number Y Coupon identifier
outcomeTransactionLogId string Y Outcome transaction log identifier
expirationDate string Y Coupon expiration datetime
redeemedAt string Y Coupon redeemed datetime
startDate string Y Coupon start datetime
statusId number Y Coupon status identifier
statusName string Y Coupon status name
usedExpireDate string | null N Coupon used expiration datetime
uniqueLink string N Unique coupon link
couponOutlets array N Coupon outlet list (returned when isIncludeOutlet=true)

CouponOutlets

Field Name Data Type Required Description
companyCode string Y Company code
brandCode string Y Brand code
branchCode string Y Branch code

Campaign

Field Name Data Type Required Description
id number Y Campaign identifier
imageEn string N Campaign image URL (EN)
imageTh string N Campaign image URL (TH)
nameEn string N Campaign name (EN)
nameTh string N Campaign name (TH)
campaignCollections array Y Campaign collection list
campaignOutcome object Y Campaign outcome information
programOutcomeCondition object Y Program outcome condition information

Coupon Status Mapping

Status ID Status Name
2 redeemed
3 used
4 expired
5 using-expired

Sample Success Response

{ 
  "errorCode": "00", 
  "successful": true, 
  "message": "Success", 
  "httpStatus": 200, 
  "data": { 
    "coupon": { 
      "code": "D1y5tpCZs1", 
      "collectionId": 1, 
      "couponId": 1, 
      "outcomeTransactionLogId": "681470e89f026", 
      "expirationDate": "2025-12-31T16:59:59.000+00:00", 
      "redeemedAt": "2025-12-31T16:59:59.000+00:00", 
      "startDate": "2025-12-31T16:59:59.000+00:00", 
      "statusId": 2, 
      "statusName": "redeemed", 
      "usedExpireDate": null, 
      "uniqueLink": "", 
      "couponOutlets": [ 
        { 
          "companyCode": "001", 
          "brandCode": "001", 
          "branchCode": "001" 
        } 
      ] 
    }, 
    "campaign": { 
      "id": 1, 
      "imageEn": "https://assets-b-ts-stable.primo-dev.com/8-ec30bfdf6807.jpg", 
      "imageTh": "", 
      "nameEn": "", 
      "nameTh": "ส่วนลดสินค้าที่เข้าร่วมรายการ 10%", 
      "campaignCollections": [ 
        { 
          "id": 1, 
          "slug": "campaign_slug1", 
          "nameTh": "", 
          "nameEn": "hot", 
          "isActive": true 
        } 
      ], 
      "campaignOutcome": { 
        "id": 1, 
        "nameEn": "coupon discount 10%", 
        "nameTh": "", 
        "conditionEn": "", 
        "conditionTh": "", 
        "descriptionEn": "", 
        "descriptionTh": "", 
        "outcomeTypeId": 1 
      }, 
      "programOutcomeCondition": { 
        "id": 1, 
        "programId": 1, 
        "programOutcomeAcceptanceId": 1, 
        "programOutcomeAcceptanceTypeId": 1, 
        "programOutcomeCouponDisplayTypeIds": [1, 2, 3, 4], 
        "programOutcomeMarkUse": { 
          "id": 1, 
          "markUseTypeId": 1, 
          "isOwnerOnly": false, 
          "unitTypeId": 1, 
          "validWithinValue": 1 
        } 
      } 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP32", 
  "message": "Coupon not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP32 Coupon not found
OP08 Other error
06 Validation error

Validation Errors

[ 
  "memberNo should not be empty", 
  "memberNo must be shorter than or equal to 255 characters", 
  "memberNo must be a string", 
  "outcomeTransactionLogId should not be empty", 
  "outcomeTransactionLogId must be shorter than or equal to 255 characters", 
  "outcomeTransactionLogId must be a string", 
  "isIncludeOutlet must be one of the following values: true, false" 
]
Overview
Member Management
Member Information
Point Management
Coupon Management
Member Onboarding
Overview
PRIMO Open API Specification
Global Environments & Base URLs
Authentication & Global Headers
Standard Response Format
Core Global Error Codes
Member Management
Create Member No PII
Bulk Create Member No PII 🜲
Update member partial profile 🜲
Create member with PII and Open ID 🜲
Member Information
Get Profile
Get Mask Profile
Get Tier Progress 🜲
Point Management
Get Point Balance
Earn Point
Void Earn Point
Redeem Point
Void Point Redemption
Coupon Management
Verify Coupon
Mark Use Coupon
Redeem and Mark Used 🜲
List Coupon Wallet 🜲
Get Coupon Wallet 🜲
Member Onboarding
List Consent 🜲
Get Member Consent 🜲
Update Member Consent Opts 🜲
Bind Marketplace 🜲
Unbind Open ID 🜲
PRIMO Open API Specification

PRIMO Open API Specification

Welcome to the PRIMO Open API Specification. This unified API gateway allows external platforms, CRM providers, and e-commerce applications to seamlessly integrate with PRIMO's core loyalty and member management engine.

Global Environments & Base URLs

Global Environments & Base URLs

All API requests must be sent over HTTPS and use the following base domains depending on your current integration stage:

Environment Base URL Description
Sandbox / Staging https://api-staging.primo-dev.com For development, testing, and QA purposes.
Production https://api.primo.com For live commercial transactions.
Authentication & Global Headers

Authentication & Global Headers

PRIMO APIs secure endpoints using Bearer Token Authentication. Every request must be submitted with Content-Type: application/json along with the standard header parameters listed below:

Header Key Data Type Required Description
authorization string Y Bearer <your_token_provided_by_primo>
session-id string Y Encrypted session or channel identifier
company-code string Y* Merchant company identification code
brand-code string Y* Merchant brand identification code
branch-code string Y* Merchant branch identification code

*Note: Merchant identity headers (company, brand, branch) are required for all transaction-related endpoints (Points, Coupons, and Privileges).

Standard Response Format

Standard Response Format

To ensure consistency across integrations, all endpoints adhere to a unified JSON response envelope schema:

Success Response Structure (HTTP 200)

{
  "successful": true,
  "errorCode": "00",
  "message": "Success",
  "httpStatus": 200,
  "data": {} 
}

Error Response Structure (HTTP 4xx / 5xx)

{
  "successful": false,
  "errorCode": "06",
  "message": "Validation error",
  "data": null
}
Core Global Error Codes

Core Global Error Codes

Error Code HTTP Status Description
00 200 Operation completed successfully.
03 500 Internal Server Error. Please contact PRIMO support.
06 400 / 404 Validation Error. Check payload fields against constraints.
10 401 Unauthorized. Invalid or expired token.
Create Member No PII

Create member no PII

The CRM provider would need to call this endpoint to create a member without personally identifiable information (PII).

HTTP Request

POST /v2.0/create-member/no-pii

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
birthDate string N Member birth date in YYYY-MM-DD format
acceptedTermId number N Current active term identifier
acceptedConsents array N Accepted consent list
customData object N Additional custom data
remark string N Additional remark

Model: Accepted Consent

Field Name Data Type Required Description
consentId number Y Consent identifier
action string Y Enum: in, out

Sample Request

{ 
  "memberNo": "M0000000001", 
  "birthDate": "1990-01-01", 
  "acceptedTermId": 1, 
  "acceptedConsents": [ 
    { 
      "consentId": 2, 
      "action": "in" 
    }
  ], 
  "customData": { 
    "utm_source": "google", 
    "utm_medium": "cpc" 
  }, 
  "remark": "สมัครผ่าน LINE OA" 
}

HTTP Response

Successful Response

Model: Create Member Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Created member number

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP27", 
  "message": "Member No already existed", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP05 Company not found
OP27 Member No already existed
OP28 Term id is not current or active
OP29 Branch and Brand do not match
OP30 Consent id is not current or active
OP31 Create member failed
Bulk Create Member No PII 🜲

Bulk Create Member No PII

The CRM provider would need to call this endpoint to create multiple members without personally identifiable information (PII).

HTTP Request

POST /v2.0/bulk-create-member/no-pii

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
members array Y List of members to create

Model: Member

Field Name Data Type Required Description
memberNo string Y Member identifier
birthDate string Y Member birth date in YYYY-MM-DD format
branchCode string Y Merchant branch code
brandCode string Y Merchant brand code
companyCode string Y Merchant company code
acceptedTermId number N Current active term identifier
acceptedConsents array N Accepted consent list
customData object N Additional custom data
remark string N Additional remark

Model: Accepted Consent

Field Name Data Type Required Description
consentId number Y Consent identifier
action string Y Enum: in, out

Sample Request

{ 
  "members": [ 
    { 
      "memberNo": "M0000000001", 
      "birthDate": "1990-01-01", 
      "branchCode": "branchA", 
      "brandCode": "brandA", 
      "companyCode": "companyA", 
      "acceptedTermId": 1, 
      "acceptedConsents": [ 
        { 
          "consentId": 1, 
          "action": "in" 
        }
      ], 
      "customData": { 
        "utm_source": "google", 
        "utm_medium": "cpc" 
      }, 
      "remark": "สมัครผ่าน LINE OA" 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Bulk Create Member Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data array Y Response data list

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Created member number
errorCode string Y Response error code
message string Y Response message
data object N Additional response data

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": [ 
    { 
      "memberNo": "M0000000001", 
      "errorCode": "00", 
      "message": "Success", 
      "data": null 
    } 
  ] 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP27", 
  "message": "Member No already existed", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP05 Company not found
OP08 Other Error
OP27 Member No already existed
OP28 Term id is not current or active
OP29 Branch and Brand do not match
OP30 Consent id is not current or active
OP31 Create member failed
06 Validation error
Update member partial profile 🜲

Partial Profile Update

The CRM provider would need to call this endpoint to partially update a member profile.

HTTP Request

PATCH /v2.0/partial-profile?memberNo={memberNo}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Query Parameters

Field Name Data Type Required Description
memberNo string Y Member number

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
firstNameTh string N First name in Thai
lastNameTh string N Last name in Thai
firstNameEn string N First name in English
lastNameEn string N Last name in English
email string N Member email
birthDate string N Birth date in YYYY-MM-DD format
gender string N Enum: M, F, O
taxpayerId string N Taxpayer ID

Sample Request

{ 
  "firstNameTh": "วี", 
  "lastNameTh": "พรีโม", 
  "firstNameEn": "Vee", 
  "lastNameEn": "Primo", 
  "email": "vee.primo@example.com", 
  "birthDate": "1990-10-01", 
  "gender": "M", 
  "taxpayerId": "1234567890123" 
}

HTTP Response

Successful Response

Model: Partial Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string N First name in Thai
lastNameTh string N Last name in Thai
firstNameEn string N First name in English
lastNameEn string N Last name in English
email string N Member email
birthDate string N Birth date in YYYY-MM-DD format
gender string Y Enum: M, F, O
taxpayerId string N Taxpayer ID

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "firstNameTh": "วี", 
      "lastNameTh": "พรีโม", 
      "firstNameEn": "Vee", 
      "lastNameEn": "Primo", 
      "email": "vee.primo@example.com", 
      "birthDate": "1990-10-01", 
      "gender": "M", 
      "taxpayerId": "1234567890123" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP38 This email is already taken
OP39 Member status is deleted or draft, cannot update
06 Validation error
Create member with PII and Open ID 🜲

Create member with PII and Open ID

The CRM provider would need to call this endpoint to create a member with personally identifiable information (PII), with optional Open ID information for member identification and account linkage.

HTTP Request

POST /v2.0/create-member/pii

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string N Member identifier
birthDate string N Member birth date in YYYY-MM-DD format
acceptedTermId number N Current active term identifier
acceptedConsents array N Accepted consent list
customData object N Additional custom data
remark string N Additional remark
firstNameTh string N First name in Thai
lastNameTh string N Last name in Thai
firstNameEn string N First name in English
lastNameEn string N Last name in English
email string N Email
phone string N Phone
gender string N Gender
citizenId string N Citizen id
passportNo string N Passport no
taxpayerId string N Taxpayer id
fax string N Fax
occupationId number N Occupation id
occupationDescription string N Occupation description
incomeId number N Income id
maritalStatusId number N Marital status id
requestId string Y Request ID from /otp/request (action=register) and (state=verified)
address opject N Address
openIdType string N Enum: [ PHONE_SHOPIFY, EMAIL_SHOPIFY, SHOPEE, LAZADA, TIKTOK ]
openId string N Open ID
uniqueKey string N Unique key

Model: Accepted Consent

Field Name Data Type Required Description
consentId number Y Consent identifier
action string Y Enum: in, out

Model: Address

Field Name Data Type Required Description
addressFreetext string N Full address
addressNo string N Address number
buildingVillage string N Building or village
district string N District
moo string N Moo
postCode string N Postal code
province string N Province
road string N Road
roomNo string N Room number
soi string N Soi
subDistrict string N Sub district

Sample Request

{
  "memberNo": "M0000000001",
  "birthDate": "1990-01-01",
  "acceptedTermId": 1,
  "acceptedConsents": [
    {
      "consentId": 2,
      "action": "in"
    }
  ],
  "customData": {
    "utm_id": "campaign_id",
    "utm_source": "google",
    "utm_medium": "cpc",
    "utm_campaign": "broadcast_morning",
    "utm_term": "morning",
    "utm_content": ""
  },
  "remark": "Remark",
  "firstNameTh": "พรีโม",
  "lastNameTh": "เวิลด์",
  "firstNameEn": "Primo",
  "lastNameEn": "World",
  "email": "123@email.com",
  "phone": "0812345678",
  "gender": "M",
  "citizenId": "6176375907134",
  "passportNo": "p11223344",
  "taxpayerId": "987654321",
  "fax": "123456789",
  "occupationId": 1,
  "occupationDescription": "",
  "incomeId": 1,
  "maritalStatusId": 1,
  "requestId": "ce8dd6cb-89d9-4660-81b4-118622cbb875",
  "address": {
    "addressNo": "123/456",
    "roomNo": "135",
    "buildingVillage": "kpark",
    "moo": "5",
    "road": "silom",
    "soi": "1",
    "districtId": 35,
    "subDistrictId": 127,
    "provinceId": 9,
    "postCode": "10150",
    "addressFreetext": "7/22 M.5, Soi Ta-iat"
  },
  "openIdType": "SHOPEE",
  "openId": "U80f3838a7c7749a72679ac50b1b02823",
  "uniqueKey": "thee1"
}

HTTP Response

Successful Response

Model: Create Member Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Created member number

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP27", 
  "message": "Member No already existed", 
  "data": null 
}

Status Codes

HTTP Status Description
201 Success
400 Invalid Data
401 Unauthorized
403 Forbidden
500 Server error

Error Codes

Error Code Description
OP05 Company not found
OP27 Member No already existed
OP28 Term id is not current or active
OP29 Branch and Brand do not match
OP30 Consent id is not current or active
OP31 Create member failed
Get Profile

Get Profile

The CRM provider would need to call this endpoint to get member profile information.

HTTP Request

POST /v2.0/get-profile

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier Field (citizen_id / member_no / phone / passport_no / email / shopify_open_id)
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string Y First name in Thai
firstNameEn string Y First name in English
lastNameTh string Y Last name in Thai
lastNameEn string Y Last name in English
tiers array Y Member tier information
points array Y Member point information
citizenId string N Citizen ID
passportNo string N Passport number
address object Y Address information
taxpayerId string N Taxpayer ID
phone string Y Phone number
email string Y Email address
gender string Y Gender
birthDate string Y Birth date in YYYY-MM-DD format
occupation string Y Occupation
occupationDescription string Y Occupation description
maritalStatus string Y Marital status
income string Y Income range
opts array Y Terms and consent information
customData object Y Additional custom data
memberStatus string Y Member status: active, deleted, draft
createdAt string Y Created datetime
updatedAt string Y Updated datetime

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupName string Y Tier group name
tierNameTh string Y Tier name in Thai
tierNameEn string Y Tier name in English
tierId number Y Tier identifier

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
lastestExpiredDate object Y Latest expired point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expired date in YYYY-MM-DD format
point number Y Expired point amount

Model: Address

Field Name Data Type Required Description
addressFreetext string N Full address
addressNo string N Address number
buildingVillage string N Building or village
district string N District
moo string N Moo
postCode string N Postal code
province string N Province
road string N Road
roomNo string N Room number
soi string N Soi
subDistrict string N Sub district

Model: Opts

Field Name Data Type Required Description
id number Y Consent identifier
type string Y Consent type
slug string Y Consent slug
version string Y Consent version
currentVersion string Y Current version
isMandatory boolean Y Mandatory flag
consentStatus string Y Consent status
grantStatus string Y Grant status
updatedAt string Y Updated datetime
updatedBy string Y Updated by

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": {
    "member": {
      "memberNo": "M0000000000000000000000000000000000000000000038904",
      "firstNameTh": "โปรไฟล์วี",
      "firstNameEn": "vtest",
      "lastNameTh": "เทส",
      "lastNameEn": "lastnametest",
      "tiers": [
        {
          "tierGroupId": 92,
          "tierGroupName": "openAPI",
          "tierNameTh": "WHITE",
          "tierNameEn": "",
          "tierId": 120
        }
      ],
      "points": [
        {
          "pointCurrencyId": 468,
          "pointCurrencyNameTh": "YETI Point",
          "pointCurrencyNameEn": null,
          "pointBalance": 0,
          "listByExpiredDate": [
            {
              "expiredDate": "string",
              "point": 0
            }
          ]
        }
      ],
      "citizenId": "0320534534535",
      "passportNo": "11111111111111114444",
      "address": {
        "addressFreetext": "-",
        "addressNo": "-",
        "buildingVillage": "-",
        "district": "ไม่ระบุ",
        "moo": "-",
        "postCode": "00000",
        "province": "ไม่ระบุ",
        "road": "-",
        "roomNo": "-",
        "soi": "1",
        "subDistrict": "ไม่ระบุ"
      },
      "taxpayerId": "1231312131312",
      "phone": "0123456989",
      "email": "getprofile@example.com",
      "gender": "ชาย",
      "birthDate": "2025-06-06",
      "occupation": "อื่นๆ",
      "occupationDescription": "ประมง",
      "maritalStatus": "ไม่ระบุ",
      "income": "10,001 - 15,000 บาท",
      "opts": [
        {
          "id": 203,
          "type": "terms",
          "slug": "Test123_V3",
          "version": "55.1",
          "currentVersion": "55.1",
          "isMandatory": true,
          "consentStatus": "active",
          "grantStatus": "granted",
          "updatedAt": "2025-06-18T13:06:02+07:00",
          "updatedBy": "Register by member"
        }
      ],
      "customData": {
        "session": {},
        "displayname": "VTESTTEST"
      },
      "memberStatus": "active",
      "createdAt": "2025-06-18T13:06:02+07:00",
      "updatedAt": "2025-06-25T11:43:50+07:00",
      "openIds": [
        {
          "openId": "9193214",
          "openIdType": "PHONE_SHOPIFY"
        }
      ]
    }
  }
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Mask Profile

Get Mark Profile

The CRM provider would need to call this endpoint to get masked member profile information.

HTTP Request

POST /v2.0/get-profile/mask

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Mark Profile Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
firstNameTh string N Masked first name in Thai
firstNameEn string N Masked first name in English
lastNameTh string N Masked last name in Thai
lastNameEn string N Masked last name in English
tiers array Y Member tier information
points array Y Member point information
citizenId string N Masked citizen ID
passportNo string N Masked passport number
address object Y Masked address information
taxpayerId string N Masked taxpayer ID
phone string N Masked phone number
email string N Masked email address

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupName string Y Tier group name
tierNameTh string Y Tier name in Thai
tierNameEn string N Tier name in English
tierId number Y Tier identifier

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
lastestExpiredDate object Y Latest expired point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expired date in YYYY-MM-DD format
point number Y Expired point amount

Model: Address

Field Name Data Type Required Description
addressFreetext string N Masked full address
addressNo string N Masked address number
buildingVillage string N Masked building or village
district string N Masked district
moo string N Masked moo
postCode string N Masked postal code
province string N Masked province
road string N Masked road
roomNo string N Masked room number
soi string N Masked soi
subDistrict string N Masked sub district

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "firstNameTh": "ว***", 
      "firstNameEn": "V****", 
      "lastNameTh": "พ****", 
      "lastNameEn": "P****", 
      "citizenId": "6***", 
      "passportNo": "P****", 
      "phone": "*****4321", 
      "email": "h****@****mobi" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Tier Progress 🜲

Get Tier Progress

The CRM provider would need to call this endpoint to get member tier progress information.

HTTP Request

POST /v2.0/get-tier-progress

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Tier Progress Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Member

Field Name Data Type Required Description
memberNo string Y Member number
tiers array Y Member tier information
points array Y Member point information

Model: Tier

Field Name Data Type Required Description
tierGroupId number Y Tier group identifier
tierGroupNameTh string Y Tier group name in Thai
tierGroupNameEn string Y Tier group name in English
tierNameTh string Y Tier name in Thai
tierNameEn string N Tier name in English
tierExpiredDate string Y Tier expired date in YYYY-MM-DD format
tierId number Y Tier identifier
priority number Y Tier priority
retentionNextTierId number Y Next retention tier ID
retentionNextTierNameTh string Y Next retention tier name in Thai
retentionNextTierNameEn string N Next retention tier name in English
retentionTargetPoints array Y Retention target point information
promotionNextTierId number Y Next promotion tier ID
promotionNextTierNameTh string Y Next promotion tier name in Thai
promotionNextTierNameEn string N Next promotion tier name in English
promotionTargetPoints array Y Promotion target point information

Model: Retention Target Point

Field Name Data Type Required Description
targetPointsForRetention number Y Target points required for retention
pointsForRetention number Y Current retention points
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English

Model: Promotion Target Point

Field Name Data Type Required Description
targetPointsForPromotion number Y Target points required for promotion
pointsForPromotion number Y Current promotion points
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string Y Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English

Model: Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointCurrencyNameTh string Y Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
pointBalance number Y Point balance
listByExpiredDate array Y Point expiration list

Model: Expired Point

Field Name Data Type Required Description
expiredDate string Y Point expiration date in YYYY-MM-DD format
point number Y Point amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "member": { 
      "memberNo": "M0000000001", 
      "tiers": [ 
        { 
          "tierGroupId": 1, 
          "tierGroupNameTh": "สมาชิก", 
          "tierGroupNameEn": "Membership", 
          "tierNameTh": "Gold", 
          "tierNameEn": "Gold", 
          "tierExpiredDate": "2026-12-31", 
          "tierId": 2, 
          "priority": 1, 
          "retentionNextTierId": 2, 
          "retentionNextTierNameTh": "Gold", 
          "retentionNextTierNameEn": "Gold", 
          "retentionTargetPoints": [ 
            { 
              "values": [ 
                { 
                  "targetPointsForRetention": 5000, 
                  "pointsForRetention": 3200, 
                  "pointCurrencyId": 1, 
                  "pointCurrencyNameTh": "คะแนน", 
                  "pointCurrencyNameEn": "Points" 
                } 
              ] 
            } 
          ], 
          "promotionNextTierId": 3, 
          "promotionNextTierNameTh": "Platinum", 
          "promotionNextTierNameEn": "Platinum", 
          "promotionTargetPoints": [ 
            { 
              "values": [ 
                { 
                  "targetPointsForPromotion": 10000, 
                  "pointsForPromotion": 7500, 
                  "pointCurrencyId": 1, 
                  "pointCurrencyNameTh": "คะแนน", 
                  "pointCurrencyNameEn": "Points" 
                } 
              ] 
            } 
          ] 
        } 
      ], 
      "points": [ 
        { 
          "pointCurrencyId": 1, 
          "pointCurrencyNameTh": "คะแนน", 
          "pointCurrencyNameEn": "Points", 
          "pointBalance": 7500, 
          "listByExpiredDate": [ 
            { 
              "expiredDate": "2026-12-31", 
              "point": 500 
            } 
          ] 
        } 
      ] 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
424 External dependency error

Error Codes

Error Code Description
OP01 Member not found
OP07 Point currency not found
OP08 Other Error
06 Validation error
SP001 Point currency not found
SP008 Loyalty Program not found
SP025 Member not found
SP058 Member not in Tier
Ext-Error-Membership-getPointsBalanceByMemberNo Dynamic external service error
Get Point Balance

Get Point Balances

The CRM provider would need to call this endpoint to retrieve a member’s point balance information.

HTTP Request

POST /v2.0/points/get-balances

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField string Y Enum: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001" 
}

HTTP Response

Successful Response

Model: Get Point Balances Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Points Data

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
pointBalance number Y Current point balance
lastestExpiredDate object Y Latest expiring point information

Model: Latest Expired Date

Field Name Data Type Required Description
expiredDate string Y Expiration date in YYYY-MM-DD format
point number Y Expiring point amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "points": [ 
      { 
        "pointCurrencyId": 1, 
        "pointBalance": 100, 
        "lastestExpiredDate": { 
          "expiredDate": "2020-12-31", 
          "point": 100 
        } 
      } 
    ] 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP01", 
  "message": "Member not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found

Error Codes

Error Code Description
OP01 Member not found
06 Validation error
Earn Point

Earn Points

The CRM provider would need to call this endpoint to earn points for a member transaction.

HTTP Request

POST /v2.0/points/earn

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField enum Y Identifier type: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value
billNo string Y Bill number
cashCoupon string N Cash coupon code
channelRef string Y Channel reference
currency string Y Currency code
earnableValue number Y Earnable amount value
invoiceNo string N Invoice number
orderId string Y Order identifier
order array Y Order item list
paymentMethod object N Payment method information
reference string N Additional reference
sourceTransactionId string Y External transaction identifier
staffId string Y Staff identifier
transactionDate string Y Transaction date in UTC format (YYYY-MM-DDTHH:mm:ssZ)

Model: Order Item

Field Name Data Type Required Description
itemCode string N Order item code
itemType enum Y Enum: service, product
sku string Y Order item SKU
productSerialNo string N Product serial number
pricePerUnit number Y Price per unit
itemQuantity number Y Item quantity
itemDiscount number Y Item discount amount
orderAmount number Y Order amount
onTopCashDiscount number N Additional cash discount
subtotal number Y Item subtotal
taxOrVat number N Tax or VAT amount
salesAfterTax number Y Sales amount after tax
deliveryCostOrShippingFee number N Delivery or shipping fee
totalAmount number Y Total item amount
pointRedemptionCashBackAmount number N Cashback amount from point redemption

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001", 
  "billNo": "812345678", 
  "channelRef": "yetimall", 
  "currency": "THB", 
  "earnableValue": 530, 
  "orderId": "OR0202303030001", 
  "orders": [ 
    { 
      "itemCode": "productRef", 
      "itemType": "product", 
      "sku": "00001", 
      "pricePerUnit": 100, 
      "itemQuantity": 5, 
      "itemDiscount": 0, 
      "orderAmount": 500, 
      "subtotal": 500, 
      "taxOrVat": 10, 
      "salesAfterTax": 510, 
      "deliveryCostOrShippingFee": 20, 
      "totalAmount": 530, 
      "pointRedemptionCashBackAmount": 0 
    } 
  ], 
  "reference": "Reference", 
  "sourceTransactionId": "primo_19091996", 
  "staffId": "admin01", 
  "transactionDate": "2022-12-31T03:07:45Z" 
}

HTTP Response

Successful Response

Model: Earn Points Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
orderNo string Y Order number
points array Y Point balance information
sourceTransactionId string Y External transaction identifier
transactionId string Y Earn transaction log identifier
transactions array Y Earn transaction details

Model: Point

Field Name Data Type Required Description
balance number Y Point balance
id number Y Point currency identifier
name string Y Point currency name

Model: Transaction

Field Name Data Type Required Description
earningOutcomeType string Y Outcome type: Point or Event
eventId number N Event identifier
eventCode string N Event code
eventNameTh string N Event name in Thai
eventNameEn string N Event name in English
pointCurrencyCode string N Point currency code
pointCurrencyNameTh string N Point currency name in Thai
pointCurrencyNameEn string N Point currency name in English
earnedEventAmount number N Earned event amount
earnedPointAmount number N Earned point amount
redeemedPointAmount number N Redeemed point amount
expiredDate string N Expiration date in YYYY-MM-DD format
sourceTransactionId string Y External transaction identifier
totalAmount number Y Total earned amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "orderNo": "OR0202303030001", 
    "points": [ 
      { 
        "balance": 1500, 
        "id": 1, 
        "name": "primo_point" 
      } 
    ], 
    "sourceTransactionId": "primo_19091996", 
    "transactionId": "6094ec405077595050e6d36e", 
    "transactions": [ 
      { 
        "earningOutcomeType": "Point", 
        "pointCurrencyCode": "POINT", 
        "pointCurrencyNameTh": "คะแนน", 
        "pointCurrencyNameEn": "Points", 
        "earnedPointAmount": 53, 
        "redeemedPointAmount": 0, 
        "expiredDate": "2025-12-31", 
        "sourceTransactionId": "primo_19091996", 
        "totalAmount": 53 
      } 
    ] 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP02", 
  "message": "SourceTransactionId is duplicated in loyalty program", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP02 SourceTransactionId is duplicated in loyalty program
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP07 Point currency not found
OP14 Transaction date occurred before current member tier entry date
06 Validation error
Void Earn Point

Void Earn Point

The CRM provider would need to call this endpoint to void an earned point transaction.

HTTP Request

POST /v2.0/points/void-earn

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField string Y Enum: citizen_id, member_no, phone, passport_no
identifierValue string Y Member identifier value
earnSourceTransactionId string Y Earned transaction ID from external system
earnBillNoOrReceiptNo string Y Earned bill number or receipt number
remark string Y Void remark
staffId string Y Staff identifier
transactionDate string Y Transaction datetime in UTC format (YYYY-MM-DDTHH:mm:ssZ)

Sample Request

{ 
  "identifierField": "member_no", 
  "identifierValue": "M0000000001", 
  "earnSourceTransactionId": "primo_M0000000001", 
  "earnBillNoOrReceiptNo": "primo_19091996", 
  "remark": "void for reject order", 
  "staffId": "admin", 
  "transactionDate": "2022-12-31T03:07:45Z" 
}

HTTP Response

Successful Response

Model: Void Earn Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
earnSourceTransactionId string Y Earned transaction ID from external system
earnBillNoOrReceiptNo string Y Earned bill number or receipt number
totalSpending number Y Total spending amount
remark string Y Void remark
staffId string Y Staff identifier

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "earnSourceTransactionId": "primo_M0000000001", 
    "earnBillNoOrReceiptNo": "primo_19091996", 
    "totalSpending": 20, 
    "remark": "void for reject order", 
    "staffId": "admin" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP13", 
  "message": "Earn transaction not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP03 Branch not found
OP04 Brand not found
OP08 Other Error
OP10 BillNoOrReceiptNo not found
OP11 This transaction is already voided
OP13 Earn transaction not found
Redeem Point

Redeem Points

The CRM provider would need to call this endpoint to create a redeem point transaction.

HTTP Request

POST /v2.0/points/redeem

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
sourceTransactionId string Y Redeem transaction ID from external system
transactionDate string Y Transaction datetime in UTC format (YYYY-MM-DDTHH:mm:ssZ)
redeemPoints array Y Redeem point list
billNo string N Bill number
remark string N Additional remark
channelRef string N Transaction channel reference
staffId string N Staff identifier
ref1 string N First reference
ref2 string N Second reference
ref3 string N Third reference

Model: Redeem Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
value number Y Redeem amount

Sample Request

{ 
  "memberNo": "M0000000001", 
  "sourceTransactionId": "primo_19091996", 
  "transactionDate": "2022-12-31T03:07:45Z", 
  "redeemPoints": [ 
    { 
      "pointCurrencyId": 1, 
      "value": 999 
    } 
  ], 
  "billNo": "812345678", 
  "remark": "redeem_from_yeti_mall", 
  "channelRef": "web_yetimall", 
  "staffId": "admin", 
  "ref1": "ref1", 
  "ref2": "ref2", 
  "ref3": "ref3" 
}

HTTP Response

Successful Response

Model: Redeem Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
redeemPoints array Y Redeemed point list
sourceTransactionId string Y Transaction ID from external system
transactionDate string Y Transaction datetime

Model: Redeemed Point

Field Name Data Type Required Description
pointCurrencyId number Y Point currency identifier
value number Y Redeemed amount

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "redeemPoints": [ 
      { 
        "pointCurrencyId": 1, 
        "value": 999 
      } 
    ], 
    "sourceTransactionId": "primo_19091996", 
    "transactionDate": "2022-12-31T03:07:45Z" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP06", 
  "message": "Point not enough", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP02 SourceTransactionId is duplicated in loyalty program
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP06 Point not enough
OP07 Point currency not found
OP08 Other Error
06 Validation error
Void Point Redemption

Void Point Earning

Reverses a previous point redemption transaction and restores the deducted points back to the member's balance.

HTTP Request

POST /v2.0/points/void-redeem

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Request Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
memberNo string Y Member identifier
sourceTransactionId string Y Void redeem transaction ID from external system
transactionDate string Y Transaction datetime in YYYY-MM-DDTHH:mm:ssZ format (UTC)
staffId string N Staff identifier
billNo string N Bill or receipt number
remark string N Additional remark
channelRef string N Transaction channel reference

Validation Rules

  • memberNo: Allow characters: A-Z, a-z, 0-9, _, - | Maximum length: 20 | Must not start with - | Must not end with _
  • staffId: Allow characters: A-Z, a-z, 0-9, _, - | Length between 6 - 32 characters
  • transactionDate: Format must be YYYY-MM-DDTHH:mm:ssZ (Example: 2022-12-31T03:05:23Z)

Sample Request

{ 
  "memberNo": "M0000000001", 
  "sourceTransactionId": "primo_20221231", 
  "transactionDate": "2022-12-31T03:05:23Z", 
  "staffId": "admin01", 
  "billNo": "primo_12334324", 
  "remark": "void redeem from portal", 
  "channelRef": "yetimall" 
}

HTTP Response

Successful Response

Model: Void Redeem Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Response data

Model: Response Data

Field Name Data Type Required Description
memberNo string Y Member number
sourceTransactionId string Y Void redeem transaction ID
transactionDate string Y Void transaction datetime
redeemSourceTransactionId string Y Original redeem transaction ID
remark string N Additional remark

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "memberNo": "M0000000001", 
    "sourceTransactionId": "void_20221231", 
    "transactionDate": "2022-12-31T03:05:23Z", 
    "redeemSourceTransactionId": "primo_20221231", 
    "remark": "void redeem from portal" 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP11", 
  "message": "This transaction is already voided", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
409 Conflict occurred

Error Codes

Error Code Description
OP01 Member not found
OP03 Branch not found
OP04 Brand not found
OP05 Company not found
OP08 Other Error
OP09 SourceTransactionId not found
OP10 BillNoOrReceiptNo not found
OP11 This transaction is already voided
OP12 Void must occur after transaction date

Validation Errors

[ 
  "[memberNo] should not be empty", 
  "[sourceTransactionId] should not be empty", 
  "[transactionDate] must be a valid datetime", 
  "[transactionDate] should not be empty", 
  "[staffId] should not be empty", 
  "[staffId] must match /regex/ format", 
  "[billNo] should not be empty", 
  "[channelRef] should not be empty", 
  "[remark] should not be empty" 
]
Verify Coupon

Verify Coupon

Verify coupon information for manual verification before mark used transaction

HTTP Request

GET /v2./transaction/coupon/verify?code={couponCode}&collectionId={collectionId}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier
source-transaction-id string N Transaction reference identifier
pos-id string N POS identifier

Query Parameters

Field Name Data Type Required Description
collectionId number Y Coupon collection identifier
code string Y Coupon code

Sample Request

GET /v2.0/transaction/coupon/verify?code=PRE-00012UU&collectionId=1

Sample Headers

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412", 
  "source-transaction-id": "abcDEF123HU1Kl", 
  "pos-id": "easy-restaurant" 
}

HTTP Response

Successful Response

Model: Verify Coupon Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
data object Y Coupon information

Response Data

Field Name Data Type Required Description
couponOutcomeLogId string Y Coupon outcome log identifier
couponId number Y Coupon identifier
code string Y Coupon code
statusId number Y Coupon status identifier
statusName string Y Coupon status name
collectionId number Y Coupon collection identifier
couponTypeId number Y Coupon type identifier
programType string Y Program type
campaignId number Y Campaign identifier
programId number Y Program identifier
programOutcomeConditionId number Y Program outcome condition identifier
campaignOutcomeId number Y Campaign outcome identifier
memberNo string Y Member number
memberId number Y Member identifier
outcomeTransactionLogId string Y Outcome transaction log identifier
expirationDate string Y Coupon expiration datetime
startDate string Y Coupon start datetime
usedAt string | null N Coupon used datetime
redeemedAt string Y Coupon redeemed datetime
couponCollection object Y Coupon collection information
campaign object Y Campaign information

Coupon Status mappings

Status ID Status Name
2 redeemed
3 used
4 expired
5 using-expired

Coupon Type mappings

Coupon Type ID Description
1 Basic Coupon
2 Cash Coupon
3 Discount Coupon
4 Product and Service
5 Premium Product and Service
6 Lucky Draw
7 Mobile Top-up

Program Type mappings

Program Type Description
Mission Mission campaign
Privilege Privilege campaign

Sample Success Response

{ 
  "successful": true, 
  "errorCode": "00", 
  "message": "Success", 
  "data": { 
    "couponOutcomeLogId": "65b75234cc765cd8dd8cc00e", 
    "couponId": 2131599, 
    "code": "qwert1uDF0MbnnI6", 
    "statusId": 2, 
    "statusName": "redeemed", 
    "collectionId": 6392, 
    "couponTypeId": 1, 
    "programType": "Privilege", 
    "campaignId": 6236, 
    "programId": 4351, 
    "programOutcomeConditionId": 4385, 
    "campaignOutcomeId": 6095, 
    "memberNo": "M0000054307", 
    "memberId": 54307, 
    "outcomeTransactionLogId": "65b75233cc765cd8dd8cc009", 
    "expirationDate": "2024-12-31T16:59:59.000+00:00", 
    "startDate": "2024-01-28T17:00:00.000+00:00", 
    "usedAt": null, 
    "redeemedAt": "2024-01-29T07:22:27.000Z", 
    "couponCollection": { 
      "id": 6392, 
      "name": "Super Coupon", 
      "refCode": "123456", 
      "descriptionTh": "Daily coupon", 
      "descriptionEn": "Daily coupon", 
      "imageTh": null, 
      "imageEn": null, 
      "status": 1, 
      "couponTypeId": 1, 
      "couponTypeNameTh": "คูปองทั่วไป", 
      "couponTypeNameEn": "Basic Coupon" 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP32", 
  "message": "Coupon not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP23 Coupon invalid
OP32 Coupon not found
03 Server error
10 Unauthorized

Validation Errors

[ 
  "[collectionId] should not be empty", 
  "[code] should not be empty" 
]
Mark Use Coupon

Mark Used Privilege

Mark a redeemed coupon as used in the loyalty platform.

HTTP Request

POST /v2.0/privileges/mark-used

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier
source-transaction-id string N Transaction reference identifier
pos-id string N POS identifier

Request Body

Field Name Data Type Required Description
memberNo string Y Member number
coupons array Y Coupon list

Coupons Object

Field Name Data Type Required Description
collectionId number Y Coupon collection identifier
code string Y Coupon code

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412", 
  "source-transaction-id": "abcDEF123HU1Kl", 
  "pos-id": "easy-restaurant" 
}

Body:

{ 
  "memberNo": "M0000000001", 
  "coupons": [ 
    { 
      "collectionId": 12, 
      "code": "3ae43345t" 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Mark Used Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
httpStatus number Y HTTP status code
data null Y Always returns null on success

Sample Success Response

{ 
  "errorCode": "00", 
  "successful": true, 
  "message": "Success", 
  "httpStatus": 200, 
  "data": null 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP36", 
  "message": "Coupon has been used", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP32 Coupon not found
OP33 Program outcome markUse not found
OP34 Cannot mark used, coupon not yet start date
OP35 Cannot mark used, coupon expired
OP36 Coupon has been used
03 Server error
10 Unauthorized

Validation Errors

[ 
  "[memberNo] must be a string", 
  "[memberNo] should not be empty", 
  "[coupons] must contain at least 1 elements", 
  "[coupons] must be an array", 
  "[collectionId] must be a number conforming to the specified constraints", 
  "[collectionId] should not be empty", 
  "[code] must be a string", 
  "[code] should not be empty" 
]
Redeem and Mark Used 🜲

Redeem and Mark Used Privilege

Redeem a privilege and immediately mark the coupon as used in a single transaction.

HTTP Request

POST /v2.0/privileges/redeem-and-mark-use

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
branch-code string Y Merchant branch code
brand-code string Y Merchant brand code
company-code string Y Merchant company code
session-id string Y Encrypted session identifier

Request Body

Field Name Data Type Required Description
memberNo string Y Member number
programOutcomeConditions array Y Program outcome conditions list

Program Outcome Conditions Object

Field Name Data Type Required Description
id number Y Program outcome condition identifier
amount number Y Redeem amount

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "branch-code": "__default_branch__", 
  "brand-code": "__default_brand__", 
  "company-code": "__default_company__", 
  "session-id": "ES12qe213eqW2412" 
}

Body:

{ 
  "memberNo": "M0000000001", 
  "programOutcomeConditions": [ 
    { 
      "id": 1, 
      "amount": 1 
    } 
  ] 
}

HTTP Response

Successful Response

Model: Redeem and Mark Used Response

Field Name Data Type Required Description
memberNo string Y Member number
programOutcomeConditions array Y Program outcome conditions result

Program Outcome Conditions Response Object

Field Name Data Type Required Description
id number Y Program outcome condition identifier
amount number Y Redeem amount
sourceTransactionId string Y Redeem source transaction identifier
sourceTransactionDate string Y Redeem transaction datetime
redeemData object Y Redeem transaction result

Redeem Data Object

Field Name Data Type Required Description
successful boolean Y Redeem transaction status
code string Y Response code
message string Y Response message

Sample Success Response

{ 
  "memberNo": "M0000000123", 
  "programOutcomeConditions": [ 
    { 
      "id": 12, 
      "amount": 1, 
      "sourceTransactionId": "M0000000123230425160053631nalksdnkjbkjbnlkbasd", 
      "sourceTransactionDate": "2023-04-25T16:01:23Z", 
      "redeemData": { 
        "successful": true, 
        "code": "00", 
        "message": "success" 
      } 
    } 
  ] 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP03", 
  "message": "Branch not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
401 Unauthorized
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP08 Other error
OP32 Coupon not found
OP33 Program outcome markUse not found
OP34 Cannot mark used, coupon not yet start date
OP35 Cannot mark used, coupon expired
OP36 Coupon has been used
03 Server error
10 Unauthorized

Validation Errors

[ 
  "id should not be empty", 
  "id must be a number conforming to the specified constraints", 
  "id must not be less than 1", 
  "amount should not be empty", 
  "amount must be a number conforming to the specified constraints", 
  "amount must not be less than 1" 
]
List Coupon Wallet 🜲

List Of Active Consents

Retrieve coupon wallets for a member with filtering and pagination support.

HTTP Request

POST /v2.0/consent

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Request Body

Field Name Data Type Required Description
memberNo string Y Member number
campaignCollectionSlugs array N Campaign collection slugs for filtering
couponOutlets array<object> N Outlet filters
couponType array N Coupon types for filtering
displayStatus array N Coupon status for filtering
sort enum N Sort field (created_at, updated_at)
order enum N Sort order (ASC, DESC)
offset number Y Pagination offset
limit number Y Pagination limit

Coupon Outlet Object

Field Name Data Type Required Description
companyCode string Y Company code
brandCode string Y Brand code
branchCode string Y Branch code

Coupon Type Values

  • basic_coupon : Basic coupon
  • cash_coupon : Cash coupon
  • discount_coupon : Discount coupon
  • lucky_draw : Lucky draw
  • mobile_top_up : Mobile top-up
  • premium : Premium coupon
  • product_and_service : Product and service

Display Status Values

  • expired : Expired coupon
  • redeemed : Redeemed coupon
  • used : Used coupon
  • using : Using coupon

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "session-id": "ES12qe213eqW2412" 
}

Body:

{ 
  "memberNo": "M0000000001", 
  "campaignCollectionSlugs": [ 
    "campaign_slug1", 
    "campaign_slug2" 
  ], 
  "couponOutlets": [ 
    { 
      "companyCode": "001", 
      "brandCode": "001", 
      "branchCode": "001" 
    } 
  ], 
  "couponType": [ 
    "basic_coupon", 
    "cash_coupon" 
  ], 
  "displayStatus": [ 
    "redeemed" 
  ], 
  "sort": "created_at", 
  "order": "ASC", 
  "offset": 0, 
  "limit": 10 
}

HTTP Response

Successful Response

Model: Coupon Wallet Response

Field Name Data Type Required Description
successful boolean Y Response status
errorCode string Y Response code
message string Y Response message
httpStatus number Y HTTP status code
data object Y Coupon wallet data

Response Data Models

Meta Object

Field Name Data Type Required Description
count number Y Number of returned items
offset number Y Pagination offset
limit number Y Pagination limit
total number Y Total records

Items Object

Field Name Data Type Required Description
coupon object Y Coupon information
campaign object Y Campaign information

Coupon Object

Field Name Data Type Required Description
collectionId number Y Coupon collection ID
couponId number Y Coupon ID
outcomeTransactionLogId string Y Outcome transaction log ID
expirationDate string Y Coupon expiration datetime
redeemedAt string Y Coupon redeemed datetime
startDate string Y Coupon start datetime
statusId number Y Coupon status ID
statusName string Y Coupon status name
usedExpireDate string | null N Coupon usage expiration datetime
uniqueLink string N Unique coupon link

Campaign Object

Field Name Data Type Required Description
id number Y Campaign ID
imageEn string N Campaign image URL (EN)
imageTh string N Campaign image URL (TH)
nameEn string N Campaign name (EN)
nameTh string N Campaign name (TH)
campaignCollections array Y Campaign collection list
campaignOutcome object Y Campaign outcome information

Sample Success Response

{ 
  "errorCode": "00", 
  "successful": true, 
  "message": "Success", 
  "httpStatus": 200, 
  "data": { 
    "meta": { 
      "count": 1, 
      "offset": 0, 
      "limit": 10, 
      "total": 100 
    }, 
    "items": [ 
      { 
        "coupon": { 
          "collectionId": 1, 
          "couponId": 1, 
          "outcomeTransactionLogId": "681470e89f026b21e8b167fa", 
          "expirationDate": "2025-12-31T16:59:59.000+00:00", 
          "redeemedAt": "2025-12-31T16:59:59.000+00:00", 
          "startDate": "2025-12-31T16:59:59.000+00:00", 
          "statusId": 2, 
          "statusName": "redeemed", 
          "usedExpireDate": null, 
          "uniqueLink": "" 
        }, 
        "campaign": { 
          "id": 1, 
          "imageEn": "https://assets-b-ts-stable.primo-dev.com/8-ec30bfdf6807.jpg", 
          "imageTh": "", 
          "nameEn": "", 
          "nameTh": "ส่วนลดสินค้าที่เข้าร่วมรายการ 10%", 
          "campaignCollections": [ 
            { 
              "id": 1, 
              "slug": "campaign_slug1", 
              "nameTh": "", 
              "nameEn": "hot", 
              "isActive": true 
            } 
          ], 
          "campaignOutcome": { 
            "id": 1, 
            "nameEn": "coupon discount 10%", 
            "nameTh": "", 
            "conditionEn": "", 
            "conditionTh": "", 
            "descriptionEn": "", 
            "descriptionTh": "", 
            "outcomeTypeId": 1 
          } 
        } 
      } 
    ] 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "06", 
  "message": [ 
    "memberNo should not be empty", 
    "limit must not be less than 1" 
  ], 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Validation error

Error Codes

Error Code Description
OP08 Other error
06 Validation error

Validation Errors

[ 
  "memberNo should not be empty", 
  "memberNo must be a string", 
  "memberNo must be shorter than or equal to 255 characters", 
  "campaignCollectionSlugs should not be empty", 
  "each value in campaignCollectionSlugs should not be empty", 
  "each value in campaignCollectionSlugs must be a string", 
  "couponOutlets should not be empty", 
  "each value in couponOutlets must contain objects of CouponOutletFilter type", 
  "couponType should not be empty", 
  "each value in couponType should not be empty", 
  "each value in couponType must be one of the following values: basic_coupon, cash_coupon, discount_coupon, lucky_draw, mobile_top_up, premium, product_and_service", 
  "displayStatus should not be empty", 
  "each value in displayStatus should not be empty", 
  "each value in displayStatus must be one of the following values: expired, redeemed, used, using", 
  "limit must be an integer number", 
  "limit must not be less than 1", 
  "offset must be an integer number", 
  "offset must not be less than 0", 
  "order must be one of the following values: ASC, DESC", 
  "sort must be one of the following values: created_at, updated_at", 
  "branchCode should not be empty", 
  "branchCode must be a string", 
  "branchCode must be shorter than or equal to 255 characters", 
  "brandCode should not be empty", 
  "brandCode must be a string", 
  "brandCode must be shorter than or equal to 255 characters", 
  "companyCode should not be empty", 
  "companyCode must be a string", 
  "companyCode must be shorter than or equal to 255 characters" 
]
Get Coupon Wallet 🜲

Get Coupon Wallet by Member

Retrieve a specific coupon wallet detail for a member by using memberNo and outcomeTransactionLogId.

HTTP Request

GET /v2.0/member/wallet?memberNo={memberNo}&outcomeTransactionLogId={outcomeTransactionLogId}&isIncludeOutlet={isIncludeOutlet}

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Query Parameters

Field Name Data Type Required Description
memberNo string Y Member number
outcomeTransactionLogId string Y Outcome transaction log identifier
isIncludeOutlet boolean N Include coupon outlet information in response (true / false)

Sample Request

GET /v2.0/member/wallet?memberNo=M0000000001&outcomeTransactionLogId=681470e89f026b21e8b167fa&isIncludeOutlet=false

Sample Headers

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "session-id": "ES12qe213eqW2412" 
}

HTTP Response

Successful Response

Model: Get Coupon Wallet Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
httpStatus number Y HTTP status code
data object Y Coupon wallet information

Response Data Details

Coupon

Field Name Data Type Required Description
code string Y Coupon code
collectionId number Y Coupon collection identifier
couponId number Y Coupon identifier
outcomeTransactionLogId string Y Outcome transaction log identifier
expirationDate string Y Coupon expiration datetime
redeemedAt string Y Coupon redeemed datetime
startDate string Y Coupon start datetime
statusId number Y Coupon status identifier
statusName string Y Coupon status name
usedExpireDate string | null N Coupon used expiration datetime
uniqueLink string N Unique coupon link
couponOutlets array N Coupon outlet list (returned when isIncludeOutlet=true)

CouponOutlets

Field Name Data Type Required Description
companyCode string Y Company code
brandCode string Y Brand code
branchCode string Y Branch code

Campaign

Field Name Data Type Required Description
id number Y Campaign identifier
imageEn string N Campaign image URL (EN)
imageTh string N Campaign image URL (TH)
nameEn string N Campaign name (EN)
nameTh string N Campaign name (TH)
campaignCollections array Y Campaign collection list
campaignOutcome object Y Campaign outcome information
programOutcomeCondition object Y Program outcome condition information

Coupon Status Mapping

Status ID Status Name
2 redeemed
3 used
4 expired
5 using-expired

Sample Success Response

{ 
  "errorCode": "00", 
  "successful": true, 
  "message": "Success", 
  "httpStatus": 200, 
  "data": { 
    "coupon": { 
      "code": "D1y5tpCZs1", 
      "collectionId": 1, 
      "couponId": 1, 
      "outcomeTransactionLogId": "681470e89f026", 
      "expirationDate": "2025-12-31T16:59:59.000+00:00", 
      "redeemedAt": "2025-12-31T16:59:59.000+00:00", 
      "startDate": "2025-12-31T16:59:59.000+00:00", 
      "statusId": 2, 
      "statusName": "redeemed", 
      "usedExpireDate": null, 
      "uniqueLink": "", 
      "couponOutlets": [ 
        { 
          "companyCode": "001", 
          "brandCode": "001", 
          "branchCode": "001" 
        } 
      ] 
    }, 
    "campaign": { 
      "id": 1, 
      "imageEn": "https://assets-b-ts-stable.primo-dev.com/8-ec30bfdf6807.jpg", 
      "imageTh": "", 
      "nameEn": "", 
      "nameTh": "ส่วนลดสินค้าที่เข้าร่วมรายการ 10%", 
      "campaignCollections": [ 
        { 
          "id": 1, 
          "slug": "campaign_slug1", 
          "nameTh": "", 
          "nameEn": "hot", 
          "isActive": true 
        } 
      ], 
      "campaignOutcome": { 
        "id": 1, 
        "nameEn": "coupon discount 10%", 
        "nameTh": "", 
        "conditionEn": "", 
        "conditionTh": "", 
        "descriptionEn": "", 
        "descriptionTh": "", 
        "outcomeTypeId": 1 
      }, 
      "programOutcomeCondition": { 
        "id": 1, 
        "programId": 1, 
        "programOutcomeAcceptanceId": 1, 
        "programOutcomeAcceptanceTypeId": 1, 
        "programOutcomeCouponDisplayTypeIds": [1, 2, 3, 4], 
        "programOutcomeMarkUse": { 
          "id": 1, 
          "markUseTypeId": 1, 
          "isOwnerOnly": false, 
          "unitTypeId": 1, 
          "validWithinValue": 1 
        } 
      } 
    } 
  } 
}

Error Response

{ 
  "successful": false, 
  "errorCode": "OP32", 
  "message": "Coupon not found", 
  "data": null 
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid request
404 Resource not found
500 Internal server error

Error Codes

Error Code Description
OP32 Coupon not found
OP08 Other error
06 Validation error

Validation Errors

[ 
  "memberNo should not be empty", 
  "memberNo must be shorter than or equal to 255 characters", 
  "memberNo must be a string", 
  "outcomeTransactionLogId should not be empty", 
  "outcomeTransactionLogId must be shorter than or equal to 255 characters", 
  "outcomeTransactionLogId must be a string", 
  "isIncludeOutlet must be one of the following values: true, false" 
]
List Consent 🜲

List Consent

Retrieves a list of available consent records, including their type, version, status, and effective date.

HTTP Request

Get/v2.0/consent

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "session-id": "ES12qe213eqW2412" 
}

HTTP Response

Successful Response

Model: Consent list Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
httpStatus number Y HTTP status code
data object Y Consent Response data

Response Data Models

data Object

Field Name Data Type Required Description
id number Y Unique identifier of the consent record
type string Y Enum:[ commu, privacy, terms ]
slug string Y Unique identifier used to reference the consent version
version string Y Version number of the consent document
specificVersion string Y Enum:[ current, current-and-min, min, next, next-and-min ]
isMin boolean Y Indicates whether this consent version is defined as the minimum version that a member must accept
descriptionUrl string Y URL of the consent document containing the detailed terms and conditions
createdAt string Y Date and time when the consent record was created
createdBy string Y Identifier of the user or system that created the consent record
updatedAt string Y Date and time when the consent record was last updated
updatedBy string Y Identifier of the user or system that last updated the consent record
publishDate string Y Date and time when the consent version is published and becomes effective
consentStatus string Y Enum:[ active, inactive, pending ]
endDate string Y Date and time when the consent version expires or is no longer effective

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": [
    {
      "id": 1,
      "type": "terms",
      "slug": "terms-v1",
      "version": "1.2",
      "specificVersion": "current",
      "isMin": false,
      "descriptionUrl": "https://storage.googleapis.com/cj-consent-description-file/terms/TERM1.2/v1-2.json",
      "createdAt": "2021-01-01T00:00:00.000Z",
      "createdBy": "admin",
      "updatedAt": "2021-06-01T00:00:00.000Z",
      "updatedBy": "admin",
      "publishDate": "2021-01-01T00:00:00.000Z",
      "consentStatus": "active",
      "endDate": "2099-12-31T00:00:00.000Z"
    }
  ]
}

Error Response

{
  "errorCode": "10",
  "message": "Unauthorized",
  "successful": false,
  "display": "พบข้อผิดพลาดในการตรวจสอบสิทธิ์ในการเข้าถึงข้อมูล"
}

Status Codes

HTTP Status Description
200 Request successful
401 Unauthorized
403 Forbidden
404 Consent not found
500 Server error

Error Codes

Error Code Description
OP52 Consent not found
03 Server Error
Get Member Consent 🜲

Get Member Consent Opts

Retrieves the consent options associated with a specific member, including the consent type, version, status, and member's consent preference.

HTTP Request

Get/v2.0/consent/check

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier
memberId string Y Internal member ID
memberNo string Y Member Number

Sample Request

Headers:

{ 
  "authorization": "Bearer U2FsdGVkX1/PcsMSjH8TsFQqwj...", 
  "session-id": "ES12qe213eqW2412" 
  "memberId": "12345" 
  "memberNo": " M00012345" 
}

HTTP Response

Successful Response

Model: Member consent opts Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
data object Y Consent Opt Response data

Response Data Models

data Object

Field Name Data Type Required Description
id number Y Unique identifier of the consent record
type string Y Enum:[ commu, privacy, terms ]
slug string Y Unique identifier used to reference the consent version
version string Y Version number of the consent document
isMandatory boolean Y Indicates whether the consent is mandatory for the member to accept.
grantStatus string Y Enum:[ deleted, granted, not-granted, renewed, withdrew ]
descriptionUrl string Y URL of the consent document containing the detailed terms and conditions
consentStatus string Y Enum:[ active, inactive, pending ]
currentConsentVersion string Y The latest version of the consent currently available to the member
currentConsentId number Y Unique identifier of the latest consent version currently available to the member
minimumConsentVersion string Y The minimum consent version that the member is required to accept
minimumConsentId number Y Unique identifier of the minimum consent version that the member is required to accept
updatedAt string Y Date and time when the consent record was last updated
updatedBy string Y Identifier of the user or system that last updated the consent record
commuChannels object Y Consent Opt Commu Channel

commu channels Object

Field Name Data Type Required Description
id string Y Unique identifier of the commu channels
nameEn string Y commu channels name thai
nameTh string Y commu channels name English

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": [
    {
      "id": 1,
      "type": "commu",
      "slug": "sms",
      "version": "1.1",
      "isMandatory": false,
      "grantStatus": "granted",
      "descriptionUrl": "https://storage.googleapis.com/cj-consent-description-file/commu/v1-1.json",
      "consentStatus": "active",
      "currentConsentVersion": "2.0",
      "currentConsentId": 4,
      "minimumConsentVersion": "1.0",
      "minimumConsentId": 1,
      "updatedAt": "2026-06-08T11:30:00.000Z",
      "updatedBy": "MP-00001",
      "commuChannels": [
        {
          "id": "1",
          "nameEn": "SMS",
          "nameTh": "ข้อความ"
        }
      ]
    }
  ]
}

Error Response

{
  "errorCode": "06",
  "message": "Invalid Data",
  "successful": false,
  "display": "ข้อมูลไม่ถูกต้อง กรุณากรอกใหม่"
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid Data
401 Unauthorized
403 Forbidden
404 Consent not found
500 Server error

Error Codes

Error Code Description
OP54 You should opt in current version
OP01 Data not found
OP53 Member's status isdraft
OP55 Cannot opt out mandatory consents
OP56 You have already granted to this version
OP57 You have already withdrew to this version
03 Server Error
Update Member Consent Opts 🜲

Update (upsert) member consent opts

Creates or updates the consent preferences for a specific member. If an existing consent record is found, it will be updated; otherwise, a new consent record will be created.

HTTP Request

Patch/v2.0/consent/opts

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier
memberId string Y Internal member ID
memberNo string Y Member Number

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
consentOpts object Y Consent Opt Item

Consent Opt Item Object

Field Name Data Type Required Description
id number Y ID of the consent to opt
action string Y Enum: in, out

Sample Request

Headers:

{
  "consentOpts": [
    {
      "id": 1,
      "action": "in"
    }
  ]
}

HTTP Response

Successful Response

Model: Consent opts update Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
data object Y Consent Opt Response data

Response Data Models

data Object

Field Name Data Type Required Description
id number Y Unique identifier of the consent record
type string Y Enum:[ commu, privacy, terms ]
slug string Y Unique identifier used to reference the consent version
version string Y Version number of the consent document
isMandatory boolean Y Indicates whether the consent is mandatory for the member to accept.
grantStatus string Y Enum:[ deleted, granted, not-granted, renewed, withdrew ]
descriptionUrl string Y URL of the consent document containing the detailed terms and conditions
consentStatus string Y Enum:[ active, inactive, pending ]
currentConsentVersion string Y The latest version of the consent currently available to the member
currentConsentId number Y Unique identifier of the latest consent version currently available to the member
minimumConsentVersion string Y The minimum consent version that the member is required to accept
minimumConsentId number Y Unique identifier of the minimum consent version that the member is required to accept
updatedAt string Y Date and time when the consent record was last updated
updatedBy string Y Identifier of the user or system that last updated the consent record
commuChannels object Y Consent Opt Commu Channel

commu channels Object

Field Name Data Type Required Description
id string Y Unique identifier of the commu channels
nameEn string Y commu channels name thai
nameTh string Y commu channels name English

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": [
    {
      "id": 1,
      "type": "commu",
      "slug": "sms",
      "version": "1.1",
      "isMandatory": false,
      "grantStatus": "granted",
      "descriptionUrl": "https://storage.googleapis.com/cj-consent-description-file/commu/v1-1.json",
      "consentStatus": "active",
      "currentConsentVersion": "2.0",
      "currentConsentId": 4,
      "minimumConsentVersion": "1.0",
      "minimumConsentId": 1,
      "updatedAt": "2026-06-08T11:30:00.000Z",
      "updatedBy": "MP-00001",
      "commuChannels": [
        {
          "id": "1",
          "nameEn": "SMS",
          "nameTh": "ข้อความ"
        }
      ]
    }
  ]
}

Error Response

{
  "errorCode": "06",
  "message": "Invalid Data",
  "successful": false,
  "display": "ข้อมูลไม่ถูกต้อง กรุณากรอกใหม่"
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid Data
401 Unauthorized
404 Consent not found
500 Server error

Error Codes

Error Code Description
06 Invalid Data
10 Unauthorized
OP54 You should opt in current version
OP01 Data not found
OP53 Member's status is draft
OP55 Cannot opt out mandatory consents
OP56 You have already granted to this version
OP57 You have already withdrew to this version
03 Server Error
Bind Marketplace 🜲

Bind Member Marketplace Account

Binds a member's account with a marketplace account to establish an association between the member and the external marketplace platform

HTTP Request

POST/v2.0/bind-marketplace

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
identifierField string Y Field used to identify the member, Enum:[ email, member_no, phone ]
identifierValue string Y Value of the specified identifier field used to identify the member
openId string Y Unique identifier of the member from the specified external platform
openIdType string Y Type of external platform associated with the Open ID, Enum:[ PHONE_SHOPIFY, EMAIL_SHOPIFY, SHOPEE, LAZADA, TIKTOK ]
verifyType string Y Verification method used to validate the member's identity , Enum:[ EMAIL_OTP, ORDER_REF, OTP ]
verifyValue string Y Value used for member verification. For ORDER_REF, provide the order reference number; otherwise, provide the request ID
companyCode string Y Unique code identifying the company associated with the member
brandCode string Y Unique code identifying the brand associated with the member
branchCode string Y Unique code identifying the branch associated with the member
isForceUnbind boolean N Indicates whether the existing Open ID binding should be forcibly removed before updating the member's Open ID association

Sample Request

Headers:

{
  "identifierField": "email",
  "identifierValue": "test@example.com",
  "openId": "9193214",
  "openIdType": "PHONE_SHOPIFY",
  "verifyType": "ORDER_REF",
  "verifyValue": "220810QSK8S7BX",
  "companyCode": "primo",
  "brandCode": "xxxx",
  "branchCode": "001",
  "isForceUnbind": false
}

HTTP Response

Successful Response

Model: Bind marketplace Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
data object Y Bind Marketplace Response data

Response Data Models

data Object

Field Name Data Type Required Description
username string Y Username or account identifier of the member's marketplace account
memberId number Y Unique identifier of the member in the CRM system
memberNo string Y Unique member number assigned to the member

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": {
    "username": "MP-00001",
    "memberId": 1,
    "memberNo": "M000000001"
  }
}

Error Response

{
  "errorCode": "06",
  "message": "Invalid Data",
  "successful": false,
  "display": "ข้อมูลไม่ถูกต้อง กรุณากรอกใหม่"
}

Status Codes

HTTP Status Description
201 Request successful
400 Invalid Data
401 Unauthorized
403 Forbidden
404 Member not found
409 Email is not match
422 User has OpenID
500 Server error

Error Codes

Error Code Description
06 Invalid Data
OP53 OTP has expired
OP54 OTP is invalid
OP55 Email OTP is invalid
OP56 Open Id already existed
10 Unauthorized
OP59 Forbidden
OP01 Data not found
OP57 Email is not match
OP58 User has OpenId
03 Server Error
Unbind Open ID 🜲

Unbind Open ID

Removes the existing Open ID association from a member's account to disconnect the member from the linked external platform account

HTTP Request

POST/v2.0/unbind-open-id

Request Header

Field Name Data Type Required Description
authorization string Y Bearer token provided by PRIMO
session-id string Y Encrypted session identifier

Content Body

Content will be in JSON object format which begins with { and ends with }.

Field Name Data Type Required Description
openId string Y Unique identifier of the external platform account to be unbound from the member
openIdType string Y Type of external platform associated with the Open ID, Open id type (EMAIL_SHOPIFY, LAZADA, LINE, PHONE_SHOPIFY, SHOPEE, TIKTOK)

Sample Request

Headers:

{
  "openId": "9193214",
  "openIdType": "PHONE_SHOPIFY"
}

HTTP Response

Successful Response

Model: Unbind open id Response

Field Name Data Type Required Description
errorCode string Y Response code
successful boolean Y Response status
message string Y Response message
data object Y Unbind Open ID Response data

Response Data Models

data Object

Field Name Data Type Required Description
memberId number Y Unique identifier of the member in the CRM system

Sample Success Response

{
  "errorCode": "00",
  "successful": true,
  "message": "Success",
  "data": {
    "memberId": "9193214"
  }

Error Response

{
  "errorCode": "06",
  "message": "Invalid Data",
  "successful": false,
  "display": "ข้อมูลไม่ถูกต้อง กรุณากรอกใหม่"
}

Status Codes

HTTP Status Description
200 Request successful
400 Invalid Data
401 Unauthorized
404 Open Id not found
500 Server error

Error Codes

Error Code Description
06 Invalid Data
OP01 Data not found
OP60 Open Id is not found
10 Unauthorized
03 Server Error