> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Third party API proxy

POST https://api-b2b.bigcommerce.com/api/v2/io/proxy
Content-Type: application/json

Get response data of third party APIs through this API.

Reference: https://docs.bigcommerce.com/developer/docs/archive/b2b-edition/v2-api/proxy/create

## Authentication

- `authToken` header (required) — API Key authentication via header

## Request

### Headers

- `authToken` (string, required) — Auth token in header.

### Body (application/json)

This endpoint expects an object.

- `method` (string, required) — HTTP request method, get/post/put/delete
- `proxyType` (string, required) — Third party type or name, such as BigCommerce
- `url` (string, required) — Url of request
- `data` (string, optional) — Request data of your third party request
- `params` (string, optional) — Request parameters of your third party request

## Response

### 200

Response Success

- `code` (double, optional) — Response status code
- `message` (string, optional) — Response message

## Errors

### 500 Internal Server Error

Response Bad Request

- `code` (double, optional) — Response status error code
- `message` (string, optional) — Response error message

## Examples

**Request**

```json
{
  "method": "string",
  "proxyType": "string",
  "url": "string"
}
```

**Response**

```json
{
  "code": 200,
  "message": "Success"
}
```

**SDK Code**

```shell Shell

curl --location --request POST 'https://api-b2b.bigcommerce.com/api/v2/io/proxy'                         --header 'Content-Type: application/json'                         --data-raw '{
    "method": "get",
    "url": "/v2/customers",
    "proxyType": "Bigcommerce"
}'

```

```python Python

import requests

url = "https://api-b2b.bigcommerce.com/api/v2/io/proxy"

payload = "{"method": "get", "url": "/v2/customers","proxyType": "Bigcommerce"}"
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

```

```javascript JavaScript

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"method": "get", "url": "/v2/customers", "proxyType": "Bigcommerce"});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

```

```go Proxy_create_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/io/proxy"

	payload := strings.NewReader("{\n  \"method\": \"string\",\n  \"proxyType\": \"string\",\n  \"url\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("authToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Proxy_create_example
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v2/io/proxy")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"method\": \"string\",\n  \"proxyType\": \"string\",\n  \"url\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Proxy_create_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-b2b.bigcommerce.com/api/v2/io/proxy")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"method\": \"string\",\n  \"proxyType\": \"string\",\n  \"url\": \"string\"\n}")
  .asString();
```

```php Proxy_create_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v2/io/proxy', [
  'body' => '{
  "method": "string",
  "proxyType": "string",
  "url": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Proxy_create_example
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/io/proxy");
var request = new RestRequest(Method.POST);
request.AddHeader("authToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"method\": \"string\",\n  \"proxyType\": \"string\",\n  \"url\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Proxy_create_example
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "method": "string",
  "proxyType": "string",
  "url": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v2/io/proxy")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```