# Okendo

> Moderate and reply to product reviews, read survey and quiz responses, and manage loyalty points with Okendo.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/okendo

## Actions

### Add tags to review

Tag a review, such as Support Needed or Favorite. Returns all of its tags.

**Inputs**

- Review (`review_id`, text, required): The review.
- Tags (`tags`, list, required): The tags, such as Support Needed. New tags are created as they are added.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "tags": [
      "example"
    ]
  }
}
```

### Adjust points

Add points to or take points from a shopper's balance, recorded as a transaction.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- Points (`points`, number, required): How many points to add. Use a negative number, such as -50, to take points away.
- Reason (for your team) (`internal_reason`, text): Why, as your team sees it in Okendo.
- Note for the shopper (`shopper_note`, text): Why, as the shopper sees it in their points history.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "loyaltyCustomer": {
      "points": {
        "balance": 1
      }
    }
  }
}
```

### Award points for custom action

Award points for an action you track yourself, using a custom way to earn set up in Okendo.

**Inputs**

- Action ID (`action_code`, text, required): The custom way to earn's action ID, shown on it in Okendo.
- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- Value (`value`, number): For a points-per-value rule: the value to multiply by its points, such as an amount spent.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "loyaltyCustomer": {
      "loyaltyCustomerId": "example",
      "points": {
        "balance": 1
      }
    },
    "pointsEarned": 1
  }
}
```

### Enroll shopper in loyalty

Enroll a shopper in your loyalty program, recording which version of its terms they accepted.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- Terms version accepted (`terms_version`, text, required): The version of the loyalty terms the shopper accepted. Get loyalty terms returns the current one.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "dateEnrolled": "example",
    "loyaltyCustomerId": "example",
    "points": {
      "balance": 1
    },
    "status": "example",
    "vipTierId": "example"
  }
}
```

### Find customer by email

Find a customer's Okendo ID from their email address.

**Inputs**

- Email (`email`, text, required): The customer's email address.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "customerId": "example"
  }
}
```

### Get customer

Get a customer's name, email address, location and when they were last active.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's Okendo ID. Use Find customer by email to get it.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "avatarUrl": "example",
    "dateFirstActive": "example",
    "dateLastActive": "example",
    "email": "example",
    "familyName": "example",
    "givenName": "example",
    "location": {
      "country": "example",
      "zoneCode": "example"
    }
  }
}
```

### Get loyalty member

Get a shopper's loyalty status, points balance and VIP tier.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "dateMinimumVipTierExpires": "example",
    "loyaltyCustomerId": "example",
    "minimumVipTierName": "example",
    "points": {
      "balance": 1
    },
    "status": "example",
    "vipTierName": "example"
  }
}
```

### Get loyalty terms

Get your loyalty program's current terms: their version, links and the sentence shoppers agree to.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "acceptTermsAndJoinProgramButtonText": "example",
    "policySentence": {
      "html": "example",
      "template": "example"
    },
    "privacyPolicyUrl": "example",
    "termsAndConditionsUrl": "example",
    "version": "example"
  }
}
```

### Get review

Get a review with its rating, text, reviewer, product, tags and reply.

**Inputs**

- Review (`review_id`, text, required): The review.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "attributesWithRating": [
      {
        "maxLabel": "example",
        "minLabel": "example",
        "title": "example",
        "type": "example",
        "value": 1
      }
    ],
    "body": "example",
    "containsProfanity": true,
    "dateCreated": "example",
    "helpfulCount": 1,
    "isIncentivized": true,
    "isRecommended": true,
    "media": [
      {
        "fullSizeUrl": "example",
        "isHidden": true,
        "largeUrl": "example",
        "streamId": "example",
        "thumbnailUrl": "example",
        "type": "example"
      }
    ],
    "order": {
      "orderId": "example",
      "orderNumber": "example"
    },
    "productAttributes": [
      {
        "title": "example",
        "type": "example",
        "value": "example"
      }
    ],
    "productId": "example",
    "productName": "example",
    "rating": 1,
    "reply": {
      "body": "example",
      "dateCreated": "example",
      "isPrivate": true,
      "rawBody": "example"
    },
    "reviewId": "example",
    "reviewer": {
      "avatarUrl": "example",
      "displayName": "example",
      "email": "example",
      "isVerified": true,
      "location": {
        "country": {
          "code": "example",
          "name": "example"
        },
        "zoneCode": "example"
      },
      "name": "example",
      "verifiedStatus": "example"
    },
    "reward": {
      "description": "example",
      "type": "example",
      "value": "example"
    },
    "sentiment": "example",
    "source": "example",
    "status": "example",
    "subscriberId": "example",
    "tags": [
      "example"
    ],
    "title": "example",
    "unhelpfulCount": 1,
    "variantId": "example",
    "variantName": "example"
  }
}
```

### List customer activity

List what a customer has done, such as writing reviews or earning points, newest first.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's Okendo ID. Use Find customer by email to get it.
- Namespace (`namespace`, text): Only data from this source, such as reviews or loyalty. Leave empty for all.
- Limit (`limit`, number): How many activities to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "activityId": "example",
        "date": "example",
        "namespace": "example",
        "title": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List customer profile data

List what Okendo knows about a customer, grouped by source, such as answers to profile questions.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's Okendo ID. Use Find customer by email to get it.
- Namespace (`namespace`, text): Only data from this source, such as reviews or loyalty. Leave empty for all.
- Limit (`limit`, number): How many profiles to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "namespace": "example",
        "properties": [
          {
            "date": "example",
            "name": "example",
            "value": "example",
            "valueType": "example"
          }
        ]
      }
    ],
    "next_page": "example"
  }
}
```

### List loyalty coupons

List the unused coupons a shopper has from the loyalty program.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- Limit (`limit`, number): How many coupons to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "appliesToCollectionIds": [
          "example"
        ],
        "appliesToProductIds": [
          "example"
        ],
        "code": "example",
        "description": "example",
        "displayType": "example",
        "expiryDate": "example",
        "maximumShipping": 1,
        "minimumPurchase": 1,
        "purchaseType": "example",
        "recurringCycleLimit": 1,
        "value": 1,
        "valueType": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List quiz responses

List the responses to a quiz, with each answer and the products it recommended, newest first.

**Inputs**

- Quiz (`quiz_id`, text, required): The quiz.
- Order (`order_by`, text): Newest responses first (the default) or oldest first. One of: `date desc` (Newest first), `date asc` (Oldest first).
- Limit (`limit`, number): How many responses to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "answeredQuestions": [
          {
            "answer": "example",
            "id": "example",
            "text": "example",
            "type": "example"
          }
        ],
        "channel": "example",
        "customer": {
          "customerId": "example",
          "email": "example"
        },
        "dateCreated": "example",
        "emailMarketingOptIn": true,
        "order": {
          "remoteOrderId": "example"
        },
        "quizId": "example",
        "quizName": "example",
        "quizResponseId": "example",
        "recommendation": {},
        "reward": {
          "description": "example",
          "type": "example",
          "value": "example"
        }
      }
    ],
    "next_page": "example"
  }
}
```

### List quizzes

List your product quizzes, with their status and how many responses each has.

**Inputs**

- Order (`order_by`, text): Newest quizzes first (the default) or oldest first. One of: `date desc` (Newest first), `date asc` (Oldest first).
- Limit (`limit`, number): How many quizzes to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "dateCreated": "example",
        "dateUpdated": "example",
        "name": "example",
        "quizId": "example",
        "responseCount": 1,
        "status": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List reviews

List your store's reviews, newest first, by moderation status and tag.

**Inputs**

- Status (`status`, text): Only reviews with this moderation status. Okendo's default is published reviews. One of: `approved` (Published), `pending` (Waiting for moderation), `rejected`.
- Tags (`tags`, list): Only reviews with any of these tags, up to 10.
- Order (`order_by`, text): Newest first (the default), oldest first, or by star rating. One of: `date desc` (Newest first), `date asc` (Oldest first), `rating desc` (Highest rating first), `rating asc` (Lowest rating first).
- Limit (`limit`, number): How many reviews to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "attributesWithRating": [
          {
            "maxLabel": "example",
            "minLabel": "example",
            "title": "example",
            "type": "example",
            "value": 1
          }
        ],
        "body": "example",
        "containsProfanity": true,
        "dateCreated": "example",
        "helpfulCount": 1,
        "isIncentivized": true,
        "isRecommended": true,
        "media": [
          {
            "fullSizeUrl": "example",
            "isHidden": true,
            "largeUrl": "example",
            "streamId": "example",
            "thumbnailUrl": "example",
            "type": "example"
          }
        ],
        "order": {
          "orderId": "example",
          "orderNumber": "example"
        },
        "productAttributes": [
          {
            "title": "example",
            "type": "example",
            "value": "example"
          }
        ],
        "productId": "example",
        "productName": "example",
        "rating": 1,
        "reply": {
          "body": "example",
          "dateCreated": "example",
          "isPrivate": true,
          "rawBody": "example"
        },
        "reviewId": "example",
        "reviewer": {
          "avatarUrl": "example",
          "displayName": "example",
          "email": "example",
          "isVerified": true,
          "location": {
            "country": {
              "code": "example",
              "name": "example"
            },
            "zoneCode": "example"
          },
          "name": "example",
          "verifiedStatus": "example"
        },
        "reward": {
          "description": "example",
          "type": "example",
          "value": "example"
        },
        "sentiment": "example",
        "source": "example",
        "status": "example",
        "subscriberId": "example",
        "tags": [
          "example"
        ],
        "title": "example",
        "unhelpfulCount": 1,
        "variantId": "example",
        "variantName": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List rewards

List the rewards shoppers can spend points on, optionally with one shopper's amounts.

**Inputs**

- Email (`email`, text): The shopper's email address. Leave empty for none.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "expiresAfterDays": 1,
        "minimumPurchase": 1,
        "purchaseType": "example",
        "recurringCycleLimit": 1,
        "redemptionRuleId": "example",
        "reward": {
          "awardVia": "example",
          "points": 1,
          "value": 1
        },
        "type": "example"
      }
    ]
  }
}
```

### List survey responses

List the responses to a survey, with each answer and who gave it, newest first.

**Inputs**

- Survey (`survey_id`, text, required): The survey.
- Order (`order_by`, text): Newest responses first (the default) or oldest first. One of: `date desc` (Newest first), `date asc` (Oldest first).
- Limit (`limit`, number): How many responses to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "answeredQuestions": [
          {
            "answer": "example",
            "id": "example",
            "text": "example",
            "type": "example"
          }
        ],
        "channel": "example",
        "customer": {
          "customerId": "example",
          "email": "example"
        },
        "dateCreated": "example",
        "emailMarketingOptIn": true,
        "isArchived": true,
        "order": {
          "remoteOrderId": "example"
        },
        "reward": {
          "description": "example",
          "type": "example",
          "value": "example"
        },
        "surveyId": "example",
        "surveyName": "example",
        "surveyResponseId": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List surveys

List your surveys, including archived ones, with how many responses each has.

**Inputs**

- Order (`order_by`, text): Newest surveys first (the default) or oldest first. One of: `date desc` (Newest first), `date asc` (Oldest first).
- Limit (`limit`, number): How many surveys to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "dateCreated": "example",
        "dateLastResponse": "example",
        "dateUpdated": "example",
        "isArchived": true,
        "name": "example",
        "responseCount": 1,
        "surveyId": "example"
      }
    ],
    "next_page": "example"
  }
}
```

### List tags

List the tags you can put on reviews.

**Inputs**

- Starts with (`prefix`, text): Only tags that start with this text.
- Limit (`limit`, number): How many tags to return, from 1 to 100. Okendo's default is 25. From 1 to 100.
- Next page (`next_page`, text): To read the next page, the next_page value a previous list step returned.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      "example"
    ],
    "next_page": "example"
  }
}
```

### List ways to earn

List the ways shoppers earn points or rewards, optionally as one shopper sees them.

**Inputs**

- Email (`email`, text): The shopper's email address. Leave empty for none.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "amount": 1,
        "awardVia": "example",
        "expiresAfterDays": 1,
        "minimumPurchase": 1,
        "purchaseType": "example",
        "type": "example",
        "value": 1,
        "waitTimeDays": 1
      }
    ]
  }
}
```

### Moderate review

Publish or reject a review, or send it back to waiting for moderation.

**Inputs**

- Review (`review_id`, text, required): The review.
- Status (`status`, text, required): The review's new moderation status. One of: `approved` (Published), `pending` (Waiting for moderation), `rejected`.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "attributesWithRating": [
      {
        "maxLabel": "example",
        "minLabel": "example",
        "title": "example",
        "type": "example",
        "value": 1
      }
    ],
    "body": "example",
    "containsProfanity": true,
    "dateCreated": "example",
    "helpfulCount": 1,
    "isIncentivized": true,
    "isRecommended": true,
    "media": [
      {
        "fullSizeUrl": "example",
        "isHidden": true,
        "largeUrl": "example",
        "streamId": "example",
        "thumbnailUrl": "example",
        "type": "example"
      }
    ],
    "order": {
      "orderId": "example",
      "orderNumber": "example"
    },
    "productAttributes": [
      {
        "title": "example",
        "type": "example",
        "value": "example"
      }
    ],
    "productId": "example",
    "productName": "example",
    "rating": 1,
    "reply": {
      "body": "example",
      "dateCreated": "example",
      "isPrivate": true,
      "rawBody": "example"
    },
    "reviewId": "example",
    "reviewer": {
      "avatarUrl": "example",
      "displayName": "example",
      "email": "example",
      "isVerified": true,
      "location": {
        "country": {
          "code": "example",
          "name": "example"
        },
        "zoneCode": "example"
      },
      "name": "example",
      "verifiedStatus": "example"
    },
    "reward": {
      "description": "example",
      "type": "example",
      "value": "example"
    },
    "sentiment": "example",
    "source": "example",
    "status": "example",
    "subscriberId": "example",
    "tags": [
      "example"
    ],
    "title": "example",
    "unhelpfulCount": 1,
    "variantId": "example",
    "variantName": "example"
  }
}
```

### Redeem points for reward

Spend a shopper's points on a reward, such as a coupon or store credit.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- Reward (`reward_id`, text, required): The reward to redeem.
- Points to spend (`variable_points`, number): For a reward of variable value: how many points to spend. At least 1.
- Reward value (`variable_value`, number): For a reward of variable value: the value those points buy. At least 0.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "loyaltyCustomer": {
      "points": {
        "balance": 1
      }
    },
    "reward": {
      "code": "example",
      "status": "example",
      "storeCredit": {
        "balanceAmount": "example",
        "transactionAmount": "example"
      },
      "type": "example"
    },
    "transactionDetails": {
      "amount": 1
    }
  }
}
```

### Remove tags from review

Take tags off a review. Returns the tags it still has.

**Inputs**

- Review (`review_id`, text, required): The review.
- Tags (`tags`, list, required): The tags to take off. Tags the review doesn't have are ignored.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "tags": [
      "example"
    ]
  }
}
```

### Reply to review

Reply to a review, publicly or privately, and optionally email the reviewer.

**Inputs**

- Review (`review_id`, text, required): The review.
- Reply (`reply`, text, required): What to reply. You can use Markdown.
- Private reply (`is_private`, true/false): Keep the reply private instead of showing it under the review.
- Email the reviewer (`email_reviewer`, true/false): Email the reply to the reviewer.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "attributesWithRating": [
      {
        "maxLabel": "example",
        "minLabel": "example",
        "title": "example",
        "type": "example",
        "value": 1
      }
    ],
    "body": "example",
    "containsProfanity": true,
    "dateCreated": "example",
    "helpfulCount": 1,
    "isIncentivized": true,
    "isRecommended": true,
    "media": [
      {
        "fullSizeUrl": "example",
        "isHidden": true,
        "largeUrl": "example",
        "streamId": "example",
        "thumbnailUrl": "example",
        "type": "example"
      }
    ],
    "order": {
      "orderId": "example",
      "orderNumber": "example"
    },
    "productAttributes": [
      {
        "title": "example",
        "type": "example",
        "value": "example"
      }
    ],
    "productId": "example",
    "productName": "example",
    "rating": 1,
    "reply": {
      "body": "example",
      "dateCreated": "example",
      "isPrivate": true,
      "rawBody": "example"
    },
    "reviewId": "example",
    "reviewer": {
      "avatarUrl": "example",
      "displayName": "example",
      "email": "example",
      "isVerified": true,
      "location": {
        "country": {
          "code": "example",
          "name": "example"
        },
        "zoneCode": "example"
      },
      "name": "example",
      "verifiedStatus": "example"
    },
    "reward": {
      "description": "example",
      "type": "example",
      "value": "example"
    },
    "sentiment": "example",
    "source": "example",
    "status": "example",
    "subscriberId": "example",
    "tags": [
      "example"
    ],
    "title": "example",
    "unhelpfulCount": 1,
    "variantId": "example",
    "variantName": "example"
  }
}
```

### Set minimum VIP tier

Keep a shopper in at least this VIP tier, until a date or for good.

**Inputs**

- Email (`email`, text): The shopper's email address. Give this or the loyalty ID.
- Loyalty ID (`loyalty_customer_id`, text): The shopper's loyalty ID, instead of their email address.
- VIP tier (`tier_name`, text, required): The VIP tier's name, exactly as in Okendo, such as Gold.
- Until (`expires`, date and time): When the minimum tier ends. Leave empty to keep it for good.

**Outputs**

- `data` (object): The response from Okendo.

**Example output**

```json
{
  "data": {
    "dateMinimumVipTierExpires": "example",
    "minimumVipTierName": "example",
    "vipTierName": "example"
  }
}
```
