CAPSULE FOR THE PREPARATION OF A BEVERAGE FROM BEVERAGE INGREDIENTS CONTAINED THEREIN, COMPRISING A BODY (2) COMPRISING AT LEAST ONE COMPARTMENT FOR RECEIVING SAID BEVERAGE INGREDIENTS AND A FLANGE-LIKE RIM (4) EXTENDING OUTWARDLY AND TRANSVERSALLY TO A CENTRAL AXIS (I) OF SAID BODY A MEMBRANE (6) FOR CLOSING THE OPENING WHICH IS SEALED ONTO THE FLANGE-LIKE RIM, AN OPTICAL CODE (7) CONTAINING BINARY INFORMATION CONFIGURED TO BE READ BY A CAMERA (11) OF A BEVERAGE PRODUCING DEVICE (20), WHEREIN THE OPTICAL CODE (7) IS A TWO-DIMENSIONAL BARCODE HAVING RECTILINEAR BORDERS (7A-7D) AND WHICH IS INSCRIBED IN A CIRCULAR AREA (8) CONCENTRIC RELATIVE TO THE CENTRE (O) OF THE MEMBRANE HAVING A RADIUS (R) SMALLER THAN THE RADIUS (R0) OF THE MEMBRANE.