Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 2 KB

api-concepts.md

File metadata and controls

31 lines (24 loc) · 2 KB
group subgroup title menu_title menu_order
php-developer-guide
99_Module Development
Public interfaces & APIs
Public interfaces & APIs
3

What is a public interface? {#public-interface}

A public interface is a set of code that third-party developers can call, implement, or build as a {% glossarytooltip 9fceecbe-31be-4e49-aac7-11d155a85382 %}plug-in{% endglossarytooltip %}. Magento guarantees that this code will not change in subsequent releases without a major version change.

Public interfaces for a {% glossarytooltip c1e4242b-1f1a-44c3-9d72-1d5b1435e142 %}module{% endglossarytooltip %} are marked with @api annotation.

{: .bs-callout .bs-callout-info } Third-party developers should use only these interfaces, that is, interfaces with the @api annotation. You can use other interfaces but those may be modified or removed in subsequent Magento releases. For more information, see [Backward compatibility]({{ page.baseurl }}/contributor-guide/backward-compatible-development/).

What is an API? {#api-definition}

An application programming interface (API) is a set of interfaces and their implementations that a module provides to other modules.

API types {#api-types}

The following items are considered types of APIs:

  • Directory structure
  • Configuration files structure
  • Events
  • Client API
  • Provider {% glossarytooltip 786086f2-622b-4007-97fe-2c19e5283035 %}API{% endglossarytooltip %} (SPI)

Directory structure and configuration file structure are types of APIs because {% glossarytooltip 55774db9-bf9d-40f3-83db-b10cc5ae3b68 %}extension{% endglossarytooltip %} developers use them. Developers write configurations, and place their {% glossarytooltip 363662cb-73f1-4347-a15e-2d2adabeb0c2 %}static files{% endglossarytooltip %} in specified folders; so if the configuration file structure or directory structure changes in subsequent releases, modules and extensions may break.