//native
/**
* Update a bank transfer method
* Updates a bank transfer method
**Token scopes**: `worker:read`, `worker:write`
*/
export async function main(auth: RT.Deel, id: string, body: Body) {
const url = new URL(`https://api.letsdeel.com/rest/v2/payouts/contractors/methods/${id}`)
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Body {
data: {
address: {
/**
* City name
*/
city: string
/**
* State code
*/
state?: string
/**
* Country code
*/
country: string
/**
* Post code
*/
post_code: string
/**
* First line of the address
*/
first_line: string
[k: string]: unknown
}
/**
* Dynamic properties based on selected option. For example, if `selectedOption` is `swift_code`, payload may include `swiftCode`, `accountHolderName`, and `accountNumber`.
*/
payload: {
[k: string]: unknown
}
/**
* Specifies if the method is the default payout method - if true, autowithdrawal will be enabled for the contractor using this method
*/
is_default?: boolean
/**
* Name for method
*/
method_name?: string
/**
* Specifies the type of payment method
*/
payment_method: 'bank_transfer'
/**
* Specifies the type of bank transfer method. Maps from requirements type field
*/
selectedOption?: string
[k: string]: unknown
}
[k: string]: unknown
}
Submitted by hugo697 235 days ago