@waffo/pancake-ts 0.11.0 → 0.12.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.
package/dist/index.d.cts CHANGED
@@ -225,7 +225,7 @@ declare enum ErrorLayer {
225
225
  Sdk = "sdk"
226
226
  }
227
227
  /**
228
- * Parameters for issuing a buyer session token.
228
+ * Parameters for issuing a customer session token.
229
229
  *
230
230
  * Provide either `storeId` or `productId` (at least one required).
231
231
  * When `productId` is given without `storeId`, the server derives the store from the product.
@@ -234,7 +234,7 @@ declare enum ErrorLayer {
234
234
  */
235
235
  interface IssueSessionTokenParams {
236
236
  /**
237
- * Buyer identity — encoded into the JWT payload for merchant-side buyer
237
+ * Customer identity — encoded into the JWT payload for merchant-side customer
238
238
  * identification. Accepts an email or any merchant-provided identifier string.
239
239
  * To pre-fill the checkout page's email field, use `buyerEmail` on
240
240
  * `checkout.authenticated.create`.
@@ -697,7 +697,7 @@ interface CancelSubscriptionResult {
697
697
  status: `${SubscriptionOrderStatus}`;
698
698
  }
699
699
  /**
700
- * Buyer billing details for checkout.
700
+ * Customer billing details for checkout.
701
701
  * @see waffo-pancake-order-service/app/lib/types.ts
702
702
  */
703
703
  interface BillingDetail {
@@ -727,7 +727,7 @@ interface CreateCheckoutSessionParams {
727
727
  priceSnapshot?: PriceInfo;
728
728
  /** Trial toggle override (subscription only) */
729
729
  withTrial?: boolean;
730
- /** Pre-filled buyer email */
730
+ /** Pre-filled customer email */
731
731
  buyerEmail?: string;
732
732
  /** Pre-filled billing details */
733
733
  billingDetail?: BillingDetail;
@@ -751,7 +751,7 @@ interface CheckoutSessionResult {
751
751
  /** Session expiration time (ISO 8601 UTC) */
752
752
  expiresAt: string;
753
753
  }
754
- /** Parameters for canceling a one-time order (buyer-side). */
754
+ /** Parameters for canceling a one-time order (customer-side). */
755
755
  interface CancelOnetimeOrderParams {
756
756
  /** Order ID */
757
757
  orderId: string;
@@ -763,7 +763,7 @@ interface CancelOnetimeOrderResult {
763
763
  /** Resulting status (`"canceled"`) */
764
764
  status: string;
765
765
  }
766
- /** Parameters for reactivating a subscription (buyer-side). */
766
+ /** Parameters for reactivating a subscription (customer-side). */
767
767
  interface ReactivateSubscriptionParams {
768
768
  /** Subscription order ID */
769
769
  orderId: string;
@@ -787,12 +787,12 @@ interface RequestedAmount {
787
787
  * multiple times; this is the shape of a single submission.
788
788
  */
789
789
  interface RefundTicketVersionData {
790
- /** Refund reason supplied by the buyer */
790
+ /** Refund reason supplied by the customer */
791
791
  reason: string;
792
792
  /** Requested refund amount; `null` if the version has no amount recorded */
793
793
  requestedAmount: RequestedAmount | null;
794
794
  }
795
- /** Parameters for creating a refund ticket (buyer-side). */
795
+ /** Parameters for creating a refund ticket (customer-side). */
796
796
  interface CreateRefundTicketParams {
797
797
  /** Payment ID to refund */
798
798
  paymentId: string;
@@ -805,7 +805,7 @@ interface CreateRefundTicketParams {
805
805
  /** Refund-ticket business-side identifier (max 128 chars); inherited by the executed refund on PSP success */
806
806
  refundTicketMerchantExternalId?: string;
807
807
  }
808
- /** Parameters for resubmitting a rejected refund ticket (buyer-side). */
808
+ /** Parameters for resubmitting a rejected refund ticket (customer-side). */
809
809
  interface ResubmitRefundTicketParams {
810
810
  /** Existing ticket ID */
811
811
  ticketId: string;
@@ -858,7 +858,7 @@ interface RefundTicket {
858
858
  /**
859
859
  * Parameters for anonymous checkout.
860
860
  *
861
- * The buyer reaches the checkout page without a session token. Merchants may still
861
+ * The customer reaches the checkout page without a session token. Merchants may still
862
862
  * pre-fill `buyerEmail` and `billingDetail`; omitting them leaves the form blank.
863
863
  *
864
864
  * Accepts every field of {@link CreateCheckoutSessionParams} — this wrapper simply
@@ -884,15 +884,15 @@ type AnonymousCheckoutParams = CreateCheckoutSessionParams;
884
884
  * const result = await client.checkout.authenticated.create({
885
885
  * productId: "PROD_xxx",
886
886
  * currency: "USD",
887
- * buyerIdentity: "user-123", // merchant-side buyer id (goes into JWT)
887
+ * buyerIdentity: "user-123", // merchant-side customer id (goes into JWT)
888
888
  * buyerEmail: "customer@example.com", // pre-filled on the checkout page
889
889
  * });
890
890
  * // Redirect to result.checkoutUrl (includes #token=...)
891
891
  */
892
892
  interface AuthenticatedCheckoutParams extends CreateCheckoutSessionParams {
893
893
  /**
894
- * Buyer identity — sent to `issue-session-token` and encoded into the JWT
895
- * payload for merchant-side buyer identification. Accepts an email or any
894
+ * Customer identity — sent to `issue-session-token` and encoded into the JWT
895
+ * payload for merchant-side customer identification. Accepts an email or any
896
896
  * merchant-provided identifier string. Use `buyerEmail` to pre-fill the
897
897
  * checkout page's email input.
898
898
  */
@@ -953,9 +953,9 @@ declare enum WebhookEventType {
953
953
  SubscriptionActivated = "subscription.activated",
954
954
  /** Subscription renewal payment succeeded */
955
955
  SubscriptionPaymentSucceeded = "subscription.payment_succeeded",
956
- /** Buyer initiated cancellation (expires at end of current period) */
956
+ /** Customer initiated cancellation (expires at end of current period) */
957
957
  SubscriptionCanceling = "subscription.canceling",
958
- /** Buyer withdrew cancellation (subscription restored) */
958
+ /** Customer withdrew cancellation (subscription restored) */
959
959
  SubscriptionUncanceled = "subscription.uncanceled",
960
960
  /** Subscription product changed (upgrade/downgrade) */
961
961
  SubscriptionUpdated = "subscription.updated",
@@ -977,7 +977,7 @@ interface WebhookEventData {
977
977
  /** Order status (e.g., "completed", "active", "canceling") */
978
978
  orderStatus?: string;
979
979
  buyerEmail: string;
980
- /** Merchant-provided buyer identity from checkout session */
980
+ /** Merchant-provided customer identity from checkout session */
981
981
  merchantProvidedBuyerIdentity?: string;
982
982
  /** Order business identifier; present on order/payment + refund events (inherited from order) */
983
983
  orderMerchantExternalId?: string;
@@ -1152,12 +1152,12 @@ declare class HttpClient {
1152
1152
  post<T>(path: string, body: object, options?: PostOptions): Promise<PostResult<T>>;
1153
1153
  }
1154
1154
 
1155
- /** Authentication resource — issue session tokens for buyers. */
1155
+ /** Authentication resource — issue session tokens for customers. */
1156
1156
  declare class AuthResource {
1157
1157
  private readonly http;
1158
1158
  constructor(http: HttpClient);
1159
1159
  /**
1160
- * Issue a session token for a buyer.
1160
+ * Issue a session token for a customer.
1161
1161
  *
1162
1162
  * @param params - Token issuance parameters
1163
1163
  * @returns Issued session token with expiration
@@ -1182,147 +1182,9 @@ declare class AuthResource {
1182
1182
  }
1183
1183
 
1184
1184
  /**
1185
- * Internal HTTP client for buyer-side requests using Bearer token authentication.
1185
+ * Anonymous checkout no customer identity provided.
1186
1186
  *
1187
- * Unlike {@link HttpClient} which signs requests with RSA-SHA256 (API Key auth),
1188
- * this client attaches a session token as `Authorization: Bearer <token>` and
1189
- * never sends an idempotency key (buyer session actions are not protected by
1190
- * gateway idempotency in the current architecture).
1191
- *
1192
- * Not exported publicly — used internally by {@link BuyerSession}.
1193
- */
1194
- declare class BuyerHttpClient {
1195
- private readonly token;
1196
- private readonly baseUrl;
1197
- private readonly _fetch;
1198
- constructor(token: string, config: Pick<WaffoPancakeConfig, "baseUrl" | "fetch">);
1199
- /**
1200
- * Send a Bearer-authenticated POST and return the full envelope plus HTTP status.
1201
- *
1202
- * Does NOT throw on `errors[]` or non-2xx status — caller inspects the result.
1203
- * Throws {@link WaffoPancakeError} only when the response body is not valid JSON.
1204
- */
1205
- post<T>(path: string, body: object): Promise<PostResult<T>>;
1206
- }
1207
-
1208
- /**
1209
- * Buyer session — lets authenticated buyers manage their own orders and subscriptions.
1210
- *
1211
- * Created via `client.buyer(token)` using a session token issued by
1212
- * `client.auth.issueSessionToken()`. All requests use Bearer token authentication.
1213
- *
1214
- * @example
1215
- * const { token } = await client.auth.issueSessionToken({
1216
- * storeId: "STO_xxx",
1217
- * buyerIdentity: "customer@example.com",
1218
- * });
1219
- * const buyer = client.buyer(token);
1220
- * await buyer.cancelSubscription({ orderId: "ORD_xxx" });
1221
- */
1222
- declare class BuyerSession {
1223
- private readonly http;
1224
- /** GraphQL query access scoped to the buyer's data. */
1225
- readonly graphql: BuyerGraphQL;
1226
- constructor(http: BuyerHttpClient);
1227
- /**
1228
- * Cancel a subscription order.
1229
- *
1230
- * @param params - Order to cancel
1231
- * @returns Order ID and resulting status
1232
- *
1233
- * @example
1234
- * const { orderId, status } = await buyer.cancelSubscription({ orderId: "ORD_xxx" });
1235
- * // status: "canceled" (was pending) or "canceling" (was active)
1236
- */
1237
- cancelSubscription(params: CancelSubscriptionParams): Promise<CancelSubscriptionResult & {
1238
- warnings?: Notice[];
1239
- }>;
1240
- /**
1241
- * Cancel a one-time order (only while payment is still pending).
1242
- *
1243
- * @param params - Order to cancel
1244
- * @returns Order ID and resulting status
1245
- *
1246
- * @example
1247
- * const { orderId, status } = await buyer.cancelOnetimeOrder({ orderId: "ORD_xxx" });
1248
- */
1249
- cancelOnetimeOrder(params: CancelOnetimeOrderParams): Promise<CancelOnetimeOrderResult & {
1250
- warnings?: Notice[];
1251
- }>;
1252
- /**
1253
- * Reactivate a subscription that is in `canceling` status.
1254
- *
1255
- * @param params - Order to reactivate
1256
- * @returns Order ID and resulting status
1257
- *
1258
- * @example
1259
- * const { orderId, status } = await buyer.reactivateSubscription({ orderId: "ORD_xxx" });
1260
- * // status: "active"
1261
- */
1262
- reactivateSubscription(params: ReactivateSubscriptionParams): Promise<ReactivateSubscriptionResult & {
1263
- warnings?: Notice[];
1264
- }>;
1265
- /**
1266
- * Submit a refund request for a payment.
1267
- *
1268
- * @param params - Refund ticket details
1269
- * @returns Created refund ticket
1270
- *
1271
- * @example
1272
- * const { ticket } = await buyer.createRefundTicket({
1273
- * paymentId: "PAY_xxx",
1274
- * reason: "Product not as described",
1275
- * requestedAmount: { amount: "29.00", currency: "USD" },
1276
- * refundTicketMerchantExternalId: "REF-2026-00891",
1277
- * });
1278
- */
1279
- createRefundTicket(params: CreateRefundTicketParams): Promise<{
1280
- ticket: RefundTicket;
1281
- warnings?: Notice[];
1282
- }>;
1283
- /**
1284
- * Resubmit a previously rejected refund ticket with updated details.
1285
- *
1286
- * @param params - Updated ticket details
1287
- * @returns Updated refund ticket
1288
- *
1289
- * @example
1290
- * const { ticket } = await buyer.resubmitRefundTicket({
1291
- * ticketId: "TKT_xxx",
1292
- * paymentId: "PAY_xxx",
1293
- * reason: "Updated reason with more detail",
1294
- * requestedAmount: { amount: "29.00", currency: "USD" },
1295
- * });
1296
- */
1297
- resubmitRefundTicket(params: ResubmitRefundTicketParams): Promise<{
1298
- ticket: RefundTicket;
1299
- warnings?: Notice[];
1300
- }>;
1301
- }
1302
- /**
1303
- * GraphQL access scoped to the buyer's session token.
1304
- */
1305
- declare class BuyerGraphQL {
1306
- private readonly http;
1307
- constructor(http: BuyerHttpClient);
1308
- /**
1309
- * Execute a GraphQL query scoped to the buyer's data.
1310
- *
1311
- * @param params - GraphQL query and variables
1312
- * @returns GraphQL response
1313
- *
1314
- * @example
1315
- * const result = await buyer.graphql.query({
1316
- * query: `query { orders { id status } }`,
1317
- * });
1318
- */
1319
- query<T = Record<string, unknown>>(params: GraphQLParams): Promise<GraphQLResponse<T>>;
1320
- }
1321
-
1322
- /**
1323
- * Anonymous checkout — no buyer identity provided.
1324
- *
1325
- * The buyer reaches the checkout page without a session token. Merchants may still
1187
+ * The customer reaches the checkout page without a session token. Merchants may still
1326
1188
  * pre-fill `buyerEmail` and `billingDetail` on the page by passing them here.
1327
1189
  * Internally creates a checkout session and returns the redirect URL.
1328
1190
  */
@@ -1332,11 +1194,11 @@ declare class CheckoutAnonymousResource {
1332
1194
  /**
1333
1195
  * Create an anonymous checkout session.
1334
1196
  *
1335
- * @param params - Checkout parameters (no buyer identity required)
1197
+ * @param params - Checkout parameters (no customer identity required)
1336
1198
  * @returns Session ID, checkout URL, and expiration
1337
1199
  *
1338
1200
  * @example
1339
- * // Minimal — buyer fills everything on the page
1201
+ * // Minimal — customer fills everything on the page
1340
1202
  * const result = await client.checkout.anonymous.create({
1341
1203
  * productId: "PROD_xxx",
1342
1204
  * currency: "USD",
@@ -1358,11 +1220,11 @@ declare class CheckoutAnonymousResource {
1358
1220
  }
1359
1221
 
1360
1222
  /**
1361
- * Authenticated checkout — merchant provides buyer identity.
1223
+ * Authenticated checkout — merchant provides customer identity.
1362
1224
  *
1363
1225
  * Issues a session token, creates a checkout session, and returns a
1364
1226
  * checkout URL with the token appended as a URL fragment (`#token=...`).
1365
- * The checkout page reads the fragment to pre-fill buyer information.
1227
+ * The checkout page reads the fragment to pre-fill customer information.
1366
1228
  */
1367
1229
  declare class CheckoutAuthenticatedResource {
1368
1230
  private readonly http;
@@ -1378,7 +1240,7 @@ declare class CheckoutAuthenticatedResource {
1378
1240
  * `buyerIdentity` and `buyerEmail` are independent inputs: identity is for the JWT,
1379
1241
  * email is for pre-filling the checkout page. The SDK forwards each to its own endpoint.
1380
1242
  *
1381
- * @param params - Checkout parameters including buyer identity
1243
+ * @param params - Checkout parameters including customer identity
1382
1244
  * @returns Session details with token-appended checkout URL
1383
1245
  *
1384
1246
  * @example
@@ -1400,8 +1262,8 @@ declare class CheckoutAuthenticatedResource {
1400
1262
  * Checkout resource — create checkout sessions for payments.
1401
1263
  *
1402
1264
  * Provides two convenience sub-resources for the common checkout flows:
1403
- * - `anonymous` — no buyer identity, empty form
1404
- * - `authenticated` — merchant provides buyer identity, pre-filled form + token
1265
+ * - `anonymous` — no customer identity, empty form
1266
+ * - `authenticated` — merchant provides customer identity, pre-filled form + token
1405
1267
  *
1406
1268
  * The low-level `createSession()` method is still available for full control.
1407
1269
  *
@@ -1413,7 +1275,7 @@ declare class CheckoutAuthenticatedResource {
1413
1275
  * });
1414
1276
  *
1415
1277
  * @example
1416
- * // Authenticated checkout (with buyer identity)
1278
+ * // Authenticated checkout (with customer identity)
1417
1279
  * const result = await client.checkout.authenticated.create({
1418
1280
  * productId: "PROD_xxx",
1419
1281
  * currency: "USD",
@@ -1424,9 +1286,9 @@ declare class CheckoutAuthenticatedResource {
1424
1286
  */
1425
1287
  declare class CheckoutResource {
1426
1288
  private readonly http;
1427
- /** Anonymous checkout — no buyer identity, empty form. */
1289
+ /** Anonymous checkout — no customer identity, empty form. */
1428
1290
  readonly anonymous: CheckoutAnonymousResource;
1429
- /** Authenticated checkout — merchant provides buyer identity. */
1291
+ /** Authenticated checkout — merchant provides customer identity. */
1430
1292
  readonly authenticated: CheckoutAuthenticatedResource;
1431
1293
  constructor(http: HttpClient);
1432
1294
  /**
@@ -1451,6 +1313,144 @@ declare class CheckoutResource {
1451
1313
  }>;
1452
1314
  }
1453
1315
 
1316
+ /**
1317
+ * Internal HTTP client for customer-side requests using Bearer token authentication.
1318
+ *
1319
+ * Unlike {@link HttpClient} which signs requests with RSA-SHA256 (API Key auth),
1320
+ * this client attaches a session token as `Authorization: Bearer <token>` and
1321
+ * never sends an idempotency key (customer session actions are not protected by
1322
+ * gateway idempotency in the current architecture).
1323
+ *
1324
+ * Not exported publicly — used internally by {@link CustomerSession}.
1325
+ */
1326
+ declare class CustomerHttpClient {
1327
+ private readonly token;
1328
+ private readonly baseUrl;
1329
+ private readonly _fetch;
1330
+ constructor(token: string, config: Pick<WaffoPancakeConfig, "baseUrl" | "fetch">);
1331
+ /**
1332
+ * Send a Bearer-authenticated POST and return the full envelope plus HTTP status.
1333
+ *
1334
+ * Does NOT throw on `errors[]` or non-2xx status — caller inspects the result.
1335
+ * Throws {@link WaffoPancakeError} only when the response body is not valid JSON.
1336
+ */
1337
+ post<T>(path: string, body: object): Promise<PostResult<T>>;
1338
+ }
1339
+
1340
+ /**
1341
+ * Customer session — lets authenticated customers manage their own orders and subscriptions.
1342
+ *
1343
+ * Created via `client.customer(token)` using a session token issued by
1344
+ * `client.auth.issueSessionToken()`. All requests use Bearer token authentication.
1345
+ *
1346
+ * @example
1347
+ * const { token } = await client.auth.issueSessionToken({
1348
+ * storeId: "STO_xxx",
1349
+ * buyerIdentity: "customer@example.com",
1350
+ * });
1351
+ * const customer = client.customer(token);
1352
+ * await customer.cancelSubscription({ orderId: "ORD_xxx" });
1353
+ */
1354
+ declare class CustomerSession {
1355
+ private readonly http;
1356
+ /** GraphQL query access scoped to the customer's data. */
1357
+ readonly graphql: CustomerGraphQL;
1358
+ constructor(http: CustomerHttpClient);
1359
+ /**
1360
+ * Cancel a subscription order.
1361
+ *
1362
+ * @param params - Order to cancel
1363
+ * @returns Order ID and resulting status
1364
+ *
1365
+ * @example
1366
+ * const { orderId, status } = await customer.cancelSubscription({ orderId: "ORD_xxx" });
1367
+ * // status: "canceled" (was pending) or "canceling" (was active)
1368
+ */
1369
+ cancelSubscription(params: CancelSubscriptionParams): Promise<CancelSubscriptionResult & {
1370
+ warnings?: Notice[];
1371
+ }>;
1372
+ /**
1373
+ * Cancel a one-time order (only while payment is still pending).
1374
+ *
1375
+ * @param params - Order to cancel
1376
+ * @returns Order ID and resulting status
1377
+ *
1378
+ * @example
1379
+ * const { orderId, status } = await customer.cancelOnetimeOrder({ orderId: "ORD_xxx" });
1380
+ */
1381
+ cancelOnetimeOrder(params: CancelOnetimeOrderParams): Promise<CancelOnetimeOrderResult & {
1382
+ warnings?: Notice[];
1383
+ }>;
1384
+ /**
1385
+ * Reactivate a subscription that is in `canceling` status.
1386
+ *
1387
+ * @param params - Order to reactivate
1388
+ * @returns Order ID and resulting status
1389
+ *
1390
+ * @example
1391
+ * const { orderId, status } = await customer.reactivateSubscription({ orderId: "ORD_xxx" });
1392
+ * // status: "active"
1393
+ */
1394
+ reactivateSubscription(params: ReactivateSubscriptionParams): Promise<ReactivateSubscriptionResult & {
1395
+ warnings?: Notice[];
1396
+ }>;
1397
+ /**
1398
+ * Submit a refund request for a payment.
1399
+ *
1400
+ * @param params - Refund ticket details
1401
+ * @returns Created refund ticket
1402
+ *
1403
+ * @example
1404
+ * const { ticket } = await customer.createRefundTicket({
1405
+ * paymentId: "PAY_xxx",
1406
+ * reason: "Product not as described",
1407
+ * requestedAmount: { amount: "29.00", currency: "USD" },
1408
+ * refundTicketMerchantExternalId: "REF-2026-00891",
1409
+ * });
1410
+ */
1411
+ createRefundTicket(params: CreateRefundTicketParams): Promise<{
1412
+ ticket: RefundTicket;
1413
+ warnings?: Notice[];
1414
+ }>;
1415
+ /**
1416
+ * Resubmit a previously rejected refund ticket with updated details.
1417
+ *
1418
+ * @param params - Updated ticket details
1419
+ * @returns Updated refund ticket
1420
+ *
1421
+ * @example
1422
+ * const { ticket } = await customer.resubmitRefundTicket({
1423
+ * ticketId: "TKT_xxx",
1424
+ * paymentId: "PAY_xxx",
1425
+ * reason: "Updated reason with more detail",
1426
+ * requestedAmount: { amount: "29.00", currency: "USD" },
1427
+ * });
1428
+ */
1429
+ resubmitRefundTicket(params: ResubmitRefundTicketParams): Promise<{
1430
+ ticket: RefundTicket;
1431
+ warnings?: Notice[];
1432
+ }>;
1433
+ }
1434
+ /**
1435
+ * GraphQL access scoped to the customer's session token.
1436
+ */
1437
+ declare class CustomerGraphQL {
1438
+ private readonly http;
1439
+ constructor(http: CustomerHttpClient);
1440
+ /**
1441
+ * Execute a GraphQL query scoped to the customer's data.
1442
+ *
1443
+ * @param params - GraphQL query and variables
1444
+ * @returns GraphQL response
1445
+ *
1446
+ * @example
1447
+ * const result = await customer.graphql.query({
1448
+ * query: `query { orders { id status } }`,
1449
+ * });
1450
+ */
1451
+ query<T = Record<string, unknown>>(params: GraphQLParams): Promise<GraphQLResponse<T>>;
1452
+ }
1453
+
1454
1454
  /** GraphQL query resource (Query only, no Mutations). */
1455
1455
  declare class GraphQLResource {
1456
1456
  private readonly http;
@@ -2026,24 +2026,38 @@ declare class WaffoPancake {
2026
2026
  readonly webhooks: WebhooksResource;
2027
2027
  constructor(config: WaffoPancakeConfig);
2028
2028
  /**
2029
- * Create a buyer session for self-service operations.
2029
+ * Create a customer session for self-service operations.
2030
2030
  *
2031
2031
  * The returned session uses Bearer token authentication and provides
2032
2032
  * methods for order cancellation, subscription management, refund tickets,
2033
2033
  * and scoped GraphQL queries.
2034
2034
  *
2035
2035
  * @param token - Session token from `client.auth.issueSessionToken()`
2036
- * @returns A buyer session with self-service methods
2036
+ * @returns A customer session with self-service methods
2037
2037
  *
2038
2038
  * @example
2039
2039
  * const { token } = await client.auth.issueSessionToken({
2040
2040
  * storeId: "STO_xxx",
2041
2041
  * buyerIdentity: "customer@example.com",
2042
2042
  * });
2043
- * const buyer = client.buyer(token);
2044
- * await buyer.cancelSubscription({ orderId: "ORD_xxx" });
2043
+ * const customer = client.customer(token);
2044
+ * await customer.cancelSubscription({ orderId: "ORD_xxx" });
2045
+ */
2046
+ customer(token: string): CustomerSession;
2047
+ /**
2048
+ * Create a customer session for self-service operations.
2049
+ *
2050
+ * @param token - Session token from `client.auth.issueSessionToken()`
2051
+ * @returns A customer session with self-service methods
2052
+ *
2053
+ * @example
2054
+ * ```typescript
2055
+ * const session = client.buyer(token); // prefer client.customer(token)
2056
+ * ```
2057
+ *
2058
+ * @deprecated Use {@link WaffoPancake.customer} instead.
2045
2059
  */
2046
- buyer(token: string): BuyerSession;
2060
+ buyer(token: string): CustomerSession;
2047
2061
  }
2048
2062
 
2049
2063
  /**