Skip to content

Commit 7ca080f

Browse files
authored
chore(clerk-js): Use /subscription_items endpoint to cancel subs (#6341)
1 parent 56e014c commit 7ca080f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/spicy-shirts-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Replace the `/subscriptions` FAPI endpoint with `/subscription_items` for cancelling subscription items.

packages/clerk-js/src/core/resources/CommerceSubscription.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export class CommerceSubscription extends BaseResource implements CommerceSubscr
6868
const json = (
6969
await BaseResource._fetch({
7070
path: orgId
71-
? `/organizations/${orgId}/commerce/subscriptions/${this.id}`
72-
: `/me/commerce/subscriptions/${this.id}`,
71+
? `/organizations/${orgId}/commerce/subscription_items/${this.id}`
72+
: `/me/commerce/subscription_items/${this.id}`,
7373
method: 'DELETE',
7474
})
7575
)?.response as unknown as DeletedObjectJSON;

0 commit comments

Comments
 (0)