afternoon-sdk 0.0.6

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.
Files changed (3) hide show
  1. package/README.md +180 -0
  2. package/package.json +66 -0
  3. package/reference.md +1455 -0
package/reference.md ADDED
@@ -0,0 +1,1455 @@
1
+ # Reference
2
+
3
+ ## Customers
4
+
5
+ <details><summary><code>client.customers.<a href="/src/api/resources/customers/client/Client.ts">listCustomers</a>({ ...params }) -> Afternoon.CustomerListResponse</code></summary>
6
+ <dl>
7
+ <dd>
8
+
9
+ #### 📝 Description
10
+
11
+ <dl>
12
+ <dd>
13
+
14
+ <dl>
15
+ <dd>
16
+
17
+ Returns a paginated list of customers for the authenticated company.
18
+
19
+ </dd>
20
+ </dl>
21
+ </dd>
22
+ </dl>
23
+
24
+ #### 🔌 Usage
25
+
26
+ <dl>
27
+ <dd>
28
+
29
+ <dl>
30
+ <dd>
31
+
32
+ ```typescript
33
+ await client.customers.listCustomers({
34
+ limit: "50",
35
+ cursor: "cm5x9z8nv0000h85r7l9p2k1m",
36
+ });
37
+ ```
38
+
39
+ </dd>
40
+ </dl>
41
+ </dd>
42
+ </dl>
43
+
44
+ #### ⚙️ Parameters
45
+
46
+ <dl>
47
+ <dd>
48
+
49
+ <dl>
50
+ <dd>
51
+
52
+ **request:** `Afternoon.GetV1CustomersRequest`
53
+
54
+ </dd>
55
+ </dl>
56
+
57
+ <dl>
58
+ <dd>
59
+
60
+ **requestOptions:** `Customers.RequestOptions`
61
+
62
+ </dd>
63
+ </dl>
64
+ </dd>
65
+ </dl>
66
+
67
+ </dd>
68
+ </dl>
69
+ </details>
70
+
71
+ <details><summary><code>client.customers.<a href="/src/api/resources/customers/client/Client.ts">createACustomer</a>({ ...params }) -> Afternoon.CustomerResponse</code></summary>
72
+ <dl>
73
+ <dd>
74
+
75
+ #### 📝 Description
76
+
77
+ <dl>
78
+ <dd>
79
+
80
+ <dl>
81
+ <dd>
82
+
83
+ Creates a new customer for the authenticated company.
84
+
85
+ </dd>
86
+ </dl>
87
+ </dd>
88
+ </dl>
89
+
90
+ #### 🔌 Usage
91
+
92
+ <dl>
93
+ <dd>
94
+
95
+ <dl>
96
+ <dd>
97
+
98
+ ```typescript
99
+ await client.customers.createACustomer();
100
+ ```
101
+
102
+ </dd>
103
+ </dl>
104
+ </dd>
105
+ </dl>
106
+
107
+ #### ⚙️ Parameters
108
+
109
+ <dl>
110
+ <dd>
111
+
112
+ <dl>
113
+ <dd>
114
+
115
+ **request:** `Afternoon.CreateCustomerRequest`
116
+
117
+ </dd>
118
+ </dl>
119
+
120
+ <dl>
121
+ <dd>
122
+
123
+ **requestOptions:** `Customers.RequestOptions`
124
+
125
+ </dd>
126
+ </dl>
127
+ </dd>
128
+ </dl>
129
+
130
+ </dd>
131
+ </dl>
132
+ </details>
133
+
134
+ <details><summary><code>client.customers.<a href="/src/api/resources/customers/client/Client.ts">retrieveACustomer</a>({ ...params }) -> Afternoon.CustomerResponse</code></summary>
135
+ <dl>
136
+ <dd>
137
+
138
+ #### 📝 Description
139
+
140
+ <dl>
141
+ <dd>
142
+
143
+ <dl>
144
+ <dd>
145
+
146
+ Fetches a customer by their ID.
147
+
148
+ </dd>
149
+ </dl>
150
+ </dd>
151
+ </dl>
152
+
153
+ #### 🔌 Usage
154
+
155
+ <dl>
156
+ <dd>
157
+
158
+ <dl>
159
+ <dd>
160
+
161
+ ```typescript
162
+ await client.customers.retrieveACustomer({
163
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
164
+ });
165
+ ```
166
+
167
+ </dd>
168
+ </dl>
169
+ </dd>
170
+ </dl>
171
+
172
+ #### ⚙️ Parameters
173
+
174
+ <dl>
175
+ <dd>
176
+
177
+ <dl>
178
+ <dd>
179
+
180
+ **request:** `Afternoon.GetV1CustomersIdRequest`
181
+
182
+ </dd>
183
+ </dl>
184
+
185
+ <dl>
186
+ <dd>
187
+
188
+ **requestOptions:** `Customers.RequestOptions`
189
+
190
+ </dd>
191
+ </dl>
192
+ </dd>
193
+ </dl>
194
+
195
+ </dd>
196
+ </dl>
197
+ </details>
198
+
199
+ <details><summary><code>client.customers.<a href="/src/api/resources/customers/client/Client.ts">deleteACustomer</a>({ ...params }) -> Afternoon.DeleteCustomerResponse</code></summary>
200
+ <dl>
201
+ <dd>
202
+
203
+ #### 📝 Description
204
+
205
+ <dl>
206
+ <dd>
207
+
208
+ <dl>
209
+ <dd>
210
+
211
+ Permanently deletes a customer by their ID.
212
+
213
+ </dd>
214
+ </dl>
215
+ </dd>
216
+ </dl>
217
+
218
+ #### 🔌 Usage
219
+
220
+ <dl>
221
+ <dd>
222
+
223
+ <dl>
224
+ <dd>
225
+
226
+ ```typescript
227
+ await client.customers.deleteACustomer({
228
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
229
+ });
230
+ ```
231
+
232
+ </dd>
233
+ </dl>
234
+ </dd>
235
+ </dl>
236
+
237
+ #### ⚙️ Parameters
238
+
239
+ <dl>
240
+ <dd>
241
+
242
+ <dl>
243
+ <dd>
244
+
245
+ **request:** `Afternoon.DeleteV1CustomersIdRequest`
246
+
247
+ </dd>
248
+ </dl>
249
+
250
+ <dl>
251
+ <dd>
252
+
253
+ **requestOptions:** `Customers.RequestOptions`
254
+
255
+ </dd>
256
+ </dl>
257
+ </dd>
258
+ </dl>
259
+
260
+ </dd>
261
+ </dl>
262
+ </details>
263
+
264
+ <details><summary><code>client.customers.<a href="/src/api/resources/customers/client/Client.ts">updateACustomer</a>({ ...params }) -> Afternoon.CustomerResponse</code></summary>
265
+ <dl>
266
+ <dd>
267
+
268
+ #### 📝 Description
269
+
270
+ <dl>
271
+ <dd>
272
+
273
+ <dl>
274
+ <dd>
275
+
276
+ Updates an existing customer. Only provided fields are changed.
277
+
278
+ </dd>
279
+ </dl>
280
+ </dd>
281
+ </dl>
282
+
283
+ #### 🔌 Usage
284
+
285
+ <dl>
286
+ <dd>
287
+
288
+ <dl>
289
+ <dd>
290
+
291
+ ```typescript
292
+ await client.customers.updateACustomer({
293
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
294
+ });
295
+ ```
296
+
297
+ </dd>
298
+ </dl>
299
+ </dd>
300
+ </dl>
301
+
302
+ #### ⚙️ Parameters
303
+
304
+ <dl>
305
+ <dd>
306
+
307
+ <dl>
308
+ <dd>
309
+
310
+ **request:** `Afternoon.UpdateCustomerRequest`
311
+
312
+ </dd>
313
+ </dl>
314
+
315
+ <dl>
316
+ <dd>
317
+
318
+ **requestOptions:** `Customers.RequestOptions`
319
+
320
+ </dd>
321
+ </dl>
322
+ </dd>
323
+ </dl>
324
+
325
+ </dd>
326
+ </dl>
327
+ </details>
328
+
329
+ ## Events
330
+
331
+ <details><summary><code>client.events.<a href="/src/api/resources/events/client/Client.ts">ingestBillableEvents</a>({ ...params }) -> Afternoon.IngestResponse</code></summary>
332
+ <dl>
333
+ <dd>
334
+
335
+ #### 📝 Description
336
+
337
+ <dl>
338
+ <dd>
339
+
340
+ <dl>
341
+ <dd>
342
+
343
+ Accepts a batch of billable events for processing. Events are queued for async processing.
344
+
345
+ </dd>
346
+ </dl>
347
+ </dd>
348
+ </dl>
349
+
350
+ #### 🔌 Usage
351
+
352
+ <dl>
353
+ <dd>
354
+
355
+ <dl>
356
+ <dd>
357
+
358
+ ```typescript
359
+ await client.events.ingestBillableEvents({
360
+ events: [
361
+ {
362
+ event_name: "api.request",
363
+ idempotency_key: "evt_abc123xyz",
364
+ customer_id: "cjld2cjxh0000qzrmn831i7rn",
365
+ timestamp: "2023-11-07T05:31:56Z",
366
+ },
367
+ ],
368
+ });
369
+ ```
370
+
371
+ </dd>
372
+ </dl>
373
+ </dd>
374
+ </dl>
375
+
376
+ #### ⚙️ Parameters
377
+
378
+ <dl>
379
+ <dd>
380
+
381
+ <dl>
382
+ <dd>
383
+
384
+ **request:** `Afternoon.IngestRequest`
385
+
386
+ </dd>
387
+ </dl>
388
+
389
+ <dl>
390
+ <dd>
391
+
392
+ **requestOptions:** `Events.RequestOptions`
393
+
394
+ </dd>
395
+ </dl>
396
+ </dd>
397
+ </dl>
398
+
399
+ </dd>
400
+ </dl>
401
+ </details>
402
+
403
+ <details><summary><code>client.events.<a href="/src/api/resources/events/client/Client.ts">synchronouslyIngestBillableEvents</a>({ ...params }) -> Afternoon.InngestSyncResponse</code></summary>
404
+ <dl>
405
+ <dd>
406
+
407
+ #### 📝 Description
408
+
409
+ <dl>
410
+ <dd>
411
+
412
+ <dl>
413
+ <dd>
414
+
415
+ Accepts a single billable event and inserts it synchronously into the database.
416
+
417
+ </dd>
418
+ </dl>
419
+ </dd>
420
+ </dl>
421
+
422
+ #### 🔌 Usage
423
+
424
+ <dl>
425
+ <dd>
426
+
427
+ <dl>
428
+ <dd>
429
+
430
+ ```typescript
431
+ await client.events.synchronouslyIngestBillableEvents({
432
+ event_name: "api.request",
433
+ idempotency_key: "evt_abc123xyz",
434
+ customer_id: "cjld2cjxh0000qzrmn831i7rn",
435
+ timestamp: "2023-11-07T05:31:56Z",
436
+ });
437
+ ```
438
+
439
+ </dd>
440
+ </dl>
441
+ </dd>
442
+ </dl>
443
+
444
+ #### ⚙️ Parameters
445
+
446
+ <dl>
447
+ <dd>
448
+
449
+ <dl>
450
+ <dd>
451
+
452
+ **request:** `Afternoon.IngestSyncRequest`
453
+
454
+ </dd>
455
+ </dl>
456
+
457
+ <dl>
458
+ <dd>
459
+
460
+ **requestOptions:** `Events.RequestOptions`
461
+
462
+ </dd>
463
+ </dl>
464
+ </dd>
465
+ </dl>
466
+
467
+ </dd>
468
+ </dl>
469
+ </details>
470
+
471
+ ## Subscriptions
472
+
473
+ <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">listSubscriptions</a>({ ...params }) -> Afternoon.SubscriptionListResponse</code></summary>
474
+ <dl>
475
+ <dd>
476
+
477
+ #### 📝 Description
478
+
479
+ <dl>
480
+ <dd>
481
+
482
+ <dl>
483
+ <dd>
484
+
485
+ Returns a paginated list of subscriptions. Supports optional customer_id and status filters.
486
+
487
+ </dd>
488
+ </dl>
489
+ </dd>
490
+ </dl>
491
+
492
+ #### 🔌 Usage
493
+
494
+ <dl>
495
+ <dd>
496
+
497
+ <dl>
498
+ <dd>
499
+
500
+ ```typescript
501
+ await client.subscriptions.listSubscriptions({
502
+ limit: "50",
503
+ cursor: "cm5x9z8nv0000h85r7l9p2k1m",
504
+ });
505
+ ```
506
+
507
+ </dd>
508
+ </dl>
509
+ </dd>
510
+ </dl>
511
+
512
+ #### ⚙️ Parameters
513
+
514
+ <dl>
515
+ <dd>
516
+
517
+ <dl>
518
+ <dd>
519
+
520
+ **request:** `Afternoon.GetV1SubscriptionsRequest`
521
+
522
+ </dd>
523
+ </dl>
524
+
525
+ <dl>
526
+ <dd>
527
+
528
+ **requestOptions:** `Subscriptions.RequestOptions`
529
+
530
+ </dd>
531
+ </dl>
532
+ </dd>
533
+ </dl>
534
+
535
+ </dd>
536
+ </dl>
537
+ </details>
538
+
539
+ <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">createASubscription</a>({ ...params }) -> Afternoon.SubscriptionResponse</code></summary>
540
+ <dl>
541
+ <dd>
542
+
543
+ #### 📝 Description
544
+
545
+ <dl>
546
+ <dd>
547
+
548
+ <dl>
549
+ <dd>
550
+
551
+ Creates a new subscription linking a customer to a plan. Both must belong to the authenticated company.
552
+
553
+ </dd>
554
+ </dl>
555
+ </dd>
556
+ </dl>
557
+
558
+ #### 🔌 Usage
559
+
560
+ <dl>
561
+ <dd>
562
+
563
+ <dl>
564
+ <dd>
565
+
566
+ ```typescript
567
+ await client.subscriptions.createASubscription({
568
+ customer_id: "cm5x9z8nv0001h85r7l9p2k2m",
569
+ plan_id: "cm5x9z8nv0002h85r7l9p2k3m",
570
+ });
571
+ ```
572
+
573
+ </dd>
574
+ </dl>
575
+ </dd>
576
+ </dl>
577
+
578
+ #### ⚙️ Parameters
579
+
580
+ <dl>
581
+ <dd>
582
+
583
+ <dl>
584
+ <dd>
585
+
586
+ **request:** `Afternoon.CreateSubscriptionRequest`
587
+
588
+ </dd>
589
+ </dl>
590
+
591
+ <dl>
592
+ <dd>
593
+
594
+ **requestOptions:** `Subscriptions.RequestOptions`
595
+
596
+ </dd>
597
+ </dl>
598
+ </dd>
599
+ </dl>
600
+
601
+ </dd>
602
+ </dl>
603
+ </details>
604
+
605
+ <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">retrieveASubscription</a>({ ...params }) -> Afternoon.SubscriptionResponse</code></summary>
606
+ <dl>
607
+ <dd>
608
+
609
+ #### 📝 Description
610
+
611
+ <dl>
612
+ <dd>
613
+
614
+ <dl>
615
+ <dd>
616
+
617
+ Fetches a subscription by its ID.
618
+
619
+ </dd>
620
+ </dl>
621
+ </dd>
622
+ </dl>
623
+
624
+ #### 🔌 Usage
625
+
626
+ <dl>
627
+ <dd>
628
+
629
+ <dl>
630
+ <dd>
631
+
632
+ ```typescript
633
+ await client.subscriptions.retrieveASubscription({
634
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
635
+ });
636
+ ```
637
+
638
+ </dd>
639
+ </dl>
640
+ </dd>
641
+ </dl>
642
+
643
+ #### ⚙️ Parameters
644
+
645
+ <dl>
646
+ <dd>
647
+
648
+ <dl>
649
+ <dd>
650
+
651
+ **request:** `Afternoon.GetV1SubscriptionsIdRequest`
652
+
653
+ </dd>
654
+ </dl>
655
+
656
+ <dl>
657
+ <dd>
658
+
659
+ **requestOptions:** `Subscriptions.RequestOptions`
660
+
661
+ </dd>
662
+ </dl>
663
+ </dd>
664
+ </dl>
665
+
666
+ </dd>
667
+ </dl>
668
+ </details>
669
+
670
+ <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">deleteASubscription</a>({ ...params }) -> Afternoon.DeleteSubscriptionResponse</code></summary>
671
+ <dl>
672
+ <dd>
673
+
674
+ #### 📝 Description
675
+
676
+ <dl>
677
+ <dd>
678
+
679
+ <dl>
680
+ <dd>
681
+
682
+ Permanently deletes a subscription by its ID.
683
+
684
+ </dd>
685
+ </dl>
686
+ </dd>
687
+ </dl>
688
+
689
+ #### 🔌 Usage
690
+
691
+ <dl>
692
+ <dd>
693
+
694
+ <dl>
695
+ <dd>
696
+
697
+ ```typescript
698
+ await client.subscriptions.deleteASubscription({
699
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
700
+ });
701
+ ```
702
+
703
+ </dd>
704
+ </dl>
705
+ </dd>
706
+ </dl>
707
+
708
+ #### ⚙️ Parameters
709
+
710
+ <dl>
711
+ <dd>
712
+
713
+ <dl>
714
+ <dd>
715
+
716
+ **request:** `Afternoon.DeleteV1SubscriptionsIdRequest`
717
+
718
+ </dd>
719
+ </dl>
720
+
721
+ <dl>
722
+ <dd>
723
+
724
+ **requestOptions:** `Subscriptions.RequestOptions`
725
+
726
+ </dd>
727
+ </dl>
728
+ </dd>
729
+ </dl>
730
+
731
+ </dd>
732
+ </dl>
733
+ </details>
734
+
735
+ <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">updateASubscription</a>({ ...params }) -> Afternoon.SubscriptionResponse</code></summary>
736
+ <dl>
737
+ <dd>
738
+
739
+ #### 📝 Description
740
+
741
+ <dl>
742
+ <dd>
743
+
744
+ <dl>
745
+ <dd>
746
+
747
+ Updates an existing subscription. Only provided fields are changed. Setting status to "canceled" automatically sets canceled_at.
748
+
749
+ </dd>
750
+ </dl>
751
+ </dd>
752
+ </dl>
753
+
754
+ #### 🔌 Usage
755
+
756
+ <dl>
757
+ <dd>
758
+
759
+ <dl>
760
+ <dd>
761
+
762
+ ```typescript
763
+ await client.subscriptions.updateASubscription({
764
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
765
+ });
766
+ ```
767
+
768
+ </dd>
769
+ </dl>
770
+ </dd>
771
+ </dl>
772
+
773
+ #### ⚙️ Parameters
774
+
775
+ <dl>
776
+ <dd>
777
+
778
+ <dl>
779
+ <dd>
780
+
781
+ **request:** `Afternoon.UpdateSubscriptionRequest`
782
+
783
+ </dd>
784
+ </dl>
785
+
786
+ <dl>
787
+ <dd>
788
+
789
+ **requestOptions:** `Subscriptions.RequestOptions`
790
+
791
+ </dd>
792
+ </dl>
793
+ </dd>
794
+ </dl>
795
+
796
+ </dd>
797
+ </dl>
798
+ </details>
799
+
800
+ ## Invoices
801
+
802
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">listInvoices</a>({ ...params }) -> Afternoon.InvoiceListResponse</code></summary>
803
+ <dl>
804
+ <dd>
805
+
806
+ #### 📝 Description
807
+
808
+ <dl>
809
+ <dd>
810
+
811
+ <dl>
812
+ <dd>
813
+
814
+ Returns a paginated list of invoices. Supports optional customer_id, subscription_id, and status filters.
815
+
816
+ </dd>
817
+ </dl>
818
+ </dd>
819
+ </dl>
820
+
821
+ #### 🔌 Usage
822
+
823
+ <dl>
824
+ <dd>
825
+
826
+ <dl>
827
+ <dd>
828
+
829
+ ```typescript
830
+ await client.invoices.listInvoices({
831
+ limit: "50",
832
+ cursor: "cm5x9z8nv0000h85r7l9p2k1m",
833
+ });
834
+ ```
835
+
836
+ </dd>
837
+ </dl>
838
+ </dd>
839
+ </dl>
840
+
841
+ #### ⚙️ Parameters
842
+
843
+ <dl>
844
+ <dd>
845
+
846
+ <dl>
847
+ <dd>
848
+
849
+ **request:** `Afternoon.GetV1InvoicesRequest`
850
+
851
+ </dd>
852
+ </dl>
853
+
854
+ <dl>
855
+ <dd>
856
+
857
+ **requestOptions:** `Invoices.RequestOptions`
858
+
859
+ </dd>
860
+ </dl>
861
+ </dd>
862
+ </dl>
863
+
864
+ </dd>
865
+ </dl>
866
+ </details>
867
+
868
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">createADraftInvoice</a>({ ...params }) -> Afternoon.InvoiceResponse</code></summary>
869
+ <dl>
870
+ <dd>
871
+
872
+ #### 📝 Description
873
+
874
+ <dl>
875
+ <dd>
876
+
877
+ <dl>
878
+ <dd>
879
+
880
+ Creates a new draft invoice for a customer. The customer must belong to the authenticated company.
881
+
882
+ </dd>
883
+ </dl>
884
+ </dd>
885
+ </dl>
886
+
887
+ #### 🔌 Usage
888
+
889
+ <dl>
890
+ <dd>
891
+
892
+ <dl>
893
+ <dd>
894
+
895
+ ```typescript
896
+ await client.invoices.createADraftInvoice({
897
+ customer_id: "cm5x9z8nv0001h85r7l9p2k2m",
898
+ });
899
+ ```
900
+
901
+ </dd>
902
+ </dl>
903
+ </dd>
904
+ </dl>
905
+
906
+ #### ⚙️ Parameters
907
+
908
+ <dl>
909
+ <dd>
910
+
911
+ <dl>
912
+ <dd>
913
+
914
+ **request:** `Afternoon.CreateInvoiceRequest`
915
+
916
+ </dd>
917
+ </dl>
918
+
919
+ <dl>
920
+ <dd>
921
+
922
+ **requestOptions:** `Invoices.RequestOptions`
923
+
924
+ </dd>
925
+ </dl>
926
+ </dd>
927
+ </dl>
928
+
929
+ </dd>
930
+ </dl>
931
+ </details>
932
+
933
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">retrieveAnInvoice</a>({ ...params }) -> Afternoon.InvoiceResponse</code></summary>
934
+ <dl>
935
+ <dd>
936
+
937
+ #### 📝 Description
938
+
939
+ <dl>
940
+ <dd>
941
+
942
+ <dl>
943
+ <dd>
944
+
945
+ Fetches an invoice by its ID, including line items.
946
+
947
+ </dd>
948
+ </dl>
949
+ </dd>
950
+ </dl>
951
+
952
+ #### 🔌 Usage
953
+
954
+ <dl>
955
+ <dd>
956
+
957
+ <dl>
958
+ <dd>
959
+
960
+ ```typescript
961
+ await client.invoices.retrieveAnInvoice({
962
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
963
+ });
964
+ ```
965
+
966
+ </dd>
967
+ </dl>
968
+ </dd>
969
+ </dl>
970
+
971
+ #### ⚙️ Parameters
972
+
973
+ <dl>
974
+ <dd>
975
+
976
+ <dl>
977
+ <dd>
978
+
979
+ **request:** `Afternoon.GetV1InvoicesIdRequest`
980
+
981
+ </dd>
982
+ </dl>
983
+
984
+ <dl>
985
+ <dd>
986
+
987
+ **requestOptions:** `Invoices.RequestOptions`
988
+
989
+ </dd>
990
+ </dl>
991
+ </dd>
992
+ </dl>
993
+
994
+ </dd>
995
+ </dl>
996
+ </details>
997
+
998
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">deleteADraftInvoice</a>({ ...params }) -> Afternoon.DeleteInvoiceResponse</code></summary>
999
+ <dl>
1000
+ <dd>
1001
+
1002
+ #### 📝 Description
1003
+
1004
+ <dl>
1005
+ <dd>
1006
+
1007
+ <dl>
1008
+ <dd>
1009
+
1010
+ Permanently deletes a draft invoice. Returns 422 if the invoice is not in draft status.
1011
+
1012
+ </dd>
1013
+ </dl>
1014
+ </dd>
1015
+ </dl>
1016
+
1017
+ #### 🔌 Usage
1018
+
1019
+ <dl>
1020
+ <dd>
1021
+
1022
+ <dl>
1023
+ <dd>
1024
+
1025
+ ```typescript
1026
+ await client.invoices.deleteADraftInvoice({
1027
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
1028
+ });
1029
+ ```
1030
+
1031
+ </dd>
1032
+ </dl>
1033
+ </dd>
1034
+ </dl>
1035
+
1036
+ #### ⚙️ Parameters
1037
+
1038
+ <dl>
1039
+ <dd>
1040
+
1041
+ <dl>
1042
+ <dd>
1043
+
1044
+ **request:** `Afternoon.DeleteV1InvoicesIdRequest`
1045
+
1046
+ </dd>
1047
+ </dl>
1048
+
1049
+ <dl>
1050
+ <dd>
1051
+
1052
+ **requestOptions:** `Invoices.RequestOptions`
1053
+
1054
+ </dd>
1055
+ </dl>
1056
+ </dd>
1057
+ </dl>
1058
+
1059
+ </dd>
1060
+ </dl>
1061
+ </details>
1062
+
1063
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">updateADraftInvoice</a>({ ...params }) -> Afternoon.InvoiceResponse</code></summary>
1064
+ <dl>
1065
+ <dd>
1066
+
1067
+ #### 📝 Description
1068
+
1069
+ <dl>
1070
+ <dd>
1071
+
1072
+ <dl>
1073
+ <dd>
1074
+
1075
+ Updates a draft invoice. Only provided fields are changed. Returns 422 if the invoice is not in draft status.
1076
+
1077
+ </dd>
1078
+ </dl>
1079
+ </dd>
1080
+ </dl>
1081
+
1082
+ #### 🔌 Usage
1083
+
1084
+ <dl>
1085
+ <dd>
1086
+
1087
+ <dl>
1088
+ <dd>
1089
+
1090
+ ```typescript
1091
+ await client.invoices.updateADraftInvoice({
1092
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
1093
+ });
1094
+ ```
1095
+
1096
+ </dd>
1097
+ </dl>
1098
+ </dd>
1099
+ </dl>
1100
+
1101
+ #### ⚙️ Parameters
1102
+
1103
+ <dl>
1104
+ <dd>
1105
+
1106
+ <dl>
1107
+ <dd>
1108
+
1109
+ **request:** `Afternoon.UpdateInvoiceRequest`
1110
+
1111
+ </dd>
1112
+ </dl>
1113
+
1114
+ <dl>
1115
+ <dd>
1116
+
1117
+ **requestOptions:** `Invoices.RequestOptions`
1118
+
1119
+ </dd>
1120
+ </dl>
1121
+ </dd>
1122
+ </dl>
1123
+
1124
+ </dd>
1125
+ </dl>
1126
+ </details>
1127
+
1128
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">finalizeADraftInvoice</a>({ ...params }) -> Afternoon.InvoiceResponse</code></summary>
1129
+ <dl>
1130
+ <dd>
1131
+
1132
+ #### 📝 Description
1133
+
1134
+ <dl>
1135
+ <dd>
1136
+
1137
+ <dl>
1138
+ <dd>
1139
+
1140
+ Transitions a draft invoice to open. Assigns an invoice number, sets finalizedAt, and recalculates totals. Requires at least one line item.
1141
+
1142
+ </dd>
1143
+ </dl>
1144
+ </dd>
1145
+ </dl>
1146
+
1147
+ #### 🔌 Usage
1148
+
1149
+ <dl>
1150
+ <dd>
1151
+
1152
+ <dl>
1153
+ <dd>
1154
+
1155
+ ```typescript
1156
+ await client.invoices.finalizeADraftInvoice({
1157
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
1158
+ });
1159
+ ```
1160
+
1161
+ </dd>
1162
+ </dl>
1163
+ </dd>
1164
+ </dl>
1165
+
1166
+ #### ⚙️ Parameters
1167
+
1168
+ <dl>
1169
+ <dd>
1170
+
1171
+ <dl>
1172
+ <dd>
1173
+
1174
+ **request:** `Afternoon.PostV1InvoicesIdFinalizeRequest`
1175
+
1176
+ </dd>
1177
+ </dl>
1178
+
1179
+ <dl>
1180
+ <dd>
1181
+
1182
+ **requestOptions:** `Invoices.RequestOptions`
1183
+
1184
+ </dd>
1185
+ </dl>
1186
+ </dd>
1187
+ </dl>
1188
+
1189
+ </dd>
1190
+ </dl>
1191
+ </details>
1192
+
1193
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">voidAnOpenInvoice</a>({ ...params }) -> Afternoon.InvoiceResponse</code></summary>
1194
+ <dl>
1195
+ <dd>
1196
+
1197
+ #### 📝 Description
1198
+
1199
+ <dl>
1200
+ <dd>
1201
+
1202
+ <dl>
1203
+ <dd>
1204
+
1205
+ Transitions an open invoice to void. Only open invoices can be voided.
1206
+
1207
+ </dd>
1208
+ </dl>
1209
+ </dd>
1210
+ </dl>
1211
+
1212
+ #### 🔌 Usage
1213
+
1214
+ <dl>
1215
+ <dd>
1216
+
1217
+ <dl>
1218
+ <dd>
1219
+
1220
+ ```typescript
1221
+ await client.invoices.voidAnOpenInvoice({
1222
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
1223
+ });
1224
+ ```
1225
+
1226
+ </dd>
1227
+ </dl>
1228
+ </dd>
1229
+ </dl>
1230
+
1231
+ #### ⚙️ Parameters
1232
+
1233
+ <dl>
1234
+ <dd>
1235
+
1236
+ <dl>
1237
+ <dd>
1238
+
1239
+ **request:** `Afternoon.PostV1InvoicesIdVoidRequest`
1240
+
1241
+ </dd>
1242
+ </dl>
1243
+
1244
+ <dl>
1245
+ <dd>
1246
+
1247
+ **requestOptions:** `Invoices.RequestOptions`
1248
+
1249
+ </dd>
1250
+ </dl>
1251
+ </dd>
1252
+ </dl>
1253
+
1254
+ </dd>
1255
+ </dl>
1256
+ </details>
1257
+
1258
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">addALineItem</a>({ ...params }) -> Afternoon.LineItemResponse</code></summary>
1259
+ <dl>
1260
+ <dd>
1261
+
1262
+ #### 📝 Description
1263
+
1264
+ <dl>
1265
+ <dd>
1266
+
1267
+ <dl>
1268
+ <dd>
1269
+
1270
+ Adds a line item to a draft invoice. Recalculates invoice totals.
1271
+
1272
+ </dd>
1273
+ </dl>
1274
+ </dd>
1275
+ </dl>
1276
+
1277
+ #### 🔌 Usage
1278
+
1279
+ <dl>
1280
+ <dd>
1281
+
1282
+ <dl>
1283
+ <dd>
1284
+
1285
+ ```typescript
1286
+ await client.invoices.addALineItem({
1287
+ id: "cm5x9z8nv0000h85r7l9p2k1m",
1288
+ quantity: 1,
1289
+ unit_amount_cents: 5000,
1290
+ });
1291
+ ```
1292
+
1293
+ </dd>
1294
+ </dl>
1295
+ </dd>
1296
+ </dl>
1297
+
1298
+ #### ⚙️ Parameters
1299
+
1300
+ <dl>
1301
+ <dd>
1302
+
1303
+ <dl>
1304
+ <dd>
1305
+
1306
+ **request:** `Afternoon.CreateLineItemRequest`
1307
+
1308
+ </dd>
1309
+ </dl>
1310
+
1311
+ <dl>
1312
+ <dd>
1313
+
1314
+ **requestOptions:** `Invoices.RequestOptions`
1315
+
1316
+ </dd>
1317
+ </dl>
1318
+ </dd>
1319
+ </dl>
1320
+
1321
+ </dd>
1322
+ </dl>
1323
+ </details>
1324
+
1325
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">removeALineItem</a>({ ...params }) -> Afternoon.DeleteLineItemResponse</code></summary>
1326
+ <dl>
1327
+ <dd>
1328
+
1329
+ #### 📝 Description
1330
+
1331
+ <dl>
1332
+ <dd>
1333
+
1334
+ <dl>
1335
+ <dd>
1336
+
1337
+ Removes a line item from a draft invoice. Recalculates invoice totals.
1338
+
1339
+ </dd>
1340
+ </dl>
1341
+ </dd>
1342
+ </dl>
1343
+
1344
+ #### 🔌 Usage
1345
+
1346
+ <dl>
1347
+ <dd>
1348
+
1349
+ <dl>
1350
+ <dd>
1351
+
1352
+ ```typescript
1353
+ await client.invoices.removeALineItem({
1354
+ id: "id",
1355
+ lineId: "lineId",
1356
+ });
1357
+ ```
1358
+
1359
+ </dd>
1360
+ </dl>
1361
+ </dd>
1362
+ </dl>
1363
+
1364
+ #### ⚙️ Parameters
1365
+
1366
+ <dl>
1367
+ <dd>
1368
+
1369
+ <dl>
1370
+ <dd>
1371
+
1372
+ **request:** `Afternoon.DeleteV1InvoicesIdLineItemsLineIdRequest`
1373
+
1374
+ </dd>
1375
+ </dl>
1376
+
1377
+ <dl>
1378
+ <dd>
1379
+
1380
+ **requestOptions:** `Invoices.RequestOptions`
1381
+
1382
+ </dd>
1383
+ </dl>
1384
+ </dd>
1385
+ </dl>
1386
+
1387
+ </dd>
1388
+ </dl>
1389
+ </details>
1390
+
1391
+ <details><summary><code>client.invoices.<a href="/src/api/resources/invoices/client/Client.ts">updateALineItem</a>({ ...params }) -> Afternoon.LineItemResponse</code></summary>
1392
+ <dl>
1393
+ <dd>
1394
+
1395
+ #### 📝 Description
1396
+
1397
+ <dl>
1398
+ <dd>
1399
+
1400
+ <dl>
1401
+ <dd>
1402
+
1403
+ Updates a line item on a draft invoice. Recalculates invoice totals.
1404
+
1405
+ </dd>
1406
+ </dl>
1407
+ </dd>
1408
+ </dl>
1409
+
1410
+ #### 🔌 Usage
1411
+
1412
+ <dl>
1413
+ <dd>
1414
+
1415
+ <dl>
1416
+ <dd>
1417
+
1418
+ ```typescript
1419
+ await client.invoices.updateALineItem({
1420
+ id: "id",
1421
+ lineId: "lineId",
1422
+ });
1423
+ ```
1424
+
1425
+ </dd>
1426
+ </dl>
1427
+ </dd>
1428
+ </dl>
1429
+
1430
+ #### ⚙️ Parameters
1431
+
1432
+ <dl>
1433
+ <dd>
1434
+
1435
+ <dl>
1436
+ <dd>
1437
+
1438
+ **request:** `Afternoon.UpdateLineItemRequest`
1439
+
1440
+ </dd>
1441
+ </dl>
1442
+
1443
+ <dl>
1444
+ <dd>
1445
+
1446
+ **requestOptions:** `Invoices.RequestOptions`
1447
+
1448
+ </dd>
1449
+ </dl>
1450
+ </dd>
1451
+ </dl>
1452
+
1453
+ </dd>
1454
+ </dl>
1455
+ </details>