@kard-financial/sdk 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/transactions/client/Client.d.ts +28 -1
  3. package/dist/cjs/api/resources/transactions/client/Client.js +28 -1
  4. package/dist/cjs/api/resources/transactions/types/CoreMerchant.d.ts +4 -0
  5. package/dist/cjs/api/resources/transactions/types/CoreMerchant.js +3 -0
  6. package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.d.ts +25 -0
  7. package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.js +3 -0
  8. package/dist/cjs/api/resources/transactions/types/CoreTransactionRequest.d.ts +6 -0
  9. package/dist/cjs/api/resources/transactions/types/CoreTransactionRequest.js +3 -0
  10. package/dist/cjs/api/resources/transactions/types/FinancialInstitution.d.ts +6 -0
  11. package/dist/cjs/api/resources/transactions/types/FinancialInstitution.js +3 -0
  12. package/dist/cjs/api/resources/transactions/types/MatchedTransactionsAttributes.d.ts +1 -1
  13. package/dist/cjs/api/resources/transactions/types/Transactions.d.ts +4 -1
  14. package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +3 -3
  15. package/dist/cjs/api/resources/transactions/types/TransactionsRequestBody.d.ts +27 -0
  16. package/dist/cjs/api/resources/transactions/types/index.d.ts +4 -0
  17. package/dist/cjs/api/resources/transactions/types/index.js +4 -0
  18. package/dist/cjs/api/resources/users/resources/attributions/client/Client.d.ts +19 -0
  19. package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +95 -0
  20. package/dist/cjs/api/resources/users/resources/attributions/client/index.d.ts +1 -1
  21. package/dist/cjs/api/resources/users/resources/attributions/client/index.js +15 -0
  22. package/dist/cjs/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.d.ts +11 -0
  23. package/dist/cjs/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.js +3 -0
  24. package/dist/cjs/api/resources/users/resources/attributions/client/requests/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/users/resources/attributions/client/requests/index.js +2 -0
  26. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.d.ts +5 -0
  27. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.js +8 -0
  28. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferIncluded.d.ts +2 -0
  29. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferIncluded.js +3 -0
  30. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.ts +20 -0
  31. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponse.js +3 -0
  32. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.d.ts +6 -0
  33. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.js +3 -0
  34. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponseData.d.ts +6 -0
  35. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponseData.js +3 -0
  36. package/dist/cjs/api/resources/users/resources/attributions/types/EventCode.d.ts +1 -0
  37. package/dist/cjs/api/resources/users/resources/attributions/types/EventCode.js +1 -0
  38. package/dist/cjs/api/resources/users/resources/attributions/types/OfferMedium.d.ts +1 -0
  39. package/dist/cjs/api/resources/users/resources/attributions/types/OfferMedium.js +1 -0
  40. package/dist/cjs/api/resources/users/resources/attributions/types/index.d.ts +5 -0
  41. package/dist/cjs/api/resources/users/resources/attributions/types/index.js +5 -0
  42. package/dist/cjs/api/resources/users/resources/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/users/resources/index.js +4 -3
  44. package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +2 -4
  45. package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +2 -4
  46. package/dist/cjs/version.d.ts +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/BaseClient.mjs +2 -2
  49. package/dist/esm/api/resources/transactions/client/Client.d.mts +28 -1
  50. package/dist/esm/api/resources/transactions/client/Client.mjs +28 -1
  51. package/dist/esm/api/resources/transactions/types/CoreMerchant.d.mts +4 -0
  52. package/dist/esm/api/resources/transactions/types/CoreMerchant.mjs +2 -0
  53. package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +25 -0
  54. package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.mjs +2 -0
  55. package/dist/esm/api/resources/transactions/types/CoreTransactionRequest.d.mts +6 -0
  56. package/dist/esm/api/resources/transactions/types/CoreTransactionRequest.mjs +2 -0
  57. package/dist/esm/api/resources/transactions/types/FinancialInstitution.d.mts +6 -0
  58. package/dist/esm/api/resources/transactions/types/FinancialInstitution.mjs +2 -0
  59. package/dist/esm/api/resources/transactions/types/MatchedTransactionsAttributes.d.mts +1 -1
  60. package/dist/esm/api/resources/transactions/types/Transactions.d.mts +4 -1
  61. package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +3 -3
  62. package/dist/esm/api/resources/transactions/types/TransactionsRequestBody.d.mts +27 -0
  63. package/dist/esm/api/resources/transactions/types/index.d.mts +4 -0
  64. package/dist/esm/api/resources/transactions/types/index.mjs +4 -0
  65. package/dist/esm/api/resources/users/resources/attributions/client/Client.d.mts +19 -0
  66. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +95 -0
  67. package/dist/esm/api/resources/users/resources/attributions/client/index.d.mts +1 -1
  68. package/dist/esm/api/resources/users/resources/attributions/client/index.mjs +1 -1
  69. package/dist/esm/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.d.mts +11 -0
  70. package/dist/esm/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.mjs +2 -0
  71. package/dist/esm/api/resources/users/resources/attributions/client/requests/index.d.mts +1 -0
  72. package/dist/esm/api/resources/users/resources/attributions/client/requests/index.mjs +1 -0
  73. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.d.mts +5 -0
  74. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.mjs +5 -0
  75. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncluded.d.mts +2 -0
  76. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncluded.mjs +2 -0
  77. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.mts +20 -0
  78. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.mjs +2 -0
  79. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.d.mts +6 -0
  80. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.mjs +2 -0
  81. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseData.d.mts +6 -0
  82. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseData.mjs +2 -0
  83. package/dist/esm/api/resources/users/resources/attributions/types/EventCode.d.mts +1 -0
  84. package/dist/esm/api/resources/users/resources/attributions/types/EventCode.mjs +1 -0
  85. package/dist/esm/api/resources/users/resources/attributions/types/OfferMedium.d.mts +1 -0
  86. package/dist/esm/api/resources/users/resources/attributions/types/OfferMedium.mjs +1 -0
  87. package/dist/esm/api/resources/users/resources/attributions/types/index.d.mts +5 -0
  88. package/dist/esm/api/resources/users/resources/attributions/types/index.mjs +5 -0
  89. package/dist/esm/api/resources/users/resources/index.d.mts +1 -0
  90. package/dist/esm/api/resources/users/resources/index.mjs +1 -0
  91. package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +2 -4
  92. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +2 -4
  93. package/dist/esm/version.d.mts +1 -1
  94. package/dist/esm/version.mjs +1 -1
  95. package/package.json +1 -1
  96. package/reference.md +92 -5
@@ -15,6 +15,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
18
21
  var __importStar = (this && this.__importStar) || (function () {
19
22
  var ownKeys = function(o) {
20
23
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -32,11 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
32
35
  return result;
33
36
  };
34
37
  })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.uploads = exports.rewards = exports.auth = exports.attributions = void 0;
40
+ __exportStar(require("./attributions/client/requests/index.js"), exports);
40
41
  exports.attributions = __importStar(require("./attributions/index.js"));
41
42
  __exportStar(require("./attributions/types/index.js"), exports);
42
43
  exports.auth = __importStar(require("./auth/index.js"));
@@ -14,8 +14,7 @@ export declare class RewardsClient {
14
14
  /**
15
15
  * Retrieve national brand offers that a specified user is eligible for. Call this endpoint to build out your
16
16
  * [targeted offers UX experience](/2024-10-01/api/getting-started#b-discover-a-lapsed-customer-clo). Local offers details
17
- * can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations) endpoint with the
18
- * `includeLocal` query parameter.<br/>
17
+ * can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations).<br/>
19
18
  * <b>Required scopes:</b> `rewards:read`
20
19
  *
21
20
  * @param {KardApi.OrganizationId} organizationId
@@ -38,8 +37,7 @@ export declare class RewardsClient {
38
37
  offers(organizationId: KardApi.OrganizationId, userId: KardApi.UserId, request?: KardApi.users.GetOffersByUserRequest, requestOptions?: RewardsClient.RequestOptions): core.HttpResponsePromise<KardApi.users.OffersResponseObject>;
39
38
  private __offers;
40
39
  /**
41
- * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. To
42
- * include local locations, add the `includeLocal` query parameter to your api call. Use this endpoint to build
40
+ * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. Use this endpoint to build
43
41
  * out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
44
42
  * that Longitude and Latitude fields are prioritized over State, City and Zipcode and are the recommended search
45
43
  * pattern.<br/>
@@ -58,8 +58,7 @@ class RewardsClient {
58
58
  /**
59
59
  * Retrieve national brand offers that a specified user is eligible for. Call this endpoint to build out your
60
60
  * [targeted offers UX experience](/2024-10-01/api/getting-started#b-discover-a-lapsed-customer-clo). Local offers details
61
- * can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations) endpoint with the
62
- * `includeLocal` query parameter.<br/>
61
+ * can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations).<br/>
63
62
  * <b>Required scopes:</b> `rewards:read`
64
63
  *
65
64
  * @param {KardApi.OrganizationId} organizationId
@@ -186,8 +185,7 @@ class RewardsClient {
186
185
  });
187
186
  }
188
187
  /**
189
- * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. To
190
- * include local locations, add the `includeLocal` query parameter to your api call. Use this endpoint to build
188
+ * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. Use this endpoint to build
191
189
  * out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
192
190
  * that Longitude and Latitude fields are prioritized over State, City and Zipcode and are the recommended search
193
191
  * pattern.<br/>
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.0";
1
+ export declare const SDK_VERSION = "2.2.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.0";
4
+ exports.SDK_VERSION = "2.2.1";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@kard-financial/sdk",
9
- "X-Fern-SDK-Version": "2.1.0",
10
- "User-Agent": "@kard-financial/sdk/2.1.0",
9
+ "X-Fern-SDK-Version": "2.2.1",
10
+ "User-Agent": "@kard-financial/sdk/2.2.1",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -15,7 +15,8 @@ export declare class TransactionsClient {
15
15
  * Call this endpoint to send all transactions made by all your enrolled users in your rewards program. The request body will depend on the transaction type.<br/>
16
16
  * Please use the correct type when calling the endpoint:
17
17
  * - `transaction`: These incoming transactions will be processed and matched by the Kard system. Learn more about the [Transaction CLO Matching](https://github.com/kard-financial/kard-postman#c-transaction-clo-matching) flow here.
18
- * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.<br/>
18
+ * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.
19
+ * - `coreTransaction`: For transactions from core banking systems with limited card-level data.<br/>
19
20
  *
20
21
  * <b>Required scopes:</b> `transaction:write`<br/>
21
22
  * <b>Note:</b> `Maximum of 500 transactions can be created per request`.
@@ -150,6 +151,32 @@ export declare class TransactionsClient {
150
151
  * }
151
152
  * }]
152
153
  * })
154
+ *
155
+ * @example
156
+ * await client.transactions.create("organization-123", {
157
+ * data: [{
158
+ * type: "coreTransaction",
159
+ * id: "core_txn_98765432109876543210",
160
+ * attributes: {
161
+ * userId: "6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
162
+ * transactionId: "CORE-TXN-2024-001234",
163
+ * amount: 4599,
164
+ * currency: "USD",
165
+ * description: "WALMART SUPERCENTER",
166
+ * direction: "DEBIT",
167
+ * status: "SETTLED",
168
+ * settledDate: "2024-10-15T14:30:00Z",
169
+ * authorizationDate: "2024-10-15T14:25:00Z",
170
+ * financialInstitution: {
171
+ * rssdId: "852218",
172
+ * name: "First National Bank"
173
+ * },
174
+ * merchant: {
175
+ * addrZipcode: "75001"
176
+ * }
177
+ * }
178
+ * }]
179
+ * })
153
180
  */
154
181
  create(organizationId: KardApi.OrganizationId, request: KardApi.TransactionsRequestBody, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<KardApi.TransactionsResponse>;
155
182
  private __create;
@@ -22,7 +22,8 @@ export class TransactionsClient {
22
22
  * Call this endpoint to send all transactions made by all your enrolled users in your rewards program. The request body will depend on the transaction type.<br/>
23
23
  * Please use the correct type when calling the endpoint:
24
24
  * - `transaction`: These incoming transactions will be processed and matched by the Kard system. Learn more about the [Transaction CLO Matching](https://github.com/kard-financial/kard-postman#c-transaction-clo-matching) flow here.
25
- * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.<br/>
25
+ * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.
26
+ * - `coreTransaction`: For transactions from core banking systems with limited card-level data.<br/>
26
27
  *
27
28
  * <b>Required scopes:</b> `transaction:write`<br/>
28
29
  * <b>Note:</b> `Maximum of 500 transactions can be created per request`.
@@ -157,6 +158,32 @@ export class TransactionsClient {
157
158
  * }
158
159
  * }]
159
160
  * })
161
+ *
162
+ * @example
163
+ * await client.transactions.create("organization-123", {
164
+ * data: [{
165
+ * type: "coreTransaction",
166
+ * id: "core_txn_98765432109876543210",
167
+ * attributes: {
168
+ * userId: "6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
169
+ * transactionId: "CORE-TXN-2024-001234",
170
+ * amount: 4599,
171
+ * currency: "USD",
172
+ * description: "WALMART SUPERCENTER",
173
+ * direction: "DEBIT",
174
+ * status: "SETTLED",
175
+ * settledDate: "2024-10-15T14:30:00Z",
176
+ * authorizationDate: "2024-10-15T14:25:00Z",
177
+ * financialInstitution: {
178
+ * rssdId: "852218",
179
+ * name: "First National Bank"
180
+ * },
181
+ * merchant: {
182
+ * addrZipcode: "75001"
183
+ * }
184
+ * }
185
+ * }]
186
+ * })
160
187
  */
161
188
  create(organizationId, request, requestOptions) {
162
189
  return core.HttpResponsePromise.fromPromise(this.__create(organizationId, request, requestOptions));
@@ -0,0 +1,4 @@
1
+ export interface CoreMerchant {
2
+ /** Merchant address zip code associated with transaction */
3
+ addrZipcode: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,25 @@
1
+ import type * as KardApi from "../../../index.mjs";
2
+ export interface CoreTransactionAttributes {
3
+ /** The ID of the user as defined on the issuers system */
4
+ userId: string;
5
+ /** The transaction ID from the core banking system */
6
+ transactionId: string;
7
+ /** Transaction amount in cents */
8
+ amount: number;
9
+ /** Currency of transaction in ISO 4217 alpha-3 format */
10
+ currency: string;
11
+ /** Description of transaction - usually includes merchant and other key details on transaction */
12
+ description: string;
13
+ /** The direction in which the funds flow - DEBIT or CREDIT */
14
+ direction: KardApi.DirectionType;
15
+ /** Transaction status (always SETTLED for core transactions) */
16
+ status: "SETTLED";
17
+ /** Timestamp when transaction was settled. Date string should be in ISO 8601 format i.e.'YYYY-MM-DDThh:mm:ss.sTZD' where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. 1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z */
18
+ settledDate: string;
19
+ /** Timestamp for transaction authorization. Date string should be in ISO 8601 format i.e.'YYYY-MM-DDThh:mm:ss.sTZD' where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. 1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z */
20
+ authorizationDate: string;
21
+ /** Financial institution details */
22
+ financialInstitution: KardApi.FinancialInstitution;
23
+ /** Merchant details */
24
+ merchant: KardApi.CoreMerchant;
25
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ import type * as KardApi from "../../../index.mjs";
2
+ export interface CoreTransactionRequest {
3
+ /** Unique identifier for the transaction event. This <b>must</b> be unique for each distinct event sent to the API. */
4
+ id: string;
5
+ attributes: KardApi.CoreTransactionAttributes;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface FinancialInstitution {
2
+ /** Research, Statistics, Supervision, Discount ID (RSSD) - Federal Reserve identifier for financial institutions */
3
+ rssdId: string;
4
+ /** Name of the financial institution */
5
+ name: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -8,7 +8,7 @@ export interface MatchedTransactionsAttributes {
8
8
  subtotal?: number;
9
9
  /** Description of transaction - usually includes merchant and other key details on transaction */
10
10
  description: string;
11
- /** Timestamp for transaction event. Date string should be in ISO format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z` */
11
+ /** Timestamp for transaction event. Date string should be in ISO 8601 format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z` */
12
12
  authorizationDate: string;
13
13
  /** The ID of the Kard offer to which the transaction was matched. If this field is omitted, the transaction will be considered unmatched to any Kard offer. This field **must** be omitted when the `paymentType` is `UNKNOWN` and neither an orderId nor a `cardLastFour` is supplied. */
14
14
  matchedOfferId?: string;
@@ -1,5 +1,5 @@
1
1
  import type * as KardApi from "../../../index.mjs";
2
- export type Transactions = KardApi.Transactions.Transaction | KardApi.Transactions.MatchedTransaction;
2
+ export type Transactions = KardApi.Transactions.Transaction | KardApi.Transactions.MatchedTransaction | KardApi.Transactions.CoreTransaction;
3
3
  export declare namespace Transactions {
4
4
  interface Transaction extends KardApi.TransactionsRequest {
5
5
  type: "transaction";
@@ -7,4 +7,7 @@ export declare namespace Transactions {
7
7
  interface MatchedTransaction extends KardApi.MatchedTransactionsRequest {
8
8
  type: "matchedTransaction";
9
9
  }
10
+ interface CoreTransaction extends KardApi.CoreTransactionRequest {
11
+ type: "coreTransaction";
12
+ }
10
13
  }
@@ -18,11 +18,11 @@ export interface TransactionsAttributes {
18
18
  mcc?: string;
19
19
  /** Name of processor associated with transaction */
20
20
  coreProviderId?: string;
21
- /** Timestamp for <b>REVERSED, RETURNED, DECLINED</b> transaction events; <b>REQUIRED</b> for transactions with <b>REVERSED, RETURNED, DECLINED</b> status. Date string should be in ISO format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00` OR `1994-11-05T08:15:30Z` */
21
+ /** Timestamp for <b>REVERSED, RETURNED, DECLINED</b> transaction events; <b>REQUIRED</b> for transactions with <b>REVERSED, RETURNED, DECLINED</b> status. Date string should be in ISO 8601 format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00` OR `1994-11-05T08:15:30Z` */
22
22
  transactionDate?: string;
23
- /** Timestamp for <b>APPROVED</b> transaction event; <b>REQUIRED</b> for transactions with <b>APPROVED</b> status, and <b>HIGHLY RECOMMENDED</b> to include for transactions with a <b>SETTLED</b> status. Date string should be in ISO format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z` */
23
+ /** Timestamp for <b>APPROVED</b> transaction event; <b>REQUIRED</b> for transactions with <b>APPROVED</b> status, and <b>HIGHLY RECOMMENDED</b> to include for transactions with a <b>SETTLED</b> status. Date string should be in ISO 8601 format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z` */
24
24
  authorizationDate?: string;
25
- /** Timestamp for <b>SETTLED</b> transaction event, <b>REQUIRED</b> for transactions with <b>SETTLED</b> status. Date string should be in ISO format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00` OR `1994-11-05T08:15:30Z` */
25
+ /** Timestamp for <b>SETTLED</b> transaction event, <b>REQUIRED</b> for transactions with <b>SETTLED</b> status. Date string should be in ISO 8601 format i.e.`'YYYY-MM-DDThh:mm:ss.sTZD'` where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. `1994-11-05T08:15:30-05:00` OR `1994-11-05T08:15:30Z` */
26
26
  settledDate?: string;
27
27
  /** Merchant details */
28
28
  merchant?: KardApi.Merchant;
@@ -120,6 +120,32 @@ import type * as KardApi from "../../../index.mjs";
120
120
  * }
121
121
  * }]
122
122
  * }
123
+ *
124
+ * @example
125
+ * {
126
+ * data: [{
127
+ * type: "coreTransaction",
128
+ * id: "core_txn_98765432109876543210",
129
+ * attributes: {
130
+ * userId: "6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
131
+ * transactionId: "CORE-TXN-2024-001234",
132
+ * amount: 4599,
133
+ * currency: "USD",
134
+ * description: "WALMART SUPERCENTER",
135
+ * direction: KardApi.DirectionType.Debit,
136
+ * status: "SETTLED",
137
+ * settledDate: "2024-10-15T14:30:00Z",
138
+ * authorizationDate: "2024-10-15T14:25:00Z",
139
+ * financialInstitution: {
140
+ * rssdId: "852218",
141
+ * name: "First National Bank"
142
+ * },
143
+ * merchant: {
144
+ * addrZipcode: "75001"
145
+ * }
146
+ * }
147
+ * }]
148
+ * }
123
149
  */
124
150
  export interface TransactionsRequestBody {
125
151
  /**
@@ -127,6 +153,7 @@ export interface TransactionsRequestBody {
127
153
  * Use `type` to distinguish between the two:
128
154
  * - `transaction`: For transactions requiring processing and matching by the Kard system.
129
155
  * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.
156
+ * - `coreTransaction`: For transactions from core banking systems with limited card-level data.
130
157
  */
131
158
  data: KardApi.Transactions[];
132
159
  }
@@ -5,12 +5,16 @@ export * from "./AuditResponseData.mjs";
5
5
  export * from "./AuditStatus.mjs";
6
6
  export * from "./CardNetwork.mjs";
7
7
  export * from "./CommissionEarnedDetails.mjs";
8
+ export * from "./CoreMerchant.mjs";
9
+ export * from "./CoreTransactionAttributes.mjs";
10
+ export * from "./CoreTransactionRequest.mjs";
8
11
  export * from "./CreateAuditMultiStatusResponse.mjs";
9
12
  export * from "./CreateAuditRequestBody.mjs";
10
13
  export * from "./CreateAuditRequestDataUnion.mjs";
11
14
  export * from "./CreateAuditResponseBody.mjs";
12
15
  export * from "./CreateAuditResponseDataUnion.mjs";
13
16
  export * from "./DirectionType.mjs";
17
+ export * from "./FinancialInstitution.mjs";
14
18
  export * from "./FraudulentTransactionAttributes.mjs";
15
19
  export * from "./FraudulentTransactionData.mjs";
16
20
  export * from "./FraudulentTransactionObject.mjs";
@@ -5,12 +5,16 @@ export * from "./AuditResponseData.mjs";
5
5
  export * from "./AuditStatus.mjs";
6
6
  export * from "./CardNetwork.mjs";
7
7
  export * from "./CommissionEarnedDetails.mjs";
8
+ export * from "./CoreMerchant.mjs";
9
+ export * from "./CoreTransactionAttributes.mjs";
10
+ export * from "./CoreTransactionRequest.mjs";
8
11
  export * from "./CreateAuditMultiStatusResponse.mjs";
9
12
  export * from "./CreateAuditRequestBody.mjs";
10
13
  export * from "./CreateAuditRequestDataUnion.mjs";
11
14
  export * from "./CreateAuditResponseBody.mjs";
12
15
  export * from "./CreateAuditResponseDataUnion.mjs";
13
16
  export * from "./DirectionType.mjs";
17
+ export * from "./FinancialInstitution.mjs";
14
18
  export * from "./FraudulentTransactionAttributes.mjs";
15
19
  export * from "./FraudulentTransactionData.mjs";
16
20
  export * from "./FraudulentTransactionObject.mjs";
@@ -56,4 +56,23 @@ export declare class AttributionsClient {
56
56
  */
57
57
  create(organizationId: KardApi.OrganizationId, userId: KardApi.UserId, request: KardApi.users.CreateAttributionRequestObject, requestOptions?: AttributionsClient.RequestOptions): core.HttpResponsePromise<KardApi.users.CreateAttributionResponse>;
58
58
  private __create;
59
+ /**
60
+ * Record when a user activates an offer. Creates an attribution event with eventCode=ACTIVATE and medium=CTA.
61
+ * Optionally include the offer data by passing `include=offer`.
62
+ *
63
+ * @param {KardApi.OrganizationId} organizationId
64
+ * @param {KardApi.UserId} userId
65
+ * @param {string} offerId - The unique identifier of the offer being activated
66
+ * @param {KardApi.users.ActivateOfferRequest} request
67
+ * @param {AttributionsClient.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link KardApi.UnauthorizedError}
70
+ * @throws {@link KardApi.InternalServerError}
71
+ * @throws {@link KardApi.InvalidRequest}
72
+ *
73
+ * @example
74
+ * await client.users.attributions.activate("organization-123", "user-123", "offer-456")
75
+ */
76
+ activate(organizationId: KardApi.OrganizationId, userId: KardApi.UserId, offerId: string, request?: KardApi.users.ActivateOfferRequest, requestOptions?: AttributionsClient.RequestOptions): core.HttpResponsePromise<KardApi.users.ActivateOfferResponse>;
77
+ private __activate;
59
78
  }
@@ -127,4 +127,99 @@ export class AttributionsClient {
127
127
  }
128
128
  });
129
129
  }
130
+ /**
131
+ * Record when a user activates an offer. Creates an attribution event with eventCode=ACTIVATE and medium=CTA.
132
+ * Optionally include the offer data by passing `include=offer`.
133
+ *
134
+ * @param {KardApi.OrganizationId} organizationId
135
+ * @param {KardApi.UserId} userId
136
+ * @param {string} offerId - The unique identifier of the offer being activated
137
+ * @param {KardApi.users.ActivateOfferRequest} request
138
+ * @param {AttributionsClient.RequestOptions} requestOptions - Request-specific configuration.
139
+ *
140
+ * @throws {@link KardApi.UnauthorizedError}
141
+ * @throws {@link KardApi.InternalServerError}
142
+ * @throws {@link KardApi.InvalidRequest}
143
+ *
144
+ * @example
145
+ * await client.users.attributions.activate("organization-123", "user-123", "offer-456")
146
+ */
147
+ activate(organizationId, userId, offerId, request = {}, requestOptions) {
148
+ return core.HttpResponsePromise.fromPromise(this.__activate(organizationId, userId, offerId, request, requestOptions));
149
+ }
150
+ __activate(organizationId_1, userId_1, offerId_1) {
151
+ return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
153
+ const { supportedComponents, include } = request;
154
+ const _queryParams = {};
155
+ if (supportedComponents != null) {
156
+ if (Array.isArray(supportedComponents)) {
157
+ _queryParams.supportedComponents = supportedComponents.map((item) => item);
158
+ }
159
+ else {
160
+ _queryParams.supportedComponents = supportedComponents;
161
+ }
162
+ }
163
+ if (include != null) {
164
+ if (Array.isArray(include)) {
165
+ _queryParams.include = include.map((item) => item);
166
+ }
167
+ else {
168
+ _queryParams.include = include;
169
+ }
170
+ }
171
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
172
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
173
+ const _response = yield core.fetcher({
174
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/attributions/offers/${core.url.encodePathParam(offerId)}/activate`),
175
+ method: "POST",
176
+ headers: _headers,
177
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
178
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
179
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
180
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
181
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
182
+ logging: this._options.logging,
183
+ });
184
+ if (_response.ok) {
185
+ return { data: _response.body, rawResponse: _response.rawResponse };
186
+ }
187
+ if (_response.error.reason === "status-code") {
188
+ switch (_response.error.statusCode) {
189
+ case 401:
190
+ throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
191
+ case 500:
192
+ throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
193
+ case 400:
194
+ throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
195
+ default:
196
+ throw new errors.KardApiError({
197
+ statusCode: _response.error.statusCode,
198
+ body: _response.error.body,
199
+ rawResponse: _response.rawResponse,
200
+ });
201
+ }
202
+ }
203
+ switch (_response.error.reason) {
204
+ case "non-json":
205
+ throw new errors.KardApiError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.rawBody,
208
+ rawResponse: _response.rawResponse,
209
+ });
210
+ case "body-is-null":
211
+ throw new errors.KardApiError({
212
+ statusCode: _response.error.statusCode,
213
+ rawResponse: _response.rawResponse,
214
+ });
215
+ case "timeout":
216
+ throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/attributions/offers/{offerId}/activate.");
217
+ case "unknown":
218
+ throw new errors.KardApiError({
219
+ message: _response.error.errorMessage,
220
+ rawResponse: _response.rawResponse,
221
+ });
222
+ }
223
+ });
224
+ }
130
225
  }
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,11 @@
1
+ import type * as KardApi from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ActivateOfferRequest {
7
+ /** UI component types to include in the offer response (when include=offer). */
8
+ supportedComponents?: KardApi.users.ComponentType | KardApi.users.ComponentType[];
9
+ /** Related resources to include in the response. Allowed value is `offer`. */
10
+ include?: KardApi.users.ActivateOfferIncludeOption | KardApi.users.ActivateOfferIncludeOption[];
11
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { ActivateOfferRequest } from "./ActivateOfferRequest.mjs";
@@ -0,0 +1,5 @@
1
+ /** Options for what to include in the activate offer response */
2
+ export declare const ActivateOfferIncludeOption: {
3
+ readonly Offer: "offer";
4
+ };
5
+ export type ActivateOfferIncludeOption = (typeof ActivateOfferIncludeOption)[keyof typeof ActivateOfferIncludeOption];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Options for what to include in the activate offer response */
3
+ export const ActivateOfferIncludeOption = {
4
+ Offer: "offer",
5
+ };
@@ -0,0 +1,2 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ export type ActivateOfferIncluded = KardApi.users.OfferDataUnion | KardApi.users.CategoryIncluded;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,20 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * data: {
6
+ * type: "offerAttribution",
7
+ * id: "c94a93a7-beb9-4e58-960c-2c812f849398",
8
+ * attributes: {
9
+ * entityId: "offer-456",
10
+ * eventCode: "ACTIVATE",
11
+ * medium: "CTA",
12
+ * eventDate: "2025-01-01T00:00:00Z"
13
+ * }
14
+ * }
15
+ * }
16
+ */
17
+ export interface ActivateOfferResponse {
18
+ data: KardApi.users.ActivateOfferResponseData;
19
+ included?: KardApi.users.ActivateOfferIncluded[];
20
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ActivateOfferResponseAttributes {
2
+ entityId: string;
3
+ eventCode: string;
4
+ medium: string;
5
+ eventDate: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ export interface ActivateOfferResponseData {
3
+ type: string;
4
+ id: string;
5
+ attributes: KardApi.users.ActivateOfferResponseAttributes;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,5 +2,6 @@
2
2
  export declare const EventCode: {
3
3
  readonly Impression: "IMPRESSION";
4
4
  readonly View: "VIEW";
5
+ readonly Activate: "ACTIVATE";
5
6
  };
6
7
  export type EventCode = (typeof EventCode)[keyof typeof EventCode];
@@ -3,4 +3,5 @@
3
3
  export const EventCode = {
4
4
  Impression: "IMPRESSION",
5
5
  View: "VIEW",
6
+ Activate: "ACTIVATE",
6
7
  };
@@ -4,5 +4,6 @@ export declare const OfferMedium: {
4
4
  readonly Email: "EMAIL";
5
5
  readonly Map: "MAP";
6
6
  readonly Search: "SEARCH";
7
+ readonly Cta: "CTA";
7
8
  };
8
9
  export type OfferMedium = (typeof OfferMedium)[keyof typeof OfferMedium];
@@ -5,4 +5,5 @@ export const OfferMedium = {
5
5
  Email: "EMAIL",
6
6
  Map: "MAP",
7
7
  Search: "SEARCH",
8
+ Cta: "CTA",
8
9
  };