Skip to content

docs(includes): loyalty methods specifics #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/includes/_loyalty.apply.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ curl --header "Content-Type: application/json" \

`POST https://<%= config[:api_endpoint] %>/loyalty/checkout/apply`

When clients proceed to the payment step, execute the this method to charge for bonuses and get the final payment value.
When clients proceed to the payment step, execute the method to charge for bonuses and get the final payment value.

If `charge_bonuses` parameter is missing or `false`, only offers and discounts will be applied. Bonuses will not be calculated in the final order value and charged.

Expand Down
4 changes: 4 additions & 0 deletions source/includes/_loyalty.cancel.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ If client failed to pay for order and don't plan to proceed, you have to cancel

Just send the same payload to `loyalty/checkout/cancel` to refund bonuses.

Specifics:

1. Cancels a specific event bonus if it has the cancellable flag
2. Only works with bonuses created via event_bonus
4 changes: 4 additions & 0 deletions source/includes/_loyalty.change.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ When client partially returns some products from an order, it's needed to recalc

Send an updated list of client's cart to refund bonuses and calculate how much money to refund.

Specifics:

1. Recalculates the order in case of product returns or replacements
2. Adjusts money and bonuses, including possible refunds
3. Returns the delta (negative for refund, positive for extra payment)
5 changes: 5 additions & 0 deletions source/includes/_loyalty.estimate.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ If `charge_bonuses` is missing or `false`, only offers and discounts will be app

When clients proceed to the payment step, execute the next method `apply` to charge for bonuses and get the final payment value.

Specifics:

1. This is a safe, read-only method that simulates order calculation — no bonuses are deducted
2. You can safely call this method multiple times for the same cart

4 changes: 4 additions & 0 deletions source/includes/_loyalty.event_bonus.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ curl 'https://<%= config[:api_endpoint] %>/loyalty/basic/event_bonus' \

Method increase bonuses. This method is used to increase user bonuses that aren't related to an order. It can be any action, for example, registration in the mobile applications. Bonuses added by this method have activated status and can be used immediately.

Specifics:

1. Bonuses are immediately confirmed and available.

### HTTP Request

`POST https://<%= config[:api_endpoint] %>/loyalty/basic/event_bonus`
Expand Down
4 changes: 4 additions & 0 deletions source/includes/_loyalty.event_bonus_history.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ curl 'https://<%= config[:api_endpoint] %>/loyalty/bonuses/event_bonus_history?s

Method return member's bonuses history which were created with `loyalty/basic/event_bonus` method only. This allows to cancel some bonuses by ID using `loyalty/bonuses/cancel` method.

Specifics:

1. Indicates which bonuses can be canceled via the cancel method (cancellable: true)

### HTTP Request

`GET https://<%= config[:api_endpoint] %>/loyalty/bonuses/event_bonus_history`
Expand Down
6 changes: 6 additions & 0 deletions source/includes/_loyalty.join.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ curl --header "Content-Type: application/json" \

Method to register a user as a member of loyalty program. Server-to-server integration method only.

Specifics:

1. The user is registered even if the loyalty program is currently inactive
2. If the user is already a member, the method still returns "success": true and doesn't change their data
3. At least the phone field is required; email is optional but should be passed if available

### Query Parameters

| Parameter | Required | Description |
Expand Down
6 changes: 6 additions & 0 deletions source/includes/_loyalty.quit.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ curl --header "Content-Type: application/json" \

Method deletes loyalty member profile from database by identifier (phone number). Loyalty level and bonuses will not be deleted immediately to prevent accident data loss, but member won't be able to receive membership benefits on next purchases.

Specifics:

1. After this method is called, the user is no longer considered a loyalty member
2. Bonuses and loyalty level are preserved internally for safety but become inactive and inaccessible for use


### Query Parameters

| Parameter | Required | Description |
Expand Down
5 changes: 5 additions & 0 deletions source/includes/_loyalty.status.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ curl https://<%= config[:api_endpoint] %>/loyalty/members/status?shop_id=...&sho

Returns the member's status in the loyalty program: member or not, current level and level expiration date.

Specifics:

1. The method only accepts the identifier as a phone number (email is not supported)
2. If the user is not a member, the response is still "success": true with "member": false

### Query Parameters

| Parameter | Required | Description |
Expand Down