v1

latestOpenAPI 3.1.02026-07-241040774.6 KB

Obter fatura

Através do identificador da fatura (invoice_id) é possível recuperar as informação da fatura.

get/invoices/{invoice_id}

Path parameters

invoice_idstring required

Código da fatura.<br>Formato: in_XXXXXXXXXXXXXXXX.

Response

200

idstring
codestring
urlstring
amountinteger
total_discountsinteger
total_incrementsinteger
statusstring
payment_methodstring
due_atstring
created_atstring

Example response

{
  "id": "in_qBY5VvpuEACaw5bg",
  "code": "O5D5FRSQ9O",
  "url": "/invoices/in_qBY5VvpuEACaw5bg",
  "amount": 1490,
  "total_discounts": 1000,
  "total_increments": 1000,
  "status": "paid",
  "payment_method": "credit_card",
  "due_at": "2017-04-19T00:00:00Z",
  "created_at": "2017-04-19T17:35:15Z",
  "items": [
    {
      "name": "Nome - teste",
      "amount": 1490,
      "quantity": 1,
      "description": "Premium"
    }
  ],
  "customer": {
    "id": "cus_mnG9AbHZmSYQRWM7",
    "name": "Tony Stark",
    "email": "38acb30a-99d9-4b12-a0aa-7305c7dd81f2@avengers.com",
    "created_at": "2017-04-19T17:35:05Z",
    "updated_at": "2017-04-19T17:35:05Z"
  },
  "subscription": {
    "id": "sub_OGE4Q1Miy1fd4B3z",
    "code": "R7P3FNU489",
    "start_at": "2017-04-19T00:00:00Z",
    "interval": "month",
    "interval_count": 1,
    "billing_type": "postpaid",
    "next_billing_at": "2017-05-19T00:00:00Z",
    "payment_method": "credit_card",
    "currency": "BRL",
    "statement_descriptor": "Spotify",
    "installments": 1,
    "status": "active",
    "created_at": "2017-04-19T17:35:06Z",
    "updated_at": "2017-04-19T17:35:06Z"
  },
  "cycle": {
    "id": "cycle_5JB1vZBZimCXvaRp",
    "start_at": "2017-04-19T00:00:00Z",
    "end_at": "2017-05-18T23:59:59Z",
    "billing_at": "2017-05-19T00:00:00Z"
  },
  "charge": {
    "id": "ch_OGWebzPtDCOQex2r",
    "code": "R7P3FNU489-01",
    "gateway_id": "729154b2-1a94-45e0-bce8-1f6966725ee5",
    "amount": 1490,
    "status": "paid",
    "currency": "BRL",
    "payment_method": "credit_card",
    "due_at": "2017-04-19T00:00:00Z",
    "paid_at": "2017-04-19T17:35:16Z",
    "created_at": "2017-04-19T17:35:15Z",
    "updated_at": "2017-04-19T17:35:15Z",
    "last_transaction": {
      "id": "tran_EBlMxnTRmfrg0joK",
      "transaction_type": "credit_card",
      "funding_source": "prepaid",
      "gateway_id": "02bf6173-0e19-4060-836e-626c81f02749",
      "amount": 1490,
      "status": "captured",
      "success": true,
      "installments": 1,
      "statement_descriptor": "Spotify",
      "acquirer_name": "simulator",
      "acquirer_affiliation_code": "MUNDI",
      "acquirer_tid": "12869",
      "acquirer_nsu": "680036",
      "acquirer_auth_code": "637781",
      "acquirer_message": "Simulator|Transação de simulação autorizada com sucesso",
      "acquirer_return_code": "0",
      "operation_type": "auth_and_capture",
      "card": {
        "id": "card_x8PBA3TppSDWjrgd",
        "first_six_digits": "542501",
        "last_four_digits": "8229",
        "brand": "Amex",
        "holder_name": "Tony Stark",
        "exp_month": 1,
        "exp_year": 2018,
        "status": "active",
        "created_at": "2017-04-19T17:35:05Z",
        "updated_at": "2017-04-19T17:35:05Z",
        "billing_address": {
          "line_1": "10880, Malibu Point, Malibu Central",
          "zip_code": "90265",
          "city": "Malibu",
          "state": "CA",
          "country": "US"
        },
        "type": "credit"
      },
      "created_at": "2017-04-19T17:35:15Z",
      "updated_at": "2017-04-19T17:35:15Z",
      "gateway_response": {
        "code": "201"
      }
    }
  }
}