# Tilopay.updateOptions()

> Partially updates the parameters sent to Init() when they change before closing the payment.

- kind: sdk-method
- status: stable
- sdk_version: 2.1.1
- last_verified: 2026-10-22
- url: https://tilopay.com/en/developers/sdk/reference/update-options

Updates values already sent in [`Tilopay.Init()`](/en/developers/sdk/reference/init) that changed
during checkout — typically when the customer edits their data, or when they select SINPE Móvil
or Yappy and information that did not apply before must be added.

> **Note:** It is a partial update. Send only the fields you want to update; there is no need to resend
> everything.

## No field is required in the call [#obligatorio]

No parameter is required in `updateOptions()`. What matters is that, before closing the
payment, the data the payment method needs (for example `typeDni` and `dni` for SINPE Móvil, or
`phoneYappy` for Yappy) was sent in `Init()` or in `updateOptions()`.

## Signature [#firma]

```js
await Tilopay.updateOptions({ /* only the fields that change */ })
```

## Call [#llamada]

```js
const update = await Tilopay.updateOptions({
  typeDni: 1,
  dni: "0707770777",
  billToFirstName: "Ana",
  billToLastName: "Rojas",
});
```

## Parameters [#parametros]

<Param id="update-options-webhook" name="webhook" type="string">
URL where Tilopay notifies the outcome of SINPE Móvil and Yappy payments.
</Param>

You can update `typeDni`, `dni`, the `billTo*` fields (except `billToEmail`), the `shipTo*`
fields, `capture`, `redirect`, `subscription` and `phoneYappy`.

<Param id="update-options-typedni" name="typeDni" type="integer">
Customer identification type. Needed for SINPE Móvil. See
[identification types](#tipos-de-identificacion).
</Param>

<Param id="update-options-dni" name="dni" type="string">
Customer identification number. Needed for SINPE Móvil. **Accepted with and without hyphens.**
</Param>

<Param id="update-options-billtofirstname" name="billToFirstName" type="string">
Customer first name.
</Param>

<Param id="update-options-billtolastname" name="billToLastName" type="string">
Customer last name.
</Param>

<Param id="update-options-billtoaddress" name="billToAddress" type="string">
Customer address line 1.
</Param>

<Param id="update-options-billtoaddress2" name="billToAddress2" type="string">
Customer address line 2.
</Param>

<Param id="update-options-billtocity" name="billToCity" type="string">
City.
</Param>

<Param id="update-options-billtostate" name="billToState" type="string">
State or province.
</Param>

<Param id="update-options-billtozippostcode" name="billToZipPostCode" type="string">
Postal code.
</Param>

<Param id="update-options-billtocountry" name="billToCountry" type="string">
Country, ISO 3166-1 alpha-2.
</Param>

<Param id="update-options-billtotelephone" name="billToTelephone" type="string">
Customer phone.
</Param>

<Param id="update-options-shiptofirstname" name="shipToFirstName" type="string">
Shipping recipient first name.
</Param>

<Param id="update-options-shiptolastname" name="shipToLastName" type="string">
Shipping recipient last name.
</Param>

<Param id="update-options-shiptoaddress" name="shipToAddress" type="string">
Shipping address line 1.
</Param>

<Param id="update-options-shiptoaddress2" name="shipToAddress2" type="string">
Shipping address line 2.
</Param>

<Param id="update-options-shiptocity" name="shipToCity" type="string">
Shipping city.
</Param>

<Param id="update-options-shiptostate" name="shipToState" type="string">
Shipping state or province.
</Param>

<Param id="update-options-shiptozippostcode" name="shipToZipPostCode" type="string">
Shipping postal code.
</Param>

<Param id="update-options-shiptocountry" name="shipToCountry" type="string">
Shipping country, ISO 3166-1 alpha-2.
</Param>

<Param id="update-options-shiptotelephone" name="shipToTelephone" type="string">
Shipping phone.
</Param>

<Param id="update-options-capture" name="capture" type="integer">
`0` authorizes; `1` authorizes and captures.
</Param>

<Param id="update-options-redirect" name="redirect" type="string (URL)">
URL where the final purchase response is expected.
</Param>

<Param id="update-options-subscription" name="subscription" type="integer">
`1` if the customer wants to save their card in Tilopay; `0` if not.
</Param>

<Param id="update-options-phoneyappy" name="phoneYappy" type="string">
Yappy phone. Needed when the customer pays with Yappy.
</Param>

> **Warning:** `billToEmail` cannot be updated. Once `Init()` returned the customer's cards, the email
> cannot be changed through this method.

## Identification types [#tipos-de-identificacion]

Applies to the `typeDni` parameter, both here and in `Tilopay.Init()`. In the masks, `#` is a
**numeric** character and `&` is **alphanumeric**. Lengths do not count hyphens.

| Code | Type | Format | Length |
|---|---|---|---|
| 1 | Cédula de identidad | `0#-####-####` | 10 |
| 2 | Cédula jurídica | `3-###-######` | 10 |
| 3 | Gobierno central | `2-###-######` | 10 |
| 4 | Institución autónoma | `4-###-######` | 10 |
| 5 | Extranjero no residente | `9&&&&&&&&&&&&&&&&&&&` | 20 |
| 6 | DIMEX | `1###########` | 12 |
| 7 | DIDI | `5###########` | 12 |

## Response [#respuesta]

```json
{
  "message": "Success"
}
```

<Param id="update-options-message" name="message" type="string">
`Success` when the update succeeded; the error description otherwise.
</Param>
