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.

GET /mis-compras returns the full purchase history for the authenticated user, ordered from newest to oldest. Each order includes its line items (the individual vinyl records purchased), a running total, the current order status, and partial shipping info — only city and state are exposed here; the full street address is kept private and is only accessible to admins via GET /admin/ventas/:id.

Endpoint details

MethodGET
Path/mis-compras
AuthJWT required (Authorization: Bearer <token>)

Request params

No query parameters or request body. The user is identified entirely from the JWT payload.

Response

Returns a JSON array of order objects, newest first. An empty array ([]) is returned if the user has not yet placed any orders.
id_venta
integer
Unique ID of the purchase order.
total
number
Total amount charged for the order (as a JavaScript number, e.g. 29.99).
estado
string
Current order status. One of: pendiente, pagada, enviada, entregada, cancelada.
fecha
string
ISO 8601 datetime when the order was created (e.g. "2024-11-03T20:15:00.000Z").
ciudad
string | null
City from the shipping address. null if no shipping record is associated with the order.
discos
array
Line items — the individual vinyl records included in this order.

Example

curl https://api.vinylvibes.example/mis-compras \
  -H "Authorization: Bearer $TOKEN"
200 response
[
  {
    "id_venta": 42,
    "total": 59.98,
    "estado": "enviada",
    "fecha": "2024-11-03T20:15:00.000Z",
    "ciudad": "Ciudad de México",
    "discos": [
      {
        "discogs_id": "249504",
        "titulo": "The Dark Side of the Moon",
        "artista": "Pink Floyd",
        "cantidad": 1,
        "precio": 29.99,
        "subtotal": 29.99
      },
      {
        "discogs_id": "870745",
        "titulo": "Kind of Blue",
        "artista": "Miles Davis",
        "cantidad": 1,
        "precio": 29.99,
        "subtotal": 29.99
      }
    ]
  }
]

Error responses

StatusConditionError message
401JWT is absent or malformed"Token de autenticación requerido."
401JWT is expired or invalid"Token inválido o expirado. Vuelve a iniciar sesión."
500Unexpected server or database error"Error al obtener el historial de compras."

Build docs developers (and LLMs) love