A customer record ties a person’s identity—name, email, phone number—to their order history and saved payment methods. Attaching customers to orders gives you a reliable identity anchor for repeat purchases, fraud signals, customer service lookups, and personalized checkout experiences. This guide shows you how to create customers, look them up, and use customer IDs in orders.
Prerequisites
- Understanding of orders and how
CustomerDatacustomer_dataCustomerDatacustomerDatacustomer_datacustomer_datacustomer_datacustomerDataworks in order creation
Create a customer
Create a customer record with the required NamenameNamenamenamenamenamename field. Email, phone, billing address, and shipping address are optional; include the contact data your own checkout flow needs.
Create customer
curl https://api.inttegro.com/customers/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Gloria Kesewaa",
"email_address": "gloria@kesewaa.co",
"phone_number": "+233544998605"
}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.customers.create({
name: "Gloria Kesewaa",
emailAddress: "gloria@kesewaa.co",
phoneNumber: "+233544998605",
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/customer"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := customer.CreateParams{
Name: "Gloria Kesewaa",
Email: "gloria@kesewaa.co",
PhoneNumber: "+233544998605",
}
result, err := client.Customers.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
import inttegro
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.customers.create(inttegro.customer.CreateRequest(
name="Gloria Kesewaa",
email_address="gloria@kesewaa.co",
phone_number="+233544998605",
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->customers->create([
'name' => 'Gloria Kesewaa',
'email_address' => 'gloria@kesewaa.co',
'phone_number' => '+233544998605',
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.customers.create(
name: "Gloria Kesewaa",
email_address: "gloria@kesewaa.co",
phone_number: "+233544998605"
)import com.inttegro.Client;
import com.inttegro.customers.CreateCustomerParams;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = CreateCustomerParams.builder()
.name("Gloria Kesewaa")
.emailAddress("gloria@kesewaa.co")
.phoneNumber("+233544998605")
.build();
var result = client.customers().create(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Customers.CreateAsync(new CreateCustomerRequest {
Name = "Gloria Kesewaa",
EmailAddress = "gloria@kesewaa.co",
PhoneNumber = "+233544998605",
});Store the returned Idcustomer.idIDididididid (cu_…) in your own database, associated with your user record. You’ll pass it in future orders to link purchases to this customer.
Look up a customer
Retrieve a customer record by ID to verify their details, display order history context, or check which payment methods they have saved.
Lookup customer
curl https://api.inttegro.com/customers/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"customer_id": "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn"}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.customers.lookup({
customerId: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.Customers.Lookup(ctx, "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")
if err != nil {
log.Fatal(err)
}
_ = result
}import os
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.customers.lookup("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->customers->lookup("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn");require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.customers.lookup(customer_id: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")import com.inttegro.Client;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.customers().lookup("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn");
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Customers.LookupAsync("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn");Attach customers to orders
Pass the customer ID in CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId when creating an order. Inttegro links the order to that customer record and populates the order’s CustomercustomerCustomercustomercustomercustomercustomercustomer object with their name, email, and phone—which appears on invoices, in the dashboard, and in order list responses.
Order with customer
new OrderCreateRequest {
CustomerId = "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
LineItems = new List<LineItemParams> {
new LineItemParams(),
},
}{
"customer_id": "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
"line_items": [
{
"price_id": "pr_abc123",
"quantity": 1
}
]
}order.CreateParams{
CustomerID: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
LineItems: []order.LineItemParams{
{},
},
}import com.inttegro.orders.OrderCreateParams;
import com.inttegro.orders.OrderLineItemParams;
var params = OrderCreateParams.builder()
.customerId("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")
.lineItem(OrderLineItemParams.builder().build())
.build();[
'customer_id' => 'cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn',
'line_items' => [
[
'price_id' => 'pr_abc123',
'quantity' => 1,
],
],
]inttegro.order.CreateExistingCustomerInput(
customer_id="cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
line_items=[
inttegro.product.LineItemInput(
price_id="pr_abc123",
quantity=1,
),
],
){
customer_id: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
line_items: [
{
price_id: "pr_abc123",
quantity: 1,
},
],
}{
customerId: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn",
lineItems: [
{
priceId: "pr_abc123",
quantity: 1,
},
],
}Attaching a customer to an order is how repeat-purchase flows work. The customer’s saved payment methods become available for selection at checkout—so returning customers don’t need to re-enter their mobile money number or card details each time.
See Charge repeat customers for the complete saved-payment-method flow.
Page through customers
Retrieve paginated customer records for reporting, syncing, or building an admin view of your customer base.
PageNumberpage_numberPageNumberpageNumberpage_numberpage_numberpage_numberpageNumber is
required, uses a 1-based index, and must be between 1 and 10. PageSizepage_sizePageSizepageSizepage_sizepage_sizepage_sizepageSize is
optional, accepts 1–256, and defaults to 256.
Page customers
curl https://api.inttegro.com/customers/page \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"page_number": 1,
"page_size": 50
}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.customers.page({
pageNumber: 1,
pageSize: 50,
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/customer"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := customer.PageParams{
PageNumber: 1,
PageSize: 50,
}
result, err := client.Customers.Page(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
import inttegro
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.customers.page(inttegro.customer.PageRequest(
page_number=1,
page_size=50,
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->customers->page([
'page_number' => 1,
'page_size' => 50,
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.customers.page(
page_number: 1,
page_size: 50
)import com.inttegro.Client;
import com.inttegro.customers.PageCustomersParams;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = PageCustomersParams.builder()
.pageNumber(1)
.pageSize(50)
.build();
var result = client.customers().page(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Customers.PageAsync(new PageCustomersRequest {
PageNumber = 1,
PageSize = 50,
});Related resources
- Customers API — Full reference for create, lookup, and page endpoints
- Charge repeat customers — Tokenize payment methods and charge customers without re-entering details
- Accept a payment — Full order creation flow with customer data