StafeBank Gateway
  1. Transactions
StafeBank Gateway
  • Overview
  • Webhooks
  • Error codes
  • Ambiente de Testes
  • Transactions
    • Criar uma Transação
      POST
    • Criar uma Transação Com 3DS
      POST
    • Criar uma Transação PIX
      POST
    • Estornar uma transação
      POST
    • Capturando uma Transação
      POST
    • Buscar Transação
      GET
    • Listar Transações
      GET
    • Retornar Histórico de uma Transação
      GET
    • Retornar Parcelas de uma transação
      GET
  • Payment Links
    • Criar Link
      POST
    • Atualizar Link
      PUT
    • Buscar Link
      GET
    • Listar Links
      GET
    • Transações de um link
      GET
  • Customer
    • Criar Cliente
      POST
    • Encontrar Cliente
      POST
    • Cartões do Cliente
      POST
    • Atualizar Cliente
      PUT
    • Buscar Cliente
      GET
    • Listar Clientes
      GET
    • Deletar um cliente
      DELETE
  • Cards
    • Criar Cartão
      POST
    • Obter Bandeira
      POST
    • Buscar Cartão
      GET
    • Listar Cartões
      GET
  • Webhook
    • Criar um webhook
    • Atualizar Webhook
    • Retornar Webhooks Cadastrados
    • Retornar um Webhook
    • Remover um Webhook
  • Simulate
    • Tax
  • Recurrence
    • Plans
      • Create Plan
      • Update Plan
      • Get a Plan
      • List Plans
    • Subscription
      • Create Subscription
      • Cancel Subscription
      • GET Subscription
  1. Transactions

Criar uma Transação

Amb. de prod.
https://onapi.stafebank.com.br
Amb. de prod.
https://onapi.stafebank.com.br
POST
/v1/transactions

Criar uma transação#

Para fazer uma cobrança você deve usar a rota /transactions para criar a sua transação, que pode ser feita por Cartão de crédito, PIX ou Boleto.
No caso de Cartão de crédito é possível utilizar um card_id ou todos os dados do cartão diretamente. A segunda opção é a mais indicada, por fatores de segurança.

Requisição

Authorization
Forneça seu token bearer no cabeçalho
Authorization
ao fazer requisições para recursos protegidos.
Exemplo:
Authorization: Bearer ********************
Parâmetros Bodyapplication/json

Exemplo
{
    "amount": 300,
    "async": false,
    "capture": true,
    "installments": 1,
    "descriptor": "Your Descriptor",
    "payment_method": "credit_card",
    "card": {
        "card_number": "5502091556851234",
        "card_holder_name": "Luke Skywalker",
        "card_expiration_date": "0333",
        "card_cvv": "111"
    },
    "customer": {
        "name": "LUCILUCI DOS SANTOS",
        "email": "allex@nogue.dev",
        "type": "individual",
        "country": "br",
        "documents": [
            {
                "type": "cnpj",
                "number": ""
            }
        ],
        "external_id": "1"
    },
    "billing": {
        "name": "Luke S.",
        "address": {
            "country": "br",
            "street": "Rua 12 de Outubro",
            "street_number": "220",
            "zipcode": "16520970",
            "state": "SP",
            "city": "Bacuriti",
            "neighborhood": "Centro"
        }
    },
    "items": [
        {
            "external_id": "5550134",
            "title": "Sabonete de Luxo",
            "unit_price": 10000,
            "quantity": 1,
            "tangible": true
        },
        {
            "external_id": "5550134",
            "title": "Sabonete de Luxo",
            "unit_price": 10000,
            "quantity": 1,
            "tangible": false
        }
    ]
}

Códigos de solicitação

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://onapi.stafebank.com.br/v1/transactions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 300,
    "async": false,
    "capture": true,
    "installments": 1,
    "descriptor": "Your Descriptor",
    "payment_method": "credit_card",
    "card": {
        "card_number": "5502091556851234",
        "card_holder_name": "Luke Skywalker",
        "card_expiration_date": "0333",
        "card_cvv": "111"
    },
    "customer": {
        "name": "LUCILUCI DOS SANTOS",
        "email": "allex@nogue.dev",
        "type": "individual",
        "country": "br",
        "documents": [
            {
                "type": "cnpj",
                "number": ""
            }
        ],
        "external_id": "1"
    },
    "billing": {
        "name": "Luke S.",
        "address": {
            "country": "br",
            "street": "Rua 12 de Outubro",
            "street_number": "220",
            "zipcode": "16520970",
            "state": "SP",
            "city": "Bacuriti",
            "neighborhood": "Centro"
        }
    },
    "items": [
        {
            "external_id": "5550134",
            "title": "Sabonete de Luxo",
            "unit_price": 10000,
            "quantity": 1,
            "tangible": true
        },
        {
            "external_id": "5550134",
            "title": "Sabonete de Luxo",
            "unit_price": 10000,
            "quantity": 1,
            "tangible": false
        }
    ]
}'

Respostas

🟢200Criar uma Transação
application/json
Body

Exemplo
{
    "id": 23,
    "ip_address": "127.0.0.1",
    "tid": null,
    "amount": 15090,
    "capture_amount": 15090,
    "paid_amount": null,
    "ref_id": "5992873329",
    "status": "processing",
    "created_at": "2022-02-02T18:05:37.000000Z",
    "updated_at": "2022-02-02T18:05:37.000000Z",
    "card": {
        "card_id": 409902444,
        "card_holder_name": "Customer Name",
        "created_at": "2022-02-02T17:47:10.000000Z",
        "updated_at": "2022-02-02T18:05:36.000000Z",
        "card_first_digits": "0000",
        "card_last_digits": "0009",
        "brand": "0"
    },
    "pix_qr_code": null,
    "pix_expiration_date": null,
    "pix_additional_fields": null,
    "installments": 1,
    "reference_key": null,
    "session": null,
    "local_time": null,
    "payment_method": "credit_card",
    "customer": {
        "id": 4642,
        "external_id": "1234f",
        "name": "James Bond",
        "type": "individual",
        "country": "br",
        "email": "james@bond.com",
        "birthday": null,
        "phone_numbers": [
            "+5511987654321"
        ],
        "created_at": "2022-02-02T18:05:37.000000Z",
        "updated_at": "2022-02-02T18:05:37.000000Z",
        "documents": [
            {
                "id": 4563,
                "type": "cpf",
                "number": "47009616000"
            }
        ]
    },
    "billing": {
        "id": 4418,
        "name": "Nome do pagador",
        "created_at": "2022-02-02T18:05:37.000000Z",
        "updated_at": "2022-02-02T18:05:37.000000Z",
        "address": {
            "street": "Alamenda Rio Negro",
            "street_number": "500",
            "zipcode": "06454000",
            "country": "br",
            "state": "sp",
            "city": "barueri",
            "neighborhood": "Alphaville",
            "complementary": null
        }
    },
    "items": [
        {
            "id": 8912,
            "external_id": "123",
            "title": "Nome do Produto 1",
            "unit_price": 1590,
            "quantity": 1,
            "tangible": 1,
            "category": null,
            "venue": null,
            "date": null,
            "created_at": "2022-02-02T18:05:37.000000Z",
            "updated_at": "2022-02-02T18:05:37.000000Z"
        }
    ],
    "metadata": null
}
🟠400Erro integração
Modificado em 2025-06-11 10:16:44
Página anterior
Ambiente de Testes
Próxima página
Criar uma Transação Com 3DS
Built with