### Example response for listing collections Source: https://www.granatum.com.br/financeiro/api Example JSON response when listing collections. ```json [ { "id":1245, "valor":"123.92", "valor_taxa":"-4.9", "percentual_multa":"2.0", "cobrar_juros":1, "valor_multa_juros":"0.0", "valor_pago":null, "instrucoes_boleto":null, "permitir_segunda_via":1, "lancamento_ids":"7835741,7835742", "forma_pagamento_id":123096, "cliente_id":10, "conta_id":8, "email":null, "data_vencimento":"2016-08-12", "data_a_transferir":null, "data_transferindo":null, "data_transferido":null, "data_cancelamento":null, "status_id":1, "status_descricao":"Pendente", "cobranca_hash":"A0SD0S0DSA00DAS0DS0AD0SA" "link_publico":"https://secure.granatum.com.br/pagar/A0SD0S0DSA00DAS0DS0AD0SA" } ] ``` -------------------------------- ### Example cURL call to list collections Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to list collections with specific parameters. ```curl curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/cobrancas?access_token=token_cliente_granatum&data_inicio=2015-01-01' ``` -------------------------------- ### Example cURL call to upload an attachment Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to upload a file as an attachment. ```curl curl -i -X POST \ -H 'content-type: multipart/form-data;' \ --form lancamento_id=123 \ --form file=[arquivo] \ --form filename=comprovante.pdf \ 'https://api.granatum.com.br/v1/anexos.json?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta - Listar Clientes Source: https://www.granatum.com.br/financeiro/api Example JSON response when listing clients. ```json [ { "id": 1, "nome": "Granatum Financeiro", "nome_fantasia": "Granatum Financeiro Online", "documento": "26328240000103", "inscricao_estadual": null, "inscricao_municipal": null, "telefone": null, "endereco": "11 99653-5631", "endereco_numero": null, "endereco_complemento": null, "bairro": null, "cep": null, "cidade_id": null, "estado_id": null, "email": null, "observacao": null, "fornecedor": false, "cliente": true, "banco_id": null, "agencia": null, "numero_conta", null, "ativo": true, "classificacao_cliente_id": null, "classificacao_fornecedor_id": null, "estrangeiro": false, "chave_pix": null, "estado": null, "cidade": null, "anexos": [ { "id": 53 }, { "id": 59 } ] }, { "id": 23, "nome": "Agencia WEB LTDA", "nome_fantasia": "Agencia Max", "documento": "34725187000165", "inscricao_estadual": null, "inscricao_municipal": null, "telefone": null, "endereco": null, "endereco_numero": null, "endereco_complemento": null, "bairro": null, "cep": null, "cidade_id": 234, "estado_id": 23, "email": null, "observacao": null, "fornecedor": false, "fornecedor": true, "banco_id": null, "agencia": null, "numero_conta", null, "ativo": false, "classificacao_cliente_id": null, "classificacao_fornecedor_id": null, "estrangeiro": false, "chave_pix": null, "estado": null, "cidade": null, "anexos": [ { "id": 53 }, { "id": 59 } ] }, ... ] ``` -------------------------------- ### Exemplo de chamada para criar um fornecedor Source: https://www.granatum.com.br/financeiro/api Example cURL command to create a supplier. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'nome=Granatum Financeiro' \ -d 'nome_fantasia=Granatum Financeiro Online' \ -d 'documento=26328240000103' \ 'https://api.granatum.com.br/v1/fornecedores?access_token=token_cliente_granatum' ``` -------------------------------- ### Listar tags - Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for listing tags. ```json [ { "id": 43, "descricao": "Black Friday", "ativo": true }, { "id": 65, "descricao": "Projeto crescimento", "ativo": true } ] ``` -------------------------------- ### Example response for uploading an attachment Source: https://www.granatum.com.br/financeiro/api Example JSON response after successfully uploading an attachment. ```json { "id": 91, "filename": "comprovante.pdf", "content_type": "application/pdf", "size": 53421, "lancamento_id": 123, "lancamento_compost_id": 2 } ``` -------------------------------- ### Example Response for a Launch Source: https://www.granatum.com.br/financeiro/api This JSON object represents a typical response from the Granatum API after a financial launch has been created or retrieved. ```json { "id": 91, "grupo_id": null, "lancamento_transferencia_id": null, "categoria_id": 98, "centro_custo_lucro_id": null, "tipo_custo_nivel_producao_id": null, "tipo_custo_apropriacao_produto_id": null, "conta_id": 8, "forma_pagamento_id": null, "pessoa_id": null, "tipo_lancamento_id": 2, "descricao": "Conta de luz", "tipo_documento_id": null, "documento": "", "data_vencimento": "2015-10-10", "valor": "123.92", "data_pagamento": null, "data_competencia": "2015-10-10", "observacao": "", "pagamento_automatico": false, "numero_repeticao": 1, "total_repeticoes": 1, "periodicidade": null, "pedido_id": null, "lancamento_composto_id": 21, "modified": "2016-04-29 04:53:25", "anexos": [ {"id": 3}, {"id": 4} ], "tags": [ {"id": 12}, {"id": 34} ], "itens_adicionais": [ {"id": 92, "descricao": "Conta de água", "valor": "321.00", "categoria_id": 50, "lancamento_composto_id": 21 ... "tags": [ {"id": 25} ] } ] } ``` -------------------------------- ### Query String for Collections Source: https://www.granatum.com.br/financeiro/api Example query string parameters for listing collections. ```text access_token=[token_cliente_granatum] ``` ```text access_token=[token_cliente_granatum]&data_inicio=[data_inicio] ``` -------------------------------- ### Example Request to Create a Launch Source: https://www.granatum.com.br/financeiro/api This code snippet demonstrates how to make a POST request to create a new financial launch entry in the Granatum API. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Conta de luz' \ -d 'valor=123.92' \ -d 'data_vencimento=2015-10-10' \ -d 'tipo_lancamento_id=1' \ -d 'conta_id=8' \ -d 'categoria_id=98' \ -d 'tags[][id]=12' \ -d 'tags[][id]=34' \ -d 'itens_adicionais[][descricao]=Conta de água' \ -d 'itens_adicionais[][valor]=321.00' \ -d 'itens_adicionais[][categoria_id]=50' \ -d 'itens_adicionais[][tags][][id]=25' \ 'https://api.granatum.com.br/v1/lancamentos?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to get DRE groupings. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/relatorios/agrupamentos/dre?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para listar formas de pagamento Source: https://www.granatum.com.br/financeiro/api Example cURL command to list all payment methods. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/formas_pagamento?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta - Consultar cliente Source: https://www.granatum.com.br/financeiro/api Example JSON response when retrieving a specific client. ```json { "id": 18, "nome": "Granatum Financeiro", "nome_fantasia": "Granatum Financeiro Online", "documento": "26328240000103", "inscricao_estadual": null, "inscricao_municipal": null, "telefone": null, "endereco": "11 99653-5631", "endereco_numero": null, "endereco_complemento": null, "bairro": null, "cep": null, "cidade_id": null, "estado_id": null, "email": null, "observacao": null, "fornecedor": false, "cliente": true, "banco_id": null, "agencia": null, "numero_conta", null, "ativo": true, "classificacao_cliente_id": null, "classificacao_fornecedor_id": null, "estrangeiro": false, "chave_pix": null, "estado": null, "cidade": null } ``` -------------------------------- ### Example cURL call to get a specific collection Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to retrieve a single collection. ```curl curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/cobrancas/1245?access_token=token_cliente_granatum' ``` -------------------------------- ### Consultar uma tag - Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for consulting a specific tag. ```json { "id": 43, "descricao": "Black Friday", "ativo": true } ``` -------------------------------- ### Listar tags - Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example cURL command to list tags. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tags?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to get DRE topic categories. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/relatorios/categorias/dre/26?access_token=token_cliente_granatum' ``` -------------------------------- ### Criar uma tag - Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response after creating a tag. ```json { "id": 91, "descricao": "Promoção Natal", "ativo": true } ``` -------------------------------- ### Exemplo de chamada para listar centros de custo e lucro Source: https://www.granatum.com.br/financeiro/api Example cURL command to list all cost and profit centers. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/centros_custo_lucro?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada GET para Listar Categorias Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada cURL para listar todas as categorias. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/categorias?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response structure from the API. ```json { "2020-3": "2644.62", "2020-4": "2281.56", "2020-5": "2418.66", "2020-6": "2644.62", "Total": "16229.62" }, "saldo_final": { "2020-1": "-7183.03", "2020-2": "-4764.37", "2020-3": "-2119.75", "2020-4": "161.81", "2020-5": "2580.47", "2020-6": "5225.09", "Total": "5225.09" } } ``` -------------------------------- ### Listar tipos custo apropriação de produto - Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for listing product appropriation cost types. ```json [ { "id": 1, "descricao": "Direto" }, { "id": 2, "descricao": "Indireto" } ] ``` -------------------------------- ### Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for DRE topic categories. ```json [ { "id": 278711, "descricao": "cccc", "cor": "#CC3366", "ativo": true, "tipo_categoria_id": 0 }, { "id": 278712, "descricao": "ccccccccc", "cor": "#993399", "ativo": true, "tipo_categoria_id": 0 }, { "id": 279040, "descricao": "companhia de Água", "cor": "#447AD1", "ativo": true, "tipo_categoria_id": 0 } ] ``` -------------------------------- ### Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for DRE groupings. ```json [ { "texto": "Sem agrupamento", "valor": "DreSemAgrupamento" }, { "texto": "Agrupar por mês", "valor": "DreMensal" }, { "texto": "Agrupar por trimestre", "valor": "DreTrimestral" }, { "texto": "Agrupar por semestre", "valor": "DreSemestral" }, { "texto": "Agrupar por centro de custo", "valor": "DreCentroCusto" }, { "texto": "Agrupar por ano", "valor": "DreAnual" } ] ``` -------------------------------- ### Exemplo de chamada (Criar Centro de Custo/Lucro) Source: https://www.granatum.com.br/financeiro/api Example cURL command to create a cost/profit center. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Setor de Compras' \ -d 'parent_id=2' \ 'https://api.granatum.com.br/v1/centros_custo_lucro?access_token=token_cliente_granatum' ``` -------------------------------- ### Consultar uma tag - Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example cURL command to consult a specific tag. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tags/43?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para criar uma forma de pagamento Source: https://www.granatum.com.br/financeiro/api Example cURL command to create a new payment method. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Transferência' \ 'https://api.granatum.com.br/v1/formas_pagamento?access_token=token_cliente_granatum' ``` -------------------------------- ### Criar uma tag - Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example cURL command to create a tag. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Promoção Natal' \ 'https://api.granatum.com.br/v1/tags?access_token=token_cliente_granatum' ``` -------------------------------- ### Listar tipos custo nível de produção - Exemplo de resposta Source: https://www.granatum.com.br/financeiro/api Example response for listing production-level cost types. ```json [ { "id": 1, "descricao": "Fixo" }, { "id": 2, "descricao": "Variável" } ] ``` -------------------------------- ### Exemplo de chamada GET para Consultar Categoria Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada cURL para consultar os dados de uma categoria específica pelo seu ID. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/categorias/43?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada - Consultar cliente Source: https://www.granatum.com.br/financeiro/api Example cURL command to retrieve client data by ID. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/clientes/18?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta para criar um fornecedor Source: https://www.granatum.com.br/financeiro/api Example JSON response after creating a supplier. ```json { "id": 1, "nome": "Granatum Financeiro", "nome_fantasia": "Granatum Financeiro Online", "documento": "26328240000103", "inscricao_estadual": null, "inscricao_municipal": null, "telefone": null, "endereco": null, "endereco_numero": null, "endereco_complemento": null, "bairro": null, "cep": null, "cidade_id": null, "estado_id": null, "email": null, "observacao": null, "fornecedor": true, "cliente": false, "banco_id": null, "agencia": null, "numero_conta", null, "ativo": true, "estado": null, "cidade": null, "classificacao_cliente_id": null, "classificacao_fornecedor_id": null, "estrangeiro": false, "chave_pix": null } ``` -------------------------------- ### Exemplo de chamada para obter anexo de um cliente Source: https://www.granatum.com.br/financeiro/api Example cURL command to retrieve an attachment for a client. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/clientes/18/anexos/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada - Excluir um cliente Source: https://www.granatum.com.br/financeiro/api Example cURL command to delete a client by ID. ```bash curl -i -X DELETE \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/clientes/18?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta (Consultar Conta) Source: https://www.granatum.com.br/financeiro/api Example JSON response for a single bank account. ```json { "id": 1, "descricao": "C/C Santander", "banco_id": "10", "agencia": "123-0", "numero": "32423-3", "nome_gerente": "Marcio Almeida", "telefone_gerente": "11 2332-3455", "permite_lancamento": true, "ativo": true, "lancamentos": [ { "id": 133, "valor": "1500.80", "data_pagamento": "2020-01-23" } ] } ``` -------------------------------- ### Exemplo de resposta (Criar Centro de Custo/Lucro) Source: https://www.granatum.com.br/financeiro/api Example JSON response after creating a cost/profit center. ```json { "id": 3, "descricao": "Setor Compras", "parent_id": 2, "ativo": true, "centros_custo_lucro_filhos":[] } ``` -------------------------------- ### Exemplo de resposta para listar formas de pagamento Source: https://www.granatum.com.br/financeiro/api Example JSON response when listing payment methods. ```json [ { "id":1, "descricao":"Dinheiro", "ativo": true }, { "id":2, "descricao":"Boleto", "ativo": true }, ... ] ``` -------------------------------- ### Exemplo de chamada - Fazer upload de um anexo em um cliente Source: https://www.granatum.com.br/financeiro/api Example cURL command to upload an attachment for a client. ```bash curl -i -X POST \ -H 'content-type: multipart/form-data;' \ --form file=[arquivo] \ --form filename=comprovante.pdf \ 'https://api.granatum.com.br/v1/clientes/18/anexos.json?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para obter anexo de um fornecedor Source: https://www.granatum.com.br/financeiro/api Este exemplo demonstra como fazer uma requisição GET para recuperar um anexo específico de um fornecedor. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/fornecedores/18/anexos/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta (Editar Centro de Custo/Lucro) Source: https://www.granatum.com.br/financeiro/api Example JSON response after editing a cost/profit center. ```json { "id": 3, "descricao": "Recursos Humanos", "parent_id": 2, "ativo": true, "centros_custo_lucro_filhos":[] } ``` -------------------------------- ### Exemplo de resposta para criar uma forma de pagamento Source: https://www.granatum.com.br/financeiro/api Example JSON response after creating a payment method. ```json { "id": 2, "descricao": "Transferência", "ativo": true } ``` -------------------------------- ### Exemplo de chamada (Editar Centro de Custo/Lucro) Source: https://www.granatum.com.br/financeiro/api Example cURL command to edit an existing cost/profit center. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Recursos Humanos' \ -d 'parent_id=2' \ 'https://api.granatum.com.br/v1/centros_custo_lucro/3?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada GET para Anexos Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada cURL para obter um anexo com o parâmetro with_file=true. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ -d with_file=true \ 'https://api.granatum.com.br/v1/anexos/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta para obter anexo de um cliente Source: https://www.granatum.com.br/financeiro/api Example JSON response when retrieving an attachment for a client. ```json { "id": 91, "filename": "comprovante.pdf", "content_type": "application/pdf", "size": 53421, "cliente_id": 18, "model_id": 18, "file": "[Arquivo em Base64]" } ``` -------------------------------- ### Exemplo de resposta para consultar um centro de custo e lucro Source: https://www.granatum.com.br/financeiro/api Example JSON response for a specific cost and profit center. ```json { "id": 2, "descricao": "Automóvel", "ativo": true, "centros_custo_lucro_filhos":[ { "id": 3, "descricao": "Recursos Humanos", "ativo": true, "centros_custo_lucro_filhos":[] } ] } ``` -------------------------------- ### Exemplo de resposta para listar centros de custo e lucro Source: https://www.granatum.com.br/financeiro/api Example JSON response when listing cost and profit centers. ```json [ { "id": 1, "descricao": "Prédio", "ativo": true, "centros_custo_lucro_filhos":[] }, { "id": 2, "descricao": "Automóvel", "ativo": true, "centros_custo_lucro_filhos":[] }, { "id": 3, "descricao": "Setor Compras", "ativo": true, "centros_custo_lucro_filhos":[] } ] ``` -------------------------------- ### POST Create Client Source: https://www.granatum.com.br/financeiro/api Creates a client that can be used as a complement when creating a Launch. ```http POST https://api.granatum.com.br/v1/clientes ``` ```http access_token=[token_cliente_granatum] ``` ```curl curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'nome=Granatum Financeiro' \ -d 'nome_fantasia=Granatum Financeiro Online' \ -d 'documento=26328240000103' \ 'https://api.granatum.com.br/v1/clientes?access_token=token_cliente_granatum' ``` ```json { "id": 1, "nome": "Granatum Financeiro", "nome_fantasia": "Granatum Financeiro Online", "documento": "26328240000103", "inscricao_estadual": null, "inscricao_municipal": null, "telefone": null, "endereco": null, "endereco_numero": null, "endereco_complemento": null, "bairro": null, "cep": null, "cidade_id": null, "estado_id": null, "email": null, "observacao": null, "fornecedor": false, "cliente": true, "banco_id": null, "agencia": null, "numero_conta": null, "ativo": true, "estado": null, "cidade": null, "classificacao_cliente_id": null, "classificacao_fornecedor_id": null, "estrangeiro": false, "chave_pix": null } ``` -------------------------------- ### Exemplo de chamada PUT para atualização de lançamento com itens adicionais Source: https://www.granatum.com.br/financeiro/api Exemplo de como usar o método PUT para atualizar um lançamento existente, incluindo a adição ou modificação de itens adicionais. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'data_vencimento=2015-10-18' \ -d 'itens_adicionais[][id]=92' \ -d 'itens_adicionais[][descricao]=Tarifa extra' \ 'https://api.granatum.com.br/v1/lancamentos/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para consultar um centro de custo e lucro Source: https://www.granatum.com.br/financeiro/api Example cURL command to retrieve a specific cost and profit center by its ID. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/centros_custo_lucro/2?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada (Consultar Conta) Source: https://www.granatum.com.br/financeiro/api Example cURL command to get bank account details by ID. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/contas/1?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para editar uma forma de pagamento Source: https://www.granatum.com.br/financeiro/api Example cURL command to edit an existing payment method. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Boleto' \ 'https://api.granatum.com.br/v1/formas_pagamento/2?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta - Fazer upload de um anexo em um cliente Source: https://www.granatum.com.br/financeiro/api Example JSON response after successfully uploading an attachment for a client. ```json { "id": 91, "filename": "comprovante.pdf", "content_type": "application/pdf", "size": 53421, "cliente_id": 18, "model_id": 18 } ``` -------------------------------- ### Example response for cancelling a collection Source: https://www.granatum.com.br/financeiro/api Example JSON response when a collection is successfully cancelled. ```json { "success": "Cobrança cancelada com sucesso." } ``` -------------------------------- ### Example cURL call to cancel a collection Source: https://www.granatum.com.br/financeiro/api Example of how to call the API to cancel a collection. ```curl $ curl -i -X DELETE \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/cobrancas/143?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para consultar um tipo de documento fiscal Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para consultar um tipo de documento fiscal específico pelo ID. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tipos_documento_fiscal/2?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada GET para listar lançamentos Source: https://www.granatum.com.br/financeiro/api Exemplo de como usar o método GET para listar todos os lançamentos disponíveis na API. ```http GET https://api.granatum.com.br/v1/lancamentos ``` -------------------------------- ### Exemplo de chamada para obter formas de pagamento Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para listar formas de pagamento. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/formas_pagamento/1?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para listar tipos de documento fiscal Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para listar todos os tipos de documento fiscal. ```bash $ curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tipos_documento_fiscal?access_token=token_cliente_granatum' ``` -------------------------------- ### List Banks Source: https://www.granatum.com.br/financeiro/api Endpoint to list banks, with example of call and response. ```http GET https://api.granatum.com.br/v1/bancos access_token=[token_cliente_granatum] ``` ```curl curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/bancos?access_token=token_cliente_granatum' ``` ```json [ { "id": 1, "nome": "Banco do Brasil S/A" }, { "id": 2, "nome": "Banco da Amazônia S/A" }, { "id": 3, "nome": "Banco do Nordeste do Brasil S/A" }, { "id": 4, "nome": "Banco do Estado de São Paulo S/A" }, ... ] ``` -------------------------------- ### List States Source: https://www.granatum.com.br/financeiro/api Endpoint to list states, with example of call and response. ```http GET https://api.granatum.com.br/v1/estados access_token=[token_cliente_granatum] ``` ```curl curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/estados?access_token=token_cliente_granatum' ``` ```json [ { "id": 1, "sigla": "AC", "nome": "Acre" },{ "id": 2, "sigla": "AL", "nome": "Alagoas" },{ "id": 3, "sigla": "AM", "nome": "Amazonas" }, ... ] ``` -------------------------------- ### List Cities Source: https://www.granatum.com.br/financeiro/api Endpoint to list cities, with example of call and response. ```http GET https://api.granatum.com.br/v1/cidades access_token=[token_cliente_granatum]&estado_id=[id_do_estado] ``` ```curl curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/cidades?access_token=token_cliente_granatum&estado_id=26' ``` ```json [ { "id": 492, "nome": "Água Branca", "estado_id": 26 },{ "id": 493, "nome": "Anadia", "estado_id": 26 },{ "id": 494, "nome": "Arapiraca", "estado_id": 26 }, ... ] ``` -------------------------------- ### Listar Clientes Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada cURL para listar clientes, incluindo inativos. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'considerar_inativos=true' \ 'https://api.granatum.com.br/v1/clientes?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para editar um tipo de documento fiscal Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para editar um tipo de documento fiscal existente. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Nota fiscal' \ 'https://api.granatum.com.br/v1/tipos_documento_fiscal/1?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de resposta DRE Source: https://www.granatum.com.br/financeiro/api Example JSON response structure for DRE groupings. ```json { "data": { "linhas": [ { "DreTopico": { "id": "1", "dre_topico_tipo_id": "3", "descricao": "Receita Operacional Líquida" }, "children": [ { "DreTopico": { "id": "2", "dre_topico_tipo_id": "2", "descricao": "Receita Operacional Bruta" }, "children": [ { "DreTopico": { "id": "11", "dre_topico_tipo_id": "2", "descricao": "receita Venda" }, "children": [] }, { "DreTopico": { "id": "26", "dre_topico_tipo_id": "2", "descricao": "receita Serviço" }, "children": [] }, { "DreTopico": { "id": "69", "dre_topico_tipo_id": "2", "descricao": "dsfsdfds" }, "children": [] } ] }, { "DreTopico": { "id": "3", "dre_topico_tipo_id": "1", "descricao": "Deduções das Receitas" }, "children": [] }, { "DreTopico": { "id": "70", "dre_topico_tipo_id": "2", "descricao": "dsdsfds" }, "children": [ { "DreTopico": { "id": "71", "dre_topico_tipo_id": "2", "descricao": "sadsd" }, "children": [] } ] }, { "DreTopico": { "id": "72", "dre_topico_tipo_id": "2", "descricao": "asdasd" }, "children": [ { "DreTopico": { "id": "73", "dre_topico_tipo_id": "2", "descricao": "adasd" }, "children": [ { "DreTopico": { "id": "74", "dre_topico_tipo_id": "2", "descricao": "asdsadsa" }, "children": [] } ] } ] } ] }, { "DreTopico": { "id": "8", "dre_topico_tipo_id": "3", "descricao": "Lucro ou Prejuízo Líquido após os tributos" }, "children": [ { "DreTopico": { "id": "12", "dre_topico_tipo_id": "1", "descricao": "" }, "children": [] }, { "DreTopico": { "id": "9", "dre_topico_tipo_id": "2", "descricao": "Receitas e Despesas Financeiras" }, "children": [] }, { "DreTopico": { "id": "10", "dre_topico_tipo_id": "1", "descricao": "Outras Receitas e Despesas" }, "children": [] } ] } ], "colunas": { "Total": "De 01/01/2020 até 31/12/2020" }, "tipos": { "1": { "sinal": "(-)", "class": "despesa" }, "2": { "sinal": "(+)", "class": "receita" }, "3": { "sinal": "(=)", "class": "resultado" } }, "dados": { "9": { "1": "-31966.00", "Total": "-31966.00" }, "11": { "1": "53142.90", "Total": "53142.90" }, "17": { "1": "-90080.81", "Total": "-90080.81" }, "26": { "1": "-7139.60", "Total": "-7139.60" }, "27": { "1": "1743.36", "Total": "1743.36" }, "28": { "1": "10674.20", "Total": "10674.20" }, "276": { "1": "327.50", "Total": "327.50" }, "2": { "1": 46003.3, "Total": 46003.3 }, "1": { "1": 46003.3, "Total": 46003.3 }, "8": { "1": 14037.3, "Total": 14037.3 }, "4": { "1": 46003.3, "Total": 46003.3 }, "6": { "1": 46003.3, "Total": 46003.3 }, "279": { "1": 14037.3, "Total": 14037.3 } } } } ``` -------------------------------- ### Consultar uma transferência - Exemplo de Chamada Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada para consultar uma transferência. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/transferencias/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Método e URL Source: https://www.granatum.com.br/financeiro/api Method and URL to get DRE topic categories by ID. ```http GET https://api.granatum.com.br/v1/relatorios/categorias/dre/:dre_topico_id ``` -------------------------------- ### Cash Flow Report Source: https://www.granatum.com.br/financeiro/api Endpoint to retrieve cash flow data for a period, with example of call. ```http GET https://api.granatum.com.br/v1/relatorios/fluxo_caixa access_token=[token_cliente_granatum] ``` ```curl curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'agrupar=FluxoCaixaMensal' \ -d 'data_inicio=2020-01-01' \ -d 'data_fim=2020-06-30' \ -d 'regime=caixa' \ 'https://api.granatum.com.br/v1/relatorios/fluxo_caixa?access_token=token_cliente_granatum' ``` -------------------------------- ### Atualizar Cliente Source: https://www.granatum.com.br/financeiro/api Exemplo de chamada cURL para atualizar um cliente existente na API. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'telefone=11 99653-5631' \ 'https://api.granatum.com.br/v1/clientes/1?access_token=token_cliente_granatum' ``` -------------------------------- ### Excluir uma tag - Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example cURL command to delete a tag. ```bash $ curl -i -X DELETE \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tags/43?access_token=token_cliente_granatum' ``` -------------------------------- ### Editar uma tag - Exemplo de chamada Source: https://www.granatum.com.br/financeiro/api Example cURL command to edit a tag. ```bash curl -i -X PUT \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Promoção Natal' \ 'https://api.granatum.com.br/v1/tags/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para criar um tipo de documento fiscal Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para criar um novo tipo de documento fiscal. ```bash curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d 'descricao=Nota fiscal' \ 'https://api.granatum.com.br/v1/tipos_documento_fiscal?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para consultar um lançamento específico Source: https://www.granatum.com.br/financeiro/api Exemplo de como consultar um lançamento específico pelo seu ID utilizando o cURL. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/lancamentos/91?access_token=token_cliente_granatum' ``` -------------------------------- ### Exemplo de chamada para consultar lançamentos Source: https://www.granatum.com.br/financeiro/api Exemplo de como consultar lançamentos utilizando o cURL, com parâmetros de filtro. ```bash curl -i -X GET \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/lancamentos?access_token=token_cliente_granatum&conta_id=[conta_bancaria_id]' ``` -------------------------------- ### Exemplo de resposta (Listar Contas) Source: https://www.granatum.com.br/financeiro/api Example JSON response when listing bank accounts. ```json [ { "id": 1, "descricao": "Conta Santander", "permite_lancamento": true, "ativo": true, "saldo": "0.0" }, { "id": 2, "descricao": "Conta Nubank", "permite_lancamento": true, "ativo": true, "saldo": "2890.0" }, { "id": 3, "descricao": "XP Investimentos", "permite_lancamento": false, "ativo": true, "saldo": "35876.0" }, ... ] ``` -------------------------------- ### Exemplo de chamada para excluir um tipo de documento fiscal Source: https://www.granatum.com.br/financeiro/api Exemplo de como chamar a API para excluir um tipo de documento fiscal. ```bash $ curl -i -X DELETE \ -H "Content-Type:application/x-www-form-urlencoded" \ 'https://api.granatum.com.br/v1/tipos_documento_fiscal/43?access_token=token_cliente_granatum' ```