Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/akibanks/api-tienda-vinilos/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through the full happy path: create an account, log in to get a JWT, search the vinyl catalog, inspect a record’s details, and place your first order. By the end you’ll have a working token and a confirmed sale ID.
1

Register

Create a new account by sending your desired username and password. Usernames must be unique; passwords must be at least 6 characters.
curl -X POST https://your-api.onrender.com/registro \
  -H "Content-Type: application/json" \
  -d '{"nombre_usuario": "testuser", "password": "mypassword123"}'
Response 201 Created
{
  "mensaje": "Usuario creado exitosamente."
}
The new account is assigned the cliente role automatically. No email verification is required.
2

Log in and get your token

Exchange your credentials for a JWT. Store the token value — you’ll pass it as a Bearer header on every protected request.
curl -X POST https://your-api.onrender.com/login \
  -H "Content-Type: application/json" \
  -d '{"nombre_usuario": "testuser", "password": "mypassword123"}'
Response 200 OK
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSw...",
  "nombre": "testuser",
  "es_admin": false,
  "es_demo": false
}
FieldDescription
tokenSigned JWT — valid for 7 days
nombreYour username as stored in the database
es_admintrue only for the admin role
es_demotrue only for the demo read-only role
On all subsequent requests to protected endpoints, include:
Authorization: Bearer <token>
Save the token to a shell variable for convenience:
TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSw..."
3

Search the catalog

Search the full Discogs catalog by any keyword — artist, album title, label, or genre. No authentication is required for this endpoint.
curl "https://your-api.onrender.com/buscar?q=pink+floyd"
Response 200 OK
{
  "resultados": [
    {
      "discogs_id": "10362301",
      "titulo": "The Dark Side Of The Moon",
      "artista": "Pink Floyd",
      "anio": 1973,
      "genero": "Rock",
      "estilo": "Psychedelic Rock",
      "imagen_url": "https://i.discogs.com/...",
      "precio": 34.99,
      "have": 142800,
      "want": 73500
    }
  ],
  "total": 1842,
  "paginas": 93
}
FieldDescription
discogs_idDiscogs release ID — use this to fetch full details
tituloAlbum or release title
artistaPrimary artist name (disambiguator suffixes like (2) are stripped)
anioRelease year, or null if unknown
generoPrimary genre from Discogs
estiloPrimary style from Discogs
imagen_urlCover art URL
precioServer-calculated price in USD (based on year + popularity)
haveNumber of Discogs community members who own this release
wantNumber of Discogs community members who want this release
Add &pagina=2 to fetch the next page of results (20 results per page).
4

Get a record's details

Fetch the full detail for a specific release by its discogs_id. This includes the tracklist, label, country, and a freshly calculated price.
curl "https://your-api.onrender.com/disco/10362301"
Response 200 OK
{
  "discogs_id": "10362301",
  "titulo": "The Dark Side Of The Moon",
  "artista": "Pink Floyd",
  "anio": 1973,
  "genero": "Rock",
  "estilo": "Psychedelic Rock",
  "imagen_url": "https://i.discogs.com/...",
  "tracklist": [
    { "posicion": "A1", "titulo": "Speak To Me", "duracion": "1:30" },
    { "posicion": "A2", "titulo": "Breathe", "duracion": "2:43" },
    { "posicion": "B1", "titulo": "Money", "duracion": "6:22" }
  ],
  "precio": 34.99,
  "have": 142800,
  "want": 73500,
  "sello": "Harvest",
  "pais": "UK"
}
Detail responses are cached in Redis for 7 days. The first request hits Discogs directly; subsequent requests are served from cache.
5

Place an order

Submit your cart and shipping address to create a confirmed sale. Authentication is required.
curl -X POST https://your-api.onrender.com/checkout \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "items": [
      {
        "discogs_id": "10362301",
        "titulo": "The Dark Side Of The Moon",
        "artista": "Pink Floyd",
        "cantidad": 1
      }
    ],
    "envio": {
      "nombre_receptor": "Test User",
      "calle": "Insurgentes Sur",
      "numero_ext": "123",
      "numero_int": "4B",
      "colonia": "Del Valle",
      "ciudad": "Ciudad de México",
      "estado": "CDMX",
      "codigo_postal": "03100",
      "referencias": "Blue building, black gate"
    }
  }'
Response 201 Created
{
  "mensaje": "¡Compra procesada exitosamente!",
  "id_venta": 42,
  "total": "34.99"
}
Prices are calculated server-side. The backend queries Discogs for the latest have/want stats and computes the final price itself. Any precio field you include in the request body is silently ignored — you cannot influence the price from the client.
Required fields in each items entry: discogs_id, titulo, artista, cantidad (positive integer). Required fields in envio: nombre_receptor, calle, numero_ext, colonia, ciudad, estado, codigo_postal. The fields numero_int and referencias are optional.
Want to understand how tokens work, when they expire, and what each user role can access? Head to the Authentication page for a full breakdown of JWT signing, role permissions, and error responses.

Build docs developers (and LLMs) love