diff --git a/404.html b/404.html index cdf4d8cf9..f54c9ce70 100644 --- a/404.html +++ b/404.html @@ -17,7 +17,7 @@ -

Centrapay Event Types

The following table details the eventTypes that Centrapay uses internally. Integrators should NOT create events with these eventTypes.

+

Centrapay Event Types

The following table details the eventTypes that Centrapay generates internally. Integrators should NOT create events with these eventTypes.

diff --git a/api/data-types/index.html b/api/data-types/index.html index 2f328dc40..7553f8bb1 100644 --- a/api/data-types/index.html +++ b/api/data-types/index.html @@ -17,7 +17,7 @@ -
+ + + + +

+Guides +

Loyalty Programs

A Loyalty Program is a collection of Promotions that reward accounts for completing certain actions. For example, a Loyalty Program could be set up to reward accounts with points every time they make a payment.

+

To set up a Loyalty Program and issue rewards, there are a few required steps:

+ +
+

Loading Diagram...

+
+ +
    +
  1. Create Loyalty Program  API  +
      +
    • A Loyalty Program is a container for the Promotions that will be created in step 2.
    • +
    +
  2. +
  3. Create Promotion(s)  API  +
      +
    • Promotions contain conditions, a target, and a reward.
    • +
    +
  4. +
  5. Create Account  API  +
      +
    • This will be the account that will participate in the Loyalty Program.
    • +
    +
  6. +
  7. Create Loyalty Program Membership for Account  API  +
      +
    • This will onboard the Account to the Loyalty Program. A Promotion Membership will be created for each Promotion under the Loyalty Program.
    • +
    • A Promotion Membership contains the progress for the Account towards completing the Promotion.
    • +
    +
  8. +
  9. Create Events  API  +
      +
    • When Accounts perform actions, Events are generated that are used to increment progress on their Promotion Memberships. Centrapay generates some Events internally but you can use this API if you’d like to send us Events from your own application.
    • +
    +
  10. +
  11. List Promotion Memberships for Account  API  +
      +
    • This will return the Account’s Promotion Memberships along with their current progress and whether they have been completed or not.
    • +
    +
  12. +
+

Events

+

When an Event is generated for an Account, Centrapay will look up all the Promotion Memberships under that Account and check the conditions for each one. If the Event satisfies the conditions, the Promotion Membership progress will be incremented.

+
Example Event
{
+  "id": "L75M3L56N2PtBSt8g7uXLU",
+  "accountId": "Jaim1Cu1Q55uooxSens6yk",
+  "type": "payment-request:paid",
+  "data": {
+    "paymentAmount": "1000"
+  },
+  "idempotencyKey": "login-de32dd90-b46c-11ea-93c3-83a333b86e7b",
+  "createdAt": "2020-05-01T12:30:00.000Z",
+  "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey"
+}
+

Creating Promotions

+

eventType

+

eventType must match the type on the Event that will cause the Promotion Membership to be incremented.

+

There are some native Event types that Centrapay generates that you can use. They can be found here  API .

+

You should NOT send us Events with a type that matches any of those in the linked page above. You CAN create Promotions with those Event types if you wish to reward Accounts for native Centrapay Events.

+

Conditions

+

Conditions are used to define certain values an Event needs to have in order to progress the Promotion Membership. Promotions can have zero or more conditions defined. Every condition must be satisfied by the Event before the Promotion Membership progress is incremented.

+

Each condition has a field property that references a field in the data object on the Event. The operator and value properties complete the condition, e.g. “greater-than” “5”.

+

Target

+

This defines how much progress is needed to complete the Promotion Membership.

+

Rewards

+

Rewards are given to the Account when the Promotion Membership is completed. The Account will receive ALL the rewards defined on the Promotion.

\ No newline at end of file diff --git a/guides/merchant-integration-barcode-flow/index.html b/guides/merchant-integration-barcode-flow/index.html index 71b94348a..10cc23556 100644 --- a/guides/merchant-integration-barcode-flow/index.html +++ b/guides/merchant-integration-barcode-flow/index.html @@ -18,7 +18,7 @@