@kard-financial/sdk 2.0.0 → 2.2.0

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 (122) 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 +20 -6
  46. package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetLocationsByUserRequest.d.ts +2 -0
  47. package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetOffersByUserRequest.d.ts +2 -0
  48. package/dist/cjs/api/resources/users/resources/rewards/types/ButtonStyle.d.ts +6 -0
  49. package/dist/cjs/api/resources/users/resources/rewards/types/ButtonStyle.js +9 -0
  50. package/dist/cjs/api/resources/users/resources/rewards/types/ComponentType.d.ts +9 -0
  51. package/dist/cjs/api/resources/users/resources/rewards/types/ComponentType.js +12 -0
  52. package/dist/cjs/api/resources/users/resources/rewards/types/CtaComponent.d.ts +10 -0
  53. package/dist/cjs/api/resources/users/resources/rewards/types/CtaComponent.js +3 -0
  54. package/dist/cjs/api/resources/users/resources/rewards/types/OfferCommonFields.d.ts +2 -0
  55. package/dist/cjs/api/resources/users/resources/rewards/types/OfferComponents.d.ts +16 -0
  56. package/dist/cjs/api/resources/users/resources/rewards/types/OfferComponents.js +3 -0
  57. package/dist/cjs/api/resources/users/resources/rewards/types/index.d.ts +4 -0
  58. package/dist/cjs/api/resources/users/resources/rewards/types/index.js +4 -0
  59. package/dist/cjs/version.d.ts +1 -1
  60. package/dist/cjs/version.js +1 -1
  61. package/dist/esm/BaseClient.mjs +2 -2
  62. package/dist/esm/api/resources/transactions/client/Client.d.mts +28 -1
  63. package/dist/esm/api/resources/transactions/client/Client.mjs +28 -1
  64. package/dist/esm/api/resources/transactions/types/CoreMerchant.d.mts +4 -0
  65. package/dist/esm/api/resources/transactions/types/CoreMerchant.mjs +2 -0
  66. package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +25 -0
  67. package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.mjs +2 -0
  68. package/dist/esm/api/resources/transactions/types/CoreTransactionRequest.d.mts +6 -0
  69. package/dist/esm/api/resources/transactions/types/CoreTransactionRequest.mjs +2 -0
  70. package/dist/esm/api/resources/transactions/types/FinancialInstitution.d.mts +6 -0
  71. package/dist/esm/api/resources/transactions/types/FinancialInstitution.mjs +2 -0
  72. package/dist/esm/api/resources/transactions/types/MatchedTransactionsAttributes.d.mts +1 -1
  73. package/dist/esm/api/resources/transactions/types/Transactions.d.mts +4 -1
  74. package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +3 -3
  75. package/dist/esm/api/resources/transactions/types/TransactionsRequestBody.d.mts +27 -0
  76. package/dist/esm/api/resources/transactions/types/index.d.mts +4 -0
  77. package/dist/esm/api/resources/transactions/types/index.mjs +4 -0
  78. package/dist/esm/api/resources/users/resources/attributions/client/Client.d.mts +19 -0
  79. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +95 -0
  80. package/dist/esm/api/resources/users/resources/attributions/client/index.d.mts +1 -1
  81. package/dist/esm/api/resources/users/resources/attributions/client/index.mjs +1 -1
  82. package/dist/esm/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.d.mts +11 -0
  83. package/dist/esm/api/resources/users/resources/attributions/client/requests/ActivateOfferRequest.mjs +2 -0
  84. package/dist/esm/api/resources/users/resources/attributions/client/requests/index.d.mts +1 -0
  85. package/dist/esm/api/resources/users/resources/attributions/client/requests/index.mjs +1 -0
  86. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.d.mts +5 -0
  87. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncludeOption.mjs +5 -0
  88. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncluded.d.mts +2 -0
  89. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferIncluded.mjs +2 -0
  90. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.mts +20 -0
  91. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.mjs +2 -0
  92. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.d.mts +6 -0
  93. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseAttributes.mjs +2 -0
  94. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseData.d.mts +6 -0
  95. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponseData.mjs +2 -0
  96. package/dist/esm/api/resources/users/resources/attributions/types/EventCode.d.mts +1 -0
  97. package/dist/esm/api/resources/users/resources/attributions/types/EventCode.mjs +1 -0
  98. package/dist/esm/api/resources/users/resources/attributions/types/OfferMedium.d.mts +1 -0
  99. package/dist/esm/api/resources/users/resources/attributions/types/OfferMedium.mjs +1 -0
  100. package/dist/esm/api/resources/users/resources/attributions/types/index.d.mts +5 -0
  101. package/dist/esm/api/resources/users/resources/attributions/types/index.mjs +5 -0
  102. package/dist/esm/api/resources/users/resources/index.d.mts +1 -0
  103. package/dist/esm/api/resources/users/resources/index.mjs +1 -0
  104. package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +2 -4
  105. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +20 -6
  106. package/dist/esm/api/resources/users/resources/rewards/client/requests/GetLocationsByUserRequest.d.mts +2 -0
  107. package/dist/esm/api/resources/users/resources/rewards/client/requests/GetOffersByUserRequest.d.mts +2 -0
  108. package/dist/esm/api/resources/users/resources/rewards/types/ButtonStyle.d.mts +6 -0
  109. package/dist/esm/api/resources/users/resources/rewards/types/ButtonStyle.mjs +6 -0
  110. package/dist/esm/api/resources/users/resources/rewards/types/ComponentType.d.mts +9 -0
  111. package/dist/esm/api/resources/users/resources/rewards/types/ComponentType.mjs +9 -0
  112. package/dist/esm/api/resources/users/resources/rewards/types/CtaComponent.d.mts +10 -0
  113. package/dist/esm/api/resources/users/resources/rewards/types/CtaComponent.mjs +2 -0
  114. package/dist/esm/api/resources/users/resources/rewards/types/OfferCommonFields.d.mts +2 -0
  115. package/dist/esm/api/resources/users/resources/rewards/types/OfferComponents.d.mts +16 -0
  116. package/dist/esm/api/resources/users/resources/rewards/types/OfferComponents.mjs +2 -0
  117. package/dist/esm/api/resources/users/resources/rewards/types/index.d.mts +4 -0
  118. package/dist/esm/api/resources/users/resources/rewards/types/index.mjs +4 -0
  119. package/dist/esm/version.d.mts +1 -1
  120. package/dist/esm/version.mjs +1 -1
  121. package/package.json +1 -1
  122. package/reference.md +92 -5
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@kard-financial/sdk",
46
- "X-Fern-SDK-Version": "2.0.0",
47
- "User-Agent": "@kard-financial/sdk/2.0.0",
46
+ "X-Fern-SDK-Version": "2.2.0",
47
+ "User-Agent": "@kard-financial/sdk/2.2.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, 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;
@@ -58,7 +58,8 @@ class TransactionsClient {
58
58
  * 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/>
59
59
  * Please use the correct type when calling the endpoint:
60
60
  * - `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.
61
- * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.<br/>
61
+ * - `matchedTransaction`: For pre-matched transactions that need validation on match by the Kard system.
62
+ * - `coreTransaction`: For transactions from core banking systems with limited card-level data.<br/>
62
63
  *
63
64
  * <b>Required scopes:</b> `transaction:write`<br/>
64
65
  * <b>Note:</b> `Maximum of 500 transactions can be created per request`.
@@ -193,6 +194,32 @@ class TransactionsClient {
193
194
  * }
194
195
  * }]
195
196
  * })
197
+ *
198
+ * @example
199
+ * await client.transactions.create("organization-123", {
200
+ * data: [{
201
+ * type: "coreTransaction",
202
+ * id: "core_txn_98765432109876543210",
203
+ * attributes: {
204
+ * userId: "6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
205
+ * transactionId: "CORE-TXN-2024-001234",
206
+ * amount: 4599,
207
+ * currency: "USD",
208
+ * description: "WALMART SUPERCENTER",
209
+ * direction: "DEBIT",
210
+ * status: "SETTLED",
211
+ * settledDate: "2024-10-15T14:30:00Z",
212
+ * authorizationDate: "2024-10-15T14:25:00Z",
213
+ * financialInstitution: {
214
+ * rssdId: "852218",
215
+ * name: "First National Bank"
216
+ * },
217
+ * merchant: {
218
+ * addrZipcode: "75001"
219
+ * }
220
+ * }
221
+ * }]
222
+ * })
196
223
  */
197
224
  create(organizationId, request, requestOptions) {
198
225
  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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import type * as KardApi from "../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type * as KardApi from "../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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.js";
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.js";
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.js";
5
5
  export * from "./AuditStatus.js";
6
6
  export * from "./CardNetwork.js";
7
7
  export * from "./CommissionEarnedDetails.js";
8
+ export * from "./CoreMerchant.js";
9
+ export * from "./CoreTransactionAttributes.js";
10
+ export * from "./CoreTransactionRequest.js";
8
11
  export * from "./CreateAuditMultiStatusResponse.js";
9
12
  export * from "./CreateAuditRequestBody.js";
10
13
  export * from "./CreateAuditRequestDataUnion.js";
11
14
  export * from "./CreateAuditResponseBody.js";
12
15
  export * from "./CreateAuditResponseDataUnion.js";
13
16
  export * from "./DirectionType.js";
17
+ export * from "./FinancialInstitution.js";
14
18
  export * from "./FraudulentTransactionAttributes.js";
15
19
  export * from "./FraudulentTransactionData.js";
16
20
  export * from "./FraudulentTransactionObject.js";
@@ -21,12 +21,16 @@ __exportStar(require("./AuditResponseData.js"), exports);
21
21
  __exportStar(require("./AuditStatus.js"), exports);
22
22
  __exportStar(require("./CardNetwork.js"), exports);
23
23
  __exportStar(require("./CommissionEarnedDetails.js"), exports);
24
+ __exportStar(require("./CoreMerchant.js"), exports);
25
+ __exportStar(require("./CoreTransactionAttributes.js"), exports);
26
+ __exportStar(require("./CoreTransactionRequest.js"), exports);
24
27
  __exportStar(require("./CreateAuditMultiStatusResponse.js"), exports);
25
28
  __exportStar(require("./CreateAuditRequestBody.js"), exports);
26
29
  __exportStar(require("./CreateAuditRequestDataUnion.js"), exports);
27
30
  __exportStar(require("./CreateAuditResponseBody.js"), exports);
28
31
  __exportStar(require("./CreateAuditResponseDataUnion.js"), exports);
29
32
  __exportStar(require("./DirectionType.js"), exports);
33
+ __exportStar(require("./FinancialInstitution.js"), exports);
30
34
  __exportStar(require("./FraudulentTransactionAttributes.js"), exports);
31
35
  __exportStar(require("./FraudulentTransactionData.js"), exports);
32
36
  __exportStar(require("./FraudulentTransactionObject.js"), exports);
@@ -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
  }
@@ -163,5 +163,100 @@ class AttributionsClient {
163
163
  }
164
164
  });
165
165
  }
166
+ /**
167
+ * Record when a user activates an offer. Creates an attribution event with eventCode=ACTIVATE and medium=CTA.
168
+ * Optionally include the offer data by passing `include=offer`.
169
+ *
170
+ * @param {KardApi.OrganizationId} organizationId
171
+ * @param {KardApi.UserId} userId
172
+ * @param {string} offerId - The unique identifier of the offer being activated
173
+ * @param {KardApi.users.ActivateOfferRequest} request
174
+ * @param {AttributionsClient.RequestOptions} requestOptions - Request-specific configuration.
175
+ *
176
+ * @throws {@link KardApi.UnauthorizedError}
177
+ * @throws {@link KardApi.InternalServerError}
178
+ * @throws {@link KardApi.InvalidRequest}
179
+ *
180
+ * @example
181
+ * await client.users.attributions.activate("organization-123", "user-123", "offer-456")
182
+ */
183
+ activate(organizationId, userId, offerId, request = {}, requestOptions) {
184
+ return core.HttpResponsePromise.fromPromise(this.__activate(organizationId, userId, offerId, request, requestOptions));
185
+ }
186
+ __activate(organizationId_1, userId_1, offerId_1) {
187
+ return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
188
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
189
+ const { supportedComponents, include } = request;
190
+ const _queryParams = {};
191
+ if (supportedComponents != null) {
192
+ if (Array.isArray(supportedComponents)) {
193
+ _queryParams.supportedComponents = supportedComponents.map((item) => item);
194
+ }
195
+ else {
196
+ _queryParams.supportedComponents = supportedComponents;
197
+ }
198
+ }
199
+ if (include != null) {
200
+ if (Array.isArray(include)) {
201
+ _queryParams.include = include.map((item) => item);
202
+ }
203
+ else {
204
+ _queryParams.include = include;
205
+ }
206
+ }
207
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
208
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
209
+ const _response = yield core.fetcher({
210
+ 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)}/offers/${core.url.encodePathParam(offerId)}/activate`),
211
+ method: "POST",
212
+ headers: _headers,
213
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
214
+ 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,
215
+ 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,
216
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
217
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
218
+ logging: this._options.logging,
219
+ });
220
+ if (_response.ok) {
221
+ return { data: _response.body, rawResponse: _response.rawResponse };
222
+ }
223
+ if (_response.error.reason === "status-code") {
224
+ switch (_response.error.statusCode) {
225
+ case 401:
226
+ throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
227
+ case 500:
228
+ throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
229
+ case 400:
230
+ throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
231
+ default:
232
+ throw new errors.KardApiError({
233
+ statusCode: _response.error.statusCode,
234
+ body: _response.error.body,
235
+ rawResponse: _response.rawResponse,
236
+ });
237
+ }
238
+ }
239
+ switch (_response.error.reason) {
240
+ case "non-json":
241
+ throw new errors.KardApiError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.rawBody,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ case "body-is-null":
247
+ throw new errors.KardApiError({
248
+ statusCode: _response.error.statusCode,
249
+ rawResponse: _response.rawResponse,
250
+ });
251
+ case "timeout":
252
+ throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/offers/{offerId}/activate.");
253
+ case "unknown":
254
+ throw new errors.KardApiError({
255
+ message: _response.error.errorMessage,
256
+ rawResponse: _response.rawResponse,
257
+ });
258
+ }
259
+ });
260
+ }
166
261
  }
167
262
  exports.AttributionsClient = AttributionsClient;
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.js";
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,11 @@
1
+ import type * as KardApi from "../../../../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { ActivateOfferRequest } from "./ActivateOfferRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,8 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ActivateOfferIncludeOption = void 0;
5
+ /** Options for what to include in the activate offer response */
6
+ exports.ActivateOfferIncludeOption = {
7
+ Offer: "offer",
8
+ };
@@ -0,0 +1,2 @@
1
+ import type * as KardApi from "../../../../../index.js";
2
+ export type ActivateOfferIncluded = KardApi.users.OfferDataUnion | KardApi.users.CategoryIncluded;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import type * as KardApi from "../../../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface ActivateOfferResponseAttributes {
2
+ entityId: string;
3
+ eventCode: string;
4
+ medium: string;
5
+ eventDate: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type * as KardApi from "../../../../../index.js";
2
+ export interface ActivateOfferResponseData {
3
+ type: string;
4
+ id: string;
5
+ attributes: KardApi.users.ActivateOfferResponseAttributes;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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];
@@ -6,4 +6,5 @@ exports.EventCode = void 0;
6
6
  exports.EventCode = {
7
7
  Impression: "IMPRESSION",
8
8
  View: "VIEW",
9
+ Activate: "ACTIVATE",
9
10
  };
@@ -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];
@@ -8,4 +8,5 @@ exports.OfferMedium = {
8
8
  Email: "EMAIL",
9
9
  Map: "MAP",
10
10
  Search: "SEARCH",
11
+ Cta: "CTA",
11
12
  };
@@ -1,3 +1,8 @@
1
+ export * from "./ActivateOfferIncluded.js";
2
+ export * from "./ActivateOfferIncludeOption.js";
3
+ export * from "./ActivateOfferResponse.js";
4
+ export * from "./ActivateOfferResponseAttributes.js";
5
+ export * from "./ActivateOfferResponseData.js";
1
6
  export * from "./CreateAttributionRequestObject.js";
2
7
  export * from "./CreateAttributionRequestUnion.js";
3
8
  export * from "./CreateAttributionResponse.js";
@@ -14,6 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ActivateOfferIncluded.js"), exports);
18
+ __exportStar(require("./ActivateOfferIncludeOption.js"), exports);
19
+ __exportStar(require("./ActivateOfferResponse.js"), exports);
20
+ __exportStar(require("./ActivateOfferResponseAttributes.js"), exports);
21
+ __exportStar(require("./ActivateOfferResponseData.js"), exports);
17
22
  __exportStar(require("./CreateAttributionRequestObject.js"), exports);
18
23
  __exportStar(require("./CreateAttributionRequestUnion.js"), exports);
19
24
  __exportStar(require("./CreateAttributionResponse.js"), exports);
@@ -1,3 +1,4 @@
1
+ export * from "./attributions/client/requests/index.js";
1
2
  export * as attributions from "./attributions/index.js";
2
3
  export * from "./attributions/types/index.js";
3
4
  export * as auth from "./auth/index.js";