PRIMO OpenAPI Specification
Welcome to the PRIMO OpenAPI 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.
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
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
| 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
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 |
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 |
| 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 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 |
| 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 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 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 |
| orders | 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 |
| pointCurrencyId | number | N | Point currency identifier |
| 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",
"pointCurrencyId": 1,
"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
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 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 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 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 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"
]
List Coupon Wallets
Retrieve coupon wallets for a member with filtering and pagination support.
HTTP Request
POST /v1/member/wallets
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 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"
]