Editar regras do Split

Changed on

Com o verbo HTTP PATCH, através do identificador da assinatura (subscription_id) é possível ativar, desativar ou alterar as regras do split na recorrência.

Para realizar a edição tem que ser enviado pelo menos um dos campos, enabled ou rules, ambos campos são opcionais e independentes.

patch/subscriptions/{subscription_id}/split

Request

  • Base URL
    https://api.pagar.me/core/v5
  • URL
    https://api.pagar.me/core/v5/subscriptions/{subscription_id}/split
  • Auth
    HTTP basic

Path parameters

subscription_idstring required

Código da Assinatura. <br>Formato: sub_XXXXXXXXXXXXXXXX.

Request body

enabledboolean

Ativa ou desativa as regras de split na assinatura. Pode ser true ou False

Response

200

idstring
codestring
start_atstring
intervalstring
interval_countinteger
billing_typestring
next_billing_atstring
payment_methodstring
currencystring
installmentsinteger
statusstring
created_atstring
updated_atstring

Example response

{
  "id": "sub_WpkrQvNriRs6QKGz",
  "code": "EP13T6I0KR",
  "start_at": "2022-01-12T00:00:00Z",
  "interval": "month",
  "interval_count": 1,
  "billing_type": "postpaid",
  "current_cycle": {
    "id": "cycle_z7NyjWYtLoCWXnM3",
    "start_at": "2022-01-12T00:00:00Z",
    "end_at": "2022-01-13T23:59:59Z",
    "billing_at": "2022-01-14T00:00:00Z",
    "status": "unbilled",
    "cycle": 1
  },
  "next_billing_at": "2022-02-14T00:00:00Z",
  "payment_method": "credit_card",
  "currency": "BRL",
  "installments": 1,
  "status": "active",
  "created_at": "2022-01-12T15:22:04Z",
  "updated_at": "2022-01-12T15:59:58Z",
  "customer": {
    "id": "cus_Vg47ZR5qFqS9j0nr",
    "name": "Tony Stark",
    "email": "297a5636-3dc1-4cca-b590-c00729b9c322@avengers.com",
    "document": "78057744049",
    "type": "individual",
    "created_at": "2022-01-12T15:22:04Z",
    "updated_at": "2022-01-12T15:22:04Z",
    "phones": {
      "home_phone": {
        "country_code": "55",
        "number": "22180513",
        "area_code": "21"
      }
    }
  },
  "card": {
    "id": "card_1jgv2gMiE3S9ROlX",
    "first_six_digits": "400000",
    "last_four_digits": "0010",
    "brand": "Visa",
    "holder_name": "Tony Stark",
    "exp_month": 1,
    "exp_year": 2022,
    "status": "active",
    "type": "credit",
    "created_at": "2022-01-12T15:22:04Z",
    "updated_at": "2022-01-12T15:22:04Z",
    "billing_address": {
      "street": "Malibu Point",
      "number": "10880",
      "zip_code": "90265",
      "neighborhood": "Central Malibu",
      "city": "Malibu",
      "state": "CA",
      "country": "US",
      "line_1": "10880, Malibu Point, Central Malibu"
    }
  },
  "items": [
    {
      "id": "si_7ga8GLwEhYf63JMR",
      "name": "Premium",
      "description": "Sem anuncios",
      "quantity": 1,
      "status": "active",
      "created_at": "2022-01-12T15:22:05Z",
      "updated_at": "2022-01-12T15:22:05Z",
      "pricing_scheme": {
        "price": 1490,
        "scheme_type": "unit"
      }
    }
  ],
  "split": {
    "rules": [
      {
        "id": "sr_WadeEMbhkHoAeEP7",
        "type": "percentage",
        "amount": 40,
        "recipient": {
          "id": "rp_PxYn9ztlLtvY8lGN",
          "name": "Recipient 1",
          "email": "tstark@avengers.com",
          "document": "26224451990",
          "description": "Recipient 1",
          "type": "individual",
          "payment_mode": "bank_transfer",
          "status": "active",
          "created_at": "2022-01-12T15:21:50Z",
          "updated_at": "2022-01-12T15:21:50Z"
        },
        "options": {
          "liable": true,
          "charge_processing_fee": true,
          "charge_remainder_fee": true
        }
      }
    ]
  },
  "metadata": {
    "id": "teste"
  }
}

Changes