{"id":1123,"date":"2019-11-27T11:24:58","date_gmt":"2019-11-27T18:24:58","guid":{"rendered":"https:\/\/help.foosales.com\/docs\/frequently-asked-questions\/errors\/why-do-i-get-a-network-error-when-submitting-an-order\/"},"modified":"2026-07-27T13:42:43","modified_gmt":"2026-07-27T19:42:43","slug":"porque-e-que-recebo-um-erro-de-rede-quando-submeto-uma-encomenda","status":"publish","type":"docs","link":"https:\/\/help.foosales.com\/pt\/docs\/frequently-asked-questions\/errors\/why-do-i-get-a-network-error-when-submitting-an-order\/","title":{"rendered":"Porque \u00e9 que recebo um erro de rede quando submeto uma encomenda?"},"content":{"rendered":"<p>Se \u00e9 <strong>capaz de se ligar<\/strong> para a sua loja, mas recebe um <strong>erro de rede<\/strong> quando <strong>apresenta\u00e7\u00e3o de uma encomenda<\/strong>Se o pedido n\u00e3o for enviado, pode haver uma configura\u00e7\u00e3o do servidor que impe\u00e7a o envio do pedido ou, eventualmente, algum outro erro que tenha ocorrido no seu back-end WordPress.<\/p>\n<p>Para verificar se houve um erro no WordPress que causou a falha da liga\u00e7\u00e3o, pode abrir o painel de administra\u00e7\u00e3o do WordPress e navegar para <strong>WooCommerce <\/strong>-&gt;<strong> Estado <\/strong>-&gt;<strong> Registos<\/strong> e ver as \u00faltimas <strong>registo de erros fatais<\/strong> seleccionando-o no menu pendente. Aqui deve poder ver se existem erros relacionados com o FooSales ou possivelmente um conflito com outro plugin. Se n\u00e3o houver erros ou nada que pare\u00e7a estar relacionado com o FooSales, ent\u00e3o pode haver uma configura\u00e7\u00e3o do servidor a impedir o envio do pedido.<\/p>\n<p>If you are not using web app that is bundled with the FooSales plugin on your own site and are using the hosted web app at <em>https:\/\/web.foosales.com<\/em>, FooSales will to your store from a domain that is different from your domain. Requests between different domains are known as <strong>pedidos de partilha de recursos entre origens (CORS)<\/strong>. O seu servidor ter\u00e1 de permitir especificamente estes tipos de pedidos. Normalmente, os servidores j\u00e1 est\u00e3o configurados para aceitar estes pedidos e devolver a resposta com os cabe\u00e7alhos adequados, mas alguns servidores podem estar configurados para os bloquear. O seu browser ir\u00e1 <strong>impedir o pedido<\/strong> de ser completada se a resposta n\u00e3o tiver o <strong>cabe\u00e7alhos necess\u00e1rios<\/strong>.<\/p>\n<p>O seu servidor precisa de devolver um <strong>Cabe\u00e7alho Access-Control-Allow-Origin<\/strong> que permite ao FooSales publicar dados na sua loja. Pode tentar adicionar o seguinte c\u00f3digo ao tema do seu WordPress <strong>functions.php<\/strong> para ver se faz alguma diferen\u00e7a:<\/p>\n<pre>fun\u00e7\u00e3o add_foosales_cors_http_header(){\r\n    header(\"Access-Control-Allow-Origin: https:\/\/web.foosales.com\");\r\n}\r\nadd_action('init','add_foosales_cors_http_header');<\/pre>\n<p>Pode tentar utilizar\u00a0<strong>https:\/\/web.foosales.com<\/strong> ou simplesmente <strong>*<\/strong> (um asterisco que permite qualquer origem) como valor de origem.<\/p>\n<p>Se o c\u00f3digo acima n\u00e3o funcionar, deve conseguir ver se este cabe\u00e7alho est\u00e1 ou n\u00e3o ativado e qual \u00e9 o seu valor se tiver acesso \u00e0 configura\u00e7\u00e3o do seu servidor. Tamb\u00e9m pode contactar o seu <strong>administrador do servidor<\/strong> ou <strong>alojamento web<\/strong> para perguntar sobre a autoriza\u00e7\u00e3o <strong>pedidos de API REST entre dom\u00ednios<\/strong> para o FooSales. Alguns browsers tamb\u00e9m t\u00eam defini\u00e7\u00f5es que podem ser ajustadas para permitir estes pedidos para o FooSales. Em alternativa, pode utilizar um <strong>servidor proxy<\/strong> que garante que todos os cabe\u00e7alhos correctos s\u00e3o definidos e devolvidos entre o seu site e o FooSales.<\/p>\n<p>We recommend using the web app that is bundled with the plugin by launching the POS directly from your WordPress admin dashboard. Authentication is handled automatically and and server requests will be made from the same domain, therefore eliminating any CORS issues.<\/p>","protected":false},"featured_media":0,"parent":485,"menu_order":5,"comment_status":"open","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_is_vendor_doc":"0","footnotes":""},"doc_tag":[98,101,102,103,104,105,106,107,108,109,110,21,16],"class_list":["post-1123","docs","type-docs","status-publish","hentry","doc_tag-api","doc_tag-blocked","doc_tag-cors","doc_tag-cross-origin","doc_tag-headers","doc_tag-network-error","doc_tag-permission","doc_tag-post","doc_tag-proxy","doc_tag-request","doc_tag-rest","doc_tag-rest-api","doc_tag-web-app"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/1123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/comments?post=1123"}],"version-history":[{"count":2,"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/1123\/revisions"}],"predecessor-version":[{"id":56510,"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/1123\/revisions\/56510"}],"up":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/485"}],"next":[{"title":"Porque \u00e9 que a aplica\u00e7\u00e3o falha?","link":"https:\/\/help.foosales.com\/pt\/docs\/frequently-asked-questions\/errors\/why-does-the-app-crash\/","href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/54724"}],"prev":[{"title":"Porque \u00e9 que recebo um erro de rede quando tento ligar-me \u00e0 minha loja?","link":"https:\/\/help.foosales.com\/pt\/docs\/frequently-asked-questions\/errors\/why-do-i-get-a-network-error-when-trying-to-connect-to-my-store\/","href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/docs\/54395"}],"wp:attachment":[{"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/media?parent=1123"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.foosales.com\/pt\/wp-json\/wp\/v2\/doc_tag?post=1123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}