@@ -62,27 +62,144 @@ FiscalAPI soporta dos modos de operación:
6262### Crear una Factura de Ingreso (Por Referencias)
6363
6464``` csharp
65+ // Crear instancia de FiscalApiClient
66+ var fiscalApi = FiscalApiClient .Create (Settings );
67+
68+ // Emisor KARLA FUENTE NOLASCO
69+ var issuer = new InvoiceIssuer
70+ {
71+ Id = " <id-emisor-en-fiscalapi>"
72+ };
73+
74+ // Receptor ESCUELA KEMPER URGATE
75+ var recipient = new InvoiceRecipient
76+ {
77+ Id = " <id-receptor-en-fiscalapi>"
78+ };
79+
80+ // Crear una lista de productos o servicios de la factura
81+ var items = new List <InvoiceItem >()
82+ {
83+ new InvoiceItem
84+ {
85+ Id = " <id-producto-en-fiscalapi>" ,
86+ Quantity = 1 ,
87+ Discount = 10 . 85 m ,
88+ },
89+ };
90+
91+ // Crear la factura
6592var invoice = new Invoice
6693{
6794 VersionCode = " 4.0" ,
68- Series = " A " ,
95+ Series = " SDK-F " ,
6996 Date = DateTime .Now ,
7097 PaymentFormCode = " 01" ,
7198 CurrencyCode = " MXN" ,
7299 TypeCode = " I" ,
73100 ExpeditionZipCode = " 42501" ,
74- Issuer = new InvoiceIssuer { Id = " id-del-emisor" },
75- Recipient = new InvoiceRecipient { Id = " id-del-receptor" },
76- Items = new List <InvoiceItem >
101+ Issuer = issuer ,
102+ Recipient = recipient ,
103+ Items = items ,
104+ PaymentMethodCode = " PUE" ,
105+ };
106+
107+ // Timbrar la factura
108+ var apiResponse = await fiscalApi .Invoices .CreateAsync (invoice );
109+ ```
110+
111+ ### Crear la misma factura de ingreso (Por valores)
112+ ``` csharp
113+ // Crear fiscalapi client
114+ var fiscalApi = FiscalApiClient .Create (settings );
115+
116+ // Crear certificados de prueba (EKU9003173C9)
117+ var sellos = new List <TaxCredential >()
118+ {
119+ new TaxCredential
77120 {
78- new InvoiceItem { Id = " id-del-producto" , Quantity = 1 }
121+ Base64File = "MIIFsDCCA5igAwIBAgIUMzAwMDEwMDAwMDA1MDAwMDM0MTYwDQ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GjpCVeJ+BEBn0JPLWVvDKHZAQMj6s5Bku35+d/MyATkpOPsGT/VTnsouxekDfikJD1f7A1ZpJbqDpkJnss3vQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAFaUgj5PqgvJigNMgtrdXZnbPfVBbukAbW4OGnUhNrA7SRAAfv2BSGk16PI0nBOr7qF2mItmBnjgEwk+DTv8Zr7w5qp7vleC6dIsZFNJoa6ZndrE/f7KO1CYruLXr5gwEkIyGfJ9NwyIagvHHMszzyHiSZIA850fWtbqtythpAliJ2jF35M5pNS+YTkRB+T6L/c6m00ymN3q9lT1rB03YywxrLreRSFZOSrbwWfg34EJbHfbFXpCSVYdJRfiVdvHnewN0r5fUlPtR9stQHyuqewzdkyb5jTTw02D2cUfL57vlPStBj7SEi3uOWvLrsiDnnCIxRMYJ2UA2ktDKHk+zWnsDmaeleSzonv2CHW42yXYPCvWi88oE1DJNYLNkIjua7MxAnkNZbScNw01A6zbLsZ3y8G6eEYnxSTRfwjd8EP4kdiHNJftm7Z4iRU7HOVh79/lRWB+gd171s3d/mI9kte3MRy6V8MMEMCAnMboGpaooYwgAmwclI2XZCczNWXfhaWe0ZS5PmytD/GDpXzkX0oEgY9K/uYo5V77NdZbGAjmyi8cE2B2ogvyaN2XfIInrZPgEffJ4AB7kFA2mwesdLOCh0BLD9itmCve3A1FGR4+stO2ANUoiI3w3Tv2yQSg4bjeDlJ08lXaaFCLW2peEXMXjQUk7fmpb5MNuOUTW6BE=",
122+ FileType = FileType .CertificateCsd ,
123+ Password = " 12345678a"
79124 },
125+ new TaxCredential
126+ {
127+ Base64File = "MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS/AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucoZQObOaLUEm+I+QZ7Y8Giupo+F1XWkLvAsdk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0v9wo0X/oO5GvZhe0ZaGHnm9zqTopALuFEAxcaQlc4R81wjC4wrIrqWnbcl2dxiBtD73KW+wcC9ymsLf4I8BEmiN25lx/OUc1IHNyXZJYSFkEfaxCEZWKcnbiyf5sqFSSlEqZLc4lUPJFAoP6s1FHVcyO0odWqdadhRZLZC9RCzQgPlMRtji/OXy5phh7diOBZv5UYp5nb+MZ2NAB/eFXm2JLguxjvEstuvTDmZDUb6Uqv++RdhO5gvKf/AcwU38ifaHQ9uvRuDocYwVxZS2nr9rOwZ8nAh+P2o4e0tEXjxFKQGhxXYkn75H3hhfnFYjik/2qunHBBZfcdG148MaNP6DjX33M238T9Zw/GyGx00JMogr2pdP4JAErv9a5yt4YR41KGf8guSOUbOXVARw6+ybh7+meb7w4BeTlj3aZkv8tVGdfIt3lrwVnlbzhLjeQY6PplKp3/a5Kr5yM0T4wJoKQQ6v3vSNmrhpbuAtKxpMILe8CQoo=",
128+ FileType = FileType .PrivateKeyCsd ,
129+ Password = " 12345678a"
130+ }
131+ };
132+
133+ // Emisor
134+ var issuer = new InvoiceIssuer
135+ {
136+ Tin = " EKU9003173C9" ,
137+ LegalName = " ESCUELA KEMPER URGATE" ,
138+ TaxRegimeCode = " 601" ,
139+ TaxCredentials = sellos
140+ };
141+
142+ // Receptor
143+ var recipient = new InvoiceRecipient
144+ {
145+ Tin = " EKU9003173C9" ,
146+ LegalName = " ESCUELA KEMPER URGATE" ,
147+ ZipCode = " 42501" ,
148+ TaxRegimeCode = " 601" ,
149+ CfdiUseCode = " G01" ,
150+ 151+ };
152+
153+ // Crear una lista de productos o servicios de la factura
154+ var items = new List <InvoiceItem >()
155+ {
156+ new InvoiceItem
157+ {
158+ ItemCode = " 01010101" ,
159+ Quantity = 9 . 5 m ,
160+ UnitOfMeasurementCode = " E48" ,
161+ UnitOfMeasurement = " Unidad de servicio" ,
162+ Description = " Invoicing software as a service" ,
163+ UnitPrice = 3587 . 75 m ,
164+ TaxObjectCode = " 02" ,
165+ ItemSku = " 7506022301697" ,
166+ Discount = 255 . 85 m ,
167+ ItemTaxes = new List <InvoiceItemTax >()
168+ {
169+ new InvoiceItemTax
170+ {
171+ TaxCode = " 002" , // IVA
172+ TaxTypeCode = " Tasa" , // Tasa
173+ TaxRate = 0 . 160000 m , // 16%
174+ TaxFlagCode = " T" // Traslado
175+ }
176+ }
177+ }
178+ };
179+
180+ // Crear la factura
181+ var invoice = new Invoice
182+ {
183+ VersionCode = " 4.0" ,
184+ Series = " SDK-F" ,
185+ Date = DateTime .Now ,
186+ PaymentFormCode = " 01" ,
187+ CurrencyCode = " MXN" ,
188+ TypeCode = " I" ,
189+ ExpeditionZipCode = " 42501" ,
190+ Issuer = issuer ,
191+ Recipient = recipient ,
192+ Items = items ,
80193 PaymentMethodCode = " PUE" ,
81194};
82195
83- var response = await fiscalApi .Invoices .CreateAsync (invoice );
196+ // Timbrar la factura
197+ var apiResponse = await fiscalApi .Invoices .CreateAsync (invoice );
84198```
85199
200+
201+
202+
86203### Crear una Nota de Crédito (Por Valores)
87204
88205``` csharp
0 commit comments