1 | |
2 | |
3 | * Edit Organization Billing Info |
4 | * |
5 | */ |
6 | export async function main(auth: RT.Qovery, organizationId: string, body: Body) { |
7 | const url = new URL(`https://api.qovery.com/organization/${organizationId}/billingInfo`) |
8 |
|
9 | const response = await fetch(url, { |
10 | method: 'PUT', |
11 | headers: { |
12 | 'Content-Type': 'application/json', |
13 | Authorization: 'Token ' + auth.apiKey |
14 | }, |
15 | body: JSON.stringify(body) |
16 | }) |
17 | if (!response.ok) { |
18 | const text = await response.text() |
19 | throw new Error(`${response.status} ${text}`) |
20 | } |
21 | return await response.json() |
22 | } |
23 |
|
24 | |
25 | |
26 | * This file was automatically generated by json-schema-to-typescript. |
27 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
28 | * and run json-schema-to-typescript to regenerate this file. |
29 | */ |
30 |
|
31 | export interface Body { |
32 | first_name: string |
33 | last_name: string |
34 | |
35 | * email used for billing, and to receive all invoices by email |
36 | */ |
37 | email: string |
38 | address: string |
39 | city: string |
40 | zip: string |
41 | |
42 | * only for US |
43 | */ |
44 | state?: string |
45 | |
46 | * ISO code of the country |
47 | */ |
48 | country_code: string |
49 | |
50 | * name of the company to bill |
51 | */ |
52 | company?: string |
53 | vat_number?: string |
54 | [k: string]: unknown |
55 | } |
56 |
|