Skip to content

Accept a payment

Accept one-time payments with Inttegro in two simple steps: create an order and confirm payment.

This guide shows you how to accept a one-time payment. You’ll create an order with payment details, confirm customer intent with an OTP, then wait for payment authorization. The entire flow takes two API calls and about 30 seconds.

How it works

Every payment follows a three-phase pattern: create the order, confirm customer intent with an OTP, then wait for provider authorization. The entire flow typically completes in under 30 seconds. For detailed information on order and payment status transitions at each step, see the Order lifecycle guide.

Step 1: create the order

Creating an order bundles everything about the transaction—who’s paying, what they’re buying, and how they’ll pay—into a single atomic unit. You’ll provide either customerData for new customers or customerId for returning ones, along with lineItems describing the products, fees, or shipping charges. When you set executePayment: true, Inttegro begins payment execution and sends a 6-digit OTP to the customer’s phone.

Create order

POST/orders/create
cURLbash
curl https://api.inttegro.com/orders/create \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "request_meta": {
    "idempotency_key": "order_2025_001"
  },
  "execute_payment": true,
  "customer_data": {
    "name": "Gloria Kesewaa",
    "email_address": "gloria@example.com",
    "phone_number": "+233544998605"
  },
  "payment_method_data": {
    "type": "mobile_money",
    "mobile_money": {
      "network": "mtn",
      "account_number": "0544998605"
    }
  },
  "line_items": [
    {
      "type": "product",
      "product": {
        "type": "physical",
        "name": "Utility Sneakers",
        "quantity": 1,
        "price": {
          "currency": "ghs",
          "value": 20000
        }
      }
    }
  ]
}'
TypeScripttypescript
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_2025_001",
  },
  executePayment: true,
  customerData: {
    name: "Gloria Kesewaa",
    emailAddress: "gloria@example.com",
    phoneNumber: "+233544998605",
  },
  paymentMethodData: {
    type: PaymentMethodTypes.MobileMoney,
    mobileMoney: {
      network: MobileMoneyNetworks.MTN,
      accountNumber: "0544998605",
    },
  },
  lineItems: [
    {
      type: LineItemTypes.Product,
      product: {
        type: ProductTypes.Physical,
        name: "Utility Sneakers",
        quantity: 1,
        price: {
          currency: "ghs",
          value: 20000,
        },
      },
    },
  ],
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/customer"
  "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_2025_001",
    },
    ExecutePayment: inttegro.Bool(true),
    CustomerData: &customer.Data{
      Name: "Gloria Kesewaa",
      Email: "gloria@example.com",
      PhoneNumber: "+233544998605",
    },
    PaymentMethodData: &paymentmethod.Data{
      Type: paymentmethod.TypeMobileMoney,
      MobileMoney: &paymentmethod.MobileMoneyParams{
        Network: paymentmethod.MobileMoneyNetworkMTN,
        AccountNumber: "0544998605",
      },
    },
    LineItems: []order.LineItemParams{
      {
        Type: order.LineItemTypeProduct,
        Product: &order.ProductLineItemParams{
          Type: product.TypePhysical,
          Name: "Utility Sneakers",
          Quantity: 1,
          Price: price.InlineParams{
            AmountParams: money.AmountParams{
              Currency: money.GHS,
              Value: 20000,
            },
          },
        },
      },
    },
  }
  result, err := client.Orders.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.orders.create(inttegro.order.CreateNewCustomerInput(
  request_meta=inttegro.order.CreateNewCustomerInputRequestMeta(
    idempotency_key="order_2025_001",
  ),
  execute_payment=True,
  customer_data=inttegro.customer.DataInput(
    name="Gloria Kesewaa",
    email_address="gloria@example.com",
    phone_number="+233544998605",
  ),
  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.MTN,
      account_number="0544998605",
    ),
  ),
  line_items=[
    inttegro.product.LineItemInput(
      type=inttegro.order.LineItemType.PRODUCT,
      product=inttegro.product.InlineDetailsInput(
        type=inttegro.product.Type.PHYSICAL,
        name="Utility Sneakers",
        quantity=1,
        price=inttegro.price.InlineParams(
          currency=inttegro.money.Currency.GHS,
          value=20000,
        ),
      ),
    ),
  ],
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->create([
  'request_meta' => new \Inttegro\Request\Meta(
    idempotencyKey: 'order_2025_001',
  ),
  'execute_payment' => true,
  'customer_data' => [
    'name' => 'Gloria Kesewaa',
    'email_address' => 'gloria@example.com',
    'phone_number' => '+233544998605',
  ],
  'payment_method_data' => [
    'type' => \Inttegro\PaymentMethodType::MobileMoney,
    'mobile_money' => [
      'network' => \Inttegro\MobileMoneyNetwork::MTN,
      'account_number' => '0544998605',
    ],
  ],
  'line_items' => [
    [
      'type' => \Inttegro\LineItemType::Product,
      'product' => [
        'type' => \Inttegro\ProductType::Physical,
        'name' => 'Utility Sneakers',
        'quantity' => 1,
        'price' => [
          'currency' => 'ghs',
          'value' => 20000,
        ],
      ],
    ],
  ],
]);
Rubyruby
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_2025_001",
  ),
  execute_payment: true,
  customer_data: {
    name: "Gloria Kesewaa",
    email_address: "gloria@example.com",
    phone_number: "+233544998605",
  },
  payment_method_data: {
    type: Inttegro::PaymentMethodType::MOBILE_MONEY,
    mobile_money: {
      network: Inttegro::MobileMoneyNetwork::MTN,
      account_number: "0544998605",
    },
  },
  line_items: [
    {
      type: Inttegro::LineItemType::PRODUCT,
      product: {
        type: Inttegro::ProductType::PHYSICAL,
        name: "Utility Sneakers",
        quantity: 1,
        price: {
          currency: "ghs",
          value: 20000,
        },
      },
    },
  ]
)
Javajava
import com.inttegro.Client;
import com.inttegro.orders.OrderCreateParams;
import com.inttegro.RequestMeta;
import com.inttegro.customers.CustomerData;
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_2025_001")
          .build())
      .executePayment(true)
      .customerData(CustomerData.builder()
          .name("Gloria Kesewaa")
          .email("gloria@example.com")
          .phoneNumber("+233544998605")
          .build())
      .paymentMethodData(PaymentMethodData.builder()
          .type(PaymentMethodType.MOBILE_MONEY)
          .mobileMoney(MobileMoneyParams.builder()
              .network(MobileMoneyNetwork.MTN)
              .accountNumber("0544998605")
              .build())
          .build())
      .lineItem(OrderLineItemParams.product(ProductLineItemParams.builder()
            .type(ProductType.PHYSICAL)
            .name("Utility Sneakers")
            .quantity(1L)
            .price(PriceParams.of(Currency.GHS, 20000))
            .build()))
      .build();
    var result = client.orders().create(params);
  }
}
C#csharp
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_2025_001",
  },
  ExecutePayment = true,
  CustomerData = new CustomerData {
    Name = "Gloria Kesewaa",
    EmailAddress = "gloria@example.com",
    PhoneNumber = "+233544998605",
  },
  PaymentMethodData = new PaymentMethodData {
    Type = Inttegro.PaymentMethodType.MobileMoney,
    MobileMoney = new MobileMoney {
      Network = Inttegro.MobileMoneyNetwork.MTN,
      AccountNumber = "0544998605",
    },
  },
  LineItems = new List<LineItemParams> {
    new LineItemParams {
      Type = Inttegro.LineItemType.Product,
      Product = new ProductDetailsParams {
        Type = Inttegro.ProductType.Physical,
        Name = "Utility Sneakers",
        Quantity = 1,
        Price = new Inttegro.PriceParams {
          Currency = Inttegro.Money.Currency.GHS,
          Value = 20000,
        },
      },
    },
  },
});

Response

Response excerptjson
{
  "order": {
    "id": "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
    "status": "requires_payment",
    "customer": {
      "id": "cu_abc123",
      "name": "Gloria Kesewaa",
      "email_address": "gloria@example.com"
    },
    "payment": {
      "id": "py_xyz789",
      "status": "requires_action",
      "payment_method": {
        "id": "pm_saved_method",
        "type": "mobile_money",
        "network": "mtn"
      },
      "next_action": {
        "type": "confirm_payment",
        "confirm_payment": {
          "expires_at": "2025-01-13T10:08:00Z",
          "request": {
            "id": "otc_req_8Ks2Vn",
            "recipient": "0544998605",
            "sent_via": "sms"
          }
        }
      }
    }
  }
}

Key attributes:

Step 2: confirm customer intent with OTP

The customer receives a confirmation token. Collect it through your UI and submit it with the order, payment, and confirmation-request IDs from the preceding response. Those four values bind the token to the exact payment action being confirmed.

Confirm payment

POST/orders/confirm_payment
cURLbash
curl https://api.inttegro.com/orders/confirm_payment \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "confirmation_id": "otc_req_8Ks2Vn",
  "order_id": "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
  "payment_id": "py_xyz789",
  "token": "302673"
}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.orders.confirmPayment({
  confirmationId: "otc_req_8Ks2Vn",
  orderId: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
  paymentId: "py_xyz789",
  token: "302673",
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/order"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := order.ConfirmParams{
    OrderID: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
    Token: "302673",
  }
  result, err := client.Orders.ConfirmPayment(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.orders.confirm_payment(inttegro.payment.ConfirmRequest(
  confirmation_id="otc_req_8Ks2Vn",
  order_id="or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
  payment_id="py_xyz789",
  token="302673",
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->confirmPayment([
  'confirmation_id' => 'otc_req_8Ks2Vn',
  'order_id' => 'or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt',
  'payment_id' => 'py_xyz789',
  'token' => '302673',
]);
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.confirm_payment(
  confirmation_id: "otc_req_8Ks2Vn",
  order_id: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
  payment_id: "py_xyz789",
  token: "302673"
)
Javajava
import com.inttegro.Client;
import com.inttegro.orders.OrderConfirmParams;

public class Example {
  public static void main(String[] args) throws Exception {
    var client = new Client(System.getenv("INTTEGRO_API_KEY"));
    var params = OrderConfirmParams.builder()
      .orderId("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
      .token("302673")
      .build();
    var result = client.orders().confirmPayment(params);
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.ConfirmPaymentAsync(new OrderConfirmPaymentRequest {
  OrderId = "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
  Token = "302673",
});

After confirmation, check the order status before fulfilling it:

Check status

POST/orders/lookup
cURLbash
curl https://api.inttegro.com/orders/lookup \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt"
}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.orders.lookup({
  orderId: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
})
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.Orders.Lookup(ctx, "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
  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.orders.lookup("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
PHPphp
<?php

use Inttegro\Client;

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

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.lookup(order_id: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
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.orders().lookup("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.LookupAsync("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");

What happens after payment

When you create an order with customerData and paymentMethodData, Inttegro automatically creates a customer record and attaches the payment method to it. The response includes both payment.customer.id and payment.paymentMethod.id—store these for future use. Next time this customer checks out, you can skip collecting their details again and charge them instantly. See Charge repeat customers to learn how.

Common patterns

Multiple items

Real shopping carts contain more than just products—there are shipping charges, processing fees, and taxes. The lineItems array supports three types: "product", "shipping", and "fee". Each line item has its own structure with a lineItems[].type discriminator and a nested object containing the details. Inttegro automatically sums all the line items to calculate the order total, which you’ll see in the lineItemGroup.total field of the response.

Create a multi-item order

POST/orders/create
cURLbash
curl https://api.inttegro.com/orders/create \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "request_meta": {
    "idempotency_key": "multi_item_order_001"
  },
  "customer_id": "cu_abc123",
  "line_items": [
    {
      "type": "product",
      "product": { "type": "physical", "name": "Shoes", "quantity": 2, "price": { "currency": "ghs", "value": 25000 } }
    },
    {
      "type": "shipping",
      "shipping": { "fee": { "currency": "ghs", "value": 2000 } }
    },
    {
      "type": "fee",
      "fee": { "label": "Processing fee", "amount": { "currency": "ghs", "value": 500 } }
    }
  ]
}'
TypeScripttypescript
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: "multi_item_order_001",
  },
  customerId: "cu_abc123",
  lineItems: [
    {
      type: LineItemTypes.Product,
      product: {
        type: ProductTypes.Physical,
        name: "Shoes",
        quantity: 2,
        price: {
          currency: "ghs",
          value: 25000,
        },
      },
    },
    {
      type: LineItemTypes.Shipping,
      shipping: {
        fee: {
          currency: "ghs",
          value: 2000,
        },
      },
    },
    {
      type: LineItemTypes.Fee,
      fee: {
        label: "Processing fee",
        amount: {
          currency: "ghs",
          value: 500,
        },
      },
    },
  ],
})
Gogo
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: "multi_item_order_001",
    },
    CustomerID: "cu_abc123",
    LineItems: []order.LineItemParams{
      {
        Type: order.LineItemTypeProduct,
        Product: &order.ProductLineItemParams{
          Type: product.TypePhysical,
          Name: "Shoes",
          Quantity: 2,
          Price: price.InlineParams{
            AmountParams: money.AmountParams{
              Currency: money.GHS,
              Value: 25000,
            },
          },
        },
      },
      {
        Type: order.LineItemTypeShipping,
        Shipping: &order.ShippingLineItemParams{
          Fee: money.AmountParams{
            Currency: money.GHS,
            Value: 2000,
          },
        },
      },
      {
        Type: order.LineItemTypeFee,
        Fee: &order.FeeLineItemParams{
          Label: "Processing fee",
          Amount: money.AmountParams{
            Currency: money.GHS,
            Value: 500,
          },
        },
      },
    },
  }
  result, err := client.Orders.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.orders.create(inttegro.order.CreateExistingCustomerInput(
  request_meta=inttegro.order.CreateExistingCustomerInputRequestMeta(
    idempotency_key="multi_item_order_001",
  ),
  customer_id="cu_abc123",
  line_items=[
    inttegro.product.LineItemInput(
      type=inttegro.order.LineItemType.PRODUCT,
      product=inttegro.product.InlineDetailsInput(
        type=inttegro.product.Type.PHYSICAL,
        name="Shoes",
        quantity=2,
        price=inttegro.price.InlineParams(
          currency=inttegro.money.Currency.GHS,
          value=25000,
        ),
      ),
    ),
    inttegro.shared.ShippingLineItemInput(
      type=inttegro.order.LineItemType.SHIPPING,
      shipping=inttegro.shared.ShippingDetailsInput(
        fee=inttegro.price.InlineParams(
          currency=inttegro.money.Currency.GHS,
          value=2000,
        ),
      ),
    ),
    inttegro.shared.FeeLineItemInput(
      type=inttegro.order.LineItemType.FEE,
      fee=inttegro.shared.FeeDetailsInput(
        label="Processing fee",
        amount=inttegro.price.InlineParams(
          currency=inttegro.money.Currency.GHS,
          value=500,
        ),
      ),
    ),
  ],
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->create([
  'request_meta' => new \Inttegro\Request\Meta(
    idempotencyKey: 'multi_item_order_001',
  ),
  'customer_id' => 'cu_abc123',
  'line_items' => [
    [
      'type' => \Inttegro\LineItemType::Product,
      'product' => [
        'type' => \Inttegro\ProductType::Physical,
        'name' => 'Shoes',
        'quantity' => 2,
        'price' => [
          'currency' => 'ghs',
          'value' => 25000,
        ],
      ],
    ],
    [
      'type' => \Inttegro\LineItemType::Shipping,
      'shipping' => [
        'fee' => [
          'currency' => 'ghs',
          'value' => 2000,
        ],
      ],
    ],
    [
      'type' => \Inttegro\LineItemType::Fee,
      'fee' => [
        'label' => 'Processing fee',
        'amount' => [
          'currency' => 'ghs',
          'value' => 500,
        ],
      ],
    ],
  ],
]);
Rubyruby
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: "multi_item_order_001",
  ),
  customer_id: "cu_abc123",
  line_items: [
    {
      type: Inttegro::LineItemType::PRODUCT,
      product: {
        type: Inttegro::ProductType::PHYSICAL,
        name: "Shoes",
        quantity: 2,
        price: {
          currency: "ghs",
          value: 25000,
        },
      },
    },
    {
      type: Inttegro::LineItemType::SHIPPING,
      shipping: {
        fee: {
          currency: "ghs",
          value: 2000,
        },
      },
    },
    {
      type: Inttegro::LineItemType::FEE,
      fee: {
        label: "Processing fee",
        amount: {
          currency: "ghs",
          value: 500,
        },
      },
    },
  ]
)
Javajava
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;
import com.inttegro.orders.ShippingLineItemParams;
import com.inttegro.money.AmountParams;
import com.inttegro.orders.FeeLineItemParams;

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("multi_item_order_001")
          .build())
      .customerId("cu_abc123")
      .lineItem(OrderLineItemParams.product(ProductLineItemParams.builder()
            .type(ProductType.PHYSICAL)
            .name("Shoes")
            .quantity(2L)
            .price(PriceParams.of(Currency.GHS, 25000))
            .build()))
      .lineItem(OrderLineItemParams.shipping(ShippingLineItemParams.builder()
            .fee(AmountParams.of(Currency.GHS, 2000))
            .build()))
      .lineItem(OrderLineItemParams.fee(FeeLineItemParams.builder()
            .label("Processing fee")
            .amount(AmountParams.of(Currency.GHS, 500))
            .build()))
      .build();
    var result = client.orders().create(params);
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.CreateAsync(new OrderCreateRequest {
  RequestMeta = new RequestMeta {
    IdempotencyKey = "multi_item_order_001",
  },
  CustomerId = "cu_abc123",
  LineItems = new List<LineItemParams> {
    new LineItemParams {
      Type = Inttegro.LineItemType.Product,
      Product = new ProductDetailsParams {
        Type = Inttegro.ProductType.Physical,
        Name = "Shoes",
        Quantity = 2,
        Price = new Inttegro.PriceParams {
          Currency = Inttegro.Money.Currency.GHS,
          Value = 25000,
        },
      },
    },
    new LineItemParams {
      Type = Inttegro.LineItemType.Shipping,
      Shipping = new ShippingDetailsParams {
        Fee = new AmountParams {
          Currency = Inttegro.Money.Currency.GHS,
          Value = 2000,
        },
      },
    },
    new LineItemParams {
      Type = Inttegro.LineItemType.Fee,
      Fee = new FeeDetailsParams {
        Label = "Processing fee",
        Amount = new AmountParams {
          Currency = Inttegro.Money.Currency.GHS,
          Value = 500,
        },
      },
    },
  },
});

Handling errors

OTP expired or wrong

OTP codes expire after about 8 minutes, and customers sometimes mistype them. When either happens, call /orders/request_confirmation to generate and send a fresh code. The customer can retry with the new code without losing their order or having to start over.

Send a new confirmation token

POST/orders/request_confirmation
cURLbash
curl https://api.inttegro.com/orders/request_confirmation \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt"
}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.orders.requestConfirmation({
  orderId: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
})
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.Orders.RequestConfirmation(ctx, "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
  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.orders.request_confirmation(
    "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt"
)
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->requestConfirmation("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.request_confirmation(
  order_id: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt"
)
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.orders().requestConfirmation("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.RequestConfirmationAsync("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");

Customer doesn’t have funds

If the customer approves the payment but their mobile money account has insufficient balance, the payment attempt fails after OTP confirmation. The order remains in Inttegro.OrderStatuses.RequiresPayment status and its latest payment attempt is marked Inttegro.PaymentAttemptStatuses.Failed. Keep the API error from the confirmation request for the reason you show in logs or support tooling; the order object does not repeat that error code in payment.latestAttempt. You can prompt the customer to add funds and retry, or offer another payment method.

Look up the order

POST/orders/lookup
cURLbash
curl https://api.inttegro.com/orders/lookup \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt"
}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.orders.lookup({
  orderId: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
})
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.Orders.Lookup(ctx, "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
  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.orders.lookup("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
PHPphp
<?php

use Inttegro\Client;

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

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.lookup(order_id: "or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt")
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.orders().lookup("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.LookupAsync("or_48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt");

Testing

Use an application configured for the test environment and only payment details and confirmation values supplied for that environment. When a payment requires confirmation, follow Confirm a payment with orderId, paymentId, confirmationId, and the supplied token; do not hardcode a universal token value.

Key tips

Phone format: Mobile money providers require phone numbers in E.164 format with country code (e.g., +233544998605). If customers enter local format like 0544998605, prepend the country code before sending to Inttegro—otherwise the OTP won’t be delivered.

Store order ID: The moment you receive the order creation response, persist id to your database. You’ll need this ID for payment confirmation, status lookups, and linking the Inttegro order to your internal records. Don’t wait until after OTP confirmation—store it immediately.

Complete flow

The language-aware samples above form the complete integration path: create the order, submit confirmation when the response requires it, and look up the order before fulfillment. The selector in the toolbar keeps every request in the same SDK language.

Next steps

That’s it! You’re ready to accept payments.

Type to search…

↑↓ navigate↵ selectEsc close