Skip to content

Commit

Permalink
Merge pull request #55 from Relewise/feat/order-data
Browse files Browse the repository at this point in the history
feat: add data property bag to track order
  • Loading branch information
mzanoni authored Mar 4, 2024
2 parents 6259eaa + bc66aad commit 64697f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/client/src/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class Tracker extends RelewiseClient {
super(datasetId, apiKey, options);
}


public async trackOrder({ user, subtotal, orderNumber, lineItems, cartName = 'default', trackingNumber }: {
public async trackOrder({ user, subtotal, orderNumber, lineItems, cartName = 'default', trackingNumber, data }: {
user: User,
subtotal: { currency: string, amount: number },
orderNumber: string,
/** @deprecated Use orderNumber instead. */
trackingNumber?: string,
lineItems: { productId: string, variantId?: string, lineTotal: number, quantity: number, data?: Record<string, DataValue> }[],
data?: Record<string, DataValue>,
cartName?: string
}, options?: RelewiseRequestOptions): Promise<void | undefined> {
return this.request<TrackOrderRequest, void>('TrackOrderRequest', {
Expand All @@ -36,6 +36,7 @@ export class Tracker extends RelewiseClient {
orderNumber: orderNumber,
trackingNumber: trackingNumber,
cartName: cartName,
data: data,
user: user,
},
}, options);
Expand Down

0 comments on commit 64697f6

Please sign in to comment.