Criar cobrança

Changed on
post/charges.

Request

  • Base URL
    https://api.pagar.me/core/v5
  • URL
    https://api.pagar.me/core/v5/charges.
  • Auth
    HTTP basic

Request body

codestring

Código identificador da cobrança no sistema da loja.

amountinteger required

Valor da cobrança em centavos

currencystring

Moeda. Valores possíveis: BRL, ARS, BOB, CLP, **COP **, MXN, PYG, **USD **, UYU e EUR.

paymentobject required

Dados sobre o pagamento. Saiba mais sobre pagamentos

customer_idstring required

Código do cliente.

customerobject required

Dados do cliente. Obrigatório caso o customer_id não seja informado. Saiba mais sobre clientes.

metadatastring

Objeto chave/valor utilizado para armazenar informações adicionais sobre a cobrança. Saiba mais sobre metadata.

Response

200

idstring
codestring
gateway_idstring
amountinteger
statusstring
currencystring
payment_methodstring
created_atstring
updated_atstring

Example response

{
  "id": "ch_kp64Edig1t79NajE",
  "code": "28ZMCQWSW4",
  "gateway_id": "909f4fb7-17a2-4753-a5de-80491ffd80d3",
  "amount": 1490,
  "status": "pending",
  "currency": "BRL",
  "payment_method": "credit_card",
  "created_at": "2017-10-19T21:45:21Z",
  "updated_at": "2017-10-19T21:45:21Z",
  "customer": {
    "id": "cus_4rNQ0PmHBGfJQGOw",
    "name": "Tony Stark",
    "email": "tony@email.com",
    "document": "93095135270",
    "type": "individual",
    "created_at": "2017-10-13T19:44:17Z",
    "updated_at": "2017-10-19T21:25:57Z",
    "phones": {
      "home_phone": {
        "country_code": "55",
        "number": "000000000",
        "area_code": "21"
      },
      "mobile_phone": {
        "country_code": "55",
        "number": "000000000",
        "area_code": "21"
      }
    },
    "metadata": {
      "company": "Avengers"
    }
  },
  "last_transaction": {
    "id": "tran_4Rp2OQJCnxS3ydzO",
    "transaction_type": "credit_card",
    "gateway_id": "3fb26923-fc6b-4004-82b9-dd1ff2811c03",
    "amount": 1490,
    "status": "authorized_pending_capture",
    "success": true,
    "installments": 1,
    "statement_descriptor": "AVENGERS",
    "acquirer_name": "simulator",
    "acquirer_tid": "241813",
    "acquirer_nsu": "999053",
    "acquirer_auth_code": "290412",
    "acquirer_message": "Simulator|Transação de simulação autorizada com sucesso",
    "acquirer_return_code": "0",
    "operation_type": "auth_only",
    "card": {
      "id": "card_M6ez8BUG8cbn5ndO",
      "first_six_digits": "455685",
      "last_four_digits": "7525",
      "brand": "Visa",
      "holder_name": "Tony Stark",
      "exp_month": 1,
      "exp_year": 2030,
      "status": "active",
      "created_at": "2017-10-19T21:41:10Z",
      "updated_at": "2017-10-19T21:41:10Z",
      "type": "credit"
    },
    "created_at": "2017-10-19T21:45:21Z",
    "updated_at": "2017-10-19T21:45:21Z",
    "gateway_response": {
      "code": "201"
    }
  },
  "metadata": {
    "code": "123"
  }
}

Changes