1 | |
2 | |
3 | * Create a request to exercise equity. |
4 | * Create a request to exercise equity. |
5 | **Token scopes**: `contracts:write` |
6 | */ |
7 | export async function main(auth: RT.Deel, body: Body) { |
8 | const url = new URL(`https://api.letsdeel.com/rest/v2/equity/exercise`) |
9 |
|
10 | const response = await fetch(url, { |
11 | method: 'POST', |
12 | headers: { |
13 | 'Content-Type': 'application/json', |
14 | Authorization: 'Bearer ' + auth.apiKey |
15 | }, |
16 | body: JSON.stringify(body) |
17 | }) |
18 | if (!response.ok) { |
19 | const text = await response.text() |
20 | throw new Error(`${response.status} ${text}`) |
21 | } |
22 | return await response.json() |
23 | } |
24 |
|
25 | |
26 | |
27 | * This file was automatically generated by json-schema-to-typescript. |
28 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
29 | * and run json-schema-to-typescript to regenerate this file. |
30 | */ |
31 |
|
32 | export interface Body { |
33 | |
34 | * The fair market value of the equity. |
35 | */ |
36 | fmv: string |
37 | |
38 | * The quantity of equity to exercise. |
39 | */ |
40 | quantity: number |
41 | |
42 | * The unique identifier of the issuer. |
43 | */ |
44 | issuer_id: string |
45 | |
46 | * The unique identifier of the worker. |
47 | */ |
48 | worker_id: string |
49 | |
50 | * The zip code of the address. |
51 | */ |
52 | address_zip: string |
53 | |
54 | * The unique identifier of the exercise. |
55 | */ |
56 | exercise_id: string |
57 | |
58 | * The city of the address. |
59 | */ |
60 | address_city: string |
61 | |
62 | * The state of the address. |
63 | */ |
64 | address_state: string |
65 | |
66 | * The street of the address. |
67 | */ |
68 | address_street: string |
69 | |
70 | * The unique identifier of the stakeholder. |
71 | */ |
72 | stakeholder_id: string |
73 | |
74 | * The country of the address. |
75 | */ |
76 | address_country: string |
77 | |
78 | * The unique identifier of the option grant. |
79 | */ |
80 | option_grant_id: string |
81 | |
82 | * The currency code of the fair market value. |
83 | */ |
84 | fmv_currency_code: string |
85 | |
86 | * The email of the stakeholder. |
87 | */ |
88 | stakeholder_email: string |
89 | |
90 | * The issue of the option grant. |
91 | */ |
92 | option_grant_issue: string |
93 | |
94 | * The label of the option grant. |
95 | */ |
96 | option_grant_label: string |
97 | |
98 | * The currency of the option grant. |
99 | */ |
100 | option_grant_currency: string |
101 | |
102 | * The issue date of the option grant. |
103 | */ |
104 | option_grant_issue_date: string |
105 | |
106 | * The expiry date of the option grant. |
107 | */ |
108 | option_grant_expiry_date: string |
109 | |
110 | * The relationship of the stakeholder. |
111 | */ |
112 | stakeholder_relationship: string |
113 | |
114 | * The strike price of the option grant. |
115 | */ |
116 | option_grant_strike_price: string |
117 | [k: string]: unknown |
118 | } |
119 |
|