Skip to content

Commit

Permalink
v5.0.0: Reopen session endpoint, loyalty data integration endpoints a…
Browse files Browse the repository at this point in the history
…nd loyalty card management endpoints (#17)

## Summary

### Integration API
- [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)
- [Get customer's loyalty points](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances)
- [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions)
- [Get card's point balances](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardBalances)
- [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions)
- [Link customer profile to card](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/linkLoyaltyCardToProfile)

### Management API
- [Add points to card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/addLoyaltyCardPoints)
- [Deduct points from card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/deductLoyaltyCardPoints)
- [Delete loyalty card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/deleteLoyaltyCard)
- [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards)
- [Get loyalty card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCard)
- [Import loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/importLoyaltyCards)
- [Transfer card data](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/transferLoyaltyCard)
- [Update loyalty card status](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/updateLoyaltyCard)
- [List card's transactions](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactionLogs)
- [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions)

- [Export customer loyalty balances](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalances) -- please note deprecation notice blow
- [Export all card transaction logs](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/exportLoyaltyCardBalances)
- [Export card's ledger log](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/exportLoyaltyCardLedger)


## ⚠️ Deprecation Notice: Export customer loyalty balance to CSV endpoint
Please note that the [Export customer loyalty balance to CSV](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalance) endpoint is getting deprecated, please update your code to point at the new [Export customer loyalty balances](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalances)

## Commit summary
* Initial commit
* Add Makefile for ease of testing purposes
* Update MGMT code sample to use management key token
  • Loading branch information
altJake authored May 3, 2023
1 parent 4d51b5d commit a6e7140
Show file tree
Hide file tree
Showing 1,022 changed files with 54,265 additions and 12,464 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DEFAULT_GOAL := testenv

.PHONY: testenv
testenv:
docker run \
--rm -it \
-v $(PWD):/sdk \
-w /sdk \
composer:1.8 \
/bin/bash -c "composer i; /bin/bash"
154 changes: 115 additions & 39 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "talon-one/talon-one-client",
"type": "library",
"version": "4.0.1",
"description": "Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerSession](https://docs.talon.one/integration-api/#operation/updateCustomerSessionV2) endpoint is `https://mycompany.talon.one/v2/customer_sessions/{Id}`",
"version": "5.0.0",
"description": "Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`",
"keywords": [
"talon-one",
"openapi-generator",
Expand Down
526 changes: 435 additions & 91 deletions docs/Api/IntegrationApi.md

Large diffs are not rendered by default.

3,388 changes: 2,555 additions & 833 deletions docs/Api/ManagementApi.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/Model/Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. |
**created** | [**\DateTime**](\DateTime.md) | The exact moment this entity was created. |
**modified** | [**\DateTime**](\DateTime.md) | The exact moment this entity was last modified. |
**id** | **int** | Internal ID of this entity. |
**created** | [**\DateTime**](\DateTime.md) | The time this entity was created. |
**modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. |
**companyName** | **string** | |
**domainName** | **string** | Subdomain Name for yourcompany.talon.one. |
**state** | **string** | State of the account (active, deactivated). |
Expand Down
8 changes: 4 additions & 4 deletions docs/Model/AccountAdditionalCost.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. |
**created** | [**\DateTime**](\DateTime.md) | The exact moment this entity was created. |
**id** | **int** | Internal ID of this entity. |
**created** | [**\DateTime**](\DateTime.md) | The time this entity was created. |
**accountId** | **int** | The ID of the account that owns this entity. |
**name** | **string** | The additional cost name that will be used in API requests and Talang. E.g. if `name == \"shipping\"` then you would set the shipping additional cost by including an `additionalCosts.shipping` property in your request payload. |
**name** | **string** | The internal name used in API requests. |
**title** | **string** | The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique. |
**description** | **string** | A description of this additional cost. |
**subscribedApplicationsIds** | **int[]** | A list of the IDs of the applications that are subscribed to this additional cost. | [optional]
**type** | **string** | The type of additional cost. The following options can be chosen: - `session`: Additional cost will be added per session, - `item`: Additional cost will be added per item, - `both`: Additional cost will be added per item and session. | [optional] [default to 'session']
**type** | **string** | The type of additional cost. Possible value: - `session`: Additional cost will be added per session. - `item`: Additional cost will be added per item. - `both`: Additional cost will be added per item and session. | [optional] [default to 'session']

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

Expand Down
16 changes: 16 additions & 0 deletions docs/Model/AccountDashboardStatistic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# # AccountDashboardStatistic

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**revenue** | [**\TalonOne\Client\Model\AccountDashboardStatisticRevenue[]**](AccountDashboardStatisticRevenue.md) | Aggregated statistic for account revenue. | [optional]
**discounts** | [**\TalonOne\Client\Model\AccountDashboardStatisticDiscount[]**](AccountDashboardStatisticDiscount.md) | Aggregated statistic for account discount. | [optional]
**loyaltyPoints** | [**\TalonOne\Client\Model\AccountDashboardStatisticLoyaltyPoints[]**](AccountDashboardStatisticLoyaltyPoints.md) | Aggregated statistic for account loyalty points. | [optional]
**referrals** | [**\TalonOne\Client\Model\AccountDashboardStatisticReferrals[]**](AccountDashboardStatisticReferrals.md) | Aggregated statistic for account referrals. | [optional]
**apiCalls** | [**\TalonOne\Client\Model\AccountDashboardStatisticApiCalls[]**](AccountDashboardStatisticApiCalls.md) | Aggregated statistic for the number of account API calls. | [optional]
**campaigns** | [**\TalonOne\Client\Model\AccountDashboardStatisticCampaigns**](AccountDashboardStatisticCampaigns.md) | |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


12 changes: 12 additions & 0 deletions docs/Model/AccountDashboardStatisticApiCalls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # AccountDashboardStatisticApiCalls

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **float** | Total number of API calls received. |
**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


12 changes: 12 additions & 0 deletions docs/Model/AccountDashboardStatisticCampaigns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # AccountDashboardStatisticCampaigns

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**live** | **int** | Number of campaigns that are active and live (across all Applications). |
**endingSoon** | **int** | Campaigns with a schedule ending in 7 days or with only 10% of budget left. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


13 changes: 13 additions & 0 deletions docs/Model/AccountDashboardStatisticDiscount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# # AccountDashboardStatisticDiscount

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **float** | Total discount value redeemed by users. |
**average** | **float** | Average discount percentage. |
**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


12 changes: 12 additions & 0 deletions docs/Model/AccountDashboardStatisticLoyaltyPoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # AccountDashboardStatisticLoyaltyPoints

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **float** | Total loyalty points earned by users. |
**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


12 changes: 12 additions & 0 deletions docs/Model/AccountDashboardStatisticReferrals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # AccountDashboardStatisticReferrals

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **float** | Total number of referrals initiated by users. |
**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


13 changes: 13 additions & 0 deletions docs/Model/AccountDashboardStatisticRevenue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# # AccountDashboardStatisticRevenue

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **float** | All revenue that went through the client's shop (including purchases that didn’t trigger an effect). |
**influenced** | **float** | The revenue that was created by a purchase that triggered an effect (excluding web hooks, notifications). |
**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


2 changes: 1 addition & 1 deletion docs/Model/AddFreeItemEffectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sku** | **string** | SKU of the item that needs to be added. |
**name** | **string** | The name/description of the effect. |
**name** | **string** | The name / description of the effect |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

Expand Down
18 changes: 18 additions & 0 deletions docs/Model/AddLoyaltyPoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# # AddLoyaltyPoints

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**points** | **float** | Amount of loyalty points. |
**name** | **string** | Name / reason for the point addition. | [optional]
**validityDuration** | **string** | The time format is either: - `immediate` or, - an **integer** followed by one letter indicating the time unit. Examples: `immediate`, `30s`, `40m`, `1h`, `5D`, `7W`, `10M`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks and months. Signifies the end of the day, week, or month. If passed, `validUntil` should be omitted. | [optional]
**validUntil** | [**\DateTime**](\DateTime.md) | Date and time when points should expire. The value should be provided in RFC 3339 format. If passed, `validityDuration` should be omitted. | [optional]
**pendingDuration** | **string** | The amount of time before the points are considered valid. The time format is either: - `immediate` or, - an **integer** followed by one letter indicating the time unit. Examples: `immediate`, `30s`, `40m`, `1h`, `5D`, `7W`, `10M`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks and months. Signifies the end of the day, week, or month. | [optional]
**pendingUntil** | [**\DateTime**](\DateTime.md) | Date and time after the points are considered valid. The value should be provided in RFC 3339 format. If passed, `pendingDuration` should be omitted. | [optional]
**subledgerId** | **string** | ID of the subledger the points are added to. If there is no existing subledger with this ID, the subledger is created automatically. | [optional]
**applicationId** | **int** | ID of the Application that is connected to the loyalty program. It is displayed in your Talon.One deployment URL. | [optional]

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


6 changes: 4 additions & 2 deletions docs/Model/AddLoyaltyPointsEffectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | The reason of the point addition. |
**name** | **string** | The name / description of this loyalty point addition. |
**programId** | **int** | The ID of the loyalty program where these points were added. |
**subLedgerId** | **string** | The ID of the subledger within the loyalty program where these points were added. |
**value** | **float** | The amount of points that were added. |
Expand All @@ -15,7 +15,9 @@ Name | Type | Description | Notes
**transactionUUID** | **string** | The identifier of this addition in the loyalty ledger. |
**cartItemPosition** | **float** | The index of the item in the cart items list on which the loyal points addition should be applied. | [optional]
**cartItemSubPosition** | **float** | The sub position is triggered when application flattening is enabled. It indicates to which item the loyalty points addition applies, for cart items with `quantity` > 1. | [optional]
**cardIdentifier** | **string** | The card on which these points were added. | [optional]
**cardIdentifier** | **string** | The alphanumeric identifier of the loyalty card. | [optional]
**bundleIndex** | **int** | The position of the bundle in a list of item bundles created from the same bundle definition. | [optional]
**bundleName** | **string** | The name of the bundle definition. | [optional]

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

Expand Down
12 changes: 12 additions & 0 deletions docs/Model/AddedDeductedPointsNotificationPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # AddedDeductedPointsNotificationPolicy

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | Notification name. |
**scopes** | **string[]** | |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)


8 changes: 4 additions & 4 deletions docs/Model/Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. |
**created** | [**\DateTime**](\DateTime.md) | The exact moment this entity was created. |
**modified** | [**\DateTime**](\DateTime.md) | The exact moment this entity was last modified. |
**id** | **int** | Internal ID of this entity. |
**created** | [**\DateTime**](\DateTime.md) | The time this entity was created. |
**modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. |
**accountId** | **int** | The ID of the account that owns this entity. |
**name** | **string** | The name of this application. |
**description** | **string** | A longer description of the application. | [optional]
Expand All @@ -19,7 +19,7 @@ Name | Type | Description | Notes
**exclusiveCampaignsStrategy** | **string** | The strategy used when choosing exclusive campaigns for evaluation. | [optional] [default to 'listOrder']
**defaultDiscountScope** | **string** | The default scope to apply `setDiscount` effects on if no scope was provided with the effect. | [optional]
**enableCascadingDiscounts** | **bool** | Indicates if discounts should cascade for this Application. | [optional]
**enableFlattenedCartItems** | **bool** | Indicates if cart items of quantity larger than one should be separated into different items of quantity one. See [the docs](https://docs.talon.one/docs/product/campaigns/campaign-evaluation/#flattened-cart-items). | [optional]
**enableFlattenedCartItems** | **bool** | Indicates if cart items of quantity larger than one should be separated into different items of quantity one. See the [docs](https://docs.talon.one/docs/product/campaigns/campaign-evaluation#flattening). | [optional]
**attributesSettings** | [**\TalonOne\Client\Model\AttributesSettings**](AttributesSettings.md) | | [optional]
**sandbox** | **bool** | Indicates if this is a live or sandbox Application. | [optional]
**enablePartialDiscounts** | **bool** | Indicates if this Application supports partial discounts. | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/ApplicationApiHealth.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**summary** | **string** | One-word summary of the health of the API connection of an application. |
**summary** | **string** | One-word summary of the health of the API connection of an application. Possible values are: - `OK`: The Application has received only successful API requests in the last 5 minutes. - `WARNING`: The Application received at least one failed request in the last 50 minutes. - `ERROR`: More than 50% of received requests failed. - `CRITICAL`: All received requests failed. - `NONE`: During the last 5 minutes, the Application hasn't recorded any integration API requests. |
**lastUsed** | [**\DateTime**](\DateTime.md) | time of last request relevant to the API health test. |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
Loading

0 comments on commit a6e7140

Please sign in to comment.