shopwedo-api
v1.0.0
Published
This is an npm package to use the ShopWeDo client.
Downloads
5
Readme
��#� �s�h�o�p�w�e�d�o�-�a�p�i�
�
�
�
�#�#� �T�h�i�s� �i�s� �a�n� �n�p�m� �p�a�c�k�a�g�e� �t�o� �u�s�e� �t�h�e� �S�h�o�p�W�e�D�o� �a�p�i�.�
�
�
�
�H�o�w� �t�o� �i�n�s�t�a�l�l�:�
�
�
�
��
��
�
�n�p�m� �i�n�s�t�a�l�l� �s�h�o�p�w�e�d�o�-�a�p�i�
�
�
��
�
�
�
�
�T�o� �m�a�k�e� �a� �g�e�t� �r�e�q�u�e�s�t�:�
�
�
�
��
��
�
�c�o�n�s�t� �S�h�o�p�W�e�D�o�A�p�i� �=� �r�e�q�u�i�r�e�(�'�s�h�o�p�w�e�d�o�-�a�p�i�'�)�;�
�
�
�
�c�o�n�s�t� �s�h�o�p�W�e�D�o�A�p�i� �=� �n�e�w� �S�h�o�p�W�e�D�o�A�p�i�(�s�h�o�p�I�d�,� �s�h�o�p�K�e�y�)�;�
�
�
�
�/�/� �p�a�r�a�m�1�:� �S�t�r�i�n�g� �o�f� �e�n�d�p�o�i�n�t� �(�s�h�o�p�w�e�d�o�-�a�p�i�-�u�r�l�/�e�n�d�p�o�i�n�t�)�
�
�/�/� �p�a�r�a�m�2�:� �c�a�l�l�b�a�c�k� �f�u�n�c�t�i�o�n�
�
�s�h�o�p�W�e�D�o�A�p�i�.�g�e�t�(�'�e�n�d�p�o�i�n�t�'�,� �(�e�r�r�o�r�,� �b�o�d�y�)� �=�>� �{�
�
� � � � �i�f�(�e�r�r�o�r�)� �c�o�n�s�o�l�e�.�l�o�g�(�"�T�h�e�r�e� �i�s� �a�n� �e�r�r�o�r�.�"�)�;�
�
� � � � �e�l�s�e� �c�o�n�s�o�l�e�.�l�o�g�(�"�S�u�c�c�e�s�s�f�u�l� �r�e�q�u�e�s�t�.�"�)�;�
�
�}�)�;�
�
�
��
�
�
�
�
�T�o� �m�a�k�e� �a� �p�o�s�t� �r�e�q�u�e�s�t�:�
�
�
�
��
��
�
�c�o�n�s�t� �S�h�o�p�W�e�D�o�A�p�i� �=� �r�e�q�u�i�r�e�(�'�s�h�o�p�w�e�d�o�-�a�p�i�'�)�;�
�
�
�
�c�o�n�s�t� �s�h�o�p�W�e�D�o�A�p�i� �=� �n�e�w� �S�h�o�p�W�e�D�o�A�p�i�(�s�h�o�p�I�d�,� �s�h�o�p�K�e�y�)�;�
�
�
�
�c�o�n�s�t� �d�a�t�a� �=� �'�{�'�s�o�m�e�'�:� �d�a�t�a�}�'�;�
�
�
�
�/�/� �p�a�r�a�m�1�:� �S�t�r�i�n�g� �o�f� �e�n�d�p�o�i�n�t� �(�s�h�o�p�w�e�d�o�-�a�p�i�-�u�r�l�/�e�n�d�p�o�i�n�t�)�
�
�/�/� �p�a�r�a�m�2�:� �J�S�O�N� �a�s� �a� �s�t�r�i�n�g� �f�o�r� �b�o�d�y� �o�f� �P�O�S�T� �r�e�q�u�e�s�t�
�
�/�/� �p�a�r�a�m�3�:� �c�a�l�l�b�a�c�k� �f�u�n�c�t�i�o�n�
�
�s�h�o�p�W�e�D�o�A�p�i�.�p�o�s�t�(�'�e�n�d�p�o�i�n�t�'�,� �d�a�t�a�,� �(�e�r�r�o�r�,� �b�o�d�y�)� �=�>� �{�
�
� � � � �i�f�(�e�r�r�o�r�)� �c�o�n�s�o�l�e�.�l�o�g�(�"�T�h�e�r�e� �i�s� �a�n� �e�r�r�o�r�.�"�)�;�
�
� � � � �e�l�s�e� �c�o�n�s�o�l�e�.�l�o�g�(�"�S�u�c�c�e�s�s�f�u�l� �r�e�q�u�e�s�t�.�"�)�;�
�
�}�)�;�
�
�
��
�
�
�