v1

latestOpenAPI 3.1.02026-07-241040774.6 KB

Editar metadados da fatura

Com o verbo HTTP PATCH, através do identificador da fatura (invoice_id) é possível atualizar o objeto metadata da fatura.

patch/invoices/{invoice_id}/metadata

Path parameters

invoice_idstring required

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

Request body

metadatastring required

Objeto chave/valor utilizado para armazenar informações adicionais sobre a fatura.<br>Saiba mais sobre metadata

Response

200

idstring
codestring
urlstring
amountinteger
statusstring
payment_methodstring
due_atstring
created_atstring

Example response

{
  "id": "in_l9JGwX1MsNS3g614",
  "code": "X8J8HG6HR3",
  "url": "/invoices/in_l9JGwX1MsNS3g614",
  "amount": 1490,
  "status": "paid",
  "payment_method": "credit_card",
  "due_at": "2017-08-10T00:00:00Z",
  "created_at": "2017-08-10T16:02:40Z",
  "items": [
    {
      "name": "Nome - teste",
      "amount": 1490,
      "quantity": 1,
      "description": "Premium"
    }
  ],
  "customer": {
    "id": "cus_2j4vnqJseriZOM0G",
    "name": "Tony Stark",
    "email": "ce7bd9d7-a959-4f64-8070-896c2d968c9a@avengers.com",
    "created_at": "2017-08-10T16:02:28Z",
    "updated_at": "2017-08-10T16:02:28Z"
  },
  "subscription": {
    "id": "sub_Rg80VjCmxt4N0Oma",
    "code": "R66DU1I4PR",
    "start_at": "2017-08-10T00:00:00Z",
    "interval": "month",
    "interval_count": 1,
    "billing_type": "postpaid",
    "next_billing_at": "2017-09-10T00:00:00Z",
    "payment_method": "credit_card",
    "currency": "BRL",
    "statement_descriptor": "Spotify",
    "installments": 1,
    "status": "active",
    "created_at": "2017-08-10T16:02:30Z",
    "updated_at": "2017-08-10T16:02:30Z"
  },
  "cycle": {
    "id": "cycle_zObQAYfOqUnMQMkB",
    "start_at": "2017-08-10T00:00:00Z",
    "end_at": "2017-09-09T23:59:59Z",
    "billing_at": "2017-09-10T00:00:00Z"
  },
  "charge": {
    "id": "ch_Wl2YRDrSOFq1Ax4r",
    "code": "R66DU1I4PR-01",
    "gateway_id": "798d388b-3e92-4ad1-a0be-893a2391c7fa",
    "amount": 1490,
    "paid_amount": 1490,
    "status": "paid",
    "currency": "BRL",
    "payment_method": "credit_card",
    "due_at": "2017-08-10T00:00:00Z",
    "paid_at": "2017-08-10T16:02:41Z",
    "created_at": "2017-08-10T16:02:40Z",
    "updated_at": "2017-08-10T16:02:40Z",
    "last_transaction": {
      "id": "tran_x7lNYXuPLS1np4n1",
      "transaction_type": "credit_card",
      "funding_source": "prepaid",
      "gateway_id": "a4f98f29-c720-4682-985e-f18234160be1",
      "amount": 1490,
      "status": "captured",
      "success": true,
      "installments": 1,
      "statement_descriptor": "Spotify",
      "acquirer_name": "simulator",
      "acquirer_affiliation_code": "TesteMaroto",
      "acquirer_tid": "21407",
      "acquirer_nsu": "743230",
      "acquirer_auth_code": "214846",
      "acquirer_message": "Simulator|Transação de simulação autorizada com sucesso",
      "acquirer_return_code": "0",
      "operation_type": "auth_and_capture",
      "card": {
        "id": "card_brVjYG5uZSrNARPg",
        "first_six_digits": "342793",
        "last_four_digits": "8229",
        "brand": "Amex",
        "holder_name": "Tony Stark",
        "exp_month": 1,
        "exp_year": 2018,
        "status": "active",
        "created_at": "2017-08-10T16:02:28Z",
        "updated_at": "2017-08-10T16:02:28Z",
        "billing_address": {
          "line_1": "10880, Malibu Point, Malibu Central",
          "zip_code": "90265",
          "city": "Malibu",
          "state": "CA",
          "country": "US"
        },
        "type": "credit"
      },
      "created_at": "2017-08-10T16:02:40Z",
      "updated_at": "2017-08-10T16:02:40Z",
      "gateway_response": {
        "code": "201"
      }
    }
  },
  "metadata": {
    "code": "1234",
    "company": "Avengers"
  }
}