Skip to main content
POST
/
refresh-token
Refresh Token
curl --request POST \
  --url https://staging-api.puppetvendors.com/refresh-token \
  --header 'x-access-token: <api-key>'
import requests

url = "https://staging-api.puppetvendors.com/refresh-token"

headers = {"x-access-token": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};

fetch('https://staging-api.puppetvendors.com/refresh-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/refresh-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-access-token: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://staging-api.puppetvendors.com/refresh-token"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("x-access-token", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://staging-api.puppetvendors.com/refresh-token")
.header("x-access-token", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging-api.puppetvendors.com/refresh-token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'

response = http.request(request)
puts response.read_body
V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Exchange a valid (non-expired) vendor JWT token for a new one with a fresh 24-hour expiry. Use this to maintain sessions without requiring re-authentication with the API key. The new token inherits the vendor scope from the original.

Use Cases

  • Long-running integrations — Automatically refresh tokens before they expire
  • Vendor portal sessions — Keep your session alive without re-entering the API key

Request

No request body required. The current token is read from the x-access-token header.

Response

200
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 86400,
    "shopDomain": "my-store.myshopify.com"
  }
}

Error Response

401
{
  "success": false,
  "error": {
    "message": "Invalid or expired token",
    "code": "UNAUTHORIZED"
  }
}

Example

curl -X POST https://staging-api.puppetvendors.com/refresh-token \
  -H "x-access-token: YOUR_VENDOR_TOKEN"