# Travel forward

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

Travel forward in time. This operation is **asynchronous** .

You need to check if the "start afresh" operation has completed by checking if the time travel status is **successful** by retrieving the time machine in a loop with a minimum delay of 3 secs between two retrieve requests.

Use method **waitForTimeTravelCompletion()** on the returned time\_machine resource which will block until the time travel completes.

Use method **waitForTimeTravelCompletion()** on the returned time\_machine resource which will block until the time travel completes.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/time_machines/delorean/travel_forward \
     -u {site_api_key}:\
     -d destination_time=1586274640
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = TimeMachine.TravelForward("delorean")
		.DestinationTime(1586274640)
		.Request();

TimeMachine timeMachine = result.TimeMachine;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    timemachineAction "github.com/chargebee/chargebee-go/v3/actions/timemachine"
    "github.com/chargebee/chargebee-go/v3/models/timemachine"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := timemachineAction.TravelForward("delorean", &timemachine.TravelForwardRequestParams{
        DestinationTime : chargebee.Int64(1586274640),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        TimeMachine := res.TimeMachine
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.TimeMachineTravelForwardRequest{
    DestinationTime : chargebee.Int64(1586274640),
}
  res, err := client.TimeMachine.TravelForward("delorean", req)
      if err != nil {
        fmt.Println(err)
    } else {
        TimeMachine := res.TimeMachine
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.sql.Timestamp;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = TimeMachine.travelForward("delorean")
            .destinationTime(new Timestamp(1586274640L * 1000))
            .request();

        TimeMachine timeMachine = result.timeMachine();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.timeMachine.TimeMachine;
import com.chargebee.v4.models.timeMachine.params.TimeMachineTravelForwardParams;
import com.chargebee.v4.models.timeMachine.responses.TimeMachineTravelForwardResponse;
import java.sql.Timestamp;

public class TimeMachineTravelForward {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        TimeMachineTravelForwardParams params = TimeMachineTravelForwardParams.builder()
            .destinationTime(new Timestamp(1586274640L * 1000))
            .build();

        TimeMachineTravelForwardResponse response = client
            .timeMachines()
            .travelForward("delorean", params);

        TimeMachine timeMachine = response.getTimeMachine();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.timeMachine.travelForward("delorean", {
        destination_time: 1586274640
    });

    console.log(result);
    const timeMachine = result.time_machine;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->timeMachine()->travelForward("delorean", [
    "destination_time" => 1586274640
]);
$timeMachine = $result->time_machine;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.TimeMachine.travel_forward("delorean",
    cb_client.TimeMachine.TravelForwardParams(
        destination_time=1586274640
    )
)
time_machine = response.time_machine
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::TimeMachine.travel_forward("delorean",{
  :destination_time => 1586274640
})

time_machine = result.time_machine
```

## Sample Response

```json
{
  "time_machine": {
    "destination_time": 1586274640,
    "genesis_time": 1585066234,
    "name": "delorean",
    "object": "time_machine",
    "time_travel_status": "in_progress"
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/time_machines/{time-machine-name}/travel_forward

## Input Parameters

- `destination_time` (optional, timestamp(UTC) in seconds)
  The **time** to travel to. Should be between the 'current' destination time of the time machine and present time.

## Returns

- `time_machine` (Time machine object)
  Resource object representing time\_machine
