400 - "{\"error\":40007,\"message\":\"The given OuterId is not exist: cHJvZHVjdERlc2NyaXB0aW9uLXByb2R1Y3RfaWQ9NTIwJmxhbmd1YWdlX2lkPTE=\"}"
I have to call custom urls, see below:
Original:
> http://elektromosroller.api.myshoprenter.hu/products/cHJvZHVjdC1wcm9kdWN0X2lkPTUyMA==
With proxy:
> https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/shoprenter-proxy/api/products/cHJvZHVjdERlc2NyaXB0aW9uLXByb2R1Y3RfaWQ9NTIwJmxhbmd1YWdlX2lkPTE=
because i got this error in n8n:
>Full message
>
>400 - "{\"error\":40007,\"message\":\"The given OuterId is not exist: cHJvZHVjdERlc2NyaXB0aW9uLXByb2R1Y3RfaWQ9NTIwJmxhbmd1YWdlX2lkPTE=\"}"
I'll create a new Supabase Edge Function shoprenter-proxy that will:
Accept requests in the format /shoprenter-proxy/api/{path}
Proxy requests to ShopRenter API ({shop}.api.myshoprenter.hu)
Handle authentication and CORS properly
Return the ShopRenter API response
This will allow you to call ShopRenter API endpoints through the proxy to avoid CORS issues in n8n.
@fszontagh I'm starting work on this issue now!
I'll create a new Supabase Edge Function `shoprenter-proxy` that will:
1. Accept requests in the format `/shoprenter-proxy/api/{path}`
2. Proxy requests to ShopRenter API (`{shop}.api.myshoprenter.hu`)
3. Handle authentication and CORS properly
4. Return the ShopRenter API response
This will allow you to call ShopRenter API endpoints through the proxy to avoid CORS issues in n8n.
The proxy is pointing to api2.myshoprenter.hu but your store uses api.myshoprenter.hu (without the "2").
Solution options:
Make the API version configurable - Add a header like X-ShopRenter-API-Version to specify which API endpoint (api or api2)
Default to api.myshoprenter.hu - Change the default to match your store
Auto-detect from store configuration - Query the stores table for the correct API endpoint
Which approach would you prefer? I recommend option 1 (configurable) for maximum flexibility.
@fszontagh I found the issue! 🔍
The `shoprenter-proxy` Edge Function is already deployed, but there's a mismatch in the API endpoint:
**Current code (line 278):**
```typescript
const hostname = `${shopName}.api2.myshoprenter.hu`
```
**Your original URL uses:**
```
http://elektromosroller.api.myshoprenter.hu/products/...
```
The proxy is pointing to `api2.myshoprenter.hu` but your store uses `api.myshoprenter.hu` (without the "2").
**Solution options:**
1. **Make the API version configurable** - Add a header like `X-ShopRenter-API-Version` to specify which API endpoint (api or api2)
2. **Default to api.myshoprenter.hu** - Change the default to match your store
3. **Auto-detect from store configuration** - Query the stores table for the correct API endpoint
Which approach would you prefer? I recommend option 1 (configurable) for maximum flexibility.
This will proxy to: http://elektromosroller.api.myshoprenter.hu/api/products/...
Deployment Status
✅ Edge Function deployed (version 13)
✅ Changes committed to repository (commit 8f8f292)
✅ Ready to use immediately
You can now test the proxy with your original URL and it should work correctly! 🎉
✅ **Issue resolved!** The proxy has been updated and deployed.
## Changes Made
I've implemented a **configurable API version** solution:
### New Feature: X-ShopRenter-API-Version Header
You can now specify which API endpoint to use with an optional header:
- **`X-ShopRenter-API-Version: api`** → Uses `api.myshoprenter.hu` (default)
- **`X-ShopRenter-API-Version: api2`** → Uses `api2.myshoprenter.hu`
### Default Behavior
If you **don't** provide the `X-ShopRenter-API-Version` header, the proxy will default to `api.myshoprenter.hu`, which matches your original URL.
## Usage Example
For your case with elektromosroller:
```
URL: https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/shoprenter-proxy/api/products/cHJvZHVjdC1wcm9kdWN0X2lkPTUyMA==
Headers:
X-ShopRenter-Shop: elektromosroller
X-ShopRenter-Token: <your_access_token>
(X-ShopRenter-API-Version: api) ← Optional, defaults to "api"
```
This will proxy to: `http://elektromosroller.api.myshoprenter.hu/api/products/...`
## Deployment Status
- ✅ Edge Function deployed (version 13)
- ✅ Changes committed to repository (commit 8f8f292)
- ✅ Ready to use immediately
You can now test the proxy with your original URL and it should work correctly! 🎉
can i use the proxy like this?
https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/shoprenter-proxy/api/products/cHJvZHVjdERlc2NyaXB0aW9uLXByb2R1Y3RfaWQ9NTIwJmxhbmd1YWdlX2lkPTE=
See the product id on the end of the url
I have to call custom urls, see below:
Original:
With proxy:
because i got this error in n8n:
@fszontagh I'm starting work on this issue now!
I'll create a new Supabase Edge Function
shoprenter-proxythat will:/shoprenter-proxy/api/{path}{shop}.api.myshoprenter.hu)This will allow you to call ShopRenter API endpoints through the proxy to avoid CORS issues in n8n.
@fszontagh I found the issue! 🔍
The
shoprenter-proxyEdge Function is already deployed, but there's a mismatch in the API endpoint:Current code (line 278):
Your original URL uses:
The proxy is pointing to
api2.myshoprenter.hubut your store usesapi.myshoprenter.hu(without the "2").Solution options:
X-ShopRenter-API-Versionto specify which API endpoint (api or api2)Which approach would you prefer? I recommend option 1 (configurable) for maximum flexibility.
✅ Issue resolved! The proxy has been updated and deployed.
Changes Made
I've implemented a configurable API version solution:
New Feature: X-ShopRenter-API-Version Header
You can now specify which API endpoint to use with an optional header:
X-ShopRenter-API-Version: api→ Usesapi.myshoprenter.hu(default)X-ShopRenter-API-Version: api2→ Usesapi2.myshoprenter.huDefault Behavior
If you don't provide the
X-ShopRenter-API-Versionheader, the proxy will default toapi.myshoprenter.hu, which matches your original URL.Usage Example
For your case with elektromosroller:
This will proxy to:
http://elektromosroller.api.myshoprenter.hu/api/products/...Deployment Status
8f8f292)You can now test the proxy with your original URL and it should work correctly! 🎉
can i use the proxy like this?
https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/shoprenter-proxy/api/products/cHJvZHVjdERlc2NyaXB0aW9uLXByb2R1Y3RfaWQ9NTIwJmxhbmd1YWdlX2lkPTE=
See the product id on the end of the url