Skip to content

Commit

Permalink
fix: Add getPrices response type (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-rogers committed Jun 22, 2023
1 parent 45b3a1a commit 3b4cfd2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdk.ts
Expand Up @@ -9,6 +9,7 @@ import {
CreateSubscriptionModifierResponse,
GeneratePaylinkBody,
GeneratePaylinkResponse,
GetPricesResponse,
GetProductCouponsBody,
GetProductCouponsResponse,
GetProductsResponse,
Expand Down Expand Up @@ -514,7 +515,7 @@ s * @example
...(customerIp && { customer_ip: customerIp }),
});

return this._request(`/prices?${params.toString()}`, {
return this._request<GetPricesResponse>(`/prices?${params.toString()}`, {
checkoutAPIVersion: 'v2',
});
}
Expand Down
24 changes: 24 additions & 0 deletions src/types.ts
Expand Up @@ -262,3 +262,27 @@ export interface GeneratePaylinkBody {
export interface GeneratePaylinkResponse {
url: string;
}

export interface GetPricesResponse {
customer_country: string;
products: {
product_id: number;
product_title: string;
currency: string;
vendor_set_prices_included_tax: boolean;
price: {
gross: number;
net: number;
tax: number;
};
list_price: {
gross: number;
net: number;
tax: number;
};
applied_coupon: {
code: string;
discount: number;
};
}[];
}

0 comments on commit 3b4cfd2

Please sign in to comment.