Activities

Point activities and transactions

Get point transactions with pagination

get

Retrieve paginated list of point transactions/activities

Query parameters
shopifyCustomerIdstringOptional

Filter by Shopify customer ID

customerIdstringOptional

Filter by internal customer ID

beforestringOptional

Cursor for pagination (before) - Firestore document ID

afterstringOptional

Cursor for pagination (after) - Firestore document ID

limitinteger · min: 1 · max: 1000Optional

Number of transactions per page

Default: 10
typestring · enumOptional

Filter by activity type

Possible values:
eventstringOptional

Filter by specific event

sourcestring · enumOptional

Filter by activity source

Possible values:
created_at_minstring · date-timeOptional

Filter activities created after this date

created_at_maxstring · date-timeOptional

Filter activities created before this date

orderstring · enumOptional

Sort order for results

Default: createdAt_descPossible values:
hasCountbooleanOptional

Include total count in response (may increase response time)

Default: false
Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Responses
200

Paginated list of transactions

application/json
Responseall of
get
GET /rest_api/v2/transactions HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Accept: */*
200

Paginated list of transactions

{
  "success": true,
  "data": [
    {
      "id": "act_abc123",
      "shopId": "shop_xyz789",
      "customerId": "cust_def456",
      "shopifyCustomerId": 7801029525739,
      "email": "[email protected]",
      "content": "Award points via REST API",
      "type": "earnPoint",
      "source": "rest_api",
      "event": "earn_point_rest_api",
      "oldPoint": 50,
      "newPoint": 150,
      "programId": "prog_abc123",
      "programTitle": "Manual Point Award",
      "priceRuleId": "text",
      "discountId": "text",
      "couponCode": "text",
      "orderId": "text",
      "orderName": "text",
      "orderNumber": 1,
      "orderCurrency": "text",
      "earnBy": "text",
      "rateMoney": 1,
      "earnPoint": 100,
      "spendPoint": 1,
      "referralCustomerEmail": "text",
      "referredCustomerEmail": "text",
      "milestoneOrder": 1,
      "isPendingPointPlaceOrder": true,
      "refundPendingPoint": 1,
      "pendingPointUntil": "2025-09-09T02:46:08.038Z",
      "adminNote": "text",
      "userNote": "text",
      "reason": "text",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "meta": {
    "pagination": {
      "hasNext": true,
      "hasPre": true,
      "total": 1,
      "totalPage": 1
    }
  },
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Get transaction by ID

get

Retrieve details of a specific point transaction

Path parameters
transactionIdstringRequired

Transaction ID

Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Responses
200

Transaction details

application/json
Responseall of
get
GET /rest_api/v2/transactions/{transactionId} HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Accept: */*
200

Transaction details

{
  "success": true,
  "data": {
    "id": "act_abc123",
    "shopId": "shop_xyz789",
    "customerId": "cust_def456",
    "shopifyCustomerId": 7801029525739,
    "email": "[email protected]",
    "content": "Award points via REST API",
    "type": "earnPoint",
    "source": "rest_api",
    "event": "earn_point_rest_api",
    "oldPoint": 50,
    "newPoint": 150,
    "programId": "prog_abc123",
    "programTitle": "Manual Point Award",
    "priceRuleId": "text",
    "discountId": "text",
    "couponCode": "text",
    "orderId": "text",
    "orderName": "text",
    "orderNumber": 1,
    "orderCurrency": "text",
    "earnBy": "text",
    "rateMoney": 1,
    "earnPoint": 100,
    "spendPoint": 1,
    "referralCustomerEmail": "text",
    "referredCustomerEmail": "text",
    "milestoneOrder": 1,
    "isPendingPointPlaceOrder": true,
    "refundPendingPoint": 1,
    "pendingPointUntil": "2025-09-09T02:46:08.038Z",
    "adminNote": "text",
    "userNote": "text",
    "reason": "text",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  },
  "meta": {},
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Deduct points from customer

post

Remove points from a customer's account

Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Body
shopifyCustomerIdstringRequired
pointintegerRequired
adminNotestringOptional
userNotestringOptional
reasonstringOptional
Responses
200

Points deducted successfully

application/json
post
POST /rest_api/v2/transactions/points/deduct HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "shopifyCustomerId": "text",
  "point": 1,
  "adminNote": "text",
  "userNote": "text",
  "reason": "text"
}
200

Points deducted successfully

{
  "success": true,
  "data": {},
  "meta": {},
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Award points to customer

post

Add points to a customer's account

Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Body
shopifyCustomerIdstringRequired
pointintegerRequired
adminNotestringOptional
userNotestringOptional
reasonstringOptional
Responses
200

Points awarded successfully

application/json
post
POST /rest_api/v2/transactions/points/award HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "shopifyCustomerId": "text",
  "point": 1,
  "adminNote": "text",
  "userNote": "text",
  "reason": "text"
}
200

Points awarded successfully

{
  "success": true,
  "data": {},
  "meta": {},
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Adjust customer points

post

Adjust customer points (positive or negative adjustment)

Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Body
shopifyCustomerIdstringRequired
pointintegerRequired
adminNotestringOptional
userNotestringOptional
reasonstringOptional
Responses
200

Points adjusted successfully

application/json
post
POST /rest_api/v2/transactions/points/adjust HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "shopifyCustomerId": "text",
  "point": 1,
  "adminNote": "text",
  "userNote": "text",
  "reason": "text"
}
200

Points adjusted successfully

{
  "success": true,
  "data": {},
  "meta": {},
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Reset customer points

post

Set customer points to a specific value

Header parameters
X-Joy-Loyalty-App-KeystringRequired

App ID of your shop which retrieved from the Settings page

Example: {{appKey}}
X-Joy-Loyalty-Secret-KeystringRequired

Secret Key of your shop which retrieved from the Settings page

Example: {{secretKey}}
Body
shopifyCustomerIdstringRequired
pointintegerRequired
adminNotestringOptional
userNotestringOptional
reasonstringOptional
Responses
200

Points reset successfully

application/json
post
POST /rest_api/v2/transactions/points/reset HTTP/1.1
Host: dev-api.joy.so
X-Joy-Loyalty-App-Key: text
X-Joy-Loyalty-Secret-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "shopifyCustomerId": "text",
  "point": 1,
  "adminNote": "text",
  "userNote": "text",
  "reason": "text"
}
200

Points reset successfully

{
  "success": true,
  "data": {},
  "meta": {},
  "message": "Operation completed successfully",
  "timestamp": "2023-07-28T07:27:54.123Z"
}

Last updated