Skip to main content
POST
/
accounts
/
customers
/
{customerId}
/
addresses
Add an address to a customer
curl --request POST \
  --url https://api-sb.meld.io/accounts/customers/{customerId}/addresses \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "BILLING"
}
'
import requests

url = "https://api-sb.meld.io/accounts/customers/{customerId}/addresses"

payload = { "type": "BILLING" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'BILLING'})
};

fetch('https://api-sb.meld.io/accounts/customers/{customerId}/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sb.meld.io/accounts/customers/{customerId}/addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'BILLING'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api-sb.meld.io/accounts/customers/{customerId}/addresses"

payload := strings.NewReader("{\n \"type\": \"BILLING\"\n}")

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

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-sb.meld.io/accounts/customers/{customerId}/addresses")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"BILLING\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-sb.meld.io/accounts/customers/{customerId}/addresses")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"BILLING\"\n}"

response = http.request(request)
puts response.read_body
{
  "addressDetails": {
    "city": "<string>",
    "country": "<string>",
    "lineOne": "<string>",
    "lineTwo": "<string>",
    "postalCode": "<string>",
    "region": "<string>"
  },
  "customerId": "<string>",
  "id": "<string>"
}

Authorizations

Authorization
string
header
default:BASIC <Meld API Key>
required

Path Parameters

customerId
string
required

Customer id

Body

application/json
address
object
required

Address details

type
enum<string>
required

Address type

Available options:
BILLING,
SHIPPING,
RESIDENCE

Response

Address is created

Customer address

addressDetails
object

Address details.

customerId
string

Customer id

id
string

Unique identifier for this customer address

status
enum<string>

Address status

Available options:
ACTIVE,
INACTIVE
type
enum<string>

Address type

Available options:
BILLING,
SHIPPING,
RESIDENCE