pm.environment.set("variable_key", "variable_value");
{ "customer_id" : "{{cust_id}}" }
postman.setGlobalVariable("refresh_token",postman.getResponseHeader("Refresh_token") );
postman.setEnvironmentVariable("VARIABLE_NAME", <<VALUE>>);
pm.environment.get("variable_key");
just like variables in Java.
we can create variables in postman to reuse the value
1.Global variables: accessible everywhere in same workspace
2.Environment variables: accessible in selected environment
3.Collection Variables: belong to the collection itself and
only accessible within the collection