1 | |
2 | |
3 | * Equity Tax Events |
4 | * Create an equity tax event |
5 | **Token scopes**: `equities:write` |
6 | */ |
7 | export async function main(auth: RT.Deel, body: Body) { |
8 | const url = new URL(`https://api.letsdeel.com/rest/v2/equities/tax-events`) |
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 | data?: { |
34 | |
35 | * The exchange rate used to convert the local currency to the payroll currency |
36 | */ |
37 | fx_rate: number |
38 | |
39 | * The tax rate applied to the benefit in kind |
40 | */ |
41 | tax_rate?: number |
42 | |
43 | * The fair market value of the equity grant at the time of the event |
44 | */ |
45 | unit_fmv?: number |
46 | |
47 | * The unique identifier of the contract of the employee who received the equity grant |
48 | */ |
49 | contract_d?: string |
50 | |
51 | * The date of the event |
52 | */ |
53 | event_date?: string |
54 | |
55 | * The price at which the equity was sold |
56 | */ |
57 | sale_price?: number |
58 | |
59 | * The gross value of the equity grant |
60 | */ |
61 | gross_value?: number |
62 | |
63 | * The currency in which the equity grant was issued |
64 | */ |
65 | plan_currency: string |
66 | |
67 | * The price at which the equity was exercised |
68 | */ |
69 | exercise_price?: number |
70 | |
71 | * The unique identifier of the equity grant - optional in case you don't have remove the property |
72 | */ |
73 | equity_grant_id?: string |
74 | |
75 | * The date of the settlement |
76 | */ |
77 | settlement_date: string |
78 | |
79 | * The currency in which the payroll is processed |
80 | */ |
81 | payroll_currency: string |
82 | |
83 | * The tax jurisdiction in which the equity grant was issued |
84 | */ |
85 | tax_jurisdiction: string |
86 | |
87 | * The fees associated with the transaction |
88 | */ |
89 | transaction_fees?: number |
90 | |
91 | * The quantity of equity that remains |
92 | */ |
93 | quantity_remaining?: number |
94 | |
95 | * The taxable gain or loss |
96 | */ |
97 | taxable_gain_or_loss: number |
98 | |
99 | * The total exercise price |
100 | */ |
101 | total_exercise_price?: number |
102 | |
103 | * The total amount of taxes withheld |
104 | */ |
105 | total_taxes_withheld: number |
106 | |
107 | * The method used to cover the taxes |
108 | */ |
109 | method_of_tax_coverage: |
110 | | 'AD_HOC' |
111 | | 'BIK_REPORTING_ONLY' |
112 | | 'BIK_WITHHOLDING_AT_SOURCE_CLIENT' |
113 | | 'BIK_WITHHOLDING_AT_SOURCE_CLIENT_REVERSE' |
114 | | 'BIK_WITHHOLDING_GROSSED_UP_BONUS' |
115 | | 'BIK_WITHHOLDING_NET_SETTLEMENT' |
116 | | 'BIK_WITHHOLDING_SALARY_DEDUCTION' |
117 | | 'BIK_WITHHOLDING_WORKER' |
118 | | 'NO_BIK_NO_WITHHOLDING' |
119 | |
120 | * The quantity of equity that was withheld or sold |
121 | */ |
122 | quantity_withheld_or_sold?: number |
123 | |
124 | * The tax withheld in the local currency |
125 | */ |
126 | withheld_tax_local_currency: number |
127 | |
128 | * The benefit in kind in the local currency |
129 | */ |
130 | benefit_in_kind_local_currency: number |
131 | |
132 | * The quantity of equity that was exercised or released |
133 | */ |
134 | quantity_exercised_or_released?: number |
135 | [k: string]: unknown |
136 | } |
137 | [k: string]: unknown |
138 | } |
139 |
|