Repeat customers expect fast, frictionless checkout. Instead of asking them to re-enter their name, email, and payment details every time, use the customer and payment method IDs from their first purchase to create instant checkout flows. This guide shows you how to charge returning customers with saved payment methods and how to handle cases where they want to use a different payment method.
How it works
After a customer’s first successful payment, Inttegro automatically creates a customer record and attaches their payment method to it. You’ll find Payment.Customer.Idorder.payment.customer.idPayment.Customer.IDpayment.customer.idpayment.customer.idpayment.customer.idpayment.customer.idpayment.customer.id and Payment.PaymentMethod.Idorder.payment.payment_method.idPayment.PaymentMethod.IDpayment.paymentMethod.idpayment.paymentMethod.idpayment.payment_method.idpayment.payment_method.idpayment.paymentMethod.id in the order response. Store these IDs in your database linked to your user account. When the customer returns, reference them with CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId and optionally PaymentMethodIdpayment_method_idPaymentMethodIDpaymentMethodIdpayment_method_idpayment_method_idpayment_method_idpaymentMethodId instead of passing full details. Inttegro handles OTP delivery and payment confirmation just like the first time, but checkout is faster because you’re not collecting information again.
Choose your integration approach
Select how you want to charge repeat customers:
The simplest repeat customer flow uses both CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId and PaymentMethodIdpayment_method_idPaymentMethodIDpaymentMethodIdpayment_method_idpayment_method_idpayment_method_idpaymentMethodId for instant, one-click checkout. The customer doesn’t need to re-enter any information—just confirm the OTP and the payment completes.
Charge with saved method
curl https://api.inttegro.com/orders/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_meta": {
"idempotency_key": "order_repeat_001"
},
"execute_payment": true,
"customer_id": "cu_abc123",
"payment_method_id": "pm_saved_method",
"line_items": [
{
"type": "product",
"product": {
"type": "digital",
"name": "Premium Subscription",
"quantity": 1,
"price": {
"currency": "ghs",
"value": 5000
}
}
}
]
}'import { InttegroClient, LineItemTypes, ProductTypes } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.orders.create({
requestMeta: {
idempotencyKey: "order_repeat_001",
},
executePayment: true,
customerId: "cu_abc123",
paymentMethodId: "pm_saved_method",
lineItems: [
{
type: LineItemTypes.Product,
product: {
type: ProductTypes.Digital,
name: "Premium Subscription",
quantity: 1,
price: {
currency: "ghs",
value: 5000,
},
},
},
],
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/money"
"github.com/inttegro/inttegro-sdk-go/v14/order"
"github.com/inttegro/inttegro-sdk-go/v14/price"
"github.com/inttegro/inttegro-sdk-go/v14/product"
"github.com/inttegro/inttegro-sdk-go/v14/request"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := order.CreateParams{
RequestMeta: &request.Meta{
IdempotencyKey: "order_repeat_001",
},
ExecutePayment: inttegro.Bool(true),
CustomerID: "cu_abc123",
PaymentMethodID: "pm_saved_method",
LineItems: []order.LineItemParams{
{
Type: order.LineItemTypeProduct,
Product: &order.ProductLineItemParams{
Type: product.TypeDigital,
Name: "Premium Subscription",
Quantity: 1,
Price: price.InlineParams{
AmountParams: money.AmountParams{
Currency: money.GHS,
Value: 5000,
},
},
},
},
},
}
result, err := client.Orders.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.orders.create(inttegro.order.CreateExistingCustomerInput(
request_meta=inttegro.order.CreateExistingCustomerInputRequestMeta(
idempotency_key="order_repeat_001",
),
execute_payment=True,
customer_id="cu_abc123",
payment_method_id="pm_saved_method",
line_items=[
inttegro.product.LineItemInput(
type=inttegro.order.LineItemType.PRODUCT,
product=inttegro.product.InlineDetailsInput(
type=inttegro.product.Type.DIGITAL,
name="Premium Subscription",
quantity=1,
price=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=5000,
),
),
),
],
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->create([
'request_meta' => new \Inttegro\Request\Meta(
idempotencyKey: 'order_repeat_001',
),
'execute_payment' => true,
'customer_id' => 'cu_abc123',
'payment_method_id' => 'pm_saved_method',
'line_items' => [
[
'type' => \Inttegro\LineItemType::Product,
'product' => [
'type' => \Inttegro\ProductType::Digital,
'name' => 'Premium Subscription',
'quantity' => 1,
'price' => [
'currency' => 'ghs',
'value' => 5000,
],
],
],
],
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.create(
request_meta: Inttegro::Order::CreateNewCustomerRequestMeta.new(
idempotency_key: "order_repeat_001",
),
execute_payment: true,
customer_id: "cu_abc123",
payment_method_id: "pm_saved_method",
line_items: [
{
type: Inttegro::LineItemType::PRODUCT,
product: {
type: Inttegro::ProductType::DIGITAL,
name: "Premium Subscription",
quantity: 1,
price: {
currency: "ghs",
value: 5000,
},
},
},
]
)import com.inttegro.Client;
import com.inttegro.orders.OrderCreateParams;
import com.inttegro.RequestMeta;
import com.inttegro.orders.OrderLineItemParams;
import com.inttegro.orders.ProductLineItemParams;
import com.inttegro.products.ProductType;
import com.inttegro.prices.PriceParams;
import com.inttegro.money.Currency;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = OrderCreateParams.builder()
.requestMeta(RequestMeta.builder()
.idempotencyKey("order_repeat_001")
.build())
.executePayment(true)
.customerId("cu_abc123")
.paymentMethodId("pm_saved_method")
.lineItem(OrderLineItemParams.product(ProductLineItemParams.builder()
.type(ProductType.DIGITAL)
.name("Premium Subscription")
.quantity(1L)
.price(PriceParams.of(Currency.GHS, 5000))
.build()))
.build();
var result = client.orders().create(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.CreateAsync(new OrderCreateRequest {
RequestMeta = new RequestMeta {
IdempotencyKey = "order_repeat_001",
},
ExecutePayment = true,
CustomerId = "cu_abc123",
PaymentMethodId = "pm_saved_method",
LineItems = new List<LineItemParams> {
new LineItemParams {
Type = Inttegro.LineItemType.Product,
Product = new ProductDetailsParams {
Type = Inttegro.ProductType.Digital,
Name = "Premium Subscription",
Quantity = 1,
Price = new Inttegro.PriceParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 5000,
},
},
},
},
});Response
{
"order": {
"id": "or_repeat_xyz",
"status": "requires_payment",
"customer": {
"id": "cu_abc123",
"name": "Gloria Kesewaa",
"email_address": "gloria@example.com"
},
"payment": {
"id": "py_new_attempt",
"status": "requires_action",
"payment_method": {
"id": "pm_saved_method",
"type": "mobile_money",
"network": "mtn",
"account_number": "0544998605"
},
"next_action": {
"type": "confirm_payment",
"confirm_payment": {
"expires_at": "2025-01-13T10:08:00Z",
"request": {
"recipient": "0544998605",
"sent_via": "sms"
}
}
}
}
}
}What’s different:
- No
CustomerDatacustomer_dataCustomerDatacustomerDatacustomer_datacustomer_datacustomer_datacustomerDataorPaymentMethodDatapayment_method_dataPaymentMethodDatapaymentMethodDatapayment_method_datapayment_method_datapayment_method_datapaymentMethodDataneeded—everything is already on file - Inttegro sends OTP to the phone number associated with the saved payment method
- Customer confirms with OTP just like the first purchase
The confirmation step is identical to first-time payments. Submit the returned order ID, payment ID, confirmation-request ID, and the customer’s token as shown in Confirm a payment.
Sometimes a repeat customer wants to use a different payment method—maybe they’re using a different mobile money provider or their old number changed. Provide CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId with new PaymentMethodDatapayment_method_dataPaymentMethodDatapaymentMethodDatapayment_method_datapayment_method_datapayment_method_datapaymentMethodData to attach the new payment method to the existing customer. Inttegro creates a new payment method record and charges it, while keeping the customer’s profile and history intact.
Charge with new method
curl https://api.inttegro.com/orders/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_meta": {
"idempotency_key": "order_new_method_001"
},
"execute_payment": true,
"customer_id": "cu_abc123",
"payment_method_data": {
"type": "mobile_money",
"mobile_money": {
"network": "telecel",
"account_number": "0501234567"
}
},
"line_items": [
{
"type": "product",
"product": {
"type": "physical",
"name": "Running Shoes",
"quantity": 1,
"price": {
"currency": "ghs",
"value": 35000
}
}
}
]
}'import {
InttegroClient,
PaymentMethodTypes,
MobileMoneyNetworks,
LineItemTypes,
ProductTypes,
} from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.orders.create({
requestMeta: {
idempotencyKey: "order_new_method_001",
},
executePayment: true,
customerId: "cu_abc123",
paymentMethodData: {
type: PaymentMethodTypes.MobileMoney,
mobileMoney: {
network: MobileMoneyNetworks.Telecel,
accountNumber: "0501234567",
},
},
lineItems: [
{
type: LineItemTypes.Product,
product: {
type: ProductTypes.Physical,
name: "Running Shoes",
quantity: 1,
price: {
currency: "ghs",
value: 35000,
},
},
},
],
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/money"
"github.com/inttegro/inttegro-sdk-go/v14/order"
"github.com/inttegro/inttegro-sdk-go/v14/paymentmethod"
"github.com/inttegro/inttegro-sdk-go/v14/price"
"github.com/inttegro/inttegro-sdk-go/v14/product"
"github.com/inttegro/inttegro-sdk-go/v14/request"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := order.CreateParams{
RequestMeta: &request.Meta{
IdempotencyKey: "order_new_method_001",
},
ExecutePayment: inttegro.Bool(true),
CustomerID: "cu_abc123",
PaymentMethodData: &paymentmethod.Data{
Type: paymentmethod.TypeMobileMoney,
MobileMoney: &paymentmethod.MobileMoneyParams{
Network: paymentmethod.MobileMoneyNetworkTelecel,
AccountNumber: "0501234567",
},
},
LineItems: []order.LineItemParams{
{
Type: order.LineItemTypeProduct,
Product: &order.ProductLineItemParams{
Type: product.TypePhysical,
Name: "Running Shoes",
Quantity: 1,
Price: price.InlineParams{
AmountParams: money.AmountParams{
Currency: money.GHS,
Value: 35000,
},
},
},
},
},
}
result, err := client.Orders.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.orders.create(inttegro.order.CreateExistingCustomerInput(
request_meta=inttegro.order.CreateExistingCustomerInputRequestMeta(
idempotency_key="order_new_method_001",
),
execute_payment=True,
customer_id="cu_abc123",
payment_method_data=inttegro.payment_method.DataInput(
type=inttegro.payment_method.Type.MOBILE_MONEY,
mobile_money=inttegro.payment_method.DataInputMobileMoney(
network=inttegro.payment_method.MobileMoneyNetwork.TELECEL,
account_number="0501234567",
),
),
line_items=[
inttegro.product.LineItemInput(
type=inttegro.order.LineItemType.PRODUCT,
product=inttegro.product.InlineDetailsInput(
type=inttegro.product.Type.PHYSICAL,
name="Running Shoes",
quantity=1,
price=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=35000,
),
),
),
],
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->create([
'request_meta' => new \Inttegro\Request\Meta(
idempotencyKey: 'order_new_method_001',
),
'execute_payment' => true,
'customer_id' => 'cu_abc123',
'payment_method_data' => [
'type' => \Inttegro\PaymentMethodType::MobileMoney,
'mobile_money' => [
'network' => \Inttegro\MobileMoneyNetwork::Telecel,
'account_number' => '0501234567',
],
],
'line_items' => [
[
'type' => \Inttegro\LineItemType::Product,
'product' => [
'type' => \Inttegro\ProductType::Physical,
'name' => 'Running Shoes',
'quantity' => 1,
'price' => [
'currency' => 'ghs',
'value' => 35000,
],
],
],
],
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.create(
request_meta: Inttegro::Order::CreateNewCustomerRequestMeta.new(
idempotency_key: "order_new_method_001",
),
execute_payment: true,
customer_id: "cu_abc123",
payment_method_data: {
type: Inttegro::PaymentMethodType::MOBILE_MONEY,
mobile_money: {
network: Inttegro::MobileMoneyNetwork::TELECEL,
account_number: "0501234567",
},
},
line_items: [
{
type: Inttegro::LineItemType::PRODUCT,
product: {
type: Inttegro::ProductType::PHYSICAL,
name: "Running Shoes",
quantity: 1,
price: {
currency: "ghs",
value: 35000,
},
},
},
]
)import com.inttegro.Client;
import com.inttegro.orders.OrderCreateParams;
import com.inttegro.RequestMeta;
import com.inttegro.paymentmethods.PaymentMethodData;
import com.inttegro.paymentmethods.PaymentMethodType;
import com.inttegro.paymentmethods.MobileMoneyParams;
import com.inttegro.paymentmethods.MobileMoneyNetwork;
import com.inttegro.orders.OrderLineItemParams;
import com.inttegro.orders.ProductLineItemParams;
import com.inttegro.products.ProductType;
import com.inttegro.prices.PriceParams;
import com.inttegro.money.Currency;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = OrderCreateParams.builder()
.requestMeta(RequestMeta.builder()
.idempotencyKey("order_new_method_001")
.build())
.executePayment(true)
.customerId("cu_abc123")
.paymentMethodData(PaymentMethodData.builder()
.type(PaymentMethodType.MOBILE_MONEY)
.mobileMoney(MobileMoneyParams.builder()
.network(MobileMoneyNetwork.TELECEL)
.accountNumber("0501234567")
.build())
.build())
.lineItem(OrderLineItemParams.product(ProductLineItemParams.builder()
.type(ProductType.PHYSICAL)
.name("Running Shoes")
.quantity(1L)
.price(PriceParams.of(Currency.GHS, 35000))
.build()))
.build();
var result = client.orders().create(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.CreateAsync(new OrderCreateRequest {
RequestMeta = new RequestMeta {
IdempotencyKey = "order_new_method_001",
},
ExecutePayment = true,
CustomerId = "cu_abc123",
PaymentMethodData = new PaymentMethodData {
Type = Inttegro.PaymentMethodType.MobileMoney,
MobileMoney = new MobileMoney {
Network = Inttegro.MobileMoneyNetwork.Telecel,
AccountNumber = "0501234567",
},
},
LineItems = new List<LineItemParams> {
new LineItemParams {
Type = Inttegro.LineItemType.Product,
Product = new ProductDetailsParams {
Type = Inttegro.ProductType.Physical,
Name = "Running Shoes",
Quantity = 1,
Price = new Inttegro.PriceParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 35000,
},
},
},
},
});Response
{
"order": {
"id": "or_new_method_xyz",
"status": "requires_payment",
"customer": {
"id": "cu_abc123",
"name": "Gloria Kesewaa",
"email_address": "gloria@example.com"
},
"payment": {
"id": "py_new_method",
"status": "requires_action",
"payment_method": {
"id": "pm_new_telecel",
"type": "mobile_money",
"network": "telecel",
"account_number": "0501234567"
},
"next_action": {
"type": "confirm_payment",
"confirm_payment": {
"expires_at": "2025-01-13T10:15:00Z",
"request": {
"recipient": "0501234567",
"sent_via": "sms"
}
}
}
}
}
}What happened:
- New
Payment.PaymentMethod.Idorder.payment.payment_method.idPayment.PaymentMethod.IDpayment.paymentMethod.idpayment.paymentMethod.idpayment.payment_method.idpayment.payment_method.idpayment.paymentMethod.idcreated (pm_new_telecel) and attached to existing customer - OTP sent to the new phone number (0501234567)
- Customer record remains the same, but now has multiple payment methods on file
- Save the new
Payment.PaymentMethod.Idorder.payment.payment_method.idPayment.PaymentMethod.IDpayment.paymentMethod.idpayment.paymentMethod.idpayment.payment_method.idpayment.payment_method.idpayment.paymentMethod.idfor future use
Subscription renewals
Store the customer and payment-method IDs when a customer subscribes. For each renewal, use the saved-method request shown above, give the order a unique idempotency key for that billing period, and use the current plan as its line item. If the returned payment requires confirmation, ask the customer to complete it. Mark the renewal paid only after the order reports a successful payment.
Testing
Use an application configured for the test environment. Create the first test order to obtain customer and payment-method IDs, then use those IDs on the repeat order. If the response requires confirmation, follow Confirm a payment with OrderIdorder_idOrderIDorderIdorder_idorder_idorder_idorderId, PaymentIdpayment_idPaymentIDpaymentIdpayment_idpayment_idpayment_idpaymentId, ConfirmationIdconfirmation_idConfirmationIDconfirmationIdconfirmation_idconfirmation_idconfirmation_idconfirmationId, and the test token supplied for that environment. Do not hardcode a universal token value.
Key tips
Store both IDs: Always save Payment.Customer.Idorder.payment.customer.idPayment.Customer.IDpayment.customer.idpayment.customer.idpayment.customer.idpayment.customer.idpayment.customer.id and Payment.PaymentMethod.Idorder.payment.payment_method.idPayment.PaymentMethod.IDpayment.paymentMethod.idpayment.paymentMethod.idpayment.payment_method.idpayment.payment_method.idpayment.paymentMethod.id from the response after the first payment. You need the customer ID to associate future orders and the payment method ID for fast checkout.
Customer profile vs payment method: A customer can have multiple payment methods. When you use CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId + PaymentMethodDatapayment_method_dataPaymentMethodDatapaymentMethodDatapayment_method_datapayment_method_datapayment_method_datapaymentMethodData, you’re adding a new payment method to an existing customer. When you use CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId + PaymentMethodIdpayment_method_idPaymentMethodIDpaymentMethodIdpayment_method_idpayment_method_idpayment_method_idpaymentMethodId, you’re charging an existing payment method.
Payment method verification: All payment methods require OTP confirmation, even saved ones. This protects both you and the customer—it proves the customer has access to the phone at the time of payment.
Handle expired payment methods: Phone numbers change, accounts get closed. If a payment fails with an expired or invalid payment method error, prompt the customer to add a new payment method using the CustomerIdcustomer_idCustomerIDcustomerIdcustomer_idcustomer_idcustomer_idcustomerId + PaymentMethodDatapayment_method_dataPaymentMethodDatapaymentMethodDatapayment_method_datapayment_method_datapayment_method_datapaymentMethodData pattern.
Next steps
- Accept a payment - First-time customer payment flow
- Retry a failed payment - Retry failed payments with alternative methods
- Order now, pay later - Defer payment to a later time
- Orders API - Complete API reference
You now know how to build fast, one-click checkout for repeat customers while maintaining security through OTP verification.