Biklo for developersTESTsandbox-api.biklo.comchange

Create a pickup point

POST/v1/company/pickup-points

scope company.write

Address rules apply exactly as they do for a delivery: the street must contain a number, the postal code must fit the country and county, and the country must be one you sell into. Get city_id from GET /v1/geo/cities. The first point you create becomes the default.

Request body#

FieldTypeRequiredDescription
labelstringrequiredYour name for this location, shown when you pick where an order ships from.
country_codestringrequiredISO-2. Must be a country you sell into (country_not_found / country_not_supported).
city_idintegerrequiredFrom GET /v1/geo/cities. An id we do not know gives city_not_found. Free-text city names are not accepted — the courier needs our id.
streetstringrequiredStreet and number. Validated in the same format the checkout enforces, so an address that would fail there fails here instead of at the moment a courier is booked.
postal_codestringrequiredChecked against the format for that country and county. Note this is a FORMAT check, not a lookup against a list of real codes — a well-formed code that does not exist is accepted here and will be caught by the courier.
contact_phonestringrequiredWho the courier calls at this address. Include the country prefix.
contact_emailstringrequiredMust be a valid address. All seven fields are required on CREATE; on update send only what changes.

Example

{
    "label": "Barcelona warehouse",
    "country_code": "ES",
    "city_id": 665904,
    "street": "Carrer Gran 42",
    "postal_code": "08001",
    "contact_phone": "+34600000000",
    "contact_email": "[email protected]"
}

Response#

FieldTypeDescription
idintegerThe pickup point id.
labelstringYour name for it.
typestring|nullWhat kind of location it is.
addressobjectWhere it is. This is a real collection address a courier will drive to.
address.streetstring|nullStreet and number.
address.citystring|nullCity name, as the courier holds it.
address.countystring|nullCounty name.
address.postal_codestring|nullPostal code.
address.country_codestring|nullISO-2.
contactobjectWho the courier calls here.
contact.phonestring|nullPhone.
contact.emailstring|nullEmail.
is_defaultbooleanWhether orders collect from here unless told otherwise.
is_activebooleanWhether it can currently be used.

Example

{
    "id": 11,
    "label": "Barcelona warehouse",
    "type": "warehouse",
    "address": {
        "street": "Carrer Gran 42",
        "city": "Barcelona",
        "county": "Barcelona",
        "postal_code": "08001",
        "country_code": "ES"
    },
    "contact": {
        "phone": "+34600000000",
        "email": "[email protected]"
    },
    "is_default": true,
    "is_active": true
}

Failures use the shared error envelope — a machine-readable code and a request_id to quote to support. Error handling.

curl -X POST "https://sandbox-api.biklo.com/v1/company/pickup-points" \
  -H "Authorization: Bearer bk_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Barcelona warehouse",
    "country_code": "ES",
    "city_id": 665904,
    "street": "Carrer Gran 42",
    "postal_code": "08001",
    "contact_phone": "+34600000000",
    "contact_email": "[email protected]"
}'
<?php

$ch = curl_init('https://sandbox-api.biklo.com/v1/company/pickup-points');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
      'label' => 'Barcelona warehouse',
      'country_code' => 'ES',
      'city_id' => 665904,
      'street' => 'Carrer Gran 42',
      'postal_code' => '08001',
      'contact_phone' => '+34600000000',
      'contact_email' => '[email protected]',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "bk_test_YOUR_KEY");

var request = new HttpRequestMessage(
    new HttpMethod("POST"),
    "https://sandbox-api.biklo.com/v1/company/pickup-points");

request.Content = new StringContent(
    @"{ ""label"": ""Barcelona warehouse"", ""country_code"": ""ES"", ""city_id"": 665904, ""street"": ""Carrer Gran 42"", ""postal_code"": ""08001"", ""contact_phone"": ""+34600000000"", ""contact_email"": ""[email protected]"" }",
    System.Text.Encoding.UTF8,
    "application/json");

var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
import requests

response = requests.post(
    "https://sandbox-api.biklo.com/v1/company/pickup-points",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
    json={
        "label": "Barcelona warehouse",
        "country_code": "ES",
        "city_id": 665904,
        "street": "Carrer Gran 42",
        "postal_code": "08001",
        "contact_phone": "+34600000000",
        "contact_email": "[email protected]"
    },
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/company/pickup-points", {
  method: "POST",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "label": "Barcelona warehouse",
      "country_code": "ES",
      "city_id": 665904,
      "street": "Carrer Gran 42",
      "postal_code": "08001",
      "contact_phone": "+34600000000",
      "contact_email": "[email protected]"
  })
});

const data = await response.json();
import java.net.http.*;
import java.net.URI;

var client = HttpClient.newHttpClient();

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox-api.biklo.com/v1/company/pickup-points"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString(
        "{ \"label\": \"Barcelona warehouse\", \"country_code\": \"ES\", \"city_id\": 665904, \"street\": \"Carrer Gran 42\", \"postal_code\": \"08001\", \"contact_phone\": \"+34600000000\", \"contact_email\": \"[email protected]\" }"))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());