

These services will cease to be available from April 1, 2021 , the new version of the API has these and more tools that will facilitate and save a lot of time in validations or penalties of the SAT in audits, we recommend widely reviewing you the new documentation at https://develers.facturoPorti.com.mx/reference/api-desarrollo-facturo as part of the new features can be part of the new features.
新的API訪問服務以:
https://testapi.facturoporti.com.mx/
https://api.facturoporti.com.mx/
取決於您使用沙箱或生產的環境。
您需要幫助還是需要雇用服務?給我們發送電子郵件至[email protected] [email protected],轉到頁面https://www.facturoporti.com.mx在線告訴我們或致電我們555 546 2288或558 421 767我們可以很樂意給您您需要的東西。
這是用於在C#中使用Web服務以生成發票,筆記,收據,工資單,軸承信,付款補充等的示例。
當您已經通過自己的手段生成XML而只需要蓋章時,此服務是理想的選擇。集成在10分鐘內很容易迅速,您將在我們的測試環境中廣播CFDI在不到1小時的時間內生產。
此外,Web服務將允許取消一個或多個CFDI
建議使用視覺工作室開發IDE 2017或更高的社區。所有社區版本都是免費的,可以從https://visualstudio.microsoft.com/es/vs/communch/下載
獲取最新版本的facturoporti c#in:
git clone https://github.com/facturoporti/factura-electronica-Web-Service-C-Sharp.git
下載包含執行沖壓過程所需的內容的存儲庫。

選擇文件按Timbrar,系統將執行以下操作:
if ( txtArchivoXML . Text . Trim ( ) . Length == 0 )
{
MessageBox . Show ( "Seleccione un archivo antes de continuar." , "Error al Timbrar Documento" ) ;
}
else
{
txtFechaInicio . Text = DateTime . Now . ToString ( ) ;
Cursor . Show ( ) ;
Cursor . Current = Cursors . WaitCursor ;
CertificarClient certificar = new CertificarClient ( ) ;
AutenticarPeticion autenticar = new AutenticarPeticion ( ) ;
TimbrarCFDIPeticion xml = new TimbrarCFDIPeticion ( ) ;
// Asigna los parametros de configuracion de conexion
autenticar . Usuario = "PruebasTimbrado" ;
autenticar . Contrasenia = "@Notiene1" ;
// abre el archivo XMl que fue seleccionado
FileStream resultado = null ;
resultado = new FileStream ( txtArchivoXML . Text , FileMode . Open , FileAccess . Read , FileShare . Read ) ;
using ( StreamReader contenidoArchivo = new StreamReader ( resultado ) )
{
xml . XMLEntrada = contenidoArchivo . ReadToEnd ( ) ;
contenidoArchivo . Close ( ) ;
}
TimbrarCFDIRespuesta respuesta = certificar . TimbradoMultiEmpresas ( autenticar , xml ) ;
certificar . Close ( ) ;
txtFechaTermino . Text = DateTime . Now . ToString ( ) ;
if ( respuesta . Estatus . Codigo == "000" )
{
txtXMLTimbrado . Text = respuesta . Timbrado . TimbreXML ;
}
MessageBox . Show ( respuesta . Estatus . Descripcion , "Generación CFDI" ) ;
Cursor . Current = Cursors . Default ;
} 在該術語上,系統指示蓋章的結果還將向您顯示財政音色:

使用的C#版本
Visual Studio 2017 Community con Framework 4.5
輸入財政作品集(UUID)進行取消:

if ( txtFolioFiscal1 . Text . Trim ( ) . Length == 0 && txtFolioFiscal2 . Text . Trim ( ) . Length == 0 )
{
MessageBox . Show ( "Ingrese al menos un Folio Fiscal antes de continuar." , "Error al cancelar el CFDI" ) ;
}
else
{
// Genera XMl con los Folios a enviar se pueden enviar uno o mas CFDI para cancelacion
// Solo se podran enviar CFDI timbrados con nuestro servicio no hay el limite de CFDI que se puean cancelar
Cursor . Show ( ) ;
Cursor . Current = Cursors . WaitCursor ;
CertificarClient certificar = new CertificarClient ( ) ;
AutenticarPeticion autenticar = new AutenticarPeticion ( ) ;
CancelarCFDIPACPeticion cancelar = new CancelarCFDIPACPeticion ( ) ;
// Asigna los parametros de configuracion de conexion
autenticar . Usuario = "PruebasTimbrado" ;
autenticar . Contrasenia = "@Notiene1" ;
cancelar . RFC = "AAA010101AAA" ; // RFC del emisor del CFDI;
cancelar . Password = "12345678a" ;
Archivos archivo = new Archivos ( ) ;
cancelar . PFX = archivo . ConvertirStreamToByte ( archivo . Abrir ( ObtieneDirectorioAplicacion ( ) + @"CertificadoAAA010101AAA.pfx" ) ) ; //"Se debe de enviar el certificado en formato PFX para realizar la cancelacion";
List < string > folios = new List < string > ( ) ;
if ( ! string . IsNullOrEmpty ( txtFolioFiscal1 . Text ) )
folios . Add ( txtFolioFiscal1 . Text . Trim ( ) ) ;
if ( ! string . IsNullOrEmpty ( txtFolioFiscal2 . Text ) )
folios . Add ( txtFolioFiscal2 . Text . Trim ( ) ) ;
cancelar . UUID = folios . ToArray ( ) ;
CancelarCFDIRespuesta respuesta = certificar . CancelarCFDICualquierPAC ( autenticar , cancelar ) ;
certificar . Close ( ) ;
txtFechaTermino . Text = DateTime . Now . ToString ( ) ;
Cursor . Current = Cursors . Default ;
// No hay limite para el envio de cancelaciones en el ejemplo solo en envian 3 pero pueden ser todos los que el usuario
// desee cancelar al mismo tiempo
for ( int contador = 0 ; contador < respuesta . FoliosRespuesta . Length ; contador ++ )
{
if ( respuesta . FoliosRespuesta [ contador ] . Estatus != null )
MessageBox . Show ( respuesta . FoliosRespuesta [ contador ] . Estatus . Descripcion , "Generación CFDI" ) ;
}
} 執行發送取消按鈕,在執行代碼之前,您必須使用您的財政數據更新值;在執行結束時,您將得到答案:

注意:如果正確的數字證書必鬚髮送的數字證書是PFX類型之一
如果您想要更多的Web服務信息,請下載集成指南,除了允許的值之外,它還包含所有屬性及其描述
分叉存儲庫
Clona存儲庫
git clone [email protected]:yourusername/invoice-electronics-web-service-c-sharp.git
創建一個分支
git checkout desarrollo
git pull al original desarrollo
# Podrás escoger el nombre de tu rama
git checkout -b <feature/my_branch>
git add .
git commit -m "mis cambios"
git push origin <feature/my_branch>
*** -
Facturoporti在墨西哥開發。使用許可證查看更多。