webapi.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
  10. <!-- Customer Group -->
  11. <route url="/V1/customerGroups/:id" method="GET">
  12. <service class="Magento\Customer\Api\GroupRepositoryInterface" method="getById"/>
  13. <resources>
  14. <resource ref="Magento_Customer::group"/>
  15. </resources>
  16. </route>
  17. <route url="/V1/customerGroups/default/:storeId" method="GET">
  18. <service class="Magento\Customer\Api\GroupManagementInterface" method="getDefaultGroup"/>
  19. <resources>
  20. <resource ref="Magento_Customer::group"/>
  21. </resources>
  22. </route>
  23. <route url="/V1/customerGroups/default" method="GET">
  24. <service class="Magento\Customer\Api\GroupManagementInterface" method="getDefaultGroup"/>
  25. <resources>
  26. <resource ref="Magento_Customer::group"/>
  27. </resources>
  28. </route>
  29. <route url="/V1/customerGroups/default/:id" method="PUT">
  30. <service class="Magento\Customer\Api\CustomerGroupConfigInterface" method="setDefaultCustomerGroup"/>
  31. <resources>
  32. <resource ref="Magento_Customer::group"/>
  33. </resources>
  34. </route>
  35. <route url="/V1/customerGroups/:id/permissions" method="GET">
  36. <service class="Magento\Customer\Api\GroupManagementInterface" method="isReadonly"/>
  37. <resources>
  38. <resource ref="Magento_Customer::group"/>
  39. </resources>
  40. </route>
  41. <route url="/V1/customerGroups/search" method="GET">
  42. <service class="Magento\Customer\Api\GroupRepositoryInterface" method="getList"/>
  43. <resources>
  44. <resource ref="Magento_Customer::group"/>
  45. </resources>
  46. </route>
  47. <route url="/V1/customerGroups" method="POST">
  48. <service class="Magento\Customer\Api\GroupRepositoryInterface" method="save"/>
  49. <resources>
  50. <resource ref="Magento_Customer::group"/>
  51. </resources>
  52. </route>
  53. <route url="/V1/customerGroups/:id" method="PUT">
  54. <service class="Magento\Customer\Api\GroupRepositoryInterface" method="save"/>
  55. <resources>
  56. <resource ref="Magento_Customer::group"/>
  57. </resources>
  58. </route>
  59. <route url="/V1/customerGroups/:id" method="DELETE">
  60. <service class="Magento\Customer\Api\GroupRepositoryInterface" method="deleteById"/>
  61. <resources>
  62. <resource ref="Magento_Customer::group"/>
  63. </resources>
  64. </route>
  65. <!-- Customer Metadata -->
  66. <route url="/V1/attributeMetadata/customer/attribute/:attributeCode" method="GET">
  67. <service class="Magento\Customer\Api\CustomerMetadataInterface" method="getAttributeMetadata"/>
  68. <resources>
  69. <resource ref="Magento_Customer::customer"/>
  70. </resources>
  71. </route>
  72. <route url="/V1/attributeMetadata/customer/form/:formCode" method="GET">
  73. <service class="Magento\Customer\Api\CustomerMetadataInterface" method="getAttributes"/>
  74. <resources>
  75. <resource ref="Magento_Customer::customer"/>
  76. </resources>
  77. </route>
  78. <route url="/V1/attributeMetadata/customer" method="GET">
  79. <service class="Magento\Customer\Api\CustomerMetadataInterface" method="getAllAttributesMetadata"/>
  80. <resources>
  81. <resource ref="Magento_Customer::customer"/>
  82. </resources>
  83. </route>
  84. <route url="/V1/attributeMetadata/customer/custom" method="GET">
  85. <service class="Magento\Customer\Api\CustomerMetadataInterface" method="getCustomAttributesMetadata"/>
  86. <resources>
  87. <resource ref="Magento_Customer::customer"/>
  88. </resources>
  89. </route>
  90. <!-- Customer Address Metadata -->
  91. <route url="/V1/attributeMetadata/customerAddress/attribute/:attributeCode" method="GET">
  92. <service class="Magento\Customer\Api\AddressMetadataInterface" method="getAttributeMetadata"/>
  93. <resources>
  94. <resource ref="Magento_Customer::customer"/>
  95. </resources>
  96. </route>
  97. <route url="/V1/attributeMetadata/customerAddress/form/:formCode" method="GET">
  98. <service class="Magento\Customer\Api\AddressMetadataInterface" method="getAttributes"/>
  99. <resources>
  100. <resource ref="Magento_Customer::customer"/>
  101. </resources>
  102. </route>
  103. <route url="/V1/attributeMetadata/customerAddress" method="GET">
  104. <service class="Magento\Customer\Api\AddressMetadataInterface" method="getAllAttributesMetadata"/>
  105. <resources>
  106. <resource ref="Magento_Customer::customer"/>
  107. </resources>
  108. </route>
  109. <route url="/V1/attributeMetadata/customerAddress/custom" method="GET">
  110. <service class="Magento\Customer\Api\AddressMetadataInterface" method="getCustomAttributesMetadata"/>
  111. <resources>
  112. <resource ref="Magento_Customer::customer"/>
  113. </resources>
  114. </route>
  115. <!-- Customer Account -->
  116. <route url="/V1/customers/:customerId" method="GET">
  117. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getById"/>
  118. <resources>
  119. <resource ref="Magento_Customer::customer"/>
  120. </resources>
  121. </route>
  122. <route url="/V1/customers" method="POST">
  123. <service class="Magento\Customer\Api\AccountManagementInterface" method="createAccount"/>
  124. <resources>
  125. <resource ref="anonymous"/>
  126. </resources>
  127. </route>
  128. <route url="/V1/customers/:customerId" method="PUT">
  129. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="save"/>
  130. <resources>
  131. <resource ref="Magento_Customer::manage"/>
  132. </resources>
  133. </route>
  134. <route url="/V1/customers/me" method="PUT">
  135. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="save"/>
  136. <resources>
  137. <resource ref="self"/>
  138. </resources>
  139. <data>
  140. <parameter name="customer.id" force="true">%customer_id%</parameter>
  141. </data>
  142. </route>
  143. <route url="/V1/customers/me" method="GET">
  144. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getById"/>
  145. <resources>
  146. <resource ref="self"/>
  147. </resources>
  148. <data>
  149. <parameter name="customerId" force="true">%customer_id%</parameter>
  150. </data>
  151. </route>
  152. <route url="/V1/customers/me/activate" method="PUT">
  153. <service class="Magento\Customer\Api\AccountManagementInterface" method="activateById"/>
  154. <resources>
  155. <resource ref="self"/>
  156. </resources>
  157. <data>
  158. <parameter name="customerId" force="true">%customer_id%</parameter>
  159. </data>
  160. </route>
  161. <route url="/V1/customers/search" method="GET">
  162. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getList"/>
  163. <resources>
  164. <resource ref="Magento_Customer::customer"/>
  165. </resources>
  166. </route>
  167. <route url="/V1/customers/:email/activate" method="PUT">
  168. <service class="Magento\Customer\Api\AccountManagementInterface" method="activate"/>
  169. <resources>
  170. <resource ref="Magento_Customer::manage"/>
  171. </resources>
  172. </route>
  173. <route url="/V1/customers/me/password" method="PUT">
  174. <service class="Magento\Customer\Api\AccountManagementInterface" method="changePasswordById"/>
  175. <resources>
  176. <resource ref="self"/>
  177. </resources>
  178. <data>
  179. <parameter name="customerId" force="true">%customer_id%</parameter>
  180. </data>
  181. </route>
  182. <route url="/V1/customers/:customerId/password/resetLinkToken/:resetPasswordLinkToken" method="GET">
  183. <service class="Magento\Customer\Api\AccountManagementInterface" method="validateResetPasswordLinkToken"/>
  184. <resources>
  185. <resource ref="anonymous"/>
  186. </resources>
  187. </route>
  188. <route url="/V1/customers/password" method="PUT">
  189. <service class="Magento\Customer\Api\AccountManagementInterface" method="initiatePasswordReset"/>
  190. <resources>
  191. <resource ref="anonymous"/>
  192. </resources>
  193. </route>
  194. <route url="/V1/customers/resetPassword" method="POST">
  195. <service class="Magento\Customer\Api\AccountManagementInterface" method="resetPassword"/>
  196. <resources>
  197. <resource ref="anonymous"/>
  198. </resources>
  199. </route>
  200. <route url="/V1/customers/:customerId/confirm" method="GET">
  201. <service class="Magento\Customer\Api\AccountManagementInterface" method="getConfirmationStatus"/>
  202. <resources>
  203. <resource ref="Magento_Customer::manage"/>
  204. </resources>
  205. </route>
  206. <route url="/V1/customers/confirm" method="POST">
  207. <service class="Magento\Customer\Api\AccountManagementInterface" method="resendConfirmation"/>
  208. <resources>
  209. <resource ref="Magento_Customer::manage"/>
  210. </resources>
  211. </route>
  212. <route url="/V1/customers/validate" method="PUT">
  213. <service class="Magento\Customer\Api\AccountManagementInterface" method="validate"/>
  214. <resources>
  215. <resource ref="Magento_Customer::manage"/>
  216. </resources>
  217. </route>
  218. <route url="/V1/customers/:customerId/permissions/readonly" method="GET">
  219. <service class="Magento\Customer\Api\AccountManagementInterface" method="isReadonly"/>
  220. <resources>
  221. <resource ref="Magento_Customer::customer"/>
  222. </resources>
  223. </route>
  224. <route url="/V1/customers/:customerId" method="DELETE">
  225. <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="deleteById"/>
  226. <resources>
  227. <resource ref="Magento_Customer::manage"/>
  228. </resources>
  229. </route>
  230. <route url="/V1/customers/isEmailAvailable" method="POST">
  231. <service class="Magento\Customer\Api\AccountManagementInterface" method="isEmailAvailable"/>
  232. <resources>
  233. <resource ref="anonymous"/>
  234. </resources>
  235. </route>
  236. <!-- Customer Addresses -->
  237. <route url="/V1/customers/addresses/:addressId" method="GET">
  238. <service class="Magento\Customer\Api\AddressRepositoryInterface" method="getById"/>
  239. <resources>
  240. <resource ref="Magento_Customer::manage"/>
  241. </resources>
  242. </route>
  243. <route url="/V1/customers/me/billingAddress" method="GET">
  244. <service class="Magento\Customer\Api\AccountManagementInterface" method="getDefaultBillingAddress"/>
  245. <resources>
  246. <resource ref="self"/>
  247. </resources>
  248. <data>
  249. <parameter name="customerId" force="true">%customer_id%</parameter>
  250. </data>
  251. </route>
  252. <route url="/V1/customers/:customerId/billingAddress" method="GET">
  253. <service class="Magento\Customer\Api\AccountManagementInterface" method="getDefaultBillingAddress"/>
  254. <resources>
  255. <resource ref="Magento_Customer::manage"/>
  256. </resources>
  257. </route>
  258. <route url="/V1/customers/me/shippingAddress" method="GET">
  259. <service class="Magento\Customer\Api\AccountManagementInterface" method="getDefaultShippingAddress"/>
  260. <resources>
  261. <resource ref="self"/>
  262. </resources>
  263. <data>
  264. <parameter name="customerId" force="true">%customer_id%</parameter>
  265. </data>
  266. </route>
  267. <route url="/V1/customers/:customerId/shippingAddress" method="GET">
  268. <service class="Magento\Customer\Api\AccountManagementInterface" method="getDefaultShippingAddress"/>
  269. <resources>
  270. <resource ref="Magento_Customer::manage"/>
  271. </resources>
  272. </route>
  273. <route url="/V1/addresses/:addressId" method="DELETE">
  274. <service class="Magento\Customer\Api\AddressRepositoryInterface" method="deleteById"/>
  275. <resources>
  276. <resource ref="Magento_Customer::manage"/>
  277. </resources>
  278. </route>
  279. </routes>