the terminal api gives you access to the same api that powers the award winning terminal ssh shop.
The Terminal API allows you to interact with the Terminal e-commerce platform. You can use it to order your own coffee however you like (cron job, neovim plugin, github action, etc.), or even create apps that allow others to authenticate through OAuth 2.0 and purchase their coffee.
There are two environments for the Terminal API: the dev sandbox, and production. The dev sandbox allows you to test out the API without creating real charges against a credit card (use the Stripe test card: 4242424242424242), and, obviously, we won't be fulfilling any orders in dev. The production environment is the real deal, and we will be fulfilling orders against real credit cards, so be careful! Or don't, we'll gladly take your money and send you coffee, just no infinite loops, pls.
We don't know what you might do with it, but our OpenAPI 3.1 specification is available here.
There are two ways to authenticate with the Terminal API: using a personal access token, or using an OAuth 2.0 client ID and secret.
The personal access token is a simple secret (string) that can be passed as a bearer token in the Authorization header. All API actions will be performed on behalf of the user associated with the token (you!). You can manage your personal access tokens in the Account page of the SSH shop:
ssh dev.terminal.shop -t tokens # dev sandbox
ssh terminal.shop -t tokens # productionThe OAuth 2.0 client ID and secret are used to authenticate with the API on behalf of another user. Like personal access tokens, you can create and manage OAuth 2.0 apps in the Account page of the SSH shop:
ssh dev.terminal.shop -t apps # dev sandbox
ssh terminal.shop -t apps # productionYou can find OAuth 2.0 configuration info here for the dev sandbox, and here for production. Note: we don't do anything with `scope`, so pass anything you like just remember that we probably log them and will post any funny values on the internet.
If you don't prefer making HTTP requests yourself, you can use one of our many client SDKs to interact with the Terminal API.
note: Our SDKs are created by the talented team at Stainless, they're awesome and you should check them out.
list products
public
get product
public
public
List all products for sale in the Terminal shop.
public
Get a product by ID from the Terminal shop.
get profile
update profile
Get the current user's profile.
Update the current user's profile.
get addresses
get address
create address
delete address
update address
Get the shipping addresses associated with the current user.
Get the shipping address with the given ID.
Create and add a shipping address to the current user.
Delete a shipping address from the current user.
Update a saved shipping address without changing its ID, so carts and subscriptions keep referencing the same saved address.
list cards
get card
create card
collect card
delete card
List the credit cards associated with the current user.
Get a credit card by ID associated with the current user.
Attach a credit card (tokenized via Stripe) to the current user.
Create a temporary URL for collecting credit card information for the current user.
Delete a credit card associated with the current user.
get cart
add item
set address
set card
convert to order
clear cart
Get the current user's cart.
Add an item to the current user's cart.
Set the shipping address for the current user's cart.
Set the credit card for the current user's cart.
Convert the current user's cart to an order.
Clear the current user's cart.
list orders
get order
create order
cancel order
update order shipping
List the orders associated with the current user.
Get the order with the given ID.
Create an order without a cart. The order will be placed immediately.
Cancel an order before fulfillment has started. Canceled orders are removed from order history.
Update the shipping address for an order before fulfillment has started.
list subscriptions
get subscription
update subscription
subscribe
cancel
List the subscriptions associated with the current user.
Get the subscription with the given ID.
Update card, address, or interval for an existing subscription.
Create a subscription for the current user.
Cancel a subscription for the current user.
list tokens
get token
create token
delete token
List the current user's personal access tokens.
Get the personal access token with the given ID.
Create a personal access token.
Delete the personal access token with the given ID.
list apps
get app
create app
delete app
List the current user's registered apps.
Get the app with the given ID.
Create an app.
Delete the app with the given ID.
show ssh email link confirmation
start ssh email linking
confirm ssh email link
get app data
subscribe email
public
Get initial app data, including user, products, cart, addresses, cards, subscriptions, and orders.
public
Subscribe to email updates from Terminal.