refresh-pos-access-token
Method: POST
Path: /pos/auth/refresh-token
Tags: Authentication
Summary
Refresh POS access token
Pos SDK Usage
SDK Method: pos.refreshAccessToken()
Example:
typescript
const { data, error } = await pos.refreshAccessToken({
refresh_token: "refresh-token-here"
});
if (error) {
console.error("Token refresh failed:", error.message);
} else {
console.log("New access token:", data.access_token);
console.log("New refresh token:", data.refresh_token);
// New tokens are automatically stored by the SDK
}TypeScript Definition
typescript
"refresh-pos-access-token": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description Refresh token. Surrounding whitespace is trimmed; blank values are rejected. */
refresh_token: string;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
access_token: string;
refresh_token: string;
};
};
};
};
/** @description The refresh token body is missing or invalid. */
400: components["responses"]["BadRequest"];
/** @description The token is invalid or expired, is not a refresh token, or its session no longer exists (`token-expired`). */
401: components["responses"]["Unauthorized"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"operationId": "refresh-pos-access-token",
"summary": "Refresh POS access token",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"refresh_token": {
"description": "Refresh token. Surrounding whitespace is trimmed; blank values are rejected.",
"type": "string",
"minLength": 1
}
},
"required": [
"refresh_token"
]
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
}
},
"required": [
"access_token",
"refresh_token"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
}
},
"400": {
"description": "The refresh token body is missing or invalid.",
"$ref": "#/components/responses/BadRequest"
},
"401": {
"description": "The token is invalid or expired, is not a refresh token, or its session no longer exists (`token-expired`).",
"$ref": "#/components/responses/Unauthorized"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/refresh-pos-access-token"
},
"security": [],
"tags": [
"Authentication"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "refreshAccessToken"
}Auto-generated from OpenAPI spec and TypeScript definitions