Biklo for developersTESTsandbox-api.biklo.comchange

The customer behind one order

GET/v1/orders/{id}/customer

scope customers.read

The endpoint to reach for when you are about to raise an invoice: you are holding an order id and you need the buyer AS THEY WERE FOR THAT SALE. A customer who has moved has two orders at two addresses, and each invoice must carry its own — GET /v1/customers/{id} gives you their latest, this gives you that order's. An order with no buyer account on it is customer_not_found (404).

Response#

FieldTypeDescription
idintegerThe buyer id.
namestringThe buyer's account name.
emailstringTheir account email.
phonestring|nullTheir account phone.
billingobject|nullThe address to invoice at. null when the order carries no address — old orders and a handful of edge cases.
billing.address_linestring|nullStreet and number. null when the buyer has since deleted the address the order pointed at — see is_live. Everything else in this block still stands, because it was snapshotted at checkout.
billing.citystringSnapshotted at checkout. This is the city the parcel was actually sent to.
billing.countystringCounty, judet or equivalent. Snapshotted at checkout.
billing.postal_codestring|nullSnapshotted at checkout, falling back to the address record for the few orders carrying none.
billing.country_codestringISO 3166-1 alpha-2, e.g. RO.
billing.countrystring|nullThe country name in Romanian, for printing. null alongside a null address_line.
billing.is_companybooleanThe buyer ordered as a BUSINESS and must be invoiced as one — in Romania that means the invoice carries the company name and CUI, not the person's. Branch on this rather than on whether company happens to be populated.
billing.companyobject|nullThe company to invoice, or null for a private buyer.
billing.company.namestringRegistered company name.
billing.company.vat_codestring|nullVAT number — the Romanian CUI/CIF, e.g. RO12345678.
billing.company.registration_nostring|nullTrade register number, e.g. J16/123/2020.
billing.is_livebooleanREAD THIS ONE. true means address_line was read from an address the buyer still controls and can edit, so it is their CURRENT street, not necessarily the one at the time of sale. Only the city, county, postcode and country are frozen. If your invoices must be reproducible, store the block when you issue the invoice rather than re-fetching it later. false means the address was deleted and address_line is null.
billing.delivered_to_lockerbooleanThe parcel went to a locker. The address here is still the buyer's own — this is a delivery detail, not a billing one.

Example

{
    "id": 9000001,
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "+40700000000",
    "billing": {
        "address_line": "Str. Exemplu 12",
        "city": "Brasov",
        "county": "Brasov",
        "postal_code": "500002",
        "country_code": "RO",
        "country": "România",
        "is_company": true,
        "company": {
            "name": "Example Bike Shop SRL",
            "vat_code": "RO12345678",
            "registration_no": "J16/123/2020"
        },
        "is_live": true,
        "delivered_to_locker": false
    }
}

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

curl -X GET "https://sandbox-api.biklo.com/v1/orders/711/customer" \
  -H "Authorization: Bearer bk_test_YOUR_KEY"
<?php

$ch = curl_init('https://sandbox-api.biklo.com/v1/orders/711/customer');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
    ],
]);

$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("GET"),
    "https://sandbox-api.biklo.com/v1/orders/711/customer");

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

response = requests.get(
    "https://sandbox-api.biklo.com/v1/orders/711/customer",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/orders/711/customer", {
  method: "GET",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY"
  }
});

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/orders/711/customer"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

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