@whop/sdk 0.0.27 → 0.0.28
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/CHANGELOG.md +41 -0
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js +7 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-tokens.d.mts +19 -20
- package/resources/access-tokens.d.mts.map +1 -1
- package/resources/access-tokens.d.ts +19 -20
- package/resources/access-tokens.d.ts.map +1 -1
- package/resources/access-tokens.js +4 -4
- package/resources/access-tokens.mjs +4 -4
- package/resources/account-links.d.mts +15 -13
- package/resources/account-links.d.mts.map +1 -1
- package/resources/account-links.d.ts +15 -13
- package/resources/account-links.d.ts.map +1 -1
- package/resources/account-links.js +2 -3
- package/resources/account-links.js.map +1 -1
- package/resources/account-links.mjs +2 -3
- package/resources/account-links.mjs.map +1 -1
- package/resources/ai-chats.d.mts +38 -26
- package/resources/ai-chats.d.mts.map +1 -1
- package/resources/ai-chats.d.ts +38 -26
- package/resources/ai-chats.d.ts.map +1 -1
- package/resources/ai-chats.js +5 -5
- package/resources/ai-chats.mjs +5 -5
- package/resources/app-builds.d.mts +35 -33
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +35 -33
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +7 -4
- package/resources/app-builds.js.map +1 -1
- package/resources/app-builds.mjs +7 -4
- package/resources/app-builds.mjs.map +1 -1
- package/resources/apps.d.mts +81 -56
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +81 -56
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js +7 -4
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs +7 -4
- package/resources/apps.mjs.map +1 -1
- package/resources/authorized-users.d.mts +32 -26
- package/resources/authorized-users.d.mts.map +1 -1
- package/resources/authorized-users.d.ts +32 -26
- package/resources/authorized-users.d.ts.map +1 -1
- package/resources/authorized-users.js +3 -2
- package/resources/authorized-users.js.map +1 -1
- package/resources/authorized-users.mjs +3 -2
- package/resources/authorized-users.mjs.map +1 -1
- package/resources/chat-channels.d.mts +27 -19
- package/resources/chat-channels.d.mts.map +1 -1
- package/resources/chat-channels.d.ts +27 -19
- package/resources/chat-channels.d.ts.map +1 -1
- package/resources/chat-channels.js +5 -3
- package/resources/chat-channels.js.map +1 -1
- package/resources/chat-channels.mjs +5 -3
- package/resources/chat-channels.mjs.map +1 -1
- package/resources/checkout-configurations.d.mts +55 -46
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +55 -46
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +3 -2
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +3 -2
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +65 -46
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +65 -46
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +7 -8
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +7 -8
- package/resources/companies.mjs.map +1 -1
- package/resources/company-token-transactions.d.mts +80 -57
- package/resources/company-token-transactions.d.mts.map +1 -1
- package/resources/company-token-transactions.d.ts +80 -57
- package/resources/company-token-transactions.d.ts.map +1 -1
- package/resources/company-token-transactions.js +6 -3
- package/resources/company-token-transactions.js.map +1 -1
- package/resources/company-token-transactions.mjs +6 -3
- package/resources/company-token-transactions.mjs.map +1 -1
- package/resources/course-chapters.d.mts +24 -19
- package/resources/course-chapters.d.mts.map +1 -1
- package/resources/course-chapters.d.ts +24 -19
- package/resources/course-chapters.d.ts.map +1 -1
- package/resources/course-chapters.js +5 -5
- package/resources/course-chapters.mjs +5 -5
- package/resources/course-lesson-interactions.d.mts +7 -6
- package/resources/course-lesson-interactions.d.mts.map +1 -1
- package/resources/course-lesson-interactions.d.ts +7 -6
- package/resources/course-lesson-interactions.d.ts.map +1 -1
- package/resources/course-lesson-interactions.js +3 -2
- package/resources/course-lesson-interactions.js.map +1 -1
- package/resources/course-lesson-interactions.mjs +3 -2
- package/resources/course-lesson-interactions.mjs.map +1 -1
- package/resources/course-lessons.d.mts +126 -84
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +126 -84
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-lessons.js +12 -8
- package/resources/course-lessons.js.map +1 -1
- package/resources/course-lessons.mjs +12 -8
- package/resources/course-lessons.mjs.map +1 -1
- package/resources/course-students.d.mts +38 -29
- package/resources/course-students.d.mts.map +1 -1
- package/resources/course-students.d.ts +38 -29
- package/resources/course-students.d.ts.map +1 -1
- package/resources/course-students.js +3 -2
- package/resources/course-students.js.map +1 -1
- package/resources/course-students.mjs +3 -2
- package/resources/course-students.mjs.map +1 -1
- package/resources/courses.d.mts +132 -91
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +132 -91
- package/resources/courses.d.ts.map +1 -1
- package/resources/courses.js +9 -5
- package/resources/courses.js.map +1 -1
- package/resources/courses.mjs +9 -5
- package/resources/courses.mjs.map +1 -1
- package/resources/disputes.d.mts +156 -102
- package/resources/disputes.d.mts.map +1 -1
- package/resources/disputes.d.ts +156 -102
- package/resources/disputes.d.ts.map +1 -1
- package/resources/disputes.js +4 -2
- package/resources/disputes.js.map +1 -1
- package/resources/disputes.mjs +4 -2
- package/resources/disputes.mjs.map +1 -1
- package/resources/dm-channels.d.mts +29 -16
- package/resources/dm-channels.d.mts.map +1 -1
- package/resources/dm-channels.d.ts +29 -16
- package/resources/dm-channels.d.ts.map +1 -1
- package/resources/dm-channels.js +9 -5
- package/resources/dm-channels.js.map +1 -1
- package/resources/dm-channels.mjs +9 -5
- package/resources/dm-channels.mjs.map +1 -1
- package/resources/dm-members.d.mts +30 -21
- package/resources/dm-members.d.mts.map +1 -1
- package/resources/dm-members.d.ts +30 -21
- package/resources/dm-members.d.ts.map +1 -1
- package/resources/dm-members.js +9 -5
- package/resources/dm-members.js.map +1 -1
- package/resources/dm-members.mjs +9 -5
- package/resources/dm-members.mjs.map +1 -1
- package/resources/entries.d.mts +29 -21
- package/resources/entries.d.mts.map +1 -1
- package/resources/entries.d.ts +29 -21
- package/resources/entries.d.ts.map +1 -1
- package/resources/entries.js +7 -4
- package/resources/entries.js.map +1 -1
- package/resources/entries.mjs +7 -4
- package/resources/entries.mjs.map +1 -1
- package/resources/experiences.d.mts +53 -45
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +53 -45
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +6 -5
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +6 -5
- package/resources/experiences.mjs.map +1 -1
- package/resources/fee-markups.d.mts +32 -21
- package/resources/fee-markups.d.mts.map +1 -1
- package/resources/fee-markups.d.ts +32 -21
- package/resources/fee-markups.d.ts.map +1 -1
- package/resources/fee-markups.js +6 -3
- package/resources/fee-markups.js.map +1 -1
- package/resources/fee-markups.mjs +6 -3
- package/resources/fee-markups.mjs.map +1 -1
- package/resources/files.d.mts +21 -17
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +21 -17
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +3 -2
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +3 -2
- package/resources/files.mjs.map +1 -1
- package/resources/forum-posts.d.mts +62 -43
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +62 -43
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +8 -4
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +8 -4
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/forums.d.mts +20 -12
- package/resources/forums.d.mts.map +1 -1
- package/resources/forums.d.ts +20 -12
- package/resources/forums.d.ts.map +1 -1
- package/resources/forums.js +5 -3
- package/resources/forums.js.map +1 -1
- package/resources/forums.mjs +5 -3
- package/resources/forums.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +108 -80
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +108 -80
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +7 -4
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +7 -4
- package/resources/invoices.mjs.map +1 -1
- package/resources/leads.d.mts +64 -42
- package/resources/leads.d.mts.map +1 -1
- package/resources/leads.d.ts +64 -42
- package/resources/leads.d.ts.map +1 -1
- package/resources/leads.js +6 -4
- package/resources/leads.js.map +1 -1
- package/resources/leads.mjs +6 -4
- package/resources/leads.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +10 -8
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +10 -8
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js +1 -1
- package/resources/ledger-accounts.mjs +1 -1
- package/resources/members.d.mts +18 -19
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +18 -19
- package/resources/members.d.ts.map +1 -1
- package/resources/members.js +3 -2
- package/resources/members.js.map +1 -1
- package/resources/members.mjs +3 -2
- package/resources/members.mjs.map +1 -1
- package/resources/memberships.d.mts +69 -51
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +69 -51
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +12 -8
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +12 -8
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +46 -32
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +46 -32
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +9 -5
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +9 -5
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications.d.mts +33 -25
- package/resources/notifications.d.mts.map +1 -1
- package/resources/notifications.d.ts +33 -25
- package/resources/notifications.d.ts.map +1 -1
- package/resources/notifications.js +2 -1
- package/resources/notifications.js.map +1 -1
- package/resources/notifications.mjs +2 -1
- package/resources/notifications.mjs.map +1 -1
- package/resources/payment-methods.d.mts +212 -114
- package/resources/payment-methods.d.mts.map +1 -1
- package/resources/payment-methods.d.ts +212 -114
- package/resources/payment-methods.d.ts.map +1 -1
- package/resources/payment-methods.js +5 -10
- package/resources/payment-methods.js.map +1 -1
- package/resources/payment-methods.mjs +5 -10
- package/resources/payment-methods.mjs.map +1 -1
- package/resources/payments.d.mts +73 -40
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +73 -40
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +23 -10
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +23 -10
- package/resources/payments.mjs.map +1 -1
- package/resources/payout-methods.d.mts +44 -29
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +44 -29
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js +3 -2
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs +3 -2
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/plans.d.mts +121 -90
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +121 -90
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js +9 -5
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs +9 -5
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +76 -65
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +76 -65
- package/resources/products.d.ts.map +1 -1
- package/resources/products.js +7 -5
- package/resources/products.js.map +1 -1
- package/resources/products.mjs +7 -5
- package/resources/products.mjs.map +1 -1
- package/resources/promo-codes.d.mts +41 -31
- package/resources/promo-codes.d.mts.map +1 -1
- package/resources/promo-codes.d.ts +41 -31
- package/resources/promo-codes.d.ts.map +1 -1
- package/resources/promo-codes.js +7 -4
- package/resources/promo-codes.js.map +1 -1
- package/resources/promo-codes.mjs +7 -4
- package/resources/promo-codes.mjs.map +1 -1
- package/resources/reactions.d.mts +24 -18
- package/resources/reactions.d.mts.map +1 -1
- package/resources/reactions.d.ts +24 -18
- package/resources/reactions.d.ts.map +1 -1
- package/resources/reactions.js +7 -4
- package/resources/reactions.js.map +1 -1
- package/resources/reactions.mjs +7 -4
- package/resources/reactions.mjs.map +1 -1
- package/resources/refunds.d.mts +43 -29
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +43 -29
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js +3 -2
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs +3 -2
- package/resources/refunds.mjs.map +1 -1
- package/resources/reviews.d.mts +66 -50
- package/resources/reviews.d.mts.map +1 -1
- package/resources/reviews.d.ts +66 -50
- package/resources/reviews.d.ts.map +1 -1
- package/resources/reviews.js +3 -2
- package/resources/reviews.js.map +1 -1
- package/resources/reviews.mjs +3 -2
- package/resources/reviews.mjs.map +1 -1
- package/resources/setup-intents.d.mts +61 -43
- package/resources/setup-intents.d.mts.map +1 -1
- package/resources/setup-intents.d.ts +61 -43
- package/resources/setup-intents.d.ts.map +1 -1
- package/resources/setup-intents.js +4 -10
- package/resources/setup-intents.js.map +1 -1
- package/resources/setup-intents.mjs +4 -10
- package/resources/setup-intents.mjs.map +1 -1
- package/resources/shared.d.mts +695 -388
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +695 -388
- package/resources/shared.d.ts.map +1 -1
- package/resources/shipments.d.mts +26 -17
- package/resources/shipments.d.mts.map +1 -1
- package/resources/shipments.d.ts +26 -17
- package/resources/shipments.d.ts.map +1 -1
- package/resources/shipments.js +5 -3
- package/resources/shipments.js.map +1 -1
- package/resources/shipments.mjs +5 -3
- package/resources/shipments.mjs.map +1 -1
- package/resources/support-channels.d.mts +27 -19
- package/resources/support-channels.d.mts.map +1 -1
- package/resources/support-channels.d.ts +27 -19
- package/resources/support-channels.d.ts.map +1 -1
- package/resources/support-channels.js +5 -4
- package/resources/support-channels.js.map +1 -1
- package/resources/support-channels.mjs +5 -4
- package/resources/support-channels.mjs.map +1 -1
- package/resources/topups.d.mts +11 -9
- package/resources/topups.d.mts.map +1 -1
- package/resources/topups.d.ts +11 -9
- package/resources/topups.d.ts.map +1 -1
- package/resources/topups.js +2 -1
- package/resources/topups.js.map +1 -1
- package/resources/topups.mjs +2 -1
- package/resources/topups.mjs.map +1 -1
- package/resources/transfers.d.mts +35 -29
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +35 -29
- package/resources/transfers.d.ts.map +1 -1
- package/resources/transfers.js +5 -3
- package/resources/transfers.js.map +1 -1
- package/resources/transfers.mjs +5 -3
- package/resources/transfers.mjs.map +1 -1
- package/resources/users.d.mts +20 -16
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +20 -16
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +4 -3
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +4 -3
- package/resources/users.mjs.map +1 -1
- package/resources/verifications.d.mts +6 -4
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +6 -4
- package/resources/verifications.d.ts.map +1 -1
- package/resources/verifications.js +1 -1
- package/resources/verifications.mjs +1 -1
- package/resources/webhooks.d.mts +136 -95
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +136 -95
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +3 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +3 -2
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +53 -44
- package/resources/withdrawals.d.mts.map +1 -1
- package/resources/withdrawals.d.ts +53 -44
- package/resources/withdrawals.d.ts.map +1 -1
- package/resources/withdrawals.js +3 -2
- package/resources/withdrawals.js.map +1 -1
- package/resources/withdrawals.mjs +3 -2
- package/resources/withdrawals.mjs.map +1 -1
- package/src/client.ts +13 -3
- package/src/resources/access-tokens.ts +19 -20
- package/src/resources/account-links.ts +15 -13
- package/src/resources/ai-chats.ts +39 -26
- package/src/resources/app-builds.ts +35 -33
- package/src/resources/apps.ts +84 -56
- package/src/resources/authorized-users.ts +32 -26
- package/src/resources/chat-channels.ts +27 -19
- package/src/resources/checkout-configurations.ts +56 -46
- package/src/resources/companies.ts +68 -46
- package/src/resources/company-token-transactions.ts +81 -58
- package/src/resources/course-chapters.ts +24 -19
- package/src/resources/course-lesson-interactions.ts +7 -6
- package/src/resources/course-lessons.ts +126 -84
- package/src/resources/course-students.ts +38 -29
- package/src/resources/courses.ts +132 -91
- package/src/resources/disputes.ts +156 -102
- package/src/resources/dm-channels.ts +29 -16
- package/src/resources/dm-members.ts +30 -21
- package/src/resources/entries.ts +29 -21
- package/src/resources/experiences.ts +53 -45
- package/src/resources/fee-markups.ts +32 -21
- package/src/resources/files.ts +21 -17
- package/src/resources/forum-posts.ts +63 -43
- package/src/resources/forums.ts +20 -12
- package/src/resources/index.ts +2 -1
- package/src/resources/invoices.ts +112 -80
- package/src/resources/leads.ts +64 -42
- package/src/resources/ledger-accounts.ts +10 -8
- package/src/resources/members.ts +18 -19
- package/src/resources/memberships.ts +69 -51
- package/src/resources/messages.ts +46 -32
- package/src/resources/notifications.ts +33 -25
- package/src/resources/payment-methods.ts +212 -114
- package/src/resources/payments.ts +77 -39
- package/src/resources/payout-methods.ts +44 -29
- package/src/resources/plans.ts +121 -90
- package/src/resources/products.ts +215 -68
- package/src/resources/promo-codes.ts +41 -31
- package/src/resources/reactions.ts +24 -18
- package/src/resources/refunds.ts +44 -29
- package/src/resources/reviews.ts +66 -50
- package/src/resources/setup-intents.ts +61 -43
- package/src/resources/shared.ts +2637 -387
- package/src/resources/shipments.ts +26 -17
- package/src/resources/support-channels.ts +27 -19
- package/src/resources/topups.ts +11 -9
- package/src/resources/transfers.ts +35 -29
- package/src/resources/users.ts +20 -16
- package/src/resources/verifications.ts +6 -4
- package/src/resources/webhooks.ts +136 -95
- package/src/resources/withdrawals.ts +53 -43
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -5,7 +5,8 @@ import { CursorPage, type CursorPageParams, PagePromise } from "../core/paginati
|
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
6
|
export declare class PromoCodes extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create a new promo code
|
|
8
|
+
* Create a new promo code that applies a discount at checkout. Can be scoped to
|
|
9
|
+
* specific products or plans.
|
|
9
10
|
*
|
|
10
11
|
* Required permissions:
|
|
11
12
|
*
|
|
@@ -27,7 +28,7 @@ export declare class PromoCodes extends APIResource {
|
|
|
27
28
|
*/
|
|
28
29
|
create(body: PromoCodeCreateParams, options?: RequestOptions): APIPromise<PromoCode>;
|
|
29
30
|
/**
|
|
30
|
-
* Retrieves
|
|
31
|
+
* Retrieves the details of an existing promo code.
|
|
31
32
|
*
|
|
32
33
|
* Required permissions:
|
|
33
34
|
*
|
|
@@ -43,7 +44,8 @@ export declare class PromoCodes extends APIResource {
|
|
|
43
44
|
*/
|
|
44
45
|
retrieve(id: string, options?: RequestOptions): APIPromise<PromoCode>;
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* Returns a paginated list of promo codes belonging to a company, with optional
|
|
48
|
+
* filtering by product, plan, and status.
|
|
47
49
|
*
|
|
48
50
|
* Required permissions:
|
|
49
51
|
*
|
|
@@ -62,7 +64,8 @@ export declare class PromoCodes extends APIResource {
|
|
|
62
64
|
*/
|
|
63
65
|
list(query: PromoCodeListParams, options?: RequestOptions): PagePromise<PromoCodeListResponsesCursorPage, PromoCodeListResponse>;
|
|
64
66
|
/**
|
|
65
|
-
* Archive a promo code, preventing
|
|
67
|
+
* Archive a promo code, preventing it from being used in future checkouts.
|
|
68
|
+
* Existing memberships are not affected.
|
|
66
69
|
*
|
|
67
70
|
* Required permissions:
|
|
68
71
|
*
|
|
@@ -187,7 +190,8 @@ export declare namespace PromoCode {
|
|
|
187
190
|
*/
|
|
188
191
|
id: string;
|
|
189
192
|
/**
|
|
190
|
-
* The
|
|
193
|
+
* The display name of the product shown to customers on the product page and in
|
|
194
|
+
* search results.
|
|
191
195
|
*/
|
|
192
196
|
title: string;
|
|
193
197
|
}
|
|
@@ -292,7 +296,8 @@ export declare namespace PromoCodeListResponse {
|
|
|
292
296
|
*/
|
|
293
297
|
id: string;
|
|
294
298
|
/**
|
|
295
|
-
* The
|
|
299
|
+
* The display name of the product shown to customers on the product page and in
|
|
300
|
+
* search results.
|
|
296
301
|
*/
|
|
297
302
|
title: string;
|
|
298
303
|
}
|
|
@@ -303,74 +308,79 @@ export declare namespace PromoCodeListResponse {
|
|
|
303
308
|
export type PromoCodeDeleteResponse = boolean;
|
|
304
309
|
export interface PromoCodeCreateParams {
|
|
305
310
|
/**
|
|
306
|
-
* The discount amount.
|
|
307
|
-
*
|
|
308
|
-
* off (e.g., 10.00
|
|
311
|
+
* The discount amount. When promo_type is percentage, this is the percent off
|
|
312
|
+
* (e.g., 20 for 20% off). When promo_type is flat_amount, this is the currency
|
|
313
|
+
* amount off (e.g., 10.00 for $10.00 off).
|
|
309
314
|
*/
|
|
310
315
|
amount_off: number;
|
|
311
316
|
/**
|
|
312
|
-
* The
|
|
317
|
+
* The three-letter ISO currency code for the promo code discount.
|
|
313
318
|
*/
|
|
314
319
|
base_currency: Shared.Currency;
|
|
315
320
|
/**
|
|
316
|
-
* The
|
|
321
|
+
* The alphanumeric code customers enter at checkout to apply the discount.
|
|
317
322
|
*/
|
|
318
323
|
code: string;
|
|
319
324
|
/**
|
|
320
|
-
* The
|
|
325
|
+
* The unique identifier of the company to create this promo code for.
|
|
321
326
|
*/
|
|
322
327
|
company_id: string;
|
|
323
328
|
/**
|
|
324
|
-
*
|
|
325
|
-
* before.
|
|
329
|
+
* Whether to restrict this promo code to only users who have never purchased from
|
|
330
|
+
* the company before.
|
|
326
331
|
*/
|
|
327
332
|
new_users_only: boolean;
|
|
328
333
|
/**
|
|
329
|
-
* The number of months
|
|
334
|
+
* The number of billing months the discount remains active. For example, 3 means
|
|
335
|
+
* the discount applies to the first 3 billing cycles.
|
|
330
336
|
*/
|
|
331
337
|
promo_duration_months: number;
|
|
332
338
|
/**
|
|
333
|
-
* The type
|
|
339
|
+
* The discount type, either percentage or flat_amount.
|
|
334
340
|
*/
|
|
335
341
|
promo_type: Shared.PromoType;
|
|
336
342
|
/**
|
|
337
|
-
*
|
|
343
|
+
* Whether to restrict this promo code to only users who have previously churned
|
|
344
|
+
* from the company.
|
|
338
345
|
*/
|
|
339
346
|
churned_users_only?: boolean | null;
|
|
340
347
|
/**
|
|
341
|
-
* Whether this promo code
|
|
348
|
+
* Whether this promo code can only be applied to existing memberships, such as for
|
|
349
|
+
* cancellation retention offers.
|
|
342
350
|
*/
|
|
343
351
|
existing_memberships_only?: boolean | null;
|
|
344
352
|
/**
|
|
345
|
-
* The
|
|
353
|
+
* The datetime when the promo code expires and can no longer be used. Null means
|
|
354
|
+
* it never expires.
|
|
346
355
|
*/
|
|
347
356
|
expires_at?: string | null;
|
|
348
357
|
/**
|
|
349
|
-
*
|
|
358
|
+
* Whether each customer can only use this promo code once.
|
|
350
359
|
*/
|
|
351
360
|
one_per_customer?: boolean | null;
|
|
352
361
|
/**
|
|
353
|
-
* The
|
|
354
|
-
*
|
|
362
|
+
* The identifiers of plans this promo code applies to. When product_id is also
|
|
363
|
+
* provided, only plans attached to that product are included.
|
|
355
364
|
*/
|
|
356
365
|
plan_ids?: Array<string> | null;
|
|
357
366
|
/**
|
|
358
|
-
* The product to
|
|
359
|
-
*
|
|
367
|
+
* The identifier of the product to scope this promo code to. When provided, the
|
|
368
|
+
* promo code only applies to plans attached to this product.
|
|
360
369
|
*/
|
|
361
370
|
product_id?: string | null;
|
|
362
371
|
/**
|
|
363
|
-
* The
|
|
372
|
+
* The maximum number of times this promo code can be used. Ignored when
|
|
373
|
+
* unlimited_stock is true.
|
|
364
374
|
*/
|
|
365
375
|
stock?: number | null;
|
|
366
376
|
/**
|
|
367
|
-
* Whether
|
|
377
|
+
* Whether the promo code can be used an unlimited number of times.
|
|
368
378
|
*/
|
|
369
379
|
unlimited_stock?: boolean | null;
|
|
370
380
|
}
|
|
371
381
|
export interface PromoCodeListParams extends CursorPageParams {
|
|
372
382
|
/**
|
|
373
|
-
* The
|
|
383
|
+
* The unique identifier of the company to list promo codes for.
|
|
374
384
|
*/
|
|
375
385
|
company_id: string;
|
|
376
386
|
/**
|
|
@@ -378,11 +388,11 @@ export interface PromoCodeListParams extends CursorPageParams {
|
|
|
378
388
|
*/
|
|
379
389
|
before?: string | null;
|
|
380
390
|
/**
|
|
381
|
-
*
|
|
391
|
+
* Only return promo codes created after this timestamp.
|
|
382
392
|
*/
|
|
383
393
|
created_after?: string | null;
|
|
384
394
|
/**
|
|
385
|
-
*
|
|
395
|
+
* Only return promo codes created before this timestamp.
|
|
386
396
|
*/
|
|
387
397
|
created_before?: string | null;
|
|
388
398
|
/**
|
|
@@ -394,11 +404,11 @@ export interface PromoCodeListParams extends CursorPageParams {
|
|
|
394
404
|
*/
|
|
395
405
|
last?: number | null;
|
|
396
406
|
/**
|
|
397
|
-
* Filter promo codes
|
|
407
|
+
* Filter to only promo codes scoped to these plan identifiers.
|
|
398
408
|
*/
|
|
399
409
|
plan_ids?: Array<string> | null;
|
|
400
410
|
/**
|
|
401
|
-
* Filter promo codes
|
|
411
|
+
* Filter to only promo codes scoped to these product identifiers.
|
|
402
412
|
*/
|
|
403
413
|
product_ids?: Array<string> | null;
|
|
404
414
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promo-codes.d.mts","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC
|
|
1
|
+
{"version":3,"file":"promo-codes.d.mts","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIpF;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIrE;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CACF,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;IAIvE;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGlF;AAED,MAAM,MAAM,gCAAgC,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAA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EG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -5,7 +5,8 @@ import { CursorPage, type CursorPageParams, PagePromise } from "../core/paginati
|
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
6
|
export declare class PromoCodes extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create a new promo code
|
|
8
|
+
* Create a new promo code that applies a discount at checkout. Can be scoped to
|
|
9
|
+
* specific products or plans.
|
|
9
10
|
*
|
|
10
11
|
* Required permissions:
|
|
11
12
|
*
|
|
@@ -27,7 +28,7 @@ export declare class PromoCodes extends APIResource {
|
|
|
27
28
|
*/
|
|
28
29
|
create(body: PromoCodeCreateParams, options?: RequestOptions): APIPromise<PromoCode>;
|
|
29
30
|
/**
|
|
30
|
-
* Retrieves
|
|
31
|
+
* Retrieves the details of an existing promo code.
|
|
31
32
|
*
|
|
32
33
|
* Required permissions:
|
|
33
34
|
*
|
|
@@ -43,7 +44,8 @@ export declare class PromoCodes extends APIResource {
|
|
|
43
44
|
*/
|
|
44
45
|
retrieve(id: string, options?: RequestOptions): APIPromise<PromoCode>;
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* Returns a paginated list of promo codes belonging to a company, with optional
|
|
48
|
+
* filtering by product, plan, and status.
|
|
47
49
|
*
|
|
48
50
|
* Required permissions:
|
|
49
51
|
*
|
|
@@ -62,7 +64,8 @@ export declare class PromoCodes extends APIResource {
|
|
|
62
64
|
*/
|
|
63
65
|
list(query: PromoCodeListParams, options?: RequestOptions): PagePromise<PromoCodeListResponsesCursorPage, PromoCodeListResponse>;
|
|
64
66
|
/**
|
|
65
|
-
* Archive a promo code, preventing
|
|
67
|
+
* Archive a promo code, preventing it from being used in future checkouts.
|
|
68
|
+
* Existing memberships are not affected.
|
|
66
69
|
*
|
|
67
70
|
* Required permissions:
|
|
68
71
|
*
|
|
@@ -187,7 +190,8 @@ export declare namespace PromoCode {
|
|
|
187
190
|
*/
|
|
188
191
|
id: string;
|
|
189
192
|
/**
|
|
190
|
-
* The
|
|
193
|
+
* The display name of the product shown to customers on the product page and in
|
|
194
|
+
* search results.
|
|
191
195
|
*/
|
|
192
196
|
title: string;
|
|
193
197
|
}
|
|
@@ -292,7 +296,8 @@ export declare namespace PromoCodeListResponse {
|
|
|
292
296
|
*/
|
|
293
297
|
id: string;
|
|
294
298
|
/**
|
|
295
|
-
* The
|
|
299
|
+
* The display name of the product shown to customers on the product page and in
|
|
300
|
+
* search results.
|
|
296
301
|
*/
|
|
297
302
|
title: string;
|
|
298
303
|
}
|
|
@@ -303,74 +308,79 @@ export declare namespace PromoCodeListResponse {
|
|
|
303
308
|
export type PromoCodeDeleteResponse = boolean;
|
|
304
309
|
export interface PromoCodeCreateParams {
|
|
305
310
|
/**
|
|
306
|
-
* The discount amount.
|
|
307
|
-
*
|
|
308
|
-
* off (e.g., 10.00
|
|
311
|
+
* The discount amount. When promo_type is percentage, this is the percent off
|
|
312
|
+
* (e.g., 20 for 20% off). When promo_type is flat_amount, this is the currency
|
|
313
|
+
* amount off (e.g., 10.00 for $10.00 off).
|
|
309
314
|
*/
|
|
310
315
|
amount_off: number;
|
|
311
316
|
/**
|
|
312
|
-
* The
|
|
317
|
+
* The three-letter ISO currency code for the promo code discount.
|
|
313
318
|
*/
|
|
314
319
|
base_currency: Shared.Currency;
|
|
315
320
|
/**
|
|
316
|
-
* The
|
|
321
|
+
* The alphanumeric code customers enter at checkout to apply the discount.
|
|
317
322
|
*/
|
|
318
323
|
code: string;
|
|
319
324
|
/**
|
|
320
|
-
* The
|
|
325
|
+
* The unique identifier of the company to create this promo code for.
|
|
321
326
|
*/
|
|
322
327
|
company_id: string;
|
|
323
328
|
/**
|
|
324
|
-
*
|
|
325
|
-
* before.
|
|
329
|
+
* Whether to restrict this promo code to only users who have never purchased from
|
|
330
|
+
* the company before.
|
|
326
331
|
*/
|
|
327
332
|
new_users_only: boolean;
|
|
328
333
|
/**
|
|
329
|
-
* The number of months
|
|
334
|
+
* The number of billing months the discount remains active. For example, 3 means
|
|
335
|
+
* the discount applies to the first 3 billing cycles.
|
|
330
336
|
*/
|
|
331
337
|
promo_duration_months: number;
|
|
332
338
|
/**
|
|
333
|
-
* The type
|
|
339
|
+
* The discount type, either percentage or flat_amount.
|
|
334
340
|
*/
|
|
335
341
|
promo_type: Shared.PromoType;
|
|
336
342
|
/**
|
|
337
|
-
*
|
|
343
|
+
* Whether to restrict this promo code to only users who have previously churned
|
|
344
|
+
* from the company.
|
|
338
345
|
*/
|
|
339
346
|
churned_users_only?: boolean | null;
|
|
340
347
|
/**
|
|
341
|
-
* Whether this promo code
|
|
348
|
+
* Whether this promo code can only be applied to existing memberships, such as for
|
|
349
|
+
* cancellation retention offers.
|
|
342
350
|
*/
|
|
343
351
|
existing_memberships_only?: boolean | null;
|
|
344
352
|
/**
|
|
345
|
-
* The
|
|
353
|
+
* The datetime when the promo code expires and can no longer be used. Null means
|
|
354
|
+
* it never expires.
|
|
346
355
|
*/
|
|
347
356
|
expires_at?: string | null;
|
|
348
357
|
/**
|
|
349
|
-
*
|
|
358
|
+
* Whether each customer can only use this promo code once.
|
|
350
359
|
*/
|
|
351
360
|
one_per_customer?: boolean | null;
|
|
352
361
|
/**
|
|
353
|
-
* The
|
|
354
|
-
*
|
|
362
|
+
* The identifiers of plans this promo code applies to. When product_id is also
|
|
363
|
+
* provided, only plans attached to that product are included.
|
|
355
364
|
*/
|
|
356
365
|
plan_ids?: Array<string> | null;
|
|
357
366
|
/**
|
|
358
|
-
* The product to
|
|
359
|
-
*
|
|
367
|
+
* The identifier of the product to scope this promo code to. When provided, the
|
|
368
|
+
* promo code only applies to plans attached to this product.
|
|
360
369
|
*/
|
|
361
370
|
product_id?: string | null;
|
|
362
371
|
/**
|
|
363
|
-
* The
|
|
372
|
+
* The maximum number of times this promo code can be used. Ignored when
|
|
373
|
+
* unlimited_stock is true.
|
|
364
374
|
*/
|
|
365
375
|
stock?: number | null;
|
|
366
376
|
/**
|
|
367
|
-
* Whether
|
|
377
|
+
* Whether the promo code can be used an unlimited number of times.
|
|
368
378
|
*/
|
|
369
379
|
unlimited_stock?: boolean | null;
|
|
370
380
|
}
|
|
371
381
|
export interface PromoCodeListParams extends CursorPageParams {
|
|
372
382
|
/**
|
|
373
|
-
* The
|
|
383
|
+
* The unique identifier of the company to list promo codes for.
|
|
374
384
|
*/
|
|
375
385
|
company_id: string;
|
|
376
386
|
/**
|
|
@@ -378,11 +388,11 @@ export interface PromoCodeListParams extends CursorPageParams {
|
|
|
378
388
|
*/
|
|
379
389
|
before?: string | null;
|
|
380
390
|
/**
|
|
381
|
-
*
|
|
391
|
+
* Only return promo codes created after this timestamp.
|
|
382
392
|
*/
|
|
383
393
|
created_after?: string | null;
|
|
384
394
|
/**
|
|
385
|
-
*
|
|
395
|
+
* Only return promo codes created before this timestamp.
|
|
386
396
|
*/
|
|
387
397
|
created_before?: string | null;
|
|
388
398
|
/**
|
|
@@ -394,11 +404,11 @@ export interface PromoCodeListParams extends CursorPageParams {
|
|
|
394
404
|
*/
|
|
395
405
|
last?: number | null;
|
|
396
406
|
/**
|
|
397
|
-
* Filter promo codes
|
|
407
|
+
* Filter to only promo codes scoped to these plan identifiers.
|
|
398
408
|
*/
|
|
399
409
|
plan_ids?: Array<string> | null;
|
|
400
410
|
/**
|
|
401
|
-
* Filter promo codes
|
|
411
|
+
* Filter to only promo codes scoped to these product identifiers.
|
|
402
412
|
*/
|
|
403
413
|
product_ids?: Array<string> | null;
|
|
404
414
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promo-codes.d.ts","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC
|
|
1
|
+
{"version":3,"file":"promo-codes.d.ts","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIpF;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIrE;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CACF,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;IAIvE;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,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AAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/promo-codes.js
CHANGED
|
@@ -7,7 +7,8 @@ const pagination_1 = require("../core/pagination.js");
|
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
8
|
class PromoCodes extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Create a new promo code
|
|
10
|
+
* Create a new promo code that applies a discount at checkout. Can be scoped to
|
|
11
|
+
* specific products or plans.
|
|
11
12
|
*
|
|
12
13
|
* Required permissions:
|
|
13
14
|
*
|
|
@@ -31,7 +32,7 @@ class PromoCodes extends resource_1.APIResource {
|
|
|
31
32
|
return this._client.post('/promo_codes', { body, ...options });
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
* Retrieves
|
|
35
|
+
* Retrieves the details of an existing promo code.
|
|
35
36
|
*
|
|
36
37
|
* Required permissions:
|
|
37
38
|
*
|
|
@@ -49,7 +50,8 @@ class PromoCodes extends resource_1.APIResource {
|
|
|
49
50
|
return this._client.get((0, path_1.path) `/promo_codes/${id}`, options);
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
|
-
*
|
|
53
|
+
* Returns a paginated list of promo codes belonging to a company, with optional
|
|
54
|
+
* filtering by product, plan, and status.
|
|
53
55
|
*
|
|
54
56
|
* Required permissions:
|
|
55
57
|
*
|
|
@@ -70,7 +72,8 @@ class PromoCodes extends resource_1.APIResource {
|
|
|
70
72
|
return this._client.getAPIList('/promo_codes', (pagination_1.CursorPage), { query, ...options });
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
|
-
* Archive a promo code, preventing
|
|
75
|
+
* Archive a promo code, preventing it from being used in future checkouts.
|
|
76
|
+
* Existing memberships are not affected.
|
|
74
77
|
*
|
|
75
78
|
* Required permissions:
|
|
76
79
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promo-codes.js","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,UAAW,SAAQ,sBAAW;IACzC
|
|
1
|
+
{"version":3,"file":"promo-codes.js","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CACF,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAiC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF;AA1FD,gCA0FC"}
|
|
@@ -4,7 +4,8 @@ import { CursorPage } from "../core/pagination.mjs";
|
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
export class PromoCodes extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create a new promo code
|
|
7
|
+
* Create a new promo code that applies a discount at checkout. Can be scoped to
|
|
8
|
+
* specific products or plans.
|
|
8
9
|
*
|
|
9
10
|
* Required permissions:
|
|
10
11
|
*
|
|
@@ -28,7 +29,7 @@ export class PromoCodes extends APIResource {
|
|
|
28
29
|
return this._client.post('/promo_codes', { body, ...options });
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
|
-
* Retrieves
|
|
32
|
+
* Retrieves the details of an existing promo code.
|
|
32
33
|
*
|
|
33
34
|
* Required permissions:
|
|
34
35
|
*
|
|
@@ -46,7 +47,8 @@ export class PromoCodes extends APIResource {
|
|
|
46
47
|
return this._client.get(path `/promo_codes/${id}`, options);
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* Returns a paginated list of promo codes belonging to a company, with optional
|
|
51
|
+
* filtering by product, plan, and status.
|
|
50
52
|
*
|
|
51
53
|
* Required permissions:
|
|
52
54
|
*
|
|
@@ -67,7 +69,8 @@ export class PromoCodes extends APIResource {
|
|
|
67
69
|
return this._client.getAPIList('/promo_codes', (CursorPage), { query, ...options });
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
|
-
* Archive a promo code, preventing
|
|
72
|
+
* Archive a promo code, preventing it from being used in future checkouts.
|
|
73
|
+
* Existing memberships are not affected.
|
|
71
74
|
*
|
|
72
75
|
* Required permissions:
|
|
73
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promo-codes.mjs","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC
|
|
1
|
+
{"version":3,"file":"promo-codes.mjs","sourceRoot":"","sources":["../src/resources/promo-codes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CACF,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,UAAiC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -5,7 +5,8 @@ import { CursorPage, type CursorPageParams, PagePromise } from "../core/paginati
|
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
6
|
export declare class Reactions extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Add an emoji reaction or poll vote to a message or forum post. In forums, the
|
|
9
|
+
* reaction is always a like.
|
|
9
10
|
*
|
|
10
11
|
* Required permissions:
|
|
11
12
|
*
|
|
@@ -13,7 +14,7 @@ export declare class Reactions extends APIResource {
|
|
|
13
14
|
*/
|
|
14
15
|
create(body: ReactionCreateParams, options?: RequestOptions): APIPromise<Shared.Reaction>;
|
|
15
16
|
/**
|
|
16
|
-
* Retrieves
|
|
17
|
+
* Retrieves the details of an existing reaction.
|
|
17
18
|
*
|
|
18
19
|
* Required permissions:
|
|
19
20
|
*
|
|
@@ -21,7 +22,8 @@ export declare class Reactions extends APIResource {
|
|
|
21
22
|
*/
|
|
22
23
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Reaction>;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Returns a paginated list of emoji reactions on a specific message or forum post,
|
|
26
|
+
* sorted by most recent.
|
|
25
27
|
*
|
|
26
28
|
* Required permissions:
|
|
27
29
|
*
|
|
@@ -29,7 +31,8 @@ export declare class Reactions extends APIResource {
|
|
|
29
31
|
*/
|
|
30
32
|
list(query: ReactionListParams, options?: RequestOptions): PagePromise<ReactionListResponsesCursorPage, ReactionListResponse>;
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* Remove an emoji reaction from a message or forum post. Only the reaction author
|
|
35
|
+
* or a channel admin can remove a reaction.
|
|
33
36
|
*
|
|
34
37
|
* Required permissions:
|
|
35
38
|
*
|
|
@@ -39,7 +42,7 @@ export declare class Reactions extends APIResource {
|
|
|
39
42
|
}
|
|
40
43
|
export type ReactionListResponsesCursorPage = CursorPage<ReactionListResponse>;
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
45
|
+
* A single reaction left by a user on a feed post, such as a like or emoji.
|
|
43
46
|
*/
|
|
44
47
|
export interface ReactionListResponse {
|
|
45
48
|
/**
|
|
@@ -47,21 +50,22 @@ export interface ReactionListResponse {
|
|
|
47
50
|
*/
|
|
48
51
|
id: string;
|
|
49
52
|
/**
|
|
50
|
-
* The emoji
|
|
53
|
+
* The emoji used for this reaction in shortcode format. Null if the reaction type
|
|
54
|
+
* is not emoji.
|
|
51
55
|
*/
|
|
52
56
|
emoji: string | null;
|
|
53
57
|
/**
|
|
54
|
-
* The
|
|
58
|
+
* The unique identifier of the post this reaction was left on.
|
|
55
59
|
*/
|
|
56
60
|
resource_id: string;
|
|
57
61
|
/**
|
|
58
|
-
* The user who
|
|
62
|
+
* The user who left this reaction on the post.
|
|
59
63
|
*/
|
|
60
64
|
user: ReactionListResponse.User;
|
|
61
65
|
}
|
|
62
66
|
export declare namespace ReactionListResponse {
|
|
63
67
|
/**
|
|
64
|
-
* The user who
|
|
68
|
+
* The user who left this reaction on the post.
|
|
65
69
|
*/
|
|
66
70
|
interface User {
|
|
67
71
|
/**
|
|
@@ -69,11 +73,11 @@ export declare namespace ReactionListResponse {
|
|
|
69
73
|
*/
|
|
70
74
|
id: string;
|
|
71
75
|
/**
|
|
72
|
-
* The
|
|
76
|
+
* The user's display name shown on their public profile.
|
|
73
77
|
*/
|
|
74
78
|
name: string | null;
|
|
75
79
|
/**
|
|
76
|
-
* The
|
|
80
|
+
* The user's unique username shown on their public profile.
|
|
77
81
|
*/
|
|
78
82
|
username: string;
|
|
79
83
|
}
|
|
@@ -84,23 +88,23 @@ export declare namespace ReactionListResponse {
|
|
|
84
88
|
export type ReactionDeleteResponse = boolean;
|
|
85
89
|
export interface ReactionCreateParams {
|
|
86
90
|
/**
|
|
87
|
-
* The
|
|
91
|
+
* The unique identifier of the message or forum post to react to.
|
|
88
92
|
*/
|
|
89
93
|
resource_id: string;
|
|
90
94
|
/**
|
|
91
|
-
* The emoji to react with
|
|
92
|
-
*
|
|
95
|
+
* The emoji to react with, in shortcode or unicode format. For example, ':heart:'
|
|
96
|
+
* or a unicode emoji. Ignored in forums where reactions are always likes.
|
|
93
97
|
*/
|
|
94
98
|
emoji?: string | null;
|
|
95
99
|
/**
|
|
96
|
-
* The
|
|
97
|
-
*
|
|
100
|
+
* The unique identifier of a poll option to vote for. Only valid when the target
|
|
101
|
+
* message or post contains a poll.
|
|
98
102
|
*/
|
|
99
103
|
poll_option_id?: string | null;
|
|
100
104
|
}
|
|
101
105
|
export interface ReactionListParams extends CursorPageParams {
|
|
102
106
|
/**
|
|
103
|
-
* The
|
|
107
|
+
* The unique identifier of the message or forum post to list reactions for.
|
|
104
108
|
*/
|
|
105
109
|
resource_id: string;
|
|
106
110
|
/**
|
|
@@ -118,7 +122,9 @@ export interface ReactionListParams extends CursorPageParams {
|
|
|
118
122
|
}
|
|
119
123
|
export interface ReactionDeleteParams {
|
|
120
124
|
/**
|
|
121
|
-
* The emoji to remove
|
|
125
|
+
* The emoji to remove, in shortcode or unicode format. For example, ':heart:' or a
|
|
126
|
+
* unicode emoji. Required when the id refers to a message or post instead of a
|
|
127
|
+
* reaction.
|
|
122
128
|
*/
|
|
123
129
|
emoji?: string | null;
|
|
124
130
|
}
|