openapi: 3.0.1
info:
title: Terminal Shop Address Token API
description: Public REST API for Terminal, a developer-focused coffee company. The API powers product browsing, carts, orders, subscriptions, addresses, cards, profiles, personal access tokens, and OAuth apps - the same surface behind the `ssh terminal.shop` storefront and the official SDKs. All monetary amounts are integers in US cents. Authentication is a Bearer personal access token (`trm_live_*` in production, `trm_test_*` in the dev sandbox) or an OAuth 2.0 access token.
termsOfService: https://www.terminal.shop/terms
contact:
name: Terminal Support
url: https://www.terminal.shop
version: '1.0'
servers:
- url: https://api.terminal.shop
description: Production
- url: https://api.dev.terminal.shop
description: Dev sandbox (no real charges)
security:
- bearerAuth: []
tags:
- name: Token
paths:
/token:
get:
operationId: listTokens
tags:
- Token
summary: List tokens
description: List the personal access tokens associated with the current user.
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
items:
$ref: '#/components/schemas/Token'
post:
operationId: createToken
tags:
- Token
summary: Create token
description: Create a personal access token. The secret is returned only once at creation time.
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
required:
- id
- token
properties:
id:
type: string
token:
type: string
description: The token secret (shown once).
/token/{id}:
get:
operationId: getToken
tags:
- Token
summary: Get token
description: Get the personal access token with the given ID.
parameters:
- $ref: '#/components/parameters/PathID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Token'
delete:
operationId: deleteToken
tags:
- Token
summary: Delete token
description: Delete the personal access token with the given ID.
parameters:
- $ref: '#/components/parameters/PathID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: string
components:
parameters:
PathID:
name: id
in: path
required: true
schema:
type: string
schemas:
Token:
type: object
required:
- id
- token
- created
properties:
id:
type: string
token:
type: string
description: Masked or full token identifier.
created:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Personal access token (`trm_live_*` in production, `trm_test_*` in the dev sandbox) or OAuth 2.0 access token, passed as `Authorization: Bearer <token>`.'