References

TerraCore v0

CreateMemberRequest#

NameMandatoryDescriptionTypeRangeConstraint
nameyesMember namestring[1-100]Not contain special chars (@, # ...)
emailnoMember emailstring[1-50]Follow email format
gendernoGenderstring{F, M, N}
dateOfBirthnoMember dobstring[8-8]yyyy-MM-dd
idCardNumbernoId of identity cardstring[9-12]
passportNumbernoId of passportstring[8-12]
idCitizenNumbernoId of citizen cardstring[12-12]
addressnoMember addressstring[0-200]

MemberInfo#

NameMandatoryDescriptionType
idyesMember loyalty identifierstring
phoneyesMember phonestring
nameyesMember namestring
statusyesMember status (0: inactive, 1: active)integer
pointnoLoyalty point balancelong
tierPointnoThe point of member in tierlong
keepTierTonoThe time that tier will expirelong (timestamp)
accumulationFromnoThe start date of the points accumulation cyclelong (timestamp)
accumulationTonoThe end date of the points accumulation cyclelong (timestamp)
currentTiernoThe current tier informationTierInfo
nextTiernoThe xext tier information(if any)TierInfo

TierInfo#

NameMandatoryDescriptionType
codeyesThe code of tierstring
nameyesThe name of tierstring
minPointyesMinimum point to achieve this tierrinteger

TransactionHistoryQuery#

Query for filtering transactions

NameMandatoryDescriptionTypeConstraint
merchantCodenoFilter by merchant codestring
fromTimenoFilter from timestringYYYY-mm-dd hh:mm:ss
toTimenoFilter to timeintegerYYYY-mm-dd hh:mm:ss
txnTypesnoFilter by transaction typesTransactionType[]
statusnoFilter by statusTransactionStatus
pagenoPageint
pageSizenoPage sizeint

TransactionType#

NameValueDescription
GRANT01Grant points
SPEND02Spend points
RETURN_GRANT03Revert granted points
RETURN_SPEND04Revert spended points
INITIATE05Initial
INITIATE_PROMOTION06Initial by promotion
ISSUE07Issue

TransactionStatus#

NameValueDescription
INIT1Init
INIT_FAILURE2Init failed
NO_ACCOUNTING3No accounting
ACCOUNTING_SUCCESS4Accounting success
ACCOUNTING_FAILURE5Accounting failed
ACCOUNTING6Accounting

TransactionHistoryResult#

NameMandatoryDescriptionType
transactionsyesList of transactionsTransaction[]
pageDatayesFilter from timePageData

Transaction#

NameMandatoryDescriptionTypeConstraint
idyesTransaction idstring
refIdyesTransaction refIdstring
orderCodenoOrder codestring
txnTypeyesTransaction typeTransactionType
subTypeyesSubtypeSubType
accountingTypeyesFilter by statusAccountingType
statusyesFilter by statusTransactionStatus
pointyesPoint amountint
createdAtyesCreated timestamplong
refTimenoRef timelong
createdByyesPoint amountstring
networkIdyesNetwork idlong
networkNameyesNetwork namestring
merchantCodenoMerchant codestring
merchantNamenoMerchant namestring
terminalCodenoTerminal codeString
terminalNamenoTerminal nameString
terminalAddressnoTerminal addressString

SubType#

NameValueDescription
ORDER1Order
DIRECT2Direct
PRIVILEGE3Privilege
ENROLLMENT4Enrollment
RETRY5Retry
NETWORK_IMPORT6Network import
MERCHANT_IMPORT7Merchant import
ADMIN_MANUAL8Admin manual

AccountingType#

NameValueDescription
DEBITDEBIT+ points
CREDITCREDIT- points

PageData#

NameMandatoryDescriptionType
currentPageyesPage numberint
pageSizeyesPage sizeint
totalItemsyesTotal itemsint
totalPageyesTotal pagesint

Error code#

NameDescriptionWhat to do
InvalidParamFormat"param name" invalid formatcheck constraint
ParamOutOfRange"param name" out of rangecheck constraint
MissingParamRequired "param name"check constraint
InvalidParam"param name" invalidcheck if param in allowed list, or recheck auth token
UnauthorizedNo permission to accessrecheck auth token
SubjectNotFound"param/subject" not foundmean user is not a loyalty member yet
SubjectInactive"param/subject" inactivemean user's loyalty account is deactivated yet
Conflict"param/subject" is duplicatedcheck if user phone already exists on same network
otherOther exceptioncheck details in exception message