@epilot/pricing-client 1.13.2 → 2.1.0

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/dist/openapi.d.ts CHANGED
@@ -21,47 +21,47 @@ declare namespace Components {
21
21
  /**
22
22
  * The first line of the address. Typically the street address or PO Box number.
23
23
  */
24
- street?: string;
24
+ street?: string | null;
25
25
  /**
26
26
  * The second line of the address. Typically the number of the apartment, suite, or unit.
27
27
  */
28
- street_number?: string;
28
+ street_number?: string | null;
29
29
  /**
30
30
  * The postal code for the address.
31
31
  */
32
- postal_code?: string;
32
+ postal_code?: string | null;
33
33
  /**
34
34
  * The name of the city, district, village, or town.
35
35
  */
36
- city?: string;
36
+ city?: string | null;
37
37
  /**
38
38
  * The two-letter code for the country of the address.
39
39
  */
40
- country?: string;
40
+ country?: string | null;
41
41
  /**
42
42
  * An additional description for the address
43
43
  */
44
- additional_info?: string;
44
+ additional_info?: string | null;
45
45
  /**
46
46
  * the company name, usually used as extra delivery instructions
47
47
  */
48
- company_name?: string;
48
+ company_name?: string | null;
49
49
  /**
50
50
  * the first name of the recipient, usually used as extra delivery instructions
51
51
  */
52
- first_name?: string;
52
+ first_name?: string | null;
53
53
  /**
54
54
  * the last name of the recipient, usually used as extra delivery instructions
55
55
  */
56
- last_name?: string;
56
+ last_name?: string | null;
57
57
  /**
58
58
  * the salutation of the recipient, usually used as extra delivery instructions
59
59
  */
60
- salutation?: string;
60
+ salutation?: string | null;
61
61
  /**
62
62
  * the title of the recipient, usually used as extra delivery instructions
63
63
  */
64
- title?: string;
64
+ title?: string | null;
65
65
  }
66
66
  /**
67
67
  * Availability check request payload
@@ -181,7 +181,7 @@ declare namespace Components {
181
181
  customer?: Customer;
182
182
  billing_address?: Address;
183
183
  delivery_address?: Address;
184
- metadata?: /* A set of key-value pairs. */ MetaData;
184
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
185
185
  line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
186
186
  /**
187
187
  * Total of all items before (discounts or) taxes are applied.
@@ -199,7 +199,7 @@ declare namespace Components {
199
199
  * A valid cart payload from a client.
200
200
  */
201
201
  export interface CartDto {
202
- metadata?: /* A set of key-value pairs. */ MetaData;
202
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
203
203
  customer?: Customer;
204
204
  billing_address?: Address;
205
205
  delivery_address?: Address;
@@ -215,7 +215,7 @@ declare namespace Components {
215
215
  * ce99875f-fba9-4fe2-a8f9-afaf52059051
216
216
  */
217
217
  source_id?: string;
218
- source?: /* Order Source */ OrderSource;
218
+ source?: /* The order generation source */ OrderSource;
219
219
  additional_addresses?: Address[];
220
220
  payment_method?: /**
221
221
  * A PaymentMethod represent your customer's payment instruments.
@@ -227,7 +227,18 @@ declare namespace Components {
227
227
  * An array of file IDs, already upload into the File API, that are related with this cart
228
228
  */
229
229
  files?: string[];
230
- status?: /* The order status */ OrderStatus;
230
+ status?: /**
231
+ *
232
+ * | status | description |
233
+ * |-------------|-------|
234
+ * | `draft` | ​​Starting state for all orders, at this point we can still edit the order |
235
+ * | `quote` | The order is in a quoting phase, bound to an expiration date |
236
+ * | `placed` | The order has been paid and can now be fulfilled (shipped, delivered, complete) or canceled |
237
+ * | `cancelled` | The order has been cancelled |
238
+ * | `completed` | The order is now closed and finalized |
239
+ *
240
+ */
241
+ OrderStatus;
231
242
  tags?: string[];
232
243
  journey_data?: {
233
244
  [name: string]: any;
@@ -302,7 +313,21 @@ declare namespace Components {
302
313
  * The number os results returned.
303
314
  */
304
315
  hits?: number;
305
- results?: (/* The product configuration */ Product | /* The price configuration */ Price)[];
316
+ results?: (/**
317
+ * The product entity
318
+ * example:
319
+ * {
320
+ * "$ref": "#/components/examples/product"
321
+ * }
322
+ */
323
+ Product | /**
324
+ * The price entity schema for simple pricing
325
+ * example:
326
+ * {
327
+ * "$ref": "#/components/examples/price"
328
+ * }
329
+ */
330
+ Price)[];
306
331
  }
307
332
  /**
308
333
  * The cart checkout request payload
@@ -315,12 +340,264 @@ declare namespace Components {
315
340
  * The cart checkout result
316
341
  */
317
342
  export interface CheckoutCartResult {
318
- order?: /* The order entity */ Order;
343
+ order?: /**
344
+ * The order entity
345
+ * example:
346
+ * {
347
+ * "$ref": "#/components/examples/order-with-simple-prices"
348
+ * }
349
+ */
350
+ Order;
319
351
  }
320
352
  /**
321
353
  * The checkout mode for the cart checkout.
322
354
  */
323
355
  export type CheckoutMode = "create_order" | "create_invoice" | "create_quote";
356
+ /**
357
+ * The price entity schema for dynamic pricing
358
+ * example:
359
+ * {
360
+ * "$ref": "#/components/examples/composite-price"
361
+ * }
362
+ */
363
+ export interface CompositePrice {
364
+ [name: string]: any;
365
+ /**
366
+ * Whether the price can be used for new purchases.
367
+ */
368
+ active?: boolean;
369
+ /**
370
+ * A brief description of the price.
371
+ */
372
+ description?: string;
373
+ /**
374
+ * A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
375
+ */
376
+ price_components?: {
377
+ $relation?: PriceComponentRelation[];
378
+ };
379
+ /**
380
+ * Three-letter ISO currency code, in lowercase.
381
+ */
382
+ unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
383
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
384
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
385
+ *
386
+ * example:
387
+ * EUR
388
+ */
389
+ Currency;
390
+ /**
391
+ * The price creation date
392
+ */
393
+ _created_at?: string;
394
+ /**
395
+ * The price id
396
+ */
397
+ _id?: string;
398
+ /**
399
+ * The price autogenerated title
400
+ */
401
+ _title?: string;
402
+ /**
403
+ * The price last update date
404
+ */
405
+ _updated_at?: string;
406
+ /**
407
+ * The organization id the price belongs to
408
+ */
409
+ _org_id?: string;
410
+ /**
411
+ * An arbitrary set of tags attached to the composite price
412
+ */
413
+ _tags?: string[];
414
+ }
415
+ /**
416
+ * Represents a composite price input to the pricing library.
417
+ * example:
418
+ * {
419
+ * "$ref": "#/components/examples/price-item"
420
+ * }
421
+ */
422
+ export interface CompositePriceItem {
423
+ /**
424
+ * price item id
425
+ */
426
+ id?: string;
427
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
428
+ /**
429
+ * The unit amount value
430
+ */
431
+ unit_amount?: number;
432
+ /**
433
+ * Total before any (discounts or) taxes are applied.
434
+ */
435
+ amount_subtotal?: number;
436
+ /**
437
+ * Net unit amount without taxes or discounts.
438
+ */
439
+ unit_amount_net?: number;
440
+ /**
441
+ * Total after (discounts and) taxes.
442
+ */
443
+ amount_total?: number;
444
+ currency?: /**
445
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
446
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
447
+ *
448
+ * example:
449
+ * EUR
450
+ */
451
+ Currency;
452
+ /**
453
+ * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
454
+ */
455
+ description?: string;
456
+ /**
457
+ * The quantity of products being purchased.
458
+ */
459
+ quantity?: number;
460
+ /**
461
+ * The id of the product.
462
+ */
463
+ product_id?: string;
464
+ /**
465
+ * The id of the price.
466
+ */
467
+ price_id?: string;
468
+ /**
469
+ * The flag for prices that contain price components.
470
+ */
471
+ is_composite_price?: boolean;
472
+ /**
473
+ * The price snapshot data.
474
+ */
475
+ _price?: /* The price snapshot data. */ /**
476
+ * The price entity schema for simple pricing
477
+ * example:
478
+ * {
479
+ * "$ref": "#/components/examples/price"
480
+ * }
481
+ */
482
+ Price | /**
483
+ * The price entity schema for dynamic pricing
484
+ * example:
485
+ * {
486
+ * "$ref": "#/components/examples/composite-price"
487
+ * }
488
+ */
489
+ CompositePrice;
490
+ /**
491
+ * The product snapshot data.
492
+ */
493
+ _product?: /* The product snapshot data. */ /**
494
+ * The product entity
495
+ * example:
496
+ * {
497
+ * "$ref": "#/components/examples/product"
498
+ * }
499
+ */
500
+ Product;
501
+ /**
502
+ * The taxes applied to the price item.
503
+ */
504
+ taxes?: (/* A tax amount associated with a specific tax rate. */ TaxAmount)[];
505
+ /**
506
+ * The sum of amounts of the price items by recurrence.
507
+ */
508
+ recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
509
+ /**
510
+ * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
511
+ */
512
+ item_components?: /**
513
+ * Represents a price item
514
+ * example:
515
+ * {
516
+ * "$ref": "#/components/examples/price-item"
517
+ * }
518
+ */
519
+ PriceItem[];
520
+ }
521
+ /**
522
+ * Represents a composite price input to the pricing library.
523
+ */
524
+ export interface CompositePriceItemDto {
525
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
526
+ /**
527
+ * The quantity of products being purchased.
528
+ */
529
+ quantity?: number;
530
+ /**
531
+ * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
532
+ */
533
+ description?: string;
534
+ /**
535
+ * The id of the product.
536
+ */
537
+ product_id?: string;
538
+ /**
539
+ * The id of the price.
540
+ */
541
+ price_id?: string;
542
+ /**
543
+ * The unit amount value
544
+ */
545
+ unit_amount?: number;
546
+ /**
547
+ * Three-letter ISO currency code, in lowercase.
548
+ */
549
+ unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
550
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
551
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
552
+ *
553
+ * example:
554
+ * EUR
555
+ */
556
+ Currency;
557
+ /**
558
+ * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
559
+ */
560
+ unit_amount_decimal?: string;
561
+ /**
562
+ * The flag for prices that contain price components.
563
+ */
564
+ is_composite_price?: boolean;
565
+ /**
566
+ * The taxes applied to the price item.
567
+ */
568
+ taxes?: (/* A valid tax rate from a client. */ TaxAmountDto)[];
569
+ /**
570
+ * The taxes applied to the price item.
571
+ */
572
+ recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmountDto)[];
573
+ _price?: /**
574
+ * The price entity schema for simple pricing
575
+ * example:
576
+ * {
577
+ * "$ref": "#/components/examples/price"
578
+ * }
579
+ */
580
+ Price | /**
581
+ * The price entity schema for dynamic pricing
582
+ * example:
583
+ * {
584
+ * "$ref": "#/components/examples/composite-price"
585
+ * }
586
+ */
587
+ CompositePrice;
588
+ _product?: /**
589
+ * The product entity
590
+ * example:
591
+ * {
592
+ * "$ref": "#/components/examples/product"
593
+ * }
594
+ */
595
+ Product;
596
+ /**
597
+ * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
598
+ */
599
+ item_components?: /* Represents a valid price item from a client. */ PriceItemDto[];
600
+ }
324
601
  /**
325
602
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
326
603
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
@@ -371,7 +648,7 @@ declare namespace Components {
371
648
  $relation?: EntityRelation;
372
649
  }
373
650
  /**
374
- * A set of key-value pairs.
651
+ * A set of key-value pairs used to store meta data information about an entity.
375
652
  */
376
653
  export type MetaData = ({
377
654
  /**
@@ -385,6 +662,10 @@ declare namespace Components {
385
662
  })[];
386
663
  /**
387
664
  * The opportunity entity
665
+ * example:
666
+ * {
667
+ * "$ref": "#/components/examples/opportunity"
668
+ * }
388
669
  */
389
670
  export interface Opportunity {
390
671
  [name: string]: any;
@@ -392,41 +673,157 @@ declare namespace Components {
392
673
  * The opportunity id number for the customer (autogenerated if left blank)
393
674
  */
394
675
  opportunity_number?: string;
676
+ /**
677
+ * The opportunity title for the opportunity
678
+ */
679
+ opportunity_title?: string;
395
680
  /**
396
681
  * A description to frame this opportunity within its sales process
397
682
  */
398
683
  description?: string;
399
684
  /**
400
- * The opportunity status
685
+ * The opportunity status (defined by the opportunity workflow)
401
686
  */
402
- status?: "lead" | "qualification" | "validation" | "offering" | "supply" | "approval" | "operations" | "complete";
403
- items?: /* The order entity */ Order[] | {
687
+ status?: string;
688
+ /**
689
+ * The expiration date
690
+ */
691
+ due_date?: string;
692
+ /**
693
+ * The opportunity assignees
694
+ */
695
+ assignee?: {
696
+ id?: string;
697
+ email?: string;
698
+ display_name?: string;
699
+ token?: string;
700
+ image_uri?: string;
701
+ organization_id?: string;
702
+ department?: string;
703
+ preferred_language?: string;
704
+ status?: string;
705
+ phone?: string;
706
+ email_notification_settings?: {
707
+ [key: string]: any;
708
+ };
709
+ is_signature_enabled?: boolean;
710
+ created_at?: string;
711
+ }[];
712
+ /**
713
+ * A list of customers related with the opportunity
714
+ */
715
+ customer?: {
716
+ $relation?: EntityRelation[];
717
+ };
718
+ /**
719
+ * A set of dates associated with the opportunity
720
+ */
721
+ dates?: ({
722
+ /**
723
+ * The date tags
724
+ */
725
+ _tags?: string[];
726
+ /**
727
+ * The date value
728
+ */
729
+ value?: string;
730
+ })[];
731
+ /**
732
+ * The billing address
733
+ */
734
+ billing_address?: {
735
+ /**
736
+ * The relation from which a field is being referenced
737
+ */
738
+ $relation_ref?: ({
739
+ /**
740
+ * The id of the referenced entity
741
+ */
742
+ entity_id?: string;
743
+ /**
744
+ * The path to the target attribute being referenced
745
+ */
746
+ path?: string;
747
+ })[];
748
+ };
749
+ /**
750
+ * The delivery address
751
+ */
752
+ delivery_address?: {
753
+ /**
754
+ * The relation from which a field is being referenced
755
+ */
756
+ $relation_ref?: ({
757
+ /**
758
+ * The id of the referenced entity
759
+ */
760
+ entity_id?: string;
761
+ /**
762
+ * The path to the target attribute being referenced
763
+ */
764
+ path?: string;
765
+ })[];
766
+ };
767
+ /**
768
+ * A list of additional addresses
769
+ */
770
+ address?: {
771
+ /**
772
+ * The relation from which a field is being referenced
773
+ */
774
+ $relation_ref?: ({
775
+ /**
776
+ * The id of the referenced entity
777
+ */
778
+ entity_id?: string;
779
+ /**
780
+ * The path to the target attribute being referenced
781
+ */
782
+ path?: string;
783
+ })[];
784
+ };
785
+ /**
786
+ * The order relations items, representing quotes or orders associated with the opportunity
787
+ */
788
+ items?: {
404
789
  $relation?: /* An order relation reference */ OrderRelation[];
405
790
  };
406
791
  /**
407
792
  * Organization Id the order belongs to
408
793
  */
409
794
  _org_id?: string;
795
+ /**
796
+ * The opportunity id
797
+ */
410
798
  _id?: string;
799
+ /**
800
+ * The opportunity creation date
801
+ */
411
802
  _created_at?: string;
803
+ /**
804
+ * The opportunity last update date
805
+ */
412
806
  _updated_at?: string;
413
807
  /**
414
- * type of source, e.g. journey or manual
808
+ * Type of source, e.g. journey or manual
415
809
  * example:
416
810
  * journey
417
811
  */
418
812
  source_type?: string;
419
813
  /**
420
- * identifier for source e.g. journey ID
814
+ * Identifier for source e.g. journey ID
421
815
  * example:
422
816
  * ce99875f-fba9-4fe2-a8f9-afaf52059051
423
817
  */
424
818
  source_id?: string;
425
- source?: /* Order Source */ OpportunitySource;
819
+ source?: /* The opportunity generation source */ OpportunitySource;
820
+ /**
821
+ * An arbitrary set of tags attached to the opportunity
822
+ */
426
823
  _tags?: string[];
427
824
  }
428
825
  /**
429
- * Order Source
826
+ * The opportunity generation source
430
827
  */
431
828
  export interface OpportunitySource {
432
829
  /**
@@ -444,40 +841,85 @@ declare namespace Components {
444
841
  }
445
842
  /**
446
843
  * The order entity
844
+ * example:
845
+ * {
846
+ * "$ref": "#/components/examples/order-with-simple-prices"
847
+ * }
447
848
  */
448
849
  export interface Order {
449
850
  [name: string]: any;
450
851
  /**
451
- * The order id number for the customer
852
+ * The order number (customer facing)
452
853
  */
453
854
  order_number?: string;
454
855
  /**
455
- * The cart id that originated or is associated with the order
856
+ * The cart id that originated or is associated with the this order
857
+ */
858
+ cart_id?: string;
859
+ status?: /**
860
+ *
861
+ * | status | description |
862
+ * |-------------|-------|
863
+ * | `draft` | ​​Starting state for all orders, at this point we can still edit the order |
864
+ * | `quote` | The order is in a quoting phase, bound to an expiration date |
865
+ * | `placed` | The order has been paid and can now be fulfilled (shipped, delivered, complete) or canceled |
866
+ * | `cancelled` | The order has been cancelled |
867
+ * | `completed` | The order is now closed and finalized |
868
+ *
456
869
  */
457
- cart_id?: string;
458
- status?: /* The order status */ OrderStatus;
870
+ OrderStatus;
459
871
  /**
460
- * type of source, e.g. journey or manual
872
+ * Type of source, e.g. journey or manual
461
873
  * example:
462
874
  * journey
463
875
  */
464
876
  source_type?: string;
465
877
  /**
466
- * identifier for source e.g. journey ID
878
+ * Identifier for source e.g. journey ID
467
879
  * example:
468
880
  * ce99875f-fba9-4fe2-a8f9-afaf52059051
469
881
  */
470
882
  source_id?: string;
471
- source?: /* Order Source */ OrderSource;
472
- metadata?: /* A set of key-value pairs. */ MetaData;
883
+ source?: /* The order generation source */ OrderSource;
884
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
885
+ /**
886
+ * A list of customers related with the opportunity
887
+ */
888
+ customer?: {
889
+ $relation?: EntityRelation[];
890
+ };
891
+ /**
892
+ * The billing contact first name
893
+ */
473
894
  billing_first_name?: string;
895
+ /**
896
+ * The billing contact last name
897
+ */
474
898
  billing_last_name?: string;
899
+ /**
900
+ * The billing account name
901
+ */
475
902
  billing_company_name?: string;
903
+ /**
904
+ * The billing account VAT
905
+ */
476
906
  billing_vat?: string;
907
+ /**
908
+ * The billing email
909
+ */
477
910
  billing_email?: string;
911
+ /**
912
+ * The billing phone
913
+ */
478
914
  billing_phone?: string;
915
+ /**
916
+ * The billing address
917
+ */
479
918
  billing_address?: Address[];
480
- currency?: /**
919
+ /**
920
+ * The order main currency
921
+ */
922
+ currency?: /* The order main currency */ /**
481
923
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
482
924
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
483
925
  *
@@ -485,16 +927,18 @@ declare namespace Components {
485
927
  * EUR
486
928
  */
487
929
  Currency;
930
+ /**
931
+ * The delivery address
932
+ */
488
933
  delivery_address?: Address[];
934
+ /**
935
+ * The payment method details for the order
936
+ */
489
937
  payment_method?: /**
490
938
  * A PaymentMethod represent your customer's payment instruments.
491
939
  *
492
940
  */
493
941
  PaymentMethod[];
494
- /**
495
- * The id of an existing contact.
496
- */
497
- contact?: string;
498
942
  line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
499
943
  /**
500
944
  * Total of all items before (discounts or) taxes are applied.
@@ -509,16 +953,39 @@ declare namespace Components {
509
953
  * Organization Id the order belongs to
510
954
  */
511
955
  _org_id?: string;
956
+ /**
957
+ * The order id
958
+ */
512
959
  _id?: string;
960
+ /**
961
+ * The order creation date
962
+ */
513
963
  _created_at?: string;
964
+ /**
965
+ * The order last update date
966
+ */
514
967
  _updated_at?: string;
968
+ /**
969
+ * An arbitrary set of tags attached to the order
970
+ */
515
971
  _tags?: string[];
516
972
  }
517
973
  /**
518
974
  * Order Entity Payload
519
975
  */
520
976
  export interface OrderPayload {
521
- status?: /* The order status */ OrderStatus;
977
+ status?: /**
978
+ *
979
+ * | status | description |
980
+ * |-------------|-------|
981
+ * | `draft` | ​​Starting state for all orders, at this point we can still edit the order |
982
+ * | `quote` | The order is in a quoting phase, bound to an expiration date |
983
+ * | `placed` | The order has been paid and can now be fulfilled (shipped, delivered, complete) or canceled |
984
+ * | `cancelled` | The order has been cancelled |
985
+ * | `completed` | The order is now closed and finalized |
986
+ *
987
+ */
988
+ OrderStatus;
522
989
  line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
523
990
  /**
524
991
  * type of source, e.g. journey or manual
@@ -564,7 +1031,7 @@ declare namespace Components {
564
1031
  _tags?: string[];
565
1032
  }
566
1033
  /**
567
- * Order Source
1034
+ * The order generation source
568
1035
  */
569
1036
  export interface OrderSource {
570
1037
  /**
@@ -581,7 +1048,15 @@ declare namespace Components {
581
1048
  title?: string;
582
1049
  }
583
1050
  /**
584
- * The order status
1051
+ *
1052
+ * | status | description |
1053
+ * |-------------|-------|
1054
+ * | `draft` | ​​Starting state for all orders, at this point we can still edit the order |
1055
+ * | `quote` | The order is in a quoting phase, bound to an expiration date |
1056
+ * | `placed` | The order has been paid and can now be fulfilled (shipped, delivered, complete) or canceled |
1057
+ * | `cancelled` | The order has been cancelled |
1058
+ * | `completed` | The order is now closed and finalized |
1059
+ *
585
1060
  */
586
1061
  export type OrderStatus = "draft" | "quote" | "placed" | "cancelled" | "completed";
587
1062
  /**
@@ -601,21 +1076,78 @@ declare namespace Components {
601
1076
  };
602
1077
  }
603
1078
  /**
604
- * The price configuration
1079
+ * The price entity schema for simple pricing
1080
+ * example:
1081
+ * {
1082
+ * "$ref": "#/components/examples/price"
1083
+ * }
605
1084
  */
606
1085
  export interface Price {
607
1086
  [name: string]: any;
1087
+ /**
1088
+ * Whether the price can be used for new purchases.
1089
+ */
608
1090
  active?: boolean;
609
- billing_scheme?: "Per Unit";
1091
+ /**
1092
+ * Describes how to compute the price per period. Either `per_unit` or `tiered`.
1093
+ * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
1094
+ * - `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.
1095
+ *
1096
+ * ⚠️ Tiered pricing is **not supported** yet.
1097
+ *
1098
+ */
1099
+ billing_scheme?: "per_unit";
1100
+ /**
1101
+ * A brief description of the price.
1102
+ */
610
1103
  description?: string;
611
- sales_tax?: SalesTax;
1104
+ /**
1105
+ * The default tax rate applicable to the product.
1106
+ * This field is deprecated, use the new `tax` attribute.
1107
+ *
1108
+ */
1109
+ sales_tax?: /**
1110
+ * The default tax rate applicable to the product.
1111
+ * This field is deprecated, use the new `tax` attribute.
1112
+ *
1113
+ */
1114
+ SalesTax;
1115
+ /**
1116
+ * The default tax rate applied to the price
1117
+ */
1118
+ tax?: {
1119
+ $relation?: EntityRelation[];
1120
+ };
1121
+ /**
1122
+ * Specifies whether the price is considered `inclusive` of taxes or `exclusive` of taxes.
1123
+ * One of `inclusive`, `exclusive`, or `unspecified`.
1124
+ *
1125
+ */
612
1126
  tax_behavior?: "inclusive" | "exclusive";
613
- tiers_mode?: "Standard";
1127
+ /**
1128
+ * Defines the tiered pricing type of the price.
1129
+ */
1130
+ tiers_mode?: "standard";
1131
+ /**
1132
+ * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
1133
+ */
614
1134
  type?: "one_time" | "recurring";
615
- billing_period?: BillingPeriod;
1135
+ /**
1136
+ * For recurring prices `billing_period` defines the default extent of the recurrence.
1137
+ */
1138
+ billing_period?: /* For recurring prices `billing_period` defines the default extent of the recurrence. */ BillingPeriod;
1139
+ /**
1140
+ * The unit amount in cents to be charged, represented as a whole integer if possible.
1141
+ */
616
1142
  unit_amount?: number;
1143
+ /**
1144
+ * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
1145
+ */
617
1146
  unit_amount_decimal?: string;
618
- unit_amount_currency?: /**
1147
+ /**
1148
+ * Three-letter ISO currency code, in lowercase.
1149
+ */
1150
+ unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
619
1151
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
620
1152
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
621
1153
  *
@@ -623,28 +1155,104 @@ declare namespace Components {
623
1155
  * EUR
624
1156
  */
625
1157
  Currency;
1158
+ /**
1159
+ * Defines the way the price amount is display in epilot journeys.
1160
+ */
1161
+ price_display_in_journeys?: "show_price" | "show_as_starting_price" | "show_as_on_request";
1162
+ /**
1163
+ * The billing period duration
1164
+ */
626
1165
  billing_duration_amount?: number;
1166
+ /**
1167
+ * The billing period duration unit
1168
+ */
627
1169
  billing_duration_unit?: "weeks" | "months" | "years";
1170
+ /**
1171
+ * The notice period duration
1172
+ */
628
1173
  notice_time_amount?: number;
1174
+ /**
1175
+ * The notice period duration unit
1176
+ */
629
1177
  notice_time_unit?: "weeks" | "months" | "years";
1178
+ /**
1179
+ * The termination period duration
1180
+ */
630
1181
  termination_time_amount?: number;
1182
+ /**
1183
+ * The termination period duration unit
1184
+ */
631
1185
  termination_time_unit?: "weeks" | "months" | "years";
1186
+ /**
1187
+ * The renewal period duration
1188
+ */
632
1189
  renewal_duration_amount?: number;
1190
+ /**
1191
+ * The renewal period duration unit
1192
+ */
633
1193
  renewal_duration_unit?: "weeks" | "months" | "years";
1194
+ /**
1195
+ * The price creation date
1196
+ */
634
1197
  _created_at?: string;
1198
+ /**
1199
+ * The price id
1200
+ */
635
1201
  _id?: string;
1202
+ /**
1203
+ * The price autogenerated title
1204
+ */
636
1205
  _title?: string;
1206
+ /**
1207
+ * The price last update date
1208
+ */
637
1209
  _updated_at?: string;
1210
+ /**
1211
+ * The organization id the price belongs to
1212
+ */
1213
+ _org_id?: string;
1214
+ /**
1215
+ * An arbitrary set of tags attached to the price
1216
+ */
1217
+ _tags?: string[];
1218
+ }
1219
+ export interface PriceComponentRelation {
1220
+ /**
1221
+ * The id of the price component
1222
+ */
1223
+ entity_id?: string;
1224
+ /**
1225
+ * By default, the quantity is set to 1, when greater than 1 this value is used as a multiplicative factor.
1226
+ * E.g: 16 x Solar Modules - Premium price.
1227
+ *
1228
+ */
1229
+ quantity?: number;
1230
+ item?: /**
1231
+ * The price entity schema for simple pricing
1232
+ * example:
1233
+ * {
1234
+ * "$ref": "#/components/examples/price"
1235
+ * }
1236
+ */
1237
+ Price;
1238
+ /**
1239
+ * An arbitrary set of tags attached to the composite price - component relation
1240
+ */
1241
+ _tags?: string[];
638
1242
  }
639
1243
  /**
640
1244
  * Represents a price item
1245
+ * example:
1246
+ * {
1247
+ * "$ref": "#/components/examples/price-item"
1248
+ * }
641
1249
  */
642
1250
  export interface PriceItem {
643
1251
  /**
644
1252
  * price item id
645
1253
  */
646
1254
  id?: string;
647
- metadata?: /* A set of key-value pairs. */ MetaData;
1255
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
648
1256
  /**
649
1257
  * The unit amount value
650
1258
  */
@@ -654,7 +1262,7 @@ declare namespace Components {
654
1262
  */
655
1263
  amount_subtotal?: number;
656
1264
  /**
657
- * Net unit amount without taxes.
1265
+ * Net unit amount without taxes or discounts.
658
1266
  */
659
1267
  unit_amount_net?: number;
660
1268
  /**
@@ -685,8 +1293,39 @@ declare namespace Components {
685
1293
  * The id of the price.
686
1294
  */
687
1295
  price_id?: string;
688
- _price?: /* The price configuration */ Price;
689
- _product?: /* The product configuration */ Product;
1296
+ /**
1297
+ * The flag for prices that contain price components.
1298
+ */
1299
+ is_composite_price?: boolean;
1300
+ /**
1301
+ * The price snapshot data.
1302
+ */
1303
+ _price?: /* The price snapshot data. */ /**
1304
+ * The price entity schema for simple pricing
1305
+ * example:
1306
+ * {
1307
+ * "$ref": "#/components/examples/price"
1308
+ * }
1309
+ */
1310
+ Price | /**
1311
+ * The price entity schema for dynamic pricing
1312
+ * example:
1313
+ * {
1314
+ * "$ref": "#/components/examples/composite-price"
1315
+ * }
1316
+ */
1317
+ CompositePrice;
1318
+ /**
1319
+ * The product snapshot data.
1320
+ */
1321
+ _product?: /* The product snapshot data. */ /**
1322
+ * The product entity
1323
+ * example:
1324
+ * {
1325
+ * "$ref": "#/components/examples/product"
1326
+ * }
1327
+ */
1328
+ Product;
690
1329
  /**
691
1330
  * The taxes applied to the price item.
692
1331
  */
@@ -700,7 +1339,7 @@ declare namespace Components {
700
1339
  * Represents a valid price item from a client.
701
1340
  */
702
1341
  export interface PriceItemDto {
703
- metadata?: /* A set of key-value pairs. */ MetaData;
1342
+ metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
704
1343
  /**
705
1344
  * The quantity of products being purchased.
706
1345
  */
@@ -717,6 +1356,29 @@ declare namespace Components {
717
1356
  * The id of the price.
718
1357
  */
719
1358
  price_id?: string;
1359
+ /**
1360
+ * The unit amount value
1361
+ */
1362
+ unit_amount?: number;
1363
+ /**
1364
+ * Three-letter ISO currency code, in lowercase.
1365
+ */
1366
+ unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
1367
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
1368
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
1369
+ *
1370
+ * example:
1371
+ * EUR
1372
+ */
1373
+ Currency;
1374
+ /**
1375
+ * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
1376
+ */
1377
+ unit_amount_decimal?: string;
1378
+ /**
1379
+ * The flag for prices that contain price components.
1380
+ */
1381
+ is_composite_price?: boolean;
720
1382
  /**
721
1383
  * The taxes applied to the price item.
722
1384
  */
@@ -725,16 +1387,51 @@ declare namespace Components {
725
1387
  * The taxes applied to the price item.
726
1388
  */
727
1389
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmountDto)[];
728
- _price?: /* The price configuration */ Price;
1390
+ _price?: /**
1391
+ * The price entity schema for simple pricing
1392
+ * example:
1393
+ * {
1394
+ * "$ref": "#/components/examples/price"
1395
+ * }
1396
+ */
1397
+ Price | /**
1398
+ * The price entity schema for dynamic pricing
1399
+ * example:
1400
+ * {
1401
+ * "$ref": "#/components/examples/composite-price"
1402
+ * }
1403
+ */
1404
+ CompositePrice;
729
1405
  /**
730
1406
  * The product linked to the price item.
731
1407
  */
732
- _product?: /* The product configuration */ Product;
1408
+ _product?: /**
1409
+ * The product entity
1410
+ * example:
1411
+ * {
1412
+ * "$ref": "#/components/examples/product"
1413
+ * }
1414
+ */
1415
+ Product;
733
1416
  }
734
1417
  /**
735
1418
  * Tracks a set of product prices, quantities, (discounts) and taxes.
736
1419
  */
737
- export type PriceItems = (/* Represents a price item */ PriceItem)[];
1420
+ export type PriceItems = (/**
1421
+ * Represents a price item
1422
+ * example:
1423
+ * {
1424
+ * "$ref": "#/components/examples/price-item"
1425
+ * }
1426
+ */
1427
+ PriceItem | /**
1428
+ * Represents a composite price input to the pricing library.
1429
+ * example:
1430
+ * {
1431
+ * "$ref": "#/components/examples/price-item"
1432
+ * }
1433
+ */
1434
+ CompositePriceItem)[];
738
1435
  /**
739
1436
  * A valid set of product prices, quantities, (discounts) and taxes from a client.
740
1437
  */
@@ -743,7 +1440,14 @@ declare namespace Components {
743
1440
  * The result from the calculation of a set of price items.
744
1441
  */
745
1442
  export interface PricingDetails {
746
- items?: (/* Represents a price item */ PriceItem)[];
1443
+ items?: (/**
1444
+ * Represents a price item
1445
+ * example:
1446
+ * {
1447
+ * "$ref": "#/components/examples/price-item"
1448
+ * }
1449
+ */
1450
+ PriceItem)[];
747
1451
  /**
748
1452
  * Total of all items before (discounts or) taxes are applied.
749
1453
  */
@@ -755,16 +1459,91 @@ declare namespace Components {
755
1459
  total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
756
1460
  }
757
1461
  /**
758
- * The product configuration
1462
+ * The product entity
1463
+ * example:
1464
+ * {
1465
+ * "$ref": "#/components/examples/product"
1466
+ * }
759
1467
  */
760
1468
  export interface Product {
761
1469
  [name: string]: any;
1470
+ /**
1471
+ * The product code
1472
+ */
762
1473
  code?: string;
763
- type?: "Product" | "Service";
1474
+ /**
1475
+ * The type of Product:
1476
+ *
1477
+ * | type | description |
1478
+ * |----| ----|
1479
+ * | `product` | Represents a physical good |
1480
+ * | `service` | Represents a service or virtual product |
1481
+ *
1482
+ */
1483
+ type?: "product" | "service";
1484
+ /**
1485
+ * The product main name
1486
+ */
764
1487
  name?: string;
1488
+ feature?: {
1489
+ /**
1490
+ * An arbitrary set of tags attached to a feature
1491
+ */
1492
+ _tags?: string[];
1493
+ feature?: string;
1494
+ }[];
1495
+ /**
1496
+ * Stores references to products that can be cross sold with the current product.
1497
+ */
1498
+ cross_sellable_products?: {
1499
+ $relation?: EntityRelation[];
1500
+ };
1501
+ /**
1502
+ * Stores references to a set of file images of the product
1503
+ */
1504
+ product_images?: {
1505
+ $relation?: EntityRelation[];
1506
+ };
1507
+ /**
1508
+ * Stores references to a set of files downloadable from the product.
1509
+ * e.g: tech specifications, quality control sheets, privacy policy agreements
1510
+ *
1511
+ */
1512
+ product_downloads?: {
1513
+ $relation?: EntityRelation[];
1514
+ };
1515
+ /**
1516
+ * A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.
1517
+ */
1518
+ price_options?: {
1519
+ $relation?: EntityRelation[];
1520
+ };
1521
+ /**
1522
+ * Stores references to the availability files that define where this product is available.
1523
+ * These files are used when interacting with products via epilot Journeys, thought the AvailabilityCheck block.
1524
+ *
1525
+ */
1526
+ _availability_files?: File[];
1527
+ /**
1528
+ * The product id
1529
+ */
765
1530
  _id?: string;
1531
+ /**
1532
+ * The autogenerated product title
1533
+ */
766
1534
  _title?: string;
767
- _availability_files?: File[];
1535
+ /**
1536
+ * The organization id the product belongs to
1537
+ */
1538
+ _org_id?: string;
1539
+ /**
1540
+ * The product creation date
1541
+ */
1542
+ _created_at?: string;
1543
+ /**
1544
+ * The product last update date
1545
+ */
1546
+ _updated_at?: string;
768
1547
  }
769
1548
  /**
770
1549
  * An amount associated with a specific recurrence.
@@ -939,9 +1718,23 @@ declare namespace Paths {
939
1718
  namespace Parameters {
940
1719
  export type XIvyOrgID = string;
941
1720
  }
942
- export type RequestBody = /* The opportunity entity */ Components.Schemas.Opportunity;
1721
+ export type RequestBody = /**
1722
+ * The opportunity entity
1723
+ * example:
1724
+ * {
1725
+ * "$ref": "#/components/examples/opportunity"
1726
+ * }
1727
+ */
1728
+ Components.Schemas.Opportunity;
943
1729
  namespace Responses {
944
- export type $201 = /* The opportunity entity */ Components.Schemas.Opportunity;
1730
+ export type $201 = /**
1731
+ * The opportunity entity
1732
+ * example:
1733
+ * {
1734
+ * "$ref": "#/components/examples/opportunity"
1735
+ * }
1736
+ */
1737
+ Components.Schemas.Opportunity;
945
1738
  export type $400 = Components.Schemas.Error;
946
1739
  }
947
1740
  }
@@ -999,7 +1792,14 @@ declare namespace Paths {
999
1792
  namespace CreateOrder {
1000
1793
  export type RequestBody = /* Order Entity Payload */ Components.Schemas.OrderPayload;
1001
1794
  namespace Responses {
1002
- export type $201 = /* The order entity */ Components.Schemas.Order;
1795
+ export type $201 = /**
1796
+ * The order entity
1797
+ * example:
1798
+ * {
1799
+ * "$ref": "#/components/examples/order-with-simple-prices"
1800
+ * }
1801
+ */
1802
+ Components.Schemas.Order;
1003
1803
  export type $400 = Components.Schemas.Error;
1004
1804
  }
1005
1805
  }
@@ -1012,7 +1812,14 @@ declare namespace Paths {
1012
1812
  }
1013
1813
  export type RequestBody = /* Order Entity Payload */ Components.Schemas.OrderPayload;
1014
1814
  namespace Responses {
1015
- export type $200 = /* The order entity */ Components.Schemas.Order;
1815
+ export type $200 = /**
1816
+ * The order entity
1817
+ * example:
1818
+ * {
1819
+ * "$ref": "#/components/examples/order-with-simple-prices"
1820
+ * }
1821
+ */
1822
+ Components.Schemas.Order;
1016
1823
  export type $400 = Components.Schemas.Error;
1017
1824
  }
1018
1825
  }
@@ -1083,7 +1890,9 @@ export interface OperationMethods {
1083
1890
  /**
1084
1891
  * $createOpportunity - createOpportunity
1085
1892
  *
1086
- * This API is Deprecated. Please use the Entity API or Submission API to create opportunities. Creates a new opportunity. During the creation of an opportunity, an unique customer-readable `opportunity_number` will be generated.
1893
+ * This API is Deprecated. Please use the Entity API or Submission API to create opportunities.
1894
+ *
1895
+ * Enables the creation of a new opportunity. During the creation of an opportunity, an unique customer-readable `opportunity_number` will be generated.
1087
1896
  * The `opportunity_number` can be used to universally identify an opportunity within epilot platform.
1088
1897
  *
1089
1898
  */
@@ -1170,7 +1979,9 @@ export interface PathsDictionary {
1170
1979
  /**
1171
1980
  * $createOpportunity - createOpportunity
1172
1981
  *
1173
- * This API is Deprecated. Please use the Entity API or Submission API to create opportunities. Creates a new opportunity. During the creation of an opportunity, an unique customer-readable `opportunity_number` will be generated.
1982
+ * This API is Deprecated. Please use the Entity API or Submission API to create opportunities.
1983
+ *
1984
+ * Enables the creation of a new opportunity. During the creation of an opportunity, an unique customer-readable `opportunity_number` will be generated.
1174
1985
  * The `opportunity_number` can be used to universally identify an opportunity within epilot platform.
1175
1986
  *
1176
1987
  */