Skip to content

Retry a failed payment

Learn how to recover from failed payments by retrying with the same payment method, a different saved method, or new payment details.

Payment failures happen—networks timeout, customers enter wrong PINs, or mobile money accounts have insufficient balance. Instead of losing the sale, give your customers an easy way to retry. This guide shows you three strategies for recovering from failed payments, each optimized for different scenarios.

How payment retries work

When a payment fails, the order remains in the system with all its details intact. You use the /orders/pay endpoint to retry payment without creating a new order. This preserves the order ID, line items, and customer information while giving you flexibility in how to process the payment. You can retry with the same payment method (network glitch scenarios), switch to a different saved payment method (customer preference), or collect entirely new payment details (expired card, wrong account). Each retry triggers a fresh OTP and payment confirmation flow.

Scenario 1: retry with the current payment method

Use this approach when the failure was likely temporary—a network timeout, momentary connectivity issue, or the customer accidentally dismissed the OTP prompt. The payment method itself is still valid; it just needs another attempt.

When you call /orders/pay with only the orderId, Inttegro automatically retries the payment using the payment method already attached to the order. This is the simplest retry flow and works great for transient failures.

Retry with current method

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

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

const result = await inttegro.orders.pay({
  orderId: "or_failed_123",
})
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.PayParams{
    OrderID: "or_failed_123",
  }
  result, err := client.Orders.Pay(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.pay(inttegro.order.PayRequest(
  order_id="or_failed_123",
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->pay([
  'order_id' => 'or_failed_123',
]);
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.pay(
  order_id: "or_failed_123"
)
Javajava
import com.inttegro.Client;
import com.inttegro.orders.OrderPayParams;

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

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.PayAsync(new OrderPayRequest {
  OrderId = "or_failed_123",
});
  • #orderIdstringrequired

    The ID of the order with the failed payment. Find this in your original order creation response.

Inspect the returned order for its next action. If confirmation is required, submit the order ID, payment ID, confirmation-request ID, and customer token using Confirm a payment. The new payment attempt has its own identifiers; do not reuse identifiers from the failed attempt.

Scenario 2: retry with a different saved payment method

Use this when the customer wants to switch to a different payment method they’ve previously used. Maybe their primary mobile money account has insufficient funds, or they prefer to use a different network this time. You’ll pass the paymentMethodId of an alternative saved method.

This only works for returning customers who have multiple saved payment methods. You can get available payment method IDs from the customer’s previous orders or by calling the customer endpoint (if you’ve implemented customer management).

Retry with saved method

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

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

const result = await inttegro.orders.pay({
  orderId: "or_failed_123",
  paymentMethodId: "pm_alternative_method",
})
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.PayParams{
    OrderID: "or_failed_123",
    PaymentMethodID: "pm_alternative_method",
  }
  result, err := client.Orders.Pay(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.pay(inttegro.order.PayRequest(
  order_id="or_failed_123",
  payment_method_id="pm_alternative_method",
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->pay([
  'order_id' => 'or_failed_123',
  'payment_method_id' => 'pm_alternative_method',
]);
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.pay(
  order_id: "or_failed_123",
  payment_method_id: "pm_alternative_method"
)
Javajava
import com.inttegro.Client;
import com.inttegro.orders.OrderPayParams;

public class Example {
  public static void main(String[] args) throws Exception {
    var client = new Client(System.getenv("INTTEGRO_API_KEY"));
    var params = OrderPayParams.builder()
      .orderId("or_failed_123")
      .paymentMethodId("pm_alternative_method")
      .build();
    var result = client.orders().pay(params);
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.PayAsync(new OrderPayRequest {
  OrderId = "or_failed_123",
  PaymentMethodId = "pm_alternative_method",
});
  • #orderIdstringrequired

    The ID of the order with the failed payment.

  • #paymentMethodIdstring

    The ID of an alternative saved payment method to use for this retry. The payment method must belong to the same customer as the original order.

Scenario 3: retry with new payment details

Use this when the customer needs to provide completely new payment information—they changed numbers, they closed their mobile money account, or they want to pay with a method they’ve never used before. You’ll pass full payment details via paymentMethodData, just like creating a new order.

This is the most flexible retry option. It works whether the customer is new or returning, and it automatically saves the new payment method for future use.

Retry with new details

POST/orders/pay
cURLbash
curl https://api.inttegro.com/orders/pay \
  -H "Authorization: Bearer $INTTEGRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "or_failed_123",
  "payment_method_data": {
    "type": "mobile_money",
    "mobile_money": {
      "network": "telecel",
      "account_number": "0209876543"
    }
  }
}'
TypeScripttypescript
import { InttegroClient, PaymentMethodTypes, MobileMoneyNetworks } from '@inttegro/inttegro-sdk'

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

const result = await inttegro.orders.pay({
  orderId: "or_failed_123",
  paymentMethodData: {
    type: PaymentMethodTypes.MobileMoney,
    mobileMoney: {
      network: MobileMoneyNetworks.Telecel,
      accountNumber: "0209876543",
    },
  },
})
Gogo
package main

import (
  "context"
  "log"
  "os"

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

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

  params := order.PayParams{
    OrderID: "or_failed_123",
    PaymentMethodData: &paymentmethod.Data{
      Type: paymentmethod.TypeMobileMoney,
      MobileMoney: &paymentmethod.MobileMoneyParams{
        Network: paymentmethod.MobileMoneyNetworkTelecel,
        AccountNumber: "0209876543",
      },
    },
  }
  result, err := client.Orders.Pay(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.pay(inttegro.order.PayRequest(
  order_id="or_failed_123",
  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="0209876543",
    ),
  ),
))
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->pay([
  'order_id' => 'or_failed_123',
  'payment_method_data' => [
    'type' => \Inttegro\PaymentMethodType::MobileMoney,
    'mobile_money' => [
      'network' => \Inttegro\MobileMoneyNetwork::Telecel,
      'account_number' => '0209876543',
    ],
  ],
]);
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.pay(
  order_id: "or_failed_123",
  payment_method_data: {
    type: Inttegro::PaymentMethodType::MOBILE_MONEY,
    mobile_money: {
      network: Inttegro::MobileMoneyNetwork::TELECEL,
      account_number: "0209876543",
    },
  }
)
Javajava
import com.inttegro.Client;
import com.inttegro.orders.OrderPayParams;
import com.inttegro.paymentmethods.PaymentMethodData;
import com.inttegro.paymentmethods.PaymentMethodType;
import com.inttegro.paymentmethods.MobileMoneyParams;
import com.inttegro.paymentmethods.MobileMoneyNetwork;

public class Example {
  public static void main(String[] args) throws Exception {
    var client = new Client(System.getenv("INTTEGRO_API_KEY"));
    var params = OrderPayParams.builder()
      .orderId("or_failed_123")
      .paymentMethodData(PaymentMethodData.builder()
          .type(PaymentMethodType.MOBILE_MONEY)
          .mobileMoney(MobileMoneyParams.builder()
              .network(MobileMoneyNetwork.TELECEL)
              .accountNumber("0209876543")
              .build())
          .build())
      .build();
    var result = client.orders().pay(params);
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.PayAsync(new OrderPayRequest {
  OrderId = "or_failed_123",
  PaymentMethodData = new PaymentMethodData {
    Type = Inttegro.PaymentMethodType.MobileMoney,
    MobileMoney = new MobileMoney {
      Network = Inttegro.MobileMoneyNetwork.Telecel,
      AccountNumber = "0209876543",
    },
  },
});

Confirming the retry

Regardless of which retry method you use, inspect the returned order. When its next action requires confirmation, submit id, payment.id, payment.nextAction.confirmPayment.request.id, and the customer’s token. See Confirm a payment for complete SDK examples.

Best practices

Let customers choose their retry strategy

Don’t automatically retry with the same method. Show a failure message that explains what happened and give customers options: “Try again with this account”, “Use a different saved account”, or “Pay with a new account”. This respects customer preference and improves success rates.

Handle common failure patterns

Track why payments fail and adjust your retry UI accordingly. If the failure was insufficient_funds, suggest an alternative payment method immediately. If it was network_timeout, auto-retry once with the same method before asking the customer. If it was invalid_pin, explain that they need to enter the correct PIN—retrying won’t help until they fix their input.

Preserve order context

When retrying, show the customer what they’re paying for. Display the order summary, line items, and total prominently so they can verify everything before confirming the OTP. This prevents confusion about duplicate charges.

Set retry limits

Don’t allow unlimited retries. After 3-5 failed attempts, pause and suggest the customer contact their mobile money provider or try a different payment method entirely. This prevents fraud patterns and protects against brute-force attacks.

Monitor retry success rates

Track which retry strategies work best for your customers. If retries with saved methods succeed more often than new payment details, optimize your UI to suggest saved methods first. Use this data to improve your payment flow over time.

Type to search…

↑↓ navigate↵ selectEsc close