@itm-studio/partner-sdk 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -0
- package/dist/index.d.mts +243 -1
- package/dist/index.d.ts +243 -1
- package/dist/index.js +1547 -1239
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1547 -1239
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/partner.graphql +208 -0
package/package.json
CHANGED
package/schema/partner.graphql
CHANGED
|
@@ -453,6 +453,66 @@ enum ContributionPageStatusFilter {
|
|
|
453
453
|
PAUSED
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
+
"""
|
|
457
|
+
How a merch payment collected outside ITM was taken. A null paymentMethod
|
|
458
|
+
means the purchase was paid through ITM checkout, in person through ITM, or was free.
|
|
459
|
+
"""
|
|
460
|
+
enum MerchPurchasePaymentMethod {
|
|
461
|
+
"""Physical currency."""
|
|
462
|
+
CASH
|
|
463
|
+
"""Card taken on a non-ITM terminal or processor (Square, SumUp, Clover...), including Apple Pay or Google Pay tapped on that terminal."""
|
|
464
|
+
CARD
|
|
465
|
+
"""Venmo, Cash App, PayPal, Zelle and similar apps."""
|
|
466
|
+
DIGITAL_WALLET
|
|
467
|
+
"""ACH, wire or bank deposit."""
|
|
468
|
+
BANK_TRANSFER
|
|
469
|
+
"""Check or money order."""
|
|
470
|
+
CHECK
|
|
471
|
+
"""Anything else, such as a third-party gift card, store credit or crypto."""
|
|
472
|
+
OTHER
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
enum MerchPurchaseSource {
|
|
476
|
+
APP
|
|
477
|
+
DASHBOARD
|
|
478
|
+
POS
|
|
479
|
+
"""Recorded through the partner API."""
|
|
480
|
+
PARTNER
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
enum MerchPurchaseState {
|
|
484
|
+
FAILED
|
|
485
|
+
PENDING
|
|
486
|
+
REFUNDED
|
|
487
|
+
REFUND_PENDING
|
|
488
|
+
SUCCESS
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
enum MerchPurchaseFulfillmentChoice {
|
|
492
|
+
PICKUP
|
|
493
|
+
SHIPPING
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
"""How merch reaches the customer: pickup at a moment, shipping, or either."""
|
|
497
|
+
enum MerchFulfillmentType {
|
|
498
|
+
MOMENT
|
|
499
|
+
MOMENT_OR_SHIPPING
|
|
500
|
+
SHIPPING
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
"""EXTERNAL means Shopify fulfills the order; such purchases cannot be redeemed from ITM."""
|
|
504
|
+
enum FulfillmentPlatform {
|
|
505
|
+
EXTERNAL
|
|
506
|
+
ITM
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
"""Only ITM-checkout merch can be recorded through createPartnerMerchPurchase."""
|
|
510
|
+
enum CheckoutPlatform {
|
|
511
|
+
EXTERNAL
|
|
512
|
+
ITM
|
|
513
|
+
WEBSITE
|
|
514
|
+
}
|
|
515
|
+
|
|
456
516
|
# ─── Types ───────────────────────────────────────────────────────────────────
|
|
457
517
|
|
|
458
518
|
type Currency {
|
|
@@ -797,6 +857,140 @@ type MerchPurchase {
|
|
|
797
857
|
updatedAt: DateTime!
|
|
798
858
|
}
|
|
799
859
|
|
|
860
|
+
"""
|
|
861
|
+
A merch purchase as a partner token sees it. Related records are referenced by
|
|
862
|
+
uid only; the customer's ITM account is never exposed.
|
|
863
|
+
"""
|
|
864
|
+
type PartnerMerchPurchase {
|
|
865
|
+
uid: ID!
|
|
866
|
+
merchUid: String!
|
|
867
|
+
merchSizeUid: String!
|
|
868
|
+
"""The customer's ITM user uid. Null for box-office walk-up purchases with no customer."""
|
|
869
|
+
userUid: String
|
|
870
|
+
pickupMomentUid: String
|
|
871
|
+
quantity: Int!
|
|
872
|
+
"""Total charged in ITM cents (major units times 100)."""
|
|
873
|
+
amountCents: Int!
|
|
874
|
+
currencyCode: String!
|
|
875
|
+
state: MerchPurchaseState!
|
|
876
|
+
source: MerchPurchaseSource!
|
|
877
|
+
"""How a payment collected outside ITM was taken; null for ITM-paid or free purchases."""
|
|
878
|
+
paymentMethod: MerchPurchasePaymentMethod
|
|
879
|
+
"""Who took the off-platform payment, e.g. "Square POS" or "Venmo"."""
|
|
880
|
+
paymentProvider: String
|
|
881
|
+
"""The off-platform payment system's transaction or order ID."""
|
|
882
|
+
externalPaymentReference: String
|
|
883
|
+
fulfillmentChoice: MerchPurchaseFulfillmentChoice
|
|
884
|
+
notes: String
|
|
885
|
+
"""When the purchase was handed over; null until redeemed."""
|
|
886
|
+
redeemedAt: DateTime
|
|
887
|
+
createdAt: DateTime!
|
|
888
|
+
updatedAt: DateTime!
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
type MerchSize {
|
|
892
|
+
uid: ID!
|
|
893
|
+
name: String!
|
|
894
|
+
isSoldOut: Boolean!
|
|
895
|
+
createdAt: DateTime!
|
|
896
|
+
updatedAt: DateTime!
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
type Merch {
|
|
900
|
+
uid: ID!
|
|
901
|
+
name: String!
|
|
902
|
+
description: String
|
|
903
|
+
"""Price in ITM cents (major units times 100)."""
|
|
904
|
+
price: Float!
|
|
905
|
+
currency: Currency!
|
|
906
|
+
fulfillmentType: MerchFulfillmentType!
|
|
907
|
+
fulfillmentPlatform: FulfillmentPlatform!
|
|
908
|
+
checkoutPlatform: CheckoutPlatform!
|
|
909
|
+
maxPerUser: Int
|
|
910
|
+
isLive: Boolean!
|
|
911
|
+
merchSizes: [MerchSize!]!
|
|
912
|
+
"""Moments where this merch can be picked up; pass one as pickupMomentUid."""
|
|
913
|
+
merchPickupMoments: [Moment!]!
|
|
914
|
+
createdAt: DateTime!
|
|
915
|
+
updatedAt: DateTime!
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
type GetMerchPaginatedResponse {
|
|
919
|
+
items: [Merch!]!
|
|
920
|
+
totalCount: Int!
|
|
921
|
+
hasNextPage: Boolean!
|
|
922
|
+
nextCursor: String
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
input MerchFiltersInput {
|
|
926
|
+
"""Merch associated with this moment, including display, upsell and pickup links. Check merchPickupMoments for pickup eligibility."""
|
|
927
|
+
momentUid: String
|
|
928
|
+
search: String
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
input GetMerchPaginatedInput {
|
|
932
|
+
cursor: String
|
|
933
|
+
"""Page size, 1-100. Defaults to 50."""
|
|
934
|
+
take: Int
|
|
935
|
+
query: String
|
|
936
|
+
filters: MerchFiltersInput
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
input PartnerMerchCustomerInput {
|
|
940
|
+
email: String
|
|
941
|
+
"""Phone number with country code, e.g. +14155550123."""
|
|
942
|
+
phoneNumber: String
|
|
943
|
+
name: String
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
input PartnerMerchShippingAddressInput {
|
|
947
|
+
"""Full name for shipping."""
|
|
948
|
+
name: String!
|
|
949
|
+
"""Contact number for shipping."""
|
|
950
|
+
phoneNumber: String!
|
|
951
|
+
addressLine1: String!
|
|
952
|
+
addressLine2: String
|
|
953
|
+
city: String!
|
|
954
|
+
"""State, province or region."""
|
|
955
|
+
state: String!
|
|
956
|
+
country: String!
|
|
957
|
+
postalCode: String!
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
input CreatePartnerMerchPurchaseInput {
|
|
961
|
+
"""
|
|
962
|
+
Caller-generated id, 8-128 letters, digits, underscores or hyphens.
|
|
963
|
+
Retrying with the same requestUid returns the original purchase; different details are rejected.
|
|
964
|
+
"""
|
|
965
|
+
requestUid: String!
|
|
966
|
+
merchUid: String!
|
|
967
|
+
merchSizeUid: String!
|
|
968
|
+
quantity: Int!
|
|
969
|
+
"""Total collected in ITM cents (major units times 100, including zero-decimal currencies). 0 for a free purchase."""
|
|
970
|
+
amountCents: Int!
|
|
971
|
+
"""ISO currency code; must match the merch's currency."""
|
|
972
|
+
currencyCode: String!
|
|
973
|
+
"""How the customer paid outside ITM. Required when amountCents is above 0; omit for a free purchase."""
|
|
974
|
+
paymentMethod: MerchPurchasePaymentMethod
|
|
975
|
+
"""Who took the payment, e.g. "Square POS" or "Venmo". Requires paymentMethod."""
|
|
976
|
+
paymentProvider: String
|
|
977
|
+
"""The payment system's transaction or order ID, for reconciliation. Requires paymentMethod."""
|
|
978
|
+
externalPaymentReference: String
|
|
979
|
+
"""Matched to an existing ITM account by phone number or email (verified login identities first) and never written onto it; a customer is created when nobody matches."""
|
|
980
|
+
customer: PartnerMerchCustomerInput!
|
|
981
|
+
"""Pickup moment, required for pickup fulfillment."""
|
|
982
|
+
pickupMomentUid: String
|
|
983
|
+
"""Required for merch offered as pickup or shipping."""
|
|
984
|
+
fulfillmentChoice: MerchPurchaseFulfillmentChoice
|
|
985
|
+
"""Required when the purchase ships."""
|
|
986
|
+
shippingAddress: PartnerMerchShippingAddressInput
|
|
987
|
+
notes: String
|
|
988
|
+
"""Mark the purchase redeemed (handed over) now. Not allowed for Shopify-fulfilled merch. Defaults to false."""
|
|
989
|
+
redeemed: Boolean
|
|
990
|
+
"""Send ITM's SMS or email confirmation with the pickup QR code. Defaults to false."""
|
|
991
|
+
sendConfirmation: Boolean
|
|
992
|
+
}
|
|
993
|
+
|
|
800
994
|
type PartnerCustomer {
|
|
801
995
|
user: User!
|
|
802
996
|
tickets: [Ticket!]!
|
|
@@ -1783,6 +1977,11 @@ type Query {
|
|
|
1783
1977
|
"""Active brand-linked assets, newest first. Defaults to 50, capped at 100. READ_MEDIA for agents."""
|
|
1784
1978
|
getPartnerMediaAssets(input: GetPartnerMediaAssetsInput!): GetPartnerMediaAssetsResponse!
|
|
1785
1979
|
|
|
1980
|
+
"""
|
|
1981
|
+
List the brand's merch with sizes and pickup moments, to find the merchUid, merchSizeUid and pickupMomentUid for createPartnerMerchPurchase.
|
|
1982
|
+
"""
|
|
1983
|
+
getPartnerMerch(input: GetMerchPaginatedInput!): GetMerchPaginatedResponse!
|
|
1984
|
+
|
|
1786
1985
|
"""An active asset linked to the caller's brand; null when unavailable. READ_MEDIA for agents."""
|
|
1787
1986
|
getPartnerMediaAsset(uid: String!): MediaAsset
|
|
1788
1987
|
|
|
@@ -2360,6 +2559,15 @@ type Mutation {
|
|
|
2360
2559
|
"""Log a payment received off-site. Brand scope comes from the authenticated token or agent session. Amount is in ITM cents (major units times 100). Retain requestUid across retries."""
|
|
2361
2560
|
createPartnerManualContribution(input: CreateManualContributionInput!): ContributionAdmin!
|
|
2362
2561
|
|
|
2562
|
+
"""
|
|
2563
|
+
Record a merch sale whose payment was collected outside ITM (cash, a card terminal, Venmo...), so it reaches the brand's CRM.
|
|
2564
|
+
Brand scope comes from the token. Amount is in ITM cents (major units times 100). Retain requestUid across retries.
|
|
2565
|
+
"""
|
|
2566
|
+
createPartnerMerchPurchase(input: CreatePartnerMerchPurchaseInput!): PartnerMerchPurchase!
|
|
2567
|
+
|
|
2568
|
+
"""Mark one of the brand's merch purchases redeemed (handed over). Redeeming an already redeemed purchase returns it unchanged."""
|
|
2569
|
+
redeemPartnerMerchPurchase(merchPurchaseUid: String!): PartnerMerchPurchase!
|
|
2570
|
+
|
|
2363
2571
|
reserveAgentMediaUpload(input: ReserveAgentMediaUploadInput!): AgentMediaUploadReservation!
|
|
2364
2572
|
finishAgentMediaUpload(uid: String!): Boolean!
|
|
2365
2573
|
|