0

Create a vendor payment provider

by
Published Oct 17, 2025

Creates a new vendor payment provider. Permissions and other requirements SubscriptionAdministration, Accounts Payable, Sage Cloud Services, Outbound Payment Services User typeBusiness user with admin permissions PermissionsList, View, Subscribe, Configure Application Subscriptions List, View, Edit Vendors

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 vendor payment provider
7
 * Creates a new vendor payment provider.
8

9

10
Permissions and other requirements
11

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

16

17

18

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

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