0

Create a payment provider bank account

by
Published Oct 17, 2025

Creates a new payment provider bank account. Permissions and other requirements SubscriptionAdministration, Sage Cloud Services, Outbound Payment Services User typeBusiness user with admin permissions PermissionsList, View, Subscribe, Configure Application Subscriptions

Script sage_intacct Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type SageIntacct = {
3
	token: string
4
}
5
/**
6
 * Create a payment provider bank account
7
 * Creates a new payment provider bank account.
8

9

10
Permissions and other requirements
11

12
SubscriptionAdministration, Sage Cloud Services, Outbound Payment Services
13
User typeBusiness user with admin permissions
14
PermissionsList, View, Subscribe, Configure Application Subscriptions
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		state?:
26
			| 'requestInitiated'
27
			| 'inProgress'
28
			| 'requestReceived'
29
			| 'requestFailed'
30
			| 'awaitingAuthorization'
31
			| 'subscribed'
32
			| 'canceled'
33
			| 'suspended'
34
		providerReferenceNumber?: string
35
		authenticationURL?: string
36
		checkStartNumber?: string
37
		isRebateAccount?: false | true
38
		remittanceEmail?: string
39
		bankAccount?: {
40
			key?: string
41
			id?: string
42
			currency?: string
43
			href?: string
44
		}
45
		paymentProvider?: { key?: string; id?: string; href?: string }
46
		href?: string
47
		audit?: {
48
			createdDateTime?: string
49
			modifiedDateTime?: string
50
			createdBy?: string
51
			modifiedBy?: string
52
		}
53
		status?: 'active' | 'inactive'
54
	}
55
) {
56
	const url = new URL(
57
		`https://api.intacct.com/ia/api/v1/objects/cash-management/payment-provider-bank-account`
58
	)
59

60
	const response = await fetch(url, {
61
		method: 'POST',
62
		headers: {
63
			'Content-Type': 'application/json',
64
			Authorization: 'Bearer ' + auth.token
65
		},
66
		body: JSON.stringify(body)
67
	})
68
	if (!response.ok) {
69
		const text = await response.text()
70
		throw new Error(`${response.status} ${text}`)
71
	}
72
	return await response.json()
73
}
74