@itm-studio/partner-sdk 0.6.1 → 0.6.3

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 CHANGED
@@ -777,6 +777,124 @@ const { getMomentLineupByToken } = await itm.query({
777
777
  });
778
778
  ```
779
779
 
780
+ ### In-person POS orders and charges
781
+
782
+ Use `getPartnerInPersonOrdersForMoment` for itemized POS sales at a moment,
783
+ `getPartnerInPersonOrder` to retrieve one order by UID, and
784
+ `getPartnerInPersonChargesForMoment` for payment records, including older charges
785
+ that have no itemized order (`orderUid: null`). These reads require a partner
786
+ API key; agent credentials are not accepted.
787
+
788
+ The order and charge lists default to confirmed sales: `PAID` and
789
+ `PARTIALLY_REFUNDED`. Omitted or `null` `statuses` uses that default. Pass a
790
+ nonempty status list to select other states, or `statuses: []` to include every
791
+ state, including pending, failed, canceled, expired, and fully refunded records.
792
+ The single-order query can retrieve any status.
793
+
794
+ ```typescript
795
+ const page = await itm.query({
796
+ getPartnerInPersonOrdersForMoment: {
797
+ __args: { momentSlug: "test-moment", take: 50 },
798
+ orders: {
799
+ uid: true,
800
+ momentUid: true,
801
+ momentSlug: true,
802
+ status: true,
803
+ currencyCode: true,
804
+ grossAmount: true,
805
+ subtotalAmount: true,
806
+ taxAmount: true,
807
+ refundedAmount: true,
808
+ paidAt: true,
809
+ user: { uid: true, name: true, primaryEmail: true },
810
+ charge: { uid: true, orderUid: true, status: true, amount: true },
811
+ items: {
812
+ uid: true,
813
+ type: true,
814
+ category: true,
815
+ name: true,
816
+ quantity: true,
817
+ unitAmount: true,
818
+ lineAmount: true,
819
+ refundedQuantity: true,
820
+ refundableQuantity: true,
821
+ ticketTierUid: true,
822
+ merchUid: true,
823
+ contributionUid: true,
824
+ },
825
+ refunds: { uid: true, amount: true, status: true },
826
+ },
827
+ totalCount: true,
828
+ hasNextPage: true,
829
+ nextCursor: true,
830
+ },
831
+ });
832
+
833
+ const single = await itm.query({
834
+ getPartnerInPersonOrder: {
835
+ __args: { orderUid: "order-uid" },
836
+ uid: true,
837
+ status: true,
838
+ refundedAmount: true,
839
+ refunds: {
840
+ uid: true,
841
+ amount: true,
842
+ status: true,
843
+ allocations: { orderItemUid: true, quantity: true, ticketUids: true },
844
+ },
845
+ },
846
+ });
847
+
848
+ const charges = await itm.query({
849
+ getPartnerInPersonChargesForMoment: {
850
+ __args: {
851
+ momentSlug: "test-moment",
852
+ statuses: [], // explicitly include every payment state
853
+ category: "MERCH", // optional ChargeCategory filter
854
+ take: 50,
855
+ },
856
+ charges: {
857
+ uid: true,
858
+ orderUid: true,
859
+ status: true,
860
+ category: true,
861
+ amount: true,
862
+ currencyCode: true,
863
+ },
864
+ totalCount: true,
865
+ hasNextPage: true,
866
+ nextCursor: true,
867
+ },
868
+ });
869
+ ```
870
+
871
+ Both lists sort newest first with a stable tie-breaker. Pass `nextCursor` as
872
+ `cursor` with the same moment and filters to continue. The default page size is
873
+ 50, larger values are capped at 100, and nonpositive values are rejected.
874
+ `totalCount` is the count matching the filters across all pages. Unknown,
875
+ foreign-moment, or filtered-out cursors are rejected. Each page is read from a
876
+ consistent database snapshot; the complete walk is not a frozen export.
877
+
878
+ Amounts are integer currency minor units: 1500 means USD 15.00 or JPY 1500.
879
+ `grossAmount` includes tax; `refundedAmount` is the recorded order refund total.
880
+ Refund records also include their own status, so pending or failed refunds
881
+ must not be counted as successful refunds. Customer and charge details can be
882
+ null for anonymous or incomplete orders. The order's customer and the card's
883
+ billing email can differ.
884
+
885
+ `getPartnerMomentStats` also exposes `inPersonOrdersCount` and
886
+ `inPersonChargesCount` for paid or partially refunded records. Those counts
887
+ share its five-minute cache. Order-backed charges appear in both counts;
888
+ do not add them together. POS-issued tickets with a holder appear in the existing
889
+ ticket/customer queries and attendance counts. Ownerless box-office walk-up
890
+ tickets are excluded from the partner ticket/customer lists. Their online `payment` can be
891
+ null because POS payments live in the in-person charge model. Bar, merchandise,
892
+ and other POS-only purchases require these order or charge queries.
893
+
894
+ This is a read API. It does not add POS checkout, cancellation, refund, or
895
+ terminal-token mutations to the partner SDK. Deploy the backend contract before
896
+ publishing an SDK version that uses these fields.
897
+
780
898
  ### `getPartnerMomentStats`
781
899
 
782
900
  Get cached partner-facing counts for a moment owned by the authenticated partner's brand. Counts
@@ -789,6 +907,8 @@ can be up to five minutes old.
789
907
  - `waitlistCount` counts active waitlist entries.
790
908
  - `externalRsvpCount` counts external RSVPs.
791
909
  - `ticketRsvpRequestsCount` counts ticket RSVP requests.
910
+ - `inPersonOrdersCount` counts paid or partially refunded itemized POS orders.
911
+ - `inPersonChargesCount` counts paid or partially refunded POS charges, including legacy charges. It overlaps with the order count.
792
912
 
793
913
  ```typescript
794
914
  const { getPartnerMomentStats } = await itm.query({
@@ -801,6 +921,9 @@ const { getPartnerMomentStats } = await itm.query({
801
921
  waitlistCount: true,
802
922
  externalRsvpCount: true,
803
923
  ticketRsvpRequestsCount: true,
924
+ inPersonOrdersCount: true,
925
+ inPersonChargesCount: true,
926
+ guestlist: { names: true, people: true, plusOnes: true, peopleCheckedIn: true },
804
927
  },
805
928
  });
806
929
  ```
@@ -851,8 +974,8 @@ const { getPartnerMomentAttendanceStats } = await itm.query({
851
974
  ```
852
975
 
853
976
  - `tickets` counts confirmed tickets, overall and per ticket tier.
854
- - `guestlist` counts guest-list entries, split into `unlabeled` and per-label
855
- buckets.
977
+ - `guestlist.total` counts people, including plus-ones; `checkedIn` counts admitted people.
978
+ Label buckets overlap: do not sum them to obtain the canonical total.
856
979
 
857
980
  > **Note:** Returns `null` if no moment matches the lookup or the moment is not
858
981
  > owned by the authenticated partner's brand. The request fails with a
@@ -860,6 +983,88 @@ const { getPartnerMomentAttendanceStats } = await itm.query({
860
983
  > `externalPlatform` and `externalId` are not provided together, when more than
861
984
  > one lookup key is given, or when an external ID matches multiple moments.
862
985
 
986
+ ### Moment guest lists and check-in history
987
+
988
+ Partner API keys can read the dedicated Guest List, separately from ticket holders.
989
+ These reads are live and brand-scoped; ITM agent credentials do not authorize them.
990
+ `getPartnerMomentStats.guestlist` provides cached totals: `names` (entries), `people`
991
+ (including plus-ones), `plusOnes`, `peopleCheckedIn`, `peopleRemaining`, and
992
+ `namesNotArrived` / `namesPartial` / `namesAllIn`. Overview counts may be five minutes old.
993
+
994
+ Both guest-list reads default to 50 results and accept `take` from 1 to 100. Pages
995
+ include `totalCount`, `hasNextPage`, and `nextCursor`. Pass the returned cursor to
996
+ continue with the same filters and sorting. Invalid/foreign cursors fail validation.
997
+ Pagination reads current data, not a frozen export; concurrent edits can change results.
998
+
999
+ ```typescript
1000
+ function fetchGuestPage(cursor: string | null) {
1001
+ return itm.query({
1002
+ getPartnerGuestListForMoment: {
1003
+ __args: { momentSlug: "my-event", take: 100, cursor },
1004
+ totalCount: true,
1005
+ hasNextPage: true,
1006
+ nextCursor: true,
1007
+ guestLists: {
1008
+ uid: true, name: true, email: true, phoneNumber: true, notes: true,
1009
+ numGuests: true, plusOnes: true, numCheckedIn: true,
1010
+ checkedInAt: true, checkInStatus: true, source: true,
1011
+ respondedToInvitation: true,
1012
+ labels: { uid: true, name: true },
1013
+ momentOccurrences: { uid: true, startsAt: true, endsAt: true },
1014
+ invitationResponse: { guestNames: true },
1015
+ guestInfos: {
1016
+ guestIndex: true, fullName: true, companyName: true, jobTitle: true,
1017
+ phoneNumber: true, birthday: true, invitedBy: true,
1018
+ },
1019
+ },
1020
+ },
1021
+ });
1022
+ }
1023
+ let cursor: string | null = null;
1024
+ do {
1025
+ const { getPartnerGuestListForMoment: page } = await fetchGuestPage(cursor);
1026
+ for (const guest of page.guestLists) console.log(guest);
1027
+ cursor = page.hasNextPage ? page.nextCursor : null;
1028
+ } while (cursor);
1029
+ ```
1030
+
1031
+ Optional `filters` support search, labels (`labelUid` / `labelUids`,
1032
+ `includeUnlabeled`), `checkInStatus` (`NOT_ARRIVED`, `PARTIAL`, `ALL_IN`),
1033
+ `checkedIn`, `hasPlusOnes`, `hasEmail`, `hasNotes`, `qrCodeSent`,
1034
+ `addedByAdminUids`, `sessionDate`, and `momentOccurrenceUid`. Occurrence filters
1035
+ also include guests assigned to the whole moment. Optional `sort` accepts
1036
+ `CREATED_AT`, `NAME`, `PARTY_SIZE`, or `LAST_CHECKED_IN`, with `ASC` / `DESC`
1037
+ direction. The default is newest-created first.
1038
+
1039
+ `numGuests` includes the invitee: a party of three has two `plusOnes`.
1040
+ `checkedInAt` is the latest active party check-in, nullable when nobody is in.
1041
+ Empty `momentOccurrences` means the whole moment. Profile answers and invitation
1042
+ names are returned only when collected; missing values remain null or empty.
1043
+ `guestIndex: 0` is the invitee; higher indexes are plus-ones. Guest profile fields
1044
+ also include social handles/URLs, address, website, and submission timestamp.
1045
+
1046
+ Retrieve all recorded check-in actions with independent cursor pagination:
1047
+
1048
+ ```typescript
1049
+ const { getPartnerGuestListCheckIns: page } = await itm.query({
1050
+ getPartnerGuestListCheckIns: {
1051
+ __args: { momentSlug: "my-event", guestlistUid: "guest-uid", take: 50 },
1052
+ totalCount: true, hasNextPage: true, nextCursor: true,
1053
+ batches: {
1054
+ uid: true, checkedInAt: true, source: true,
1055
+ count: true, activeCount: true, voidedAt: true, voidReason: true,
1056
+ },
1057
+ },
1058
+ });
1059
+ ```
1060
+
1061
+ Continue using `page.nextCursor` while `page.hasNextPage` is true. History includes
1062
+ undone actions, is newest first, and is not truncated at 100 total actions.
1063
+ `count` is the people admitted by an action; `activeCount` excludes undone admissions.
1064
+ Admission slots do not identify named people, so a batch cannot establish which
1065
+ named plus-one arrived. Legacy entries may have aggregate counts without ledger
1066
+ history; these read operations never manufacture or backfill check-ins.
1067
+
863
1068
  ### `getPartnerTicketTiersForMoment`
864
1069
 
865
1070
  Get paginated, partner-facing ticket tiers for a moment. Use this for pricing,