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

# Set Billing Market

POST https://api.megaport.com/v2/market
Content-Type: application/json

Configures the billing market (and currency) and the billing contact details.

Provide values for these attributes in the Body of the call:

*   `currencyEnum` â€“ The billing currency for this market. The currencies vary for each billing market. In most markets, the US dollar (USD) is available as the secondary currency. For example, the Singapore billing market offers the option of billing in both Singapore dollars (SGD) and USD. Once you have chosen a currency, it cannot be changed. Currency values include USD, AUD, CAD, EUR, HKD, JPY, NZD, SGD, SEK, CHF, and GBP.
*   `language` - Two letter language code to indicate billing language, which is currently handled in English with a value of `en`.
*   Billing contact details â€“ The name, phone, email address, physical address, and country for the billing contact.
*   `yourPoNumber` â€“ An optional PO number for tracking. This number is optional and appears on all invoices related to its market.
*   `taxNumber` â€“ The tax or VAT registration number as required per region.
*   `firstPartyId` - ID for the billing market. This table shows the values.
    
    | Country | ID |
    | --- | --- |
    | US | 1558 |
    | AU | 808 |
    | AT | 20442 |
    | BE | 20449 |
    | BG | 4640 |
    | CA | 1652 |
    | CH | 8299 |
    | DE | 4515 |
    | DK | 20447 |
    | ES | 30369 |
    | FI | 20440 |
    | FR | 20451 |
    | HK | 819 |
    | IE | 2683 |
    | IT | 30367 |
    | JP | 20453 |
    | LU | 30423 |
    | NL | 2685 |
    | NO | 20438 |
    | NZ | 855 |
    | PL | 20444 |
    | SE | 2681 |
    | SG | 817 |
    | UK | 2675 |
    

#### Mexico Billing Market

These attributes are required for the Mexico billing market:

*   `companyTypeMexico` - The legal tax ID type of the taxpayer (company (Legal entity), individual (Legal person), or foreign company). A company or individual is the taxpayer registered with the Mexico Federal Taxpayer Registry. A foreign company is a business or individual not registered with the Mexican TAX Administration Service (SAT). Valid values for this field are `01: Legal Entity`, `02: legal person`, and `03: foreign company`.
*   `taxRegimeCodeMexico` - The Fiscal Regime code registered with the Mexican TAX Administration Service (SAT).
*   `satPurposeMexico` - Relates to the use of the electronic tax invoice (CFDI) that will be issued to the taxpayer receiving the invoice. Use this field to record the economic activity on the electronic invoice that will be reported to the Mexican TAX Administration Service (SAT).
*   `rfcMexico` - The Federal Taxpayer Registry number as issued by the Mexican Tax Administration Service (SAT). An RFC number is assigned to each taxpayer (Legal entity or person) that carries out economic activity in Mexico.
    

**Note:**

*   Valid values for `taxRegimeCodeMexico`, `satPurposeMexico`, and `rfcMexico` vary depending on the selected company type. For more information on all valid values, see the Company Billing Markets page in the Megaport Portal where these fields are displayed for the Mexico billing market.
    

For more information, see [Enabling Billing Markets](https://docs.megaport.com/finance/enabling-market/).

Reference: https://en.megaport.ferndocs.com/api-reference/account-setup/set-billing-market

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Body (application/json)

This endpoint expects an object.

- `address1` (string, optional)
- `address2` (any, optional, nullable)
- `billingContactEmail` (string, optional)
- `billingContactName` (string, optional)
- `billingContactPhone` (string, optional)
- `city` (string, optional)
- `country` (string, optional)
- `currencyEnum` (string, optional)
- `firstPartyId` (double, optional)
- `language` (string, optional)
- `postcode` (string, optional)
- `state` (string, optional)
- `taxNumber` (any, optional, nullable)
- `yourPoNumber` (any, optional, nullable)

## Response

### 201

Set Billing Market / Set Billing Market

- `data` (V2MarketPostResponsesContentApplicationJsonSchemaData, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Types

### V2MarketPostResponsesContentApplicationJsonSchemaData

- `supplyId` (double, optional)

## Examples

**Request**

```json
{
  "address1": "1 Test Street",
  "address2": null,
  "billingContactEmail": "market@megaport.com",
  "billingContactName": "Market Contact",
  "billingContactPhone": "+61 7 12341234",
  "city": "Somewhere",
  "country": "AU",
  "currencyEnum": "AUD",
  "firstPartyId": 808,
  "language": "en",
  "postcode": "4000",
  "state": "Anywhere",
  "taxNumber": null,
  "yourPoNumber": null
}
```

**Response**

```json
{
  "data": {
    "supplyId": 5987
  },
  "message": "Market Created",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python
import requests

url = "https://api.megaport.com/v2/market"

payload = {
    "address1": "1 Test Street",
    "address2": None,
    "billingContactEmail": "market@megaport.com",
    "billingContactName": "Market Contact",
    "billingContactPhone": "+61 7 12341234",
    "city": "Somewhere",
    "country": "AU",
    "currencyEnum": "AUD",
    "firstPartyId": 808,
    "language": "en",
    "postcode": "4000",
    "state": "Anywhere",
    "taxNumber": None,
    "yourPoNumber": None
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v2/market';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"address1":"1 Test Street","address2":null,"billingContactEmail":"market@megaport.com","billingContactName":"Market Contact","billingContactPhone":"+61 7 12341234","city":"Somewhere","country":"AU","currencyEnum":"AUD","firstPartyId":808,"language":"en","postcode":"4000","state":"Anywhere","taxNumber":null,"yourPoNumber":null}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.megaport.com/v2/market"

	payload := strings.NewReader("{\n  \"address1\": \"1 Test Street\",\n  \"address2\": null,\n  \"billingContactEmail\": \"market@megaport.com\",\n  \"billingContactName\": \"Market Contact\",\n  \"billingContactPhone\": \"+61 7 12341234\",\n  \"city\": \"Somewhere\",\n  \"country\": \"AU\",\n  \"currencyEnum\": \"AUD\",\n  \"firstPartyId\": 808,\n  \"language\": \"en\",\n  \"postcode\": \"4000\",\n  \"state\": \"Anywhere\",\n  \"taxNumber\": null,\n  \"yourPoNumber\": null\n}")

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

	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
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/market")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"address1\": \"1 Test Street\",\n  \"address2\": null,\n  \"billingContactEmail\": \"market@megaport.com\",\n  \"billingContactName\": \"Market Contact\",\n  \"billingContactPhone\": \"+61 7 12341234\",\n  \"city\": \"Somewhere\",\n  \"country\": \"AU\",\n  \"currencyEnum\": \"AUD\",\n  \"firstPartyId\": 808,\n  \"language\": \"en\",\n  \"postcode\": \"4000\",\n  \"state\": \"Anywhere\",\n  \"taxNumber\": null,\n  \"yourPoNumber\": null\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v2/market")
  .header("Content-Type", "application/json")
  .body("{\n  \"address1\": \"1 Test Street\",\n  \"address2\": null,\n  \"billingContactEmail\": \"market@megaport.com\",\n  \"billingContactName\": \"Market Contact\",\n  \"billingContactPhone\": \"+61 7 12341234\",\n  \"city\": \"Somewhere\",\n  \"country\": \"AU\",\n  \"currencyEnum\": \"AUD\",\n  \"firstPartyId\": 808,\n  \"language\": \"en\",\n  \"postcode\": \"4000\",\n  \"state\": \"Anywhere\",\n  \"taxNumber\": null,\n  \"yourPoNumber\": null\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v2/market', [
  'body' => '{
  "address1": "1 Test Street",
  "address2": null,
  "billingContactEmail": "market@megaport.com",
  "billingContactName": "Market Contact",
  "billingContactPhone": "+61 7 12341234",
  "city": "Somewhere",
  "country": "AU",
  "currencyEnum": "AUD",
  "firstPartyId": 808,
  "language": "en",
  "postcode": "4000",
  "state": "Anywhere",
  "taxNumber": null,
  "yourPoNumber": null
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/market");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"address1\": \"1 Test Street\",\n  \"address2\": null,\n  \"billingContactEmail\": \"market@megaport.com\",\n  \"billingContactName\": \"Market Contact\",\n  \"billingContactPhone\": \"+61 7 12341234\",\n  \"city\": \"Somewhere\",\n  \"country\": \"AU\",\n  \"currencyEnum\": \"AUD\",\n  \"firstPartyId\": 808,\n  \"language\": \"en\",\n  \"postcode\": \"4000\",\n  \"state\": \"Anywhere\",\n  \"taxNumber\": null,\n  \"yourPoNumber\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "address1": "1 Test Street",
  "address2": ,
  "billingContactEmail": "market@megaport.com",
  "billingContactName": "Market Contact",
  "billingContactPhone": "+61 7 12341234",
  "city": "Somewhere",
  "country": "AU",
  "currencyEnum": "AUD",
  "firstPartyId": 808,
  "language": "en",
  "postcode": "4000",
  "state": "Anywhere",
  "taxNumber": ,
  "yourPoNumber": 
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/market")! 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()
```