REST Assured extracts values with .extract() — .extract().path('gpath') for a single value, .extract().response() for the whole response, or .extract().as(Pojo.class) — so you can reuse data in later requests or custom assertions.
After (or instead of) inline validation, .extract() pulls data out: String token = ...post('/login').then().extract().path('token'); or int id = ...then().extract().path('data.id'). You can grab .extract().response() to inspect body, headers, cookies, and time programmatically, or .jsonPath() for a JsonPath object supporting getList/getMap. Extraction is essential for chained workflows (login → use token, create → use id) and for assertions too complex for a single matcher. It bridges REST Assured's fluent validation with plain Java logic (JUnit/TestNG asserts).
Chaining auth: String token = given().body(creds).post('/login').then().extract().path('token'); then given().header('Authorization', 'Bearer ' + token).get('/profile')... reuses the extracted token.
You need the created order's id from a POST response to then GET that order. How do you get and reuse it?