Skip to main content
POST
/
shipping
/
store-locations
Create store location
curl --request POST \
  --url https://api.bitbybit.studio/customer/api/open/v1/shipping/store-locations \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "locationName": "Main Warehouse — Jakarta",
  "phoneNumber": "+6281234567890",
  "country": "Indonesia",
  "countryCode": "ID",
  "province": "DKI Jakarta",
  "city": "Kota Jakarta Barat",
  "district": "Tambora",
  "districtId": 2412,
  "subDistrict": "Tanah Sereal",
  "subDistrictId": 33417,
  "zip": "11210",
  "address1": "Jl. KH. Moh. Mansyur No. 12",
  "latitude": -6.1539,
  "longitude": 106.8054,
  "mainAddress": true
}
'
import requests

url = "https://api.bitbybit.studio/customer/api/open/v1/shipping/store-locations"

payload = {
"locationName": "Main Warehouse — Jakarta",
"phoneNumber": "+6281234567890",
"country": "Indonesia",
"countryCode": "ID",
"province": "DKI Jakarta",
"city": "Kota Jakarta Barat",
"district": "Tambora",
"districtId": 2412,
"subDistrict": "Tanah Sereal",
"subDistrictId": 33417,
"zip": "11210",
"address1": "Jl. KH. Moh. Mansyur No. 12",
"latitude": -6.1539,
"longitude": 106.8054,
"mainAddress": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
locationName: 'Main Warehouse — Jakarta',
phoneNumber: '+6281234567890',
country: 'Indonesia',
countryCode: 'ID',
province: 'DKI Jakarta',
city: 'Kota Jakarta Barat',
district: 'Tambora',
districtId: 2412,
subDistrict: 'Tanah Sereal',
subDistrictId: 33417,
zip: '11210',
address1: 'Jl. KH. Moh. Mansyur No. 12',
latitude: -6.1539,
longitude: 106.8054,
mainAddress: true
})
};

fetch('https://api.bitbybit.studio/customer/api/open/v1/shipping/store-locations', 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.bitbybit.studio/customer/api/open/v1/shipping/store-locations",
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([
'locationName' => 'Main Warehouse — Jakarta',
'phoneNumber' => '+6281234567890',
'country' => 'Indonesia',
'countryCode' => 'ID',
'province' => 'DKI Jakarta',
'city' => 'Kota Jakarta Barat',
'district' => 'Tambora',
'districtId' => 2412,
'subDistrict' => 'Tanah Sereal',
'subDistrictId' => 33417,
'zip' => '11210',
'address1' => 'Jl. KH. Moh. Mansyur No. 12',
'latitude' => -6.1539,
'longitude' => 106.8054,
'mainAddress' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$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.bitbybit.studio/customer/api/open/v1/shipping/store-locations"

payload := strings.NewReader("{\n \"locationName\": \"Main Warehouse — Jakarta\",\n \"phoneNumber\": \"+6281234567890\",\n \"country\": \"Indonesia\",\n \"countryCode\": \"ID\",\n \"province\": \"DKI Jakarta\",\n \"city\": \"Kota Jakarta Barat\",\n \"district\": \"Tambora\",\n \"districtId\": 2412,\n \"subDistrict\": \"Tanah Sereal\",\n \"subDistrictId\": 33417,\n \"zip\": \"11210\",\n \"address1\": \"Jl. KH. Moh. Mansyur No. 12\",\n \"latitude\": -6.1539,\n \"longitude\": 106.8054,\n \"mainAddress\": true\n}")

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

req.Header.Add("x-api-key", "<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.bitbybit.studio/customer/api/open/v1/shipping/store-locations")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"locationName\": \"Main Warehouse — Jakarta\",\n \"phoneNumber\": \"+6281234567890\",\n \"country\": \"Indonesia\",\n \"countryCode\": \"ID\",\n \"province\": \"DKI Jakarta\",\n \"city\": \"Kota Jakarta Barat\",\n \"district\": \"Tambora\",\n \"districtId\": 2412,\n \"subDistrict\": \"Tanah Sereal\",\n \"subDistrictId\": 33417,\n \"zip\": \"11210\",\n \"address1\": \"Jl. KH. Moh. Mansyur No. 12\",\n \"latitude\": -6.1539,\n \"longitude\": 106.8054,\n \"mainAddress\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bitbybit.studio/customer/api/open/v1/shipping/store-locations")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"locationName\": \"Main Warehouse — Jakarta\",\n \"phoneNumber\": \"+6281234567890\",\n \"country\": \"Indonesia\",\n \"countryCode\": \"ID\",\n \"province\": \"DKI Jakarta\",\n \"city\": \"Kota Jakarta Barat\",\n \"district\": \"Tambora\",\n \"districtId\": 2412,\n \"subDistrict\": \"Tanah Sereal\",\n \"subDistrictId\": 33417,\n \"zip\": \"11210\",\n \"address1\": \"Jl. KH. Moh. Mansyur No. 12\",\n \"latitude\": -6.1539,\n \"longitude\": 106.8054,\n \"mainAddress\": true\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "locationName": "<string>",
    "phoneNumber": "<string>",
    "country": "<string>",
    "countryCode": "<string>",
    "province": "<string>",
    "provinceCode": "<string>",
    "city": "<string>",
    "district": "<string>",
    "districtId": 123,
    "subDistrict": "<string>",
    "subDistrictId": 123,
    "zip": "<string>",
    "address1": "<string>",
    "address2": "<string>",
    "latitude": 123,
    "longitude": 123,
    "mainAddress": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "origin.districtId is required for KiriminAja Express"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}

Authorizations

x-api-key
string
header
required

API key for authentication. Create one in Settings > Developer. The key must have the BITCRM product scope and an orders resource scope; required action depends on the endpoint (READ, WRITE, or DELETE).

Body

application/json
locationName
string
required
Maximum string length: 255
phoneNumber
string
country
string
countryCode
string
province
string
provinceCode
string
city
string
district
string
districtId
integer
subDistrict
string
subDistrictId
integer
zip
string
address1
string
address2
string
latitude
number<double>
longitude
number<double>
mainAddress
boolean

Response

Store location created.

data
object