# Update Plan

The **Update Plan** API allows you to modify an existing plan, enabling you to update attributes such as the plan's status, installment details, and the payment method associated with the plan.

Use this API to manage and adjust installment plans after creation.

**PATCH** `/installments-plans/{installment_code}`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Update Plan

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Path parameters

- `installment_code` (string, required)
  The unique identifier of the installment plan.

## Body

Content type: `application/json`

- `name` (string)
  The installment plan name (MAX 255; MIN 3)
- `account_id` (string[])
  The unique identifier of WHITELABEL's account that will have the installment plan available to use (MAX 64 ; MIN 36).
- `merchant_reference` (string)
  Identification of the installment plan (MAX 255; MIN 3)
- `installments_plan` (object[])
  Definition of installments available for each scenario
  - `installment` (integer<int32>, required)
    The number of monthly installments shoppers can choose
  - `rate` (number<float>, required)
    The rate applied to the final amount of the transaction by the payment provider after using installments. The value should be entered as a multiplier, not a percentage. For example, to apply a 20% rate, enter `1.20` instead of `20`.
  - `financial_costs` (object[])
    Optional financial costs details for this installment option.
    - `type` (string, required)
      The financial cost type identifier (MIN 3; MAX 255).

      <br/> Example: `CFT`, `TEA`, `CET`, `CAT`
    - `rate` (number<float>, required)
      The financial cost rate as a decimal number (e.g., 45.25 for 45.25%).
  - `type` ("MERCHANT_INSTALLMENTS" | "ISSUER_INSTALLMENTS")
    Installment’s type. Only available for Ecuador and Mexico. Merchant refers to payments deferred with interest, and Issuer refer to payments deferred without interest
- `country_code` (string)
  The issuer's country  (ISO 3166-1 MAX 2; MIN 2)
- `scheme` (string)
  Card’s scheme information. (MAX 255; MIN 3)
- `brand` (string[])
  Card’s brand information (MAX 255; MIN 3).
- `issuer` (string)
  Card issuer (MAX 255; MIN 3)
- `iin` (string[])
  The issuer identification number (IIN) refers to the first few digits of a payment card number issued by a financial institution (MAX 8; MIN 6)
- `first_installment_deferral` (integer<int32>)
  The amount of months to wait to debit the first installment (MAX: 3).
- `amount` (object)
  The amounts that the installment plan will be available for. If null, available for any amount.
  - `currency` (string, required)
    The currency used to make the payment (ISO 4217 MAX 3; MIN 3)
  - `min_value` (number<float>)
    The minimum amount the installment plan will be available to use (multiple of 0.0001).
  - `max_value` (number<float>)
    The maximum amount the installment plan will be available to use (multiple of 0.0001).
- `availability` (object)
  The dates that the installment plan will be available for. If null then it does not have a finish date
  - `start_at` (string<date-time>, required)
    The start date that the installment plan will be available to use
  - `finish_at` (string<date-time>, required)
    The end date until the installment plan will be available to use.

Example:

```json
{
  "name": "string",
  "account_id": [
    "string"
  ],
  "merchant_reference": "string",
  "installments_plan": [
    {
      "installment": 0,
      "rate": 0,
      "financial_costs": [
        {
          "type": "string",
          "rate": 0
        }
      ],
      "type": "MERCHANT_INSTALLMENTS"
    }
  ],
  "country_code": "string",
  "scheme": "string",
  "brand": [
    "string"
  ],
  "issuer": "string",
  "iin": [
    "string"
  ],
  "first_installment_deferral": 0,
  "amount": {
    "currency": "string",
    "min_value": 0,
    "max_value": 0
  },
  "availability": {
    "start_at": "1970-01-01T00:00:00.000Z",
    "finish_at": "1970-01-01T00:00:00.000Z"
  }
}
```

## Responses

### 200

200

- `id` (string)
- `name` (string)
- `account_id` (string[])
- `merchant_reference` (string)
- `installments_plan` (object[])
  - `installment` (integer)
  - `rate` (integer)
  - `provider_id` (string)
  - `financial_costs` (object[])
    - `type` ("CFT" | "TEA" | "CET" | "CAT")
    - `rate` (number<float>)
    - `formatted_value` (string)
- `type` (string)
- `source` (string)
- `provider_id` (string)
- `scheme` (string)
- `brand` (string[])
- `issuer` (string)
- `issuer_id` (string)
- `iin` (any)
- `country_code` (string)
- `first_installment_deferral` (integer)
- `amount` (object)
  - `currency` (string)
  - `min_value` (integer)
  - `max_value` (integer)
- `availability` (object)
  - `start_at` (string)
  - `finish_at` (string)
- `created_at` (string)
- `updated_at` (string)

Example:

```json
{
  "id": "4d573425-33f9-4c46-b009-2c7e749b0ec7",
  "name": "plan_007",
  "account_id": [
    "f7c5fe77-721b-49c2-84d3-957748df3c2c"
  ],
  "merchant_reference": "Test",
  "installments_plan": [
    {
      "installment": 1,
      "rate": 1,
      "provider_id": "",
      "financial_costs": [
        {
          "type": "CFT",
          "rate": 0,
          "formatted_value": "string"
        }
      ]
    }
  ],
  "type": "",
  "source": "",
  "provider_id": "",
  "scheme": "",
  "brand": [
    "VISA"
  ],
  "issuer": "",
  "issuer_id": "",
  "iin": null,
  "country_code": "US",
  "first_installment_deferral": 0,
  "amount": {
    "currency": "USD",
    "min_value": 0,
    "max_value": 100000000
  },
  "availability": {
    "start_at": "2023-09-12T00:00:00Z",
    "finish_at": "2030-09-20T00:00:00Z"
  },
  "created_at": "2023-10-11T17:52:31.886178246Z",
  "updated_at": "2023-10-11T17:52:31.886178246Z"
}
```

### 400

400

Example:

```json
{}
```