Skip to main content
GET
/
extra
/
get
/
:id
// Get all extras and filter by ID
const getExtraById = async (extraId) => {
  const response = await fetch('https://api.example.com/extra/get', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    credentials: 'include'
  });
  
  const data = await response.json();
  const extra = data.result.find(item => item.id_extra === extraId);
  
  return extra;
};

// Usage
const extra = await getExtraById(3);
{
  "id_extra": 3,
  "name": "Silla Plástica",
  "value_add": 5000,
  "quantity": 50
}
Based on the current API implementation, getting all extras is available via GET /extra/get. To get a specific extra, you would need to filter the results from the list endpoint by id_extra.

Getting a Specific Extra

While the API currently implements a single GET /extra/get endpoint that returns all extras, you can retrieve a specific extra by:
  1. Calling the list endpoint (GET /extra/get)
  2. Filtering the results by the desired id_extra

Example Implementation

// Get all extras and filter by ID
const getExtraById = async (extraId) => {
  const response = await fetch('https://api.example.com/extra/get', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    credentials: 'include'
  });
  
  const data = await response.json();
  const extra = data.result.find(item => item.id_extra === extraId);
  
  return extra;
};

// Usage
const extra = await getExtraById(3);
{
  "id_extra": 3,
  "name": "Silla Plástica",
  "value_add": 5000,
  "quantity": 50
}

Response Fields

id_extra
number
Unique identifier for the extra
name
string
Name of the extra item
value_add
number
Additional cost for the extra item
quantity
number
Available quantity of the extra item

Build docs developers (and LLMs) love