-
Notifications
You must be signed in to change notification settings - Fork 10
/
schemaV2.graphql
14452 lines (12162 loc) · 274 KB
/
schemaV2.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
An OAuth application or a personal token
"""
type Application {
id: String!
legacyId: Int!
type: ApplicationType
@deprecated(
reason: "2022-06-16: This Application object will only be used for OAuth tokens. Use PersonalToken for user tokens"
)
name: String
description: String
apiKey: String
@deprecated(
reason: "2022-06-16: This Application object will only be used for OAuth tokens. Use PersonalToken for user tokens"
)
clientId: String
clientSecret: String
redirectUri: URL
account: Account!
oAuthAuthorization: OAuthAuthorization
}
"""
All application types
"""
enum ApplicationType {
API_KEY
OAUTH
}
"""
A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt.
"""
scalar URL
"""
An OAuth authorization
"""
type OAuthAuthorization {
id: String
account: Individual!
application: Application!
"""
The time of creation
"""
createdAt: DateTime!
"""
The time of last update
"""
updatedAt: DateTime!
"""
The time of expiration
"""
expiresAt: DateTime!
"""
The last time of token was used
"""
lastUsedAt: DateTime
"""
The attached scopes.
"""
scope: [OAuthScope]
}
"""
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
"""
scalar DateTime
"""
All supported OAuth scopes
"""
enum OAuthScope {
"""
Access your email address.
"""
email
"""
Access your incognito account.
"""
incognito
"""
Manage your account, collectives and organizations.
"""
account
"""
Create and manage expenses, payout methods.
"""
expenses
"""
Create and manage contributions, payment methods.
"""
orders
"""
Refund and reject recorded transactions.
"""
transactions
"""
Create and manage virtual cards.
"""
virtualCards
"""
Create and manage updates.
"""
updates
"""
Create and manage conversations.
"""
conversations
"""
Create and manage webhooks
"""
webhooks
"""
Administrate fiscal hosts.
"""
host
"""
Create and manage OAuth applications.
"""
applications
"""
Create and manage connected accounts.
"""
connectedAccounts
"""
Perform critical administrative operations.
"""
root
}
"""
Account interface shared by all kind of accounts (Bot, Collective, Event, User, Organization)
"""
interface Account {
"""
The public id identifying the account (ie: 5v08jk63-w4g9nbpz-j7qmyder-p7ozax5g)
"""
id: String!
"""
The internal database identifier of the collective (ie: 580)
"""
legacyId: Int! @deprecated(reason: "2020-01-01: should only be used during the transition to GraphQL API v2.")
"""
The slug identifying the account (ie: babel)
"""
slug: String!
"""
The type of the account (BOT/COLLECTIVE/EVENT/ORGANIZATION/INDIVIDUAL/VENDOR)
"""
type: AccountType!
"""
Public name
"""
name: String
"""
Private, legal name. Used for expense receipts, taxes, etc. Scope: "account".
"""
legalName: String
description: String
longDescription: String
tags: [String]
website: String
twitterHandle: String
githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl")
repositoryUrl: String
currency: String
expensePolicy: String
"""
Defines if the contributors wants to be incognito (name not displayed)
"""
isIncognito: Boolean!
imageUrl(height: Int, format: ImageFormat): String
backgroundImageUrl(height: Int, format: ImageFormat): String
"""
The time of creation
"""
createdAt: DateTime
"""
The time of last update
"""
updatedAt: DateTime
"""
Returns whether this account is archived
"""
isArchived: Boolean!
"""
Whether this account is frozen
"""
isFrozen: Boolean!
"""
Returns whether the account accepts financial contributions.
"""
isActive: Boolean
"""
Returns whether the account is setup to Host collectives.
"""
isHost: Boolean!
"""
Returns true if the remote user is an admin of this account
"""
isAdmin: Boolean!
parentAccount: Account
members(
limit: Int! = 100
offset: Int! = 0
role: [MemberRole]
"""
Admin only. To filter on the email address of a member, useful to check if a member exists.
"""
email: EmailAddress
"""
Type of accounts (BOT/COLLECTIVE/EVENT/ORGANIZATION/INDIVIDUAL)
"""
accountType: [AccountType]
): MemberCollection!
"""
Get pending member invitations for this account
"""
memberInvitations(role: [MemberRole]): [MemberInvitation]
memberOf(
limit: Int! = 100
offset: Int! = 0
role: [MemberRole]
"""
Filter on (un)approved collectives
"""
isApproved: Boolean
"""
Filter on archived collectives
"""
isArchived: Boolean
"""
Type of accounts (BOT/COLLECTIVE/EVENT/ORGANIZATION/INDIVIDUAL)
"""
accountType: [AccountType]
"""
Specific account to query the membership of.
"""
account: AccountReferenceInput
orderBy: OrderByInput! = { field: CREATED_AT, direction: DESC }
"""
Order the query by requested role order
"""
orderByRoles: Boolean
): MemberOfCollection
"""
Returns the emails of the account. Individuals only have one, but organizations can have multiple emails.
"""
emails: [EmailAddress!]
transactions(
"""
The number of results to fetch (default 10, max 1000)
"""
limit: Int! = 100
"""
The offset to use to fetch
"""
offset: Int! = 0
"""
The transaction type (DEBIT or CREDIT)
"""
type: TransactionType
"""
The payment method types. Can include `null` for transactions without a payment method
"""
paymentMethodType: [PaymentMethodType]
"""
Reference of the account assigned to the other side of the transaction (CREDIT -> sender, DEBIT -> recipient). Avoid, favor account instead.
"""
fromAccount: AccountReferenceInput
"""
Reference of the host accounting the transaction
"""
host: AccountReferenceInput
"""
NOT IMPLEMENTED. Only return transactions that match these tags.
"""
tags: [String] @deprecated(reason: "2020-08-09: Was never implemented.")
"""
The order of results
"""
orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: DESC }
"""
Only return transactions where the amount is greater than or equal to this value (in cents)
"""
minAmount: Int @deprecated(reason: "2020-08-09: GraphQL v2 should not expose amounts as integer.")
"""
Only return transactions where the amount is lower than or equal to this value (in cents)
"""
maxAmount: Int @deprecated(reason: "2020-08-09: GraphQL v2 should not expose amounts as integer.")
"""
Only return transactions that were created after this date
"""
dateFrom: DateTime
"""
Only return transactions that were created before this date
"""
dateTo: DateTime
"""
The term to search
"""
searchTerm: String
"""
Only return transactions with an Expense attached
"""
hasExpense: Boolean
"""
Only return transactions with an Order attached
"""
hasOrder: Boolean
"""
Whether to include regular transactions from the account (turn false if you only want Incognito or Gift Card transactions)
"""
includeRegularTransactions: Boolean! = true
"""
If the account is a user and this field is true, contributions from the incognito profile will be included too (admins only)
"""
includeIncognitoTransactions: Boolean! = false
"""
Whether to include transactions from children (Events and Projects)
"""
includeChildrenTransactions: Boolean! = false
"""
Whether to include transactions from Gift Cards issued by the account.
"""
includeGiftCardTransactions: Boolean! = false
"""
Whether to include debt transactions
"""
includeDebts: Boolean! = false
"""
To filter by transaction kind
"""
kind: [TransactionKind]
"""
The transactions group to filter by
"""
group: String
): TransactionCollection!
orders(
"""
The number of results to fetch (default 10, max 1000)
"""
limit: Int! = 100
"""
The offset to use to fetch
"""
offset: Int! = 0
"""
If account is a host, also include hosted accounts orders
"""
includeHostedAccounts: Boolean
"""
Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING.
"""
includeIncognito: Boolean = false
"""
Account orders filter (INCOMING or OUTGOING)
"""
filter: AccountOrdersFilter
"""
Use this field to filter orders on their frequency (ONETIME, MONTHLY or YEARLY)
"""
frequency: ContributionFrequency
"""
Use this field to filter orders on their statuses
"""
status: [OrderStatus]
"""
The order of results
"""
orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: DESC }
"""
Only return orders where the amount is greater than or equal to this value (in cents)
"""
minAmount: Int
"""
Only return orders where the amount is lower than or equal to this value (in cents)
"""
maxAmount: Int
"""
Only return orders that were created after this date
"""
dateFrom: DateTime
"""
Only return orders that were created after this date
"""
dateTo: DateTime
"""
The term to search
"""
searchTerm: String
tierSlug: String @deprecated(reason: "2022-02-25: Should be replaced by a tier reference. Not existing yet.")
"""
Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency.
"""
onlySubscriptions: Boolean
): OrderCollection!
settings: JSON!
conversations(
limit: Int! = 15
offset: Int! = 0
"""
Only return conversations matching this tag
"""
tag: String
): ConversationCollection!
"""
Returns conversation's tags for collective sorted by popularity
"""
conversationsTags(limit: Int! = 30): [TagStat]
"""
Returns expense tags for collective sorted by popularity
"""
expensesTags(limit: Int! = 30): [TagStat]
"""
The list of expense types supported by this account
"""
supportedExpenseTypes: [ExpenseType!]!
transferwise: TransferWise
"""
The list of payout methods that this account can use to get paid
"""
payoutMethods: [PayoutMethod]
"""
The list of payment methods that this account can use to pay for Orders
"""
paymentMethods(
"""
Filter on given types (CREDITCARD, GIFTCARD...)
"""
type: [PaymentMethodType]
"""
Filter on given types (CREDITCARD, GIFTCARD...)
"""
enumType: [PaymentMethodType] @deprecated(reason: "2021-08-20: use type instead from now")
"""
Filter on the given service types (opencollective, stripe, paypal...)
"""
service: [PaymentMethodService]
"""
Whether to include expired payment methods. Payment methods expired since more than 6 months will never be returned.
"""
includeExpired: Boolean
): [PaymentMethod]
"""
The list of connected accounts (Stripe, Twitter, etc ...)
"""
connectedAccounts: [ConnectedAccount]
"""
The list of applications created by this account. Admin only. Scope: "applications".
"""
oAuthApplications(
"""
The number of results to fetch (default 10, max 1000)
"""
limit: Int! = 10
"""
The offset to use to fetch
"""
offset: Int! = 0
): OAuthApplicationCollection
"""
The address associated to this account. This field is always public for collectives and events.
"""
location: Location
"""
Categories set by Open Collective to help moderation.
"""
categories: [String]!
stats: AccountStats
"""
Updates published by the account. To see unpublished updates, you need to be an admin and have the scope "updates".
"""
updates(
"""
The number of results to fetch (default 10, max 1000)
"""
limit: Int! = 10
"""
The offset to use to fetch
"""
offset: Int! = 0
"""
Only return published updates.
"""
onlyPublishedUpdates: Boolean = false
onlyChangelogUpdates: Boolean
orderBy: UpdateChronologicalOrderInput! = { field: CREATED_AT, direction: DESC }
searchTerm: String
): UpdateCollection!
"""
Describes the features enabled and available for this account
"""
features: CollectiveFeatures!
"""
Virtual Cards attached to the account. Admin only. Scope: "virtualCards".
"""
virtualCards(
limit: Int! = 100
offset: Int! = 0
state: String = null
merchantAccount: AccountReferenceInput = null
"""
Only return expenses that were created after this date
"""
dateFrom: DateTime = null
"""
Only return expenses that were created before this date
"""
dateTo: DateTime = null
orderBy: ChronologicalOrderInput = { field: CREATED_AT, direction: DESC }
): VirtualCardCollection
"""
Virtual Cards Merchants used by the account. Admin only. Scope: "virtualCards".
"""
virtualCardMerchants(limit: Int! = 100, offset: Int! = 0): AccountCollection
childrenAccounts(limit: Int! = 100, offset: Int! = 0, accountType: [AccountType]): AccountCollection!
"""
Policies for the account. To see non-public policies you need to be admin and have the scope: "account".
"""
policies: Policies!
"""
List of activities that the logged-in user is subscribed for this collective
"""
activitySubscriptions(channel: ActivityChannel): [ActivitySubscription]
"""
Logged-in user permissions on an account
"""
permissions: AccountPermissions!
}
"""
All account types
"""
enum AccountType {
BOT
COLLECTIVE
EVENT
FUND
INDIVIDUAL
ORGANIZATION
PROJECT
VENDOR
}
enum ImageFormat {
txt
png
jpg
gif
svg
}
"""
A collection of "Members" (ie: Organization backing a Collective)
"""
type MemberCollection implements Collection {
offset: Int
limit: Int
totalCount: Int
nodes: [Member]
}
"""
Collection interface shared by all collection types
"""
interface Collection {
offset: Int
limit: Int
totalCount: Int
}
"""
All member roles
"""
enum MemberRole {
BACKER
ADMIN
CONTRIBUTOR
HOST
ATTENDEE
MEMBER
FUNDRAISER
FOLLOWER
ACCOUNTANT
CONNECTED_ACCOUNT
}
"""
A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/.
"""
scalar EmailAddress
"""
An invitation to join the members of a collective
"""
type MemberInvitation {
id: String!
"""
The person who invited the member, if any
"""
inviter: Individual
createdAt: DateTime!
account: Account!
memberAccount: Account!
role: MemberRole!
description: String
tier: Tier
since: DateTime
}
"""
Tier model
"""
type Tier {
id: String!
legacyId: Int!
slug: String
name: String
description: String
"""
Get all orders
"""
orders(limit: Int! = 100, offset: Int! = 0, status: [OrderStatus]): OrderCollection!
amount: Amount!
button: String
goal: Amount!
type: TierType!
interval: TierInterval @deprecated(reason: "2020-08-24: Please use \"frequency\"")
frequency: TierFrequency!
presets: [Int]
maxQuantity: Int
"""
Number of tickets available. Returns null if there is no limit.
"""
availableQuantity: Int
customFields: JSON
amountType: TierAmountType!
minimumAmount: Amount!
endsAt: DateTime
invoiceTemplate: String
useStandalonePage: Boolean
}
"""
A collection of "Orders"
"""
type OrderCollection implements Collection {
offset: Int
limit: Int
totalCount: Int
nodes: [Order]
}
"""
Order model
"""
type Order {
id: String!
legacyId: Int!
description: String
"""
Base order amount (without platform tip)
"""
amount: Amount!
"""
Total order amount, including all taxes and platform tip
"""
totalAmount: Amount!
quantity: Int
status: OrderStatus
frequency: ContributionFrequency
nextChargeDate: DateTime
tier: Tier
fromAccount: Account
toAccount: Account
"""
Transactions for this order ordered by createdAt ASC
"""
transactions: [Transaction]!
createdAt: DateTime
updatedAt: DateTime
"""
WARNING: Total amount donated between collectives, though there will be edge cases especially when looking on the Order level, as the order id is not used in calculating this.
"""
totalDonations: Amount!
paymentMethod: PaymentMethod
"""
Platform Tip attached to the Order.
"""
platformTipAmount: Amount
platformTipEligible: Boolean
tags: [String]!
taxes: [OrderTax]!
"""
This represents a MemberOf relationship (ie: Collective backed by an Individual) attached to the Order.
"""
membership: MemberOf
"""
The permissions given to current logged in user for this order
"""
permissions: OrderPermissions!
"""
Data related to the order
"""
data: JSON
"""
Custom data related to the order, based on the fields described by tier.customFields. Must be authenticated as an admin of the fromAccount or toAccount (returns null otherwise)
"""
customData: JSON
"""
Memo field which adds additional details about the order. For example in added funds this can be a note to mark what method (cheque, money order) the funds were received.
"""
memo: String
}
"""
All order statuses
"""
enum OrderStatus {
ACTIVE
CANCELLED
DISPUTED
ERROR
EXPIRED
IN_REVIEW
NEW
PAID
PENDING
PLEDGED
REFUNDED
REJECTED
REQUIRE_CLIENT_CONFIRMATION
}
enum ContributionFrequency {
MONTHLY
YEARLY
ONETIME
}
"""
Transaction interface shared by all kind of transactions (Debit, Credit)
"""
interface Transaction {
id: String!
legacyId: Int!
uuid: String! @deprecated(reason: "2021-08-15: Use id instead.")
group: String!
type: TransactionType!
kind: TransactionKind
description(
"""
Wether to generate the description dynamically.
"""
dynamic: Boolean = false
"""
Wether to generate the full description when using dynamic.
"""
full: Boolean = false
): String
amount: Amount!
amountInHostCurrency: Amount!
"""
Exchange rate between the currency of the transaction and the currency of the host (transaction.amount * transaction.hostCurrencyFxRate = transaction.amountInHostCurrency)
"""
hostCurrencyFxRate: Float
netAmount(
"""
Fetch HOST_FEE transaction and integrate in calculation for retro-compatiblity.
"""
fetchHostFee: Boolean = false
): Amount!
netAmountInHostCurrency(
"""
Fetch HOST_FEE transaction and integrate in calculation for retro-compatiblity.
"""
fetchHostFee: Boolean = false
): Amount!
taxAmount: Amount!
"""
If taxAmount is set, this field will contain more info about the tax
"""
taxInfo: TaxInfo
platformFee: Amount!
hostFee(
"""
Fetch HOST_FEE transaction for retro-compatiblity.
"""
fetchHostFee: Boolean = false
): Amount
paymentProcessorFee: Amount
host: Account
account: Account
oppositeAccount: Account
"""
The sender of a transaction (on CREDIT = oppositeAccount, DEBIT = account)
"""
fromAccount: Account
"""
The recipient of a transaction (on CREDIT = account, DEBIT = oppositeAccount)
"""
toAccount: Account
giftCardEmitterAccount: Account
createdAt: DateTime
updatedAt: DateTime
expense: Expense
order: Order
isRefunded: Boolean
isRefund: Boolean
isDisputed: Boolean
isInReview: Boolean
paymentMethod: PaymentMethod
payoutMethod: PayoutMethod
permissions: TransactionPermissions
isOrderRejected: Boolean!
refundTransaction: Transaction
relatedTransactions(
"""
Filter by kind
"""
kind: [TransactionKind]
): [Transaction]!
"""
Merchant id related to the Transaction (Stripe, PayPal, Wise, Privacy)
"""
merchantId: String
"""
The balance after the Transaction has run. Only for financially active accounts.
"""
balanceInHostCurrency: Amount
invoiceTemplate: String
}
"""
All transaction types
"""
enum TransactionType {
DEBIT
CREDIT
}
enum TransactionKind {
ADDED_FUNDS
BALANCE_TRANSFER
CONTRIBUTION
EXPENSE
HOST_FEE
HOST_FEE_SHARE
HOST_FEE_SHARE_DEBT
PAYMENT_PROCESSOR_COVER
PAYMENT_PROCESSOR_DISPUTE_FEE
PAYMENT_PROCESSOR_FEE
PLATFORM_FEE
PLATFORM_TIP
PLATFORM_TIP_DEBT
PREPAID_PAYMENT_METHOD
}
"""
Information about a tax
"""
type TaxInfo {
"""
An unique identifier for this tax (GST, VAT, etc)
"""
id: String!
"""
Identifier for this tax (GST, VAT, etc)
"""
type: OrderTaxType!
"""
Percentage applied, between 0-100
"""
percentage: Int! @deprecated(reason: "Please use `rate` instead")