Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Expandir
titleExemplo em de requisição:
Bloco de código
languagepy
import requests

url = "http://localhost:8000/api/integrator/contract/?taxvat=01234567899"

payload={}
headers = {
  'Authorization': 'Basic ZGFuaWVsLnBpY2NvbGlAZGF0YWNha2UuY29tLmJyOm11ZGFyQG11ZGFy{{token}}'
})

response = requests.request("GET", url, headers=headers, data=payload)
Expandir
titleResposta Status 200
Bloco de código
{
    "data": [
        {
            "type": "ContractViewSet",
            "id": "1",
            "attributes": {
                "integration": 9,
                "remote_id": "1",
                "contract_name": "contrato 1"
            }
        },
        {
            "type": "ContractViewSet",
            "id": "2",
            "attributes": {
                "integration": 9,
                "remote_id": "2",
                "contract_name": "contrato 2"
            }
        }
    ]
}

Se não houver contratos ou não for informado pelo ERP, retorna uma lista vazia, mas sem erro:

Bloco de código
{
    "data": []
}

...

Expandir
titleExemplo em de requisição:
Bloco de código
languagepy
import requests

url = "http://localhost:8000/api/integrator/unpaid_bill/?taxvat=08335564876&contract_id=18945"

payload={}
headers = {
  'Authorization': 'Basic {{base64token}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Expandir
titleResposta Status 200
Bloco de código
{
    "data": [
        {
            "type": "UnpaidBillViewSet",
            "id": "012345678999231",
            "attributes": {
                "integration": null,
                "fatura": "012345678999231",
                "customer_name": "Ava Zimmerman",
                "valor": null,
                "valor_inicial": null,
                "juros": null,
                "multa": null,
                "desconto": null,
                "emissao": "2022-08-16",
                "vencimento": "2022-08-30",
                "historico": "Boleto Datacake",
                "boleto": "http://localhost:8000/api/integrator/unpaid_bill/083355648769231-08335564876/get_boleto/?integrations=9&internal_pdf=true",
                "bank_code": null,
                "barcode": null,
                "boleto_totem": "http://localhost:8000/api/integrator/unpaid_bill/083355648769231-08335564876/print_boleto/?integrations=9&contract_id=1",
                "code_fatura": "012345678999231-01234567899",
                "document_number": "01234567899",
                "remote_id": "01234",
                "integration_id": "9",
                "identifier": null,
                "pix_code": null,
                "bill_receipt": null,
                "bill_pix_receipt": null
            }
        },
    ]
}
Expandir
titleResposta Status 400
Bloco de código
{
    "errors": "Boletos em aberto não encontrados ou cliente não existe."
}

...

Expandir
titleExemplo em de requisição:
Bloco de código
languagepy
import requests

url = "http://localhost:8000/api/integrator/unpaid_bill/012345678999231-01234567899/get_unpaid_bill/"

payload={}
headers = {
  'Authorization': 'Basic e3t1c2VyfX06e3twYXNzd29yZH19{{token}}'
}

response = requests.request("GET", url, headers=headers, data=payload)
Expandir
titleResposta Status 200
Bloco de código
{
    "data": {
        "type": "UnpaidBillViewSet",
        "id": "012345678999231",
        "attributes": {
            "integration": null,
            "fatura": "012345678999231",
            "customer_name": "Ava Zimmerman",
            "valor": 0.1,
            "valor_inicial": 0.1,
            "juros": null,
            "multa": null,
            "desconto": null,
            "emissao": "2022-08-16",
            "vencimento": "2022-08-30",
            "historico": "Boleto Datacake",
            "boleto": "http://localhost:8000/api/integrator/unpaid_bill/083355648769231-08335564876/get_boleto/?integrations=9&internal_pdf=true",
            "bank_code": null,
            "barcode": "09394985755382544014802844544082887801550238853",
            "boleto_totem": "http://localhost:8000/api/integrator/unpaid_bill/083355648769231-08335564876/print_boleto/?integrations=9&contract_id=None",
            "code_fatura": "012345678999231-01234567899",
            "document_number": "01234567899",
            "remote_id": "01234",
            "integration_id": "9",
            "identifier": "2",
            "pix_code": null,
            "bill_receipt": null,
            "bill_pix_receipt": null
        }
    }
}
Expandir
titleResposta Status 400
Bloco de código
{
    "errors": "Boleto não encontrado."
}

...

Expandir
titleExemplo em de requisição:
Bloco de código
languagepy
import requests

url = "http://localhost:8000/api/integrator/unpaid_bill/012345678999231-01234567899/get_pix/"

payload={}
headers = {
  'Authorization': 'Basic e3t1c2VyfX06e3twYXNzd29yZH19{{token}}'
}

response = requests.request("GET", url, headers=headers, data=payload)
Expandir
titleResposta Status 200
Bloco de código
{
    "data": {
        "type": "UnpaidBillViewSet",
        "id": "6cbf058e-6b6a-4a64-9680-cafc4a8ab55a",
        "attributes": {
            "integration_response": {},
            "extra_data": {
                "descriptition": "Totem Datacake - Boleto: #083355648769231",
                "pix_key": "30273146000171",
                "merchant_name": "DATACAKE",
                "merchant_city": "LENÇÓIS PAULISTA",
                "customer_code": null,
                "customer_name": null,
                "transaction_id": "6cbf058e-6b6a-4a64-9680-cafc4a8ab55a"
            },
            "payment_type": "pix",
            "origin": "UNKNOWN",
            "class_type": "charge",
            "totem_uuid": null,
            "expiration_date": null,
            "pix_location": null,
            "pix_integration_id": "1",
            "br_code": "00020101021126810014br.gov.bcb.pix0114302731460001710241Totem Datacake - Boleto:  08335564876923152040000530398654040.105802BR5908DATACAKE6015LENCOIS PAULIST610918682-57062290525202208231215DATACAKE1tq3163049E4B",
            "data_fiscal": null,
            "txid": "202208231215DATACAKE1tq31",
            "bill_id": "083355648769231",
            "card_type": null,
            "payment_method_name": "Pix 1",
            "advanced_status": "ATIVA",
            "nsu_host": null,
            "ip_origem": null,
            "cupom_fiscal": null,
            "total": "0.10",
            "gateway_response": null,
            "error": null,
            "nsu_sitef": null,
            "pinpad_response": {},
            "captured_amount": "0.10",
            "transaction_id": "202208231215DATACAKE1tq31",
            "compiled_status": "Status: Success<br />Integração: Desconhecido<br />Avançado: Ativa/Não Paga<br />",
            "refund_amount": "0.00",
            "status": "success",
            "hora_fiscal": null,
            "payment_date": null,
            "hold_mount": "0.00",
            "integration_status": null,
            "advanced_id": "6cbf058e-6b6a-4a64-9680-cafc4a8ab55a",
            "customer_taxvat": "08335564876",
            "integration_id": "9",
            "token": "",
            "created": "2022-08-23T12:15:56.431851-03:00",
            "updated": "2022-08-23T12:15:56.586389-03:00",
            "reference": "202208231215DATACAKE1tq31"
        },
        "relationships": {
            "user": {
                "links": {
                    "self": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/relationships/user/",
                    "related": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/user/"
                },
                "data": null
            },
            "billing_address": {
                "links": {
                    "self": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/relationships/billing_address/",
                    "related": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/billing_address/"
                },
                "data": null
            },
            "payment_method": {
                "links": {
                    "self": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/relationships/payment_method/",
                    "related": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/payment_method/"
                },
                "data": {
                    "type": "PaymentMethod",
                    "id": "1"
                }
            },
            "credit_card": {
                "links": {
                    "self": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/relationships/credit_card/",
                    "related": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/credit_card/"
                },
                "data": null
            },
            "order": {
                "links": {
                    "self": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/relationships/order/",
                    "related": "/api/store/transaction/6cbf058e-6b6a-4a64-9680-cafc4a8ab55a/order/"
                },
                "data": null
            }
        }
    }
}
Expandir
titleResposta Status 400
Bloco de código
{
    "errors": "Erro ao gerar PIX. Por favor tente novamente em instantes."
}

...

Expandir
titleExemplo em de requisição:
Bloco de código
languagepy
import requests

url = "http://localhost:8000/api/pix/integration/202208231215DATACAKE1tq31/check_transaction_status/"

payload={}
headers = {
  'Authorization': 'Basic e3t1c2VyfX06e3twYXNzd29yZH19{{token}}'
}

response = requests.request("GET", url, headers=headers, data=payload)
Expandir
titleResposta Status 200
Bloco de código
{
    "data": {
        "status": true
    }
}
Expandir
titleResposta Status 400
Bloco de código
{
    "errors": {
        "status": false
    }
}
Expandir
titleResposta Status 404
Bloco de código
{
    "errors": {
        "status": false
    }
}

...