v1

latestOpenAPI 3.1.02026-07-241040774.6 KB

Editar metadados do pedido

patch/orders/{order_id}/metadata

Path parameters

order_idstring required

Código do pedido

Request body

metadataobject required

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

Response

200

idstring
codestring
amountinteger
currencystring
closedboolean
statusstring
created_atstring
updated_atstring
closed_atstring
checkoutsobject[]

Example response

{
  "id": "or_QPGePOvTxc6P869J",
  "code": "91XXS4JCY4",
  "amount": 1000,
  "currency": "BRL",
  "closed": true,
  "items": [
    {
      "id": "oi_K972l6WS54HNrEW4",
      "description": "Chaveiro do Tesseract",
      "amount": 1000,
      "quantity": 1,
      "status": "active",
      "created_at": "2019-01-22T15:25:03Z",
      "updated_at": "2019-01-22T15:25:03Z",
      "order": {
        "id": "or_QPGePOvTxc6P869J",
        "code": "91XXS4JCY4",
        "amount": 1000,
        "closed": true,
        "created_at": "2019-01-22T15:25:03Z",
        "updated_at": "2019-01-22T15:25:27Z",
        "closed_at": "2019-01-22T15:25:03Z",
        "currency": "BRL",
        "status": "paid",
        "customer_id": "cus_rN18K4KIMKcYW2RV",
        "metadata": {
          "code": "1234",
          "company": "Avengers"
        },
        "items": [
          {
            "id": "oi_K972l6WS54HNrEW4",
            "description": "Chaveiro do Tesseract",
            "amount": 1000,
            "quantity": 1,
            "status": "active"
          }
        ]
      }
    }
  ],
  "customer": {
    "id": "cus_rN18K4KIMKcYW2RV",
    "name": "Tony Stark",
    "email": "matrinho@mailinator.com",
    "document": "12345678900",
    "type": "individual",
    "created_at": "2019-01-21T18:55:22Z",
    "updated_at": "2019-01-21T18:55:22Z",
    "phones": {
      "home_phone": {
        "country_code": "55",
        "number": "32659874",
        "area_code": "21"
      },
      "mobile_phone": {
        "country_code": "55",
        "number": "998563214",
        "area_code": "21"
      }
    }
  },
  "status": "paid",
  "created_at": "2019-01-22T15:25:03Z",
  "updated_at": "2019-01-22T15:25:27Z",
  "closed_at": "2019-01-22T15:25:03Z",
  "charges": [
    {
      "id": "ch_x37ElW0u6zhNKWYQ",
      "code": "91XXS4JCY4",
      "amount": 1000,
      "paid_amount": 1000,
      "status": "paid",
      "currency": "BRL",
      "payment_method": "credit_card",
      "paid_at": "2019-01-22T15:25:03Z",
      "created_at": "2019-01-22T15:25:03Z",
      "updated_at": "2019-01-22T15:25:03Z",
      "customer": {
        "id": "cus_rN18K4KIMKcYW2RV",
        "name": "Tony Stark",
        "email": "matrinho@mailinator.com",
        "document": "12345678900",
        "type": "individual",
        "created_at": "2019-01-21T18:55:22Z",
        "updated_at": "2019-01-21T18:55:22Z",
        "phones": {
          "home_phone": {
            "country_code": "55",
            "number": "32659874",
            "area_code": "21"
          },
          "mobile_phone": {
            "country_code": "55",
            "number": "998563214",
            "area_code": "21"
          }
        }
      },
      "last_transaction": {
        "id": "tran_qZwlgwxU3kt2l71x",
        "transaction_type": "credit_card",
        "funding_source": "prepaid",
        "gateway_id": "6e4f207d-e1e8-41ff-bca4-777124e71e5c",
        "amount": 1000,
        "status": "captured",
        "success": true,
        "installments": 1,
        "statement_descriptor": "AVENGERS",
        "acquirer_tid": "1f76f5aa-3012-49ef-bbe0-2c3083d32648",
        "acquirer_nsu": "1f76f5aa-3012-49ef-bbe0-2c3083d32648",
        "acquirer_auth_code": "659",
        "acquirer_message": "Transação capturada com sucesso",
        "acquirer_return_code": "00",
        "operation_type": "auth_and_capture",
        "card": {
          "id": "card_MaN0P9phbcVbDJQ4",
          "first_six_digits": "400000",
          "last_four_digits": "0010",
          "brand": "Visa",
          "holder_name": "Tony Stark",
          "exp_month": 1,
          "exp_year": 2020,
          "status": "active",
          "type": "credit",
          "created_at": "2019-01-21T18:56:14Z",
          "updated_at": "2019-01-21T18:56:14Z",
          "billing_address": {
            "zip_code": "90265",
            "city": "Malibu",
            "state": "CA",
            "country": "US",
            "line_1": "10880, Malibu Point, Malibu Central"
          }
        },
        "created_at": "2019-01-22T15:25:03Z",
        "updated_at": "2019-01-22T15:25:03Z",
        "gateway_response": {
          "code": "200"
        }
      }
    }
  ],
  "metadata": {
    "code": "1234",
    "company": "Avengers"
  }
}