Sha256: 3eafa9e61d38e69a1eee1b8fe8d0c18acb78ecfc123ab956c96dcbee4f638431

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 Bytes

Contents

## Updating carnets

### Changing the metadata

You can update the `custom_id` and the `notification_url` of a carnet at any time.

It's important to keep in mind that all the charges of the carnet will be updated. If you want to update only one charge, check [Updating charges](/docs/charge-update.md).

```ruby
params = {
  id: 1004
}

body = {
  notification_url: "http://yourdomain.com",
  custom_id: "my_new_id"
}

gerencianet = Gerencianet.new(options)
puts gerencianet.update_carnet_metadata(params: params, body: body)
```

If everything goes well, the response will be:

```ruby
{
  "code": 200
}
```

### Updating the expiration date of a parcel

Only parcels with status `waiting` or `unpaid` can have expiration date set or updated:

```ruby
params = {
  id: 1008
}

body = {
  parcel: 1,
  expire_at: "2020-12-12"
}

gerencianet = Gerencianet.new(options)
puts gerencianet.update_parcel(params: params, body: body)
```

If everything goes well, the response will be:

```ruby
{
  "code": 200
}
```

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gerencianet-0.0.5 docs/carnet-update.md
gerencianet-0.0.4 docs/carnet-update.md
gerencianet-0.0.3 docs/carnet-update.md
gerencianet-0.0.2 docs/carnet-update.md