def refresh(tokens):
    body = {'app_name': APP_NAME, 'app_version': APP_VERSION, 'source_token_type': 'refresh_token', 'source_token': tokens['refresh_token'], 'requested_token_type': 'access_token'}
    response_json = requests.post(f'https://api.amazon.com/auth/token', headers=get_headers(tokens['domain']), json=body).json()
    try:
        tokens['access_token'] = response_json['access_token']
    except:
        print(json.dumps(response_json))
    return tokens
def refresh(tokens):
    body = {'app_name': APP_NAME, 'app_version': APP_VERSION, 'source_token_type': 'refresh_token', 'source_token': tokens['refresh_token'], 'requested_token_type': 'access_token'}
    response_json = requests.post(f'https://api.amazon.com/auth/token', headers=get_headers(tokens['domain']), json=body).json()
    try:
        tokens['access_token'] = response_json['access_token']
    except:
        print(json.dumps(response_json))
    return tokens