Skip to content

Manage customers

Create customer records, attach them to orders, and use customer data to personalize and track the payment experience.

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

Create a customer

Create a customer record with the required name field. Email, phone, billing address, and shipping address are optional; include the contact data your own checkout flow needs.

Create customer

POST/customers/create
cURLbash
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"
  }'
TypeScripttypescript
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",
})
Gogo
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
}
Pythonpython
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",
))
PHPphp
<?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',
]);
Rubyruby
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"
)
Javajava
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);
  }
}
C#csharp
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 id (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

POST/customers/lookup
cURLbash
curl https://api.inttegro.com/customers/lookup \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_id": "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn"}'
TypeScripttypescript
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",
})
Gogo
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
}
Pythonpython
import os

from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

result = client.customers.lookup("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->customers->lookup("cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn");
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.customers.lookup(customer_id: "cu_ewoa27qe7aO4GZouasUSmVXILsmxjR0Hc6lCMBkn")
Javajava
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");
  }
}
C#csharp
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 customerId when creating an order. Inttegro links the order to that customer record and populates the order’s customer 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.

pageNumber is required, uses a 1-based index, and must be between 1 and 10. pageSize is optional, accepts 1–256, and defaults to 256.

Page customers

POST/customers/page
cURLbash
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
  }'
TypeScripttypescript
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,
})
Gogo
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
}
Pythonpython
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,
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->customers->page([
  'page_number' => 1,
  'page_size' => 50,
]);
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.customers.page(
  page_number: 1,
  page_size: 50
)
Javajava
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);
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Customers.PageAsync(new PageCustomersRequest {
  PageNumber = 1,
  PageSize = 50,
});

Type to search…

↑↓ navigate↵ selectEsc close