Created
August 27, 2015 17:25
-
-
Save acras/1274e12b0d1bf885040e to your computer and use it in GitHub Desktop.
Este exemplo em Python mostra como consultar uma NFSe na API do Focus NFe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import json | |
import requests | |
########################################################################################## | |
# Exemplo de consulta de NFSe no município de Sâo Paulo pela API do Focus NFe | |
# | |
# https://focusnfe.com.br/api | |
# Documentação: https://focusnfe.com.br/api-documentacao | |
# | |
# IMPORTANTE | |
# * Os dados aqui contidos devem ser alterados pelo token enviado pelo suporte técnico | |
# * A ref precisa ser alterada para a ref que deve ser consultada | |
# | |
########################################################################################## | |
#CONSTANTES da empresa e do acesso à API | |
url_servico = 'http://homologacao.acrasnfe.acras.com.br/nfse.json' #Para produção alterar a URL | |
token = '************************' #Informe o Token recebido do suporte | |
ref = "py0008" | |
#Realiza a requisição HTTP que consulta a nota para a API | |
print 'Consultando a Nota ref.: ' + ref | |
r = requests.post(url_servico + "/" + token + ".json?ref="+ ref) | |
print r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment