Testing getting orders through API requests!

Orders =

Total =

If the [GET] request receives an error:

Access to XMLHttpRequest at 'site' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    To work around this problem, you can do one of three things:
  • You can install the Allow-Control-Allow-Origin for Chrome extension.

    The extension will add the necessary HTTP headers for CORS:

    Access-Control-Allow-Origin: *

    Access-Control-Allow-Methods: "GET, PUT, POST, DELETE, HEAD, OPTIONS"

    Access-Control-Expose-Headers: "you can add values here"

  • Or add the three lines below to your .htaccess file to enable CORS for this folder:

    Header set Access-Control-Allow-Origin "*"

    Header set Access-Control-Allow-Headers "Content-Type"

    Header set Access-Control-Allow-Methods "GET"

  • Or configure the server, of course if you have access.

    For example, to set Access-Control-Allow-Origin header in Apache, just add

    the following line inside either the Directory, Location, Files or VirtualHost sections:

    <IfModule mod_headers.c>

       Header set Access-Control-Allow-Origin "*"

    </IfModule>

    The above line will allow Apache to accept requests from all other domains.