( campaign: string = 'claude_code_guest_pass', )
| 45 | } |
| 46 | |
| 47 | export async function fetchReferralRedemptions( |
| 48 | campaign: string = 'claude_code_guest_pass', |
| 49 | ): Promise<ReferralRedemptionsResponse> { |
| 50 | const { accessToken, orgUUID } = await prepareApiRequest() |
| 51 | |
| 52 | const headers = { |
| 53 | ...getOAuthHeaders(accessToken), |
| 54 | 'x-organization-uuid': orgUUID, |
| 55 | } |
| 56 | |
| 57 | const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/referral/redemptions` |
| 58 | |
| 59 | const response = await axios.get<ReferralRedemptionsResponse>(url, { |
| 60 | headers, |
| 61 | params: { campaign }, |
| 62 | timeout: 10000, // 10 second timeout |
| 63 | }) |
| 64 | |
| 65 | return response.data |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Prechecks for if user can access guest passes feature |
no test coverage detected