Docs
post https://gateway.iugu.com/api/v1/transactions/charge

Autorizar e capturar em uma única requisição

Realiza autorização e captura em uma única etapa

Permissão necessária: gateway:transactions.charge

Esta permissão deve constar como uma das ações permitidas para o app que faz a chamada. Isto pode ser feito através do GIA, ou então na edição do aplicativo. Em caso de dúvidas, clique aqui.

Schema Obrigatório

Tipo de conteúdo: application/json

account_id

Obrigatório

String

Identificador da conta

order_id

Obrigatório

String

Identificador do pedido

client_ref
String

Número de referência do cliente

credit_card_id
String

ID do cartão de crédito armazenado no Smart-Vault

mcc

Obrigatório

String

Merchant Category Code

cnpj

Obrigatório

String = 14 characters

CNPJ do estabelecimento

amount_cents

Obrigatório

Integer

Valor da transação em centavos

installments

Obrigatório

Integer

Número de parcelas

soft_descriptor

Obrigatório

String

Texto que aparecerá na fatura do cartão

currency
String

Moeda da transação

extra_amount_cents
Integer

Valor adicional em centavos

fines_cents
Integer

Valor de multa em centavos

discount_cents
Integer

Valor de desconto em centavos

recurrent
Boolean

Indica se é uma transação recorrente

ip_address
String

Endereço IP do cliente

site
String

URL do site

skip_anti_fraud
Boolean

Se deve pular a verificação anti-fraude

sub_merchant
Object

id
String

ID do sub-merchant

document_type
String
Enum: `cpf`, `cnpj`

Tipo do documento

document_number
String [11..14] characters

Número do documento

address
String

Endereço

city
String

Cidade

state
String

Estado

country_code
String

Código do país

postal_code
String

CEP

mcc
String

Merchant Category Code

company_name
String

Nome da empresa

phone_number
String

Número de telefone

items
Array of objects

name

Obrigatório

String

Nome do item

type

Obrigatório

String

Tipo do item

price_cents

Obrigatório

Integer

Preço em centavos

description
String

Descrição do item

quantity
Integer

Quantidade

payer
Object

email

Obrigatório

String

Email do pagador

id
String

ID do pagador

name
String

Nome do pagador

document_number
String

Número do documento

phone_prefix
String

Prefixo do telefone

phone_number
String

Número do telefone

gender
String
Enum: `M`, `F`

Gênero

borned_at
String

Data de nascimento

created_at
String

Data de criação

address
Object

street
String

Rua

number
String

Número

district
String

Bairro

city
String

Cidade

state
String

Estado

country
String

País

postal_code
String

CEP

receiver
Object

name
String

Nome do recebedor

document_number
String

Número do documento

postal_code
String

CEP

subscription
Object

id
String

ID da assinatura

price_cents
Integer

Preço em centavos

recurrence
Integer

Recorrência

started_at
String

Data de início

expires_at
String

Data de expiração

Exemplo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  "account_id": "",
  "order_id": "",
  "client_ref": "",
  "credit_card_id": "",
  "mcc": "",
  "cnpj": "",
  "amount_cents": "",
  "installments": "",
  "soft_descriptor": "",
  "currency": "",
  "extra_amount_cents": "",
  "fines_cents": "",
  "discount_cents": "",
  "recurrent": "",
  "ip_address": "",
  "site": "",
  "skip_anti_fraud": "",
  "sub_merchant": {
    "id": "",
    "document_type": "",
    "document_number": "",
    "address": "",
    "city": "",
    "state": "",
    "country_code": "",
    "postal_code": "",
    "mcc": "",
    "company_name": "",
    "phone_number": ""
  },
  "items": [
    {
      "name": "",
      "type": "",
      "price_cents": "",
      "description": "",
      "quantity": ""
    }
  ],
  "payer": {
    "email": "",
    "id": "",
    "name": "",
    "document_number": "",
    "phone_prefix": "",
    "phone_number": "",
    "gender": "",
    "borned_at": "",
    "created_at": "",
    "address": {
      "street": "",
      "number": "",
      "district": "",
      "city": "",
      "state": "",
      "country": "",
      "postal_code": ""
    }
  },
  "receiver": {
    "name": "",
    "document_number": "",
    "postal_code": ""
  },
  "subscription": {
    "id": "",
    "price_cents": "",
    "recurrence": "",
    "started_at": "",
    "expires_at": ""
  }
}

Respostas

200
Pagamento processado com sucesso
payment
Object

id
String

account_id
String

order_id
String

amount_cents
Integer

status
String

created_at
String

transactions
Array of objects

success
Boolean

function
String
Enum: `authorization`, `charge`, `capture`, `cancel`

acquirer
Object

status_code
String

status_description
String

401
Não autorizado - Token de autenticação inválido ou ausente
403
Proibido - Verificação anti-fraude falhou
404
Cartão de crédito não encontrado
422
Erros de validação ou cobrança falhou