@@ -29,8 +29,10 @@ public void run() {
2929 FiscalApiSettings settings = new FiscalApiSettings ();
3030 settings .setDebugMode (true );
3131 settings .setApiUrl ("https://test.fiscalapi.com" );
32- settings .setApiKey ("<api-key>" );
33- settings .setTenant ("<tenant-key>" );
32+ //settings.setApiKey("<api-key>");
33+ settings .setApiKey ("sk_test_4e7ca2f5_6c02_4571_9767_212f32cebd59" );
34+ settings .setTenant ("102e5f13-e114-41dd-bea7-507fce177281" );
35+ //settings.setTenant("<tenant-key>");
3436
3537
3638
@@ -251,8 +253,8 @@ public void run() {
251253 //region Facturas
252254
253255// // ***Obtener una factura por Id***//
254- // ApiResponse<Invoice> apiResponse = client.getInvoiceService().getById("bda0b31d-e1e0-4644-91ea-c6f0e90fb57c ",true);
255- // System.out.printf("apiResponse: %s\n", apiResponse);
256+ ApiResponse <Invoice > apiResponse = client .getInvoiceService ().getById ("1207c05b-9c4b-42ed-aa39-1fab4e993c7b " ,true );
257+ System .out .printf ("apiResponse: %s\n " , apiResponse );
256258
257259// // ***Listar facturas***//
258260// ApiResponse<PagedList<Invoice>> apiResponse = client.getInvoiceService().getList(1,3);
@@ -864,42 +866,42 @@ public void run() {
864866// System.out.println(apiResponse);
865867
866868 // Generar nota de crédito con precios dinámicos
867- Invoice invoice = new Invoice ();
868- invoice .setVersionCode ("4.0" );
869- invoice .setSeries ("CN" );
870- invoice .setDate (LocalDateTime .now ().minusHours (2 ));
871- invoice .setPaymentFormCode ("03" );
872- invoice .setCurrencyCode ("MXN" );
873- invoice .setTypeCode ("E" );
874- invoice .setExpeditionZipCode ("01160" );
875- invoice .setPaymentMethodCode ("PUE" );
876-
877- // Emisor por referencia
878- InvoiceIssuer issuer = new InvoiceIssuer ();
879- issuer .setId ("3f3478b4-60fd-459e-8bfc-f8239fc96257" );
880- invoice .setIssuer (issuer );
881-
882- // Receptor por referencia
883- InvoiceRecipient recipient = new InvoiceRecipient ();
884- recipient .setId ("96b46762-d246-4a67-a562-510a25dbafa9" );
885- invoice .setRecipient (recipient );
886-
887- // Facturas relacionadas
888- List <RelatedInvoice > relatedInvoices = new ArrayList <>();
889- RelatedInvoice related = new RelatedInvoice ();
890- related .setUuid ("5FB2822E-396D-4725-8521-CDC4BDD20CCF" );
891- related .setRelationshipTypeCode ("01" );
892- relatedInvoices .add (related );
893- invoice .setRelatedInvoices (relatedInvoices );
894-
895- // Productos / Servicios por referencia
896- List <InvoiceItem > items = new ArrayList <>();
897- InvoiceItem item = new InvoiceItem ();
898- item .setId ("114a4be5-fb65-40b2-a762-ff0c55c6ebfa" );
899- item .setQuantity (0.5 );
900- item .setUnitPrice (150.0 );
901- items .add (item );
902- invoice .setItems (items );
869+ // Invoice invoice = new Invoice();
870+ // invoice.setVersionCode("4.0");
871+ // invoice.setSeries("CN");
872+ // invoice.setDate(LocalDateTime.now().minusHours(2));
873+ // invoice.setPaymentFormCode("03");
874+ // invoice.setCurrencyCode("MXN");
875+ // invoice.setTypeCode("E");
876+ // invoice.setExpeditionZipCode("01160");
877+ // invoice.setPaymentMethodCode("PUE");
878+ //
879+ // // Emisor por referencia
880+ // InvoiceIssuer issuer = new InvoiceIssuer();
881+ // issuer.setId("3f3478b4-60fd-459e-8bfc-f8239fc96257");
882+ // invoice.setIssuer(issuer);
883+ //
884+ // // Receptor por referencia
885+ // InvoiceRecipient recipient = new InvoiceRecipient();
886+ // recipient.setId("96b46762-d246-4a67-a562-510a25dbafa9");
887+ // invoice.setRecipient(recipient);
888+ //
889+ // // Facturas relacionadas
890+ // List<RelatedInvoice> relatedInvoices = new ArrayList<>();
891+ // RelatedInvoice related = new RelatedInvoice();
892+ // related.setUuid("5FB2822E-396D-4725-8521-CDC4BDD20CCF");
893+ // related.setRelationshipTypeCode("01");
894+ // relatedInvoices.add(related);
895+ // invoice.setRelatedInvoices(relatedInvoices);
896+ //
897+ // // Productos / Servicios por referencia
898+ // List<InvoiceItem> items = new ArrayList<>();
899+ // InvoiceItem item = new InvoiceItem();
900+ // item.setId("114a4be5-fb65-40b2-a762-ff0c55c6ebfa");
901+ // item.setQuantity(0.5);
902+ // item.setUnitPrice(150.0);
903+ // items.add(item);
904+ // invoice.setItems(items);
903905
904906// ApiResponse<Invoice> apiResponse = client.getInvoiceService().create(invoice);
905907// System.out.println(apiResponse);
0 commit comments