CaptoDocs
  • CaptoDocs
  • Preguntas Frequentes
  • Manual de uso
    • Documentos
      • Ficheros
      • Aprobación
    • Subir Archivos
    • Nuevo
      • Usuario
      • Empresa
      • Miembro
      • Documento
      • Carpeta
      • Email
    • Configuración
      • Empresa
      • Empresas cabecera
      • Empresa reglas
      • Empresa enlaces
      • Documentos
      • Cabecera documentos
      • Campos documento
      • Reglas documento
  • Manual Técnico
    • Tecnologia
    • Base de datos
    • Entrenamiento I.A.
    • Ejemplos
  • Guía de Referencia
    • Workflow
  • Changelog
  • Instalación
    • Linux
      • Ubuntu 18.04 x64
    • Windows
      • Windows 10 x64
    • Mac
    • VMware
      • VMWare x64 CPU
    • Docker
      • Ubuntu 18.04 x64 CPU
      • Ubuntu 18.04 x64 GPU
  • Conecta
    • Sage
      • Sage 200
    • Wolters Kluwer
      • a3ERP
        • Settings:
        • Company Header
        • Company Rules
        • Company End Points
        • Document Header
        • Document Fields
        • Document Rules
        • Pasos del Api
      • a3ASESOR
    • QuickBooks
      • Cloud Accounting
    • Ecofin Cloud
      • Settings:
      • Company Header
      • Company Rules
      • Company End Points
      • Document Header
      • Document Fields
      • Document rules
      • Gestión de Errores
      • Pasos del API
    • Zapier
      • Hubspot
      • Spreadsheets
    • PHP Integration
    • Python Integration
      • Microsoft Excel (CSV)
Con tecnología de GitBook
En esta página

¿Te fue útil?

  1. Conecta

Python Integration

Webhook

$ pip install Flask
webhook.py
from flask import Flask, request, jsonify, make_response
import json, os


app = Flask(__name__)

@app.route('/data', methods = ['POST', 'GET'])
def data(): 
    data = request.json
    data_string = json.dumps(data)
    data_json = json.loads(data_string)
    print(data_json, file=open("output.txt", "a"))

    return make_response("",200)

if __name__ == "__main__":
    app.run(host = '127.0.0.1', port='3000', debug=True)
python webhook.py

#running in background
nohup python webhook.py > captodocs.log 2>&1 &

Ejemplo de datos guardados en output.txt

output.txt
{
	"AccountingUser": "ADMIN",
	"Company": "1",
	"Department": "1",
	"Division": "1",
	"Holding": "HOLDING1",
	"Journal": "400",
	"LocalCurrency": "EUR",
	"Monbas": "2",
	"Posting": "1",
	"Token": "4R33vj9EdJHsdaAE74345fDsW",
	"Detail": "1",
	"Impost": "1",
	"Name": "Alquiler local",
	"Pagapu": "1",
	"PaymentAutomatic": "0",
	"PaymentClacre": "03",
	"PaymentOnAccount": "572000003",
	"PaymentOnAccountAuxcod": "",
	"PaymentOnAccountAuxtip": "",
	"SellerAccount": "410000003",
	"SellerAuxiliary": "",
	"SellerAuxiliaryAuxcod": "",
	"SellerConamp": "Alquiler y servicios mes",
	"SellerConcep": "02",
	"Tipfac": "PR",
	"SellerPartyCorporateName": "Alquileres, S.L.",
	"SellerAddress": "Av Diagonal, 1234",
	"SellerAddressPostCode": "08173",
	"SellerAddessTown": "Barcelona",
	"SellerTaxIdentification": "B00000000",
	"SellerEmail": "seller@email.com",
	"SelletTel": "0000000000000",
	"InvoiceNumber": "5158",
	"InvoiceIssueDate": "20190110",
	"BuyerPartyCorporateName": "Empresa, S.L.",
	"BuyerAddress": "Av Diagonal, 1234",
	"BuyesAddressPostCode": "08173",
	"BuyesAddressTown": "Barcelona",
	"BuyerAddressProvince": "Barcelona",
	"BuyerTaxIdentification": "B00000000",
	"Detail1ArticleCode": "Renta Octubre",
	"Detail1TotalCost": "819,30",
	"Detail2ArticleCode": "Gastos Comunes",
	"Detail2TotalCost": "219,59",
	"InvoiceTotalsGrossAmount": "1038,89",
	"Tax1Rate": "21,00",
	"Tax1TotalAmount": "218,17",
	"TotalInvoiceAmount": "1257,06",
	"Detail1": {
		"DetailAccount": "62100001",
		"DetailAuxiliary": "",
		"DetailAuxiliaryAuxcod": "",
		"DetailConamp": "Alquiler",
		"DetailConcep": "02",
		"DetailCurrency": "EUR"
	},
	"Detail2": {
		"DetailAccount": "62100001",
		"DetailAuxiliary": "",
		"DetailAuxiliaryAuxcod": "",
		"DetailConamp": "Suministros",
		"DetailConcep": "02",
		"DetailCurrency": "EUR"
	},
	"Tax1": {
		"TaxAccountTax": "47200000",
		"TaxAuxapu": "0",
		"TaxAuxcod": "",
		"TaxAuxtip": "",
		"TaxClaopr": "",
		"TaxColimp": "1",
		"TaxCurrency": "EUR",
		"TaxLibreg": "SOP",
		"TaxRelaci": "RG",
		"TaxType": "1"
	},
	"TotalInvoice": {
		"TotalInvoiceAccounting": "62100001",
		"TotalInvoiceAuxapu": "0",
		"TotalInvoiceAuxcod": "",
		"TotalInvoiceAuxtip": "",
		"TotalInvoiceCurrency": "EUR"
	}
}
AnteriorPHP IntegrationSiguienteMicrosoft Excel (CSV)

Última actualización hace 5 años

¿Te fue útil?