Orders rarely stay perfect after creation. Inventory changes, operations teams attach internal metadata after review, and approved quotes get revised after an invoice has already gone out. This guide shows how to use Update an order for the three update flows most teams hit in production without losing payment context or order history.
Prerequisites
- An existing order ID in a mutable state such as
Inttegro.OrderStatus.Preparing"preparing""preparing""preparing"'preparing''preparing'Inttegro::Order::Status::PREPARINGInttegro.OrderStatuses.PreparingorInttegro.OrderStatus.RequiresPayment"requires_payment""requires_payment""requires_payment"'requires_payment''requires_payment'Inttegro::Order::Status::REQUIRES_PAYMENTInttegro.OrderStatuses.RequiresPayment - Familiarity with the Order lifecycle
- Access to the Update an order API reference
How the update operation behaves
Reach for Update an order when you need to:
- Replace the order’s full line item set before payment starts
- Refresh order-level
CustomDatacustom_dataCustomDatacustomDatacustom_datacustom_datacustom_datacustomDatawithout disturbing payment state - Revise a sealed order and deliberately reseal it
The endpoint always returns the full order object. If the order is still open, Inttegro applies the change directly. If the order is already sealed and your change affects economics or payment configuration, you must make the seal decision explicit with FinalizefinalizeFinalizefinalizefinalizefinalizefinalizefinalize. Metadata-only CustomDatacustom_dataCustomDatacustomDatacustom_datacustom_datacustom_datacustomData updates are different: Inttegro can apply them without reopening or resealing by itself. The examples below use direct HTTPS calls so you can adopt the endpoint immediately from any stack.
Scenario 1: replace line items before payment starts
This is the most common order update flow. A customer changes quantities, an item goes out of stock, or you need to add a manual fee before charging. Send the complete new LineItemsline_itemsLineItemslineItemsline_itemsline_itemsline_itemslineItems array—Inttegro replaces the previous collection instead of merging it.
Replace line items
curl https://api.inttegro.com/orders/update \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
"number": "ORDER-2025-041-REV1",
"line_items": [
{
"type": "product",
"product": {
"name": "Warehouse-picked sneaker",
"type": "physical",
"quantity": 2,
"price": { "currency": "ghs", "value": 9500 }
}
},
{
"type": "fee",
"fee": {
"label": "Delivery fee",
"amount": { "currency": "ghs", "value": 1500 }
}
}
]
}'import { InttegroClient, LineItemTypes, ProductTypes } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.orders.update({
orderId: "or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
number: "ORDER-2025-041-REV1",
lineItems: [
{
type: LineItemTypes.Product,
product: {
name: "Warehouse-picked sneaker",
type: ProductTypes.Physical,
quantity: 2,
price: {
currency: "ghs",
value: 9500,
},
},
},
{
type: LineItemTypes.Fee,
fee: {
label: "Delivery fee",
amount: {
currency: "ghs",
value: 1500,
},
},
},
],
})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"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := order.UpdateParams{
OrderID: "or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
Number: "ORDER-2025-041-REV1",
LineItems: []order.LineItemParams{
{
Type: order.LineItemTypeProduct,
Product: &order.ProductLineItemParams{
Name: "Warehouse-picked sneaker",
Type: product.TypePhysical,
Quantity: 2,
Price: price.InlineParams{
AmountParams: money.AmountParams{
Currency: money.GHS,
Value: 9500,
},
},
},
},
{
Type: order.LineItemTypeFee,
Fee: &order.FeeLineItemParams{
Label: "Delivery fee",
Amount: money.AmountParams{
Currency: money.GHS,
Value: 1500,
},
},
},
},
}
result, err := client.Orders.Update(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.update(inttegro.order.UpdateRequest(
order_id="or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
number="ORDER-2025-041-REV1",
line_items=[
inttegro.product.LineItemInput(
type=inttegro.order.LineItemType.PRODUCT,
product=inttegro.product.InlineDetailsInput(
name="Warehouse-picked sneaker",
type=inttegro.product.Type.PHYSICAL,
quantity=2,
price=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=9500,
),
),
),
inttegro.shared.FeeLineItemInput(
type=inttegro.order.LineItemType.FEE,
fee=inttegro.shared.FeeDetailsInput(
label="Delivery fee",
amount=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=1500,
),
),
),
],
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->update([
'order_id' => 'or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA',
'number' => 'ORDER-2025-041-REV1',
'line_items' => [
[
'type' => \Inttegro\LineItemType::Product,
'product' => [
'name' => 'Warehouse-picked sneaker',
'type' => \Inttegro\ProductType::Physical,
'quantity' => 2,
'price' => [
'currency' => 'ghs',
'value' => 9500,
],
],
],
[
'type' => \Inttegro\LineItemType::Fee,
'fee' => [
'label' => 'Delivery fee',
'amount' => [
'currency' => 'ghs',
'value' => 1500,
],
],
],
],
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.update(
order_id: "or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
number: "ORDER-2025-041-REV1",
line_items: [
{
type: Inttegro::LineItemType::PRODUCT,
product: {
name: "Warehouse-picked sneaker",
type: Inttegro::ProductType::PHYSICAL,
quantity: 2,
price: {
currency: "ghs",
value: 9500,
},
},
},
{
type: Inttegro::LineItemType::FEE,
fee: {
label: "Delivery fee",
amount: {
currency: "ghs",
value: 1500,
},
},
},
]
)import com.inttegro.Client;
import com.inttegro.orders.OrderUpdateParams;
import java.util.List;
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.FeeLineItemParams;
import com.inttegro.money.AmountParams;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = OrderUpdateParams.builder()
.orderId("or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA")
.number("ORDER-2025-041-REV1")
.lineItems(List.of(
OrderLineItemParams.product(ProductLineItemParams.builder()
.name("Warehouse-picked sneaker")
.type(ProductType.PHYSICAL)
.quantity(2L)
.price(PriceParams.of(Currency.GHS, 9500))
.build()),
OrderLineItemParams.fee(FeeLineItemParams.builder()
.label("Delivery fee")
.amount(AmountParams.of(Currency.GHS, 1500))
.build())
))
.build();
var result = client.orders().update(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.UpdateAsync(new OrderUpdateRequest {
OrderId = "or_4Jv9wK2LmQ8rT6xP1nY5sC3dF7hB0uA",
Number = "ORDER-2025-041-REV1",
LineItems = new List<LineItemParams> {
new LineItemParams {
Type = Inttegro.LineItemType.Product,
Product = new ProductDetailsParams {
Name = "Warehouse-picked sneaker",
Type = Inttegro.ProductType.Physical,
Quantity = 2,
Price = new Inttegro.PriceParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 9500,
},
},
},
new LineItemParams {
Type = Inttegro.LineItemType.Fee,
Fee = new FeeDetailsParams {
Label = "Delivery fee",
Amount = new AmountParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 1500,
},
},
},
},
});After the update:
- Inttegro replaces the previous line items completely.
LineItemGroup.Totalline_item_group.totalLineItemGroup.TotallineItemGroup.totallineItemGroup.totalline_item_group.totalline_item_group.totallineItemGroup.totalandPayment.Amountpayment.amountPayment.Amountpayment.amountpayment.amountpayment.amountpayment.amountpayment.amountare recalculated from the new items.- The order remains editable because you did not ask Inttegro to seal it.
Scenario 2: refresh order-level custom data
Many teams update orders after creation just to attach operational metadata: a review channel, approver identity, fulfillment lane, or internal note that should travel with the order. Send the full replacement CustomDatacustom_dataCustomDatacustomDatacustom_datacustom_datacustom_datacustomData object when you want to refresh those fields. This is a metadata-only mutation, so it does not require reopen or reseal by itself.
Update custom data
curl https://api.inttegro.com/orders/update \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
"custom_data": {
"channel": "ops_review",
"edited_by": "dashboard",
"priority": "high"
}
}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.orders.update({
orderId: "or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
customData: {
channel: "ops_review",
edited_by: "dashboard",
priority: "high",
},
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/customdata"
"github.com/inttegro/inttegro-sdk-go/v14/order"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := order.UpdateParams{
OrderID: "or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
CustomData: func() *customdata.Data { value, err := customdata.New(map[string]string{
"channel": "ops_review",
"edited_by": "dashboard",
"priority": "high",
}); if err != nil { panic(err) }; return value }(),
}
result, err := client.Orders.Update(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.update(inttegro.order.UpdateRequest(
order_id="or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
custom_data=inttegro.CustomData({
"channel": "ops_review",
"edited_by": "dashboard",
"priority": "high",
}),
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->update([
'order_id' => 'or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u',
'custom_data' => [
'channel' => 'ops_review',
'edited_by' => 'dashboard',
'priority' => 'high',
],
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.update(
order_id: "or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
custom_data: {
channel: "ops_review",
edited_by: "dashboard",
priority: "high",
}
)import com.inttegro.Client;
import com.inttegro.orders.OrderUpdateParams;
import com.inttegro.CustomData;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = OrderUpdateParams.builder()
.orderId("or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u")
.customData(new CustomData()
.set("channel", "ops_review")
.set("edited_by", "dashboard")
.set("priority", "high"))
.build();
var result = client.orders().update(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.UpdateAsync(new OrderUpdateRequest {
OrderId = "or_aR7mK4qP9dT2xW6nC1yV8sJ5bL0fH3u",
CustomData = new Inttegro.CustomData()
.Set("channel", "ops_review")
.Set("edited_by", "dashboard")
.Set("priority", "high"),
});After the update:
- Inttegro replaces the top-level
CustomDatacustom_dataCustomDatacustomDatacustomDatacustom_datacustom_datacustomDataobject with the new one you provided. - The order’s economic state stays unchanged: totals, line items, and payment amount are preserved.
- Because this is metadata-only, you can use it without reopening a sealed order or resealing it again.
Use this flow for internal annotations that should travel with the order record but must not change what the customer pays. Typical examples include review queues, fulfillment lanes, campaign attribution, and dashboard-only notes.
Scenario 3: revise a sealed order and reseal it in one request
This is the high-friction case that matters most in production. You already finalized the order and maybe even sent the invoice, then a customer negotiates a change before payment completes. Send the revised fields together with FinalizefinalizeFinalizefinalizefinalizefinalizefinalizefinalize: truetruetruetruetrueTruetruetrue and Inttegro will reopen the sealed order internally, apply the changes, and reseal it before returning the updated object.
Revise and reseal
curl https://api.inttegro.com/orders/update \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
"number": "QUOTE-2025-009-REV2",
"finalize": true,
"line_items": [
{
"type": "product",
"product": {
"name": "Annual support retainer",
"type": "service",
"quantity": 1,
"price": { "currency": "ghs", "value": 120000 }
}
},
{
"type": "fee",
"fee": {
"label": "Onboarding workshop",
"amount": { "currency": "ghs", "value": 15000 }
}
}
]
}'import { InttegroClient, LineItemTypes, ProductTypes } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.orders.update({
orderId: "or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
number: "QUOTE-2025-009-REV2",
finalize: true,
lineItems: [
{
type: LineItemTypes.Product,
product: {
name: "Annual support retainer",
type: ProductTypes.Service,
quantity: 1,
price: {
currency: "ghs",
value: 120000,
},
},
},
{
type: LineItemTypes.Fee,
fee: {
label: "Onboarding workshop",
amount: {
currency: "ghs",
value: 15000,
},
},
},
],
})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"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := order.UpdateParams{
OrderID: "or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
Number: "QUOTE-2025-009-REV2",
Finalize: inttegro.Bool(true),
LineItems: []order.LineItemParams{
{
Type: order.LineItemTypeProduct,
Product: &order.ProductLineItemParams{
Name: "Annual support retainer",
Type: product.TypeService,
Quantity: 1,
Price: price.InlineParams{
AmountParams: money.AmountParams{
Currency: money.GHS,
Value: 120000,
},
},
},
},
{
Type: order.LineItemTypeFee,
Fee: &order.FeeLineItemParams{
Label: "Onboarding workshop",
Amount: money.AmountParams{
Currency: money.GHS,
Value: 15000,
},
},
},
},
}
result, err := client.Orders.Update(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.update(inttegro.order.UpdateRequest(
order_id="or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
number="QUOTE-2025-009-REV2",
finalize=True,
line_items=[
inttegro.product.LineItemInput(
type=inttegro.order.LineItemType.PRODUCT,
product=inttegro.product.InlineDetailsInput(
name="Annual support retainer",
type=inttegro.product.Type.SERVICE,
quantity=1,
price=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=120000,
),
),
),
inttegro.shared.FeeLineItemInput(
type=inttegro.order.LineItemType.FEE,
fee=inttegro.shared.FeeDetailsInput(
label="Onboarding workshop",
amount=inttegro.price.InlineParams(
currency=inttegro.money.Currency.GHS,
value=15000,
),
),
),
],
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->orders->update([
'order_id' => 'or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y',
'number' => 'QUOTE-2025-009-REV2',
'finalize' => true,
'line_items' => [
[
'type' => \Inttegro\LineItemType::Product,
'product' => [
'name' => 'Annual support retainer',
'type' => \Inttegro\ProductType::Service,
'quantity' => 1,
'price' => [
'currency' => 'ghs',
'value' => 120000,
],
],
],
[
'type' => \Inttegro\LineItemType::Fee,
'fee' => [
'label' => 'Onboarding workshop',
'amount' => [
'currency' => 'ghs',
'value' => 15000,
],
],
],
],
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.orders.update(
order_id: "or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
number: "QUOTE-2025-009-REV2",
finalize: true,
line_items: [
{
type: Inttegro::LineItemType::PRODUCT,
product: {
name: "Annual support retainer",
type: Inttegro::ProductType::SERVICE,
quantity: 1,
price: {
currency: "ghs",
value: 120000,
},
},
},
{
type: Inttegro::LineItemType::FEE,
fee: {
label: "Onboarding workshop",
amount: {
currency: "ghs",
value: 15000,
},
},
},
]
)import com.inttegro.Client;
import com.inttegro.orders.OrderUpdateParams;
import java.util.List;
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.FeeLineItemParams;
import com.inttegro.money.AmountParams;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = OrderUpdateParams.builder()
.orderId("or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y")
.number("QUOTE-2025-009-REV2")
.finalizeOrder(true)
.lineItems(List.of(
OrderLineItemParams.product(ProductLineItemParams.builder()
.name("Annual support retainer")
.type(ProductType.SERVICE)
.quantity(1L)
.price(PriceParams.of(Currency.GHS, 120000))
.build()),
OrderLineItemParams.fee(FeeLineItemParams.builder()
.label("Onboarding workshop")
.amount(AmountParams.of(Currency.GHS, 15000))
.build())
))
.build();
var result = client.orders().update(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Orders.UpdateAsync(new OrderUpdateRequest {
OrderId = "or_zT5mQ8wL2pR7vK1xN4cD9sF6hB3uJ0y",
Number = "QUOTE-2025-009-REV2",
Finalize = true,
LineItems = new List<LineItemParams> {
new LineItemParams {
Type = Inttegro.LineItemType.Product,
Product = new ProductDetailsParams {
Name = "Annual support retainer",
Type = Inttegro.ProductType.Service,
Quantity = 1,
Price = new Inttegro.PriceParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 120000,
},
},
},
new LineItemParams {
Type = Inttegro.LineItemType.Fee,
Fee = new FeeDetailsParams {
Label = "Onboarding workshop",
Amount = new AmountParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 15000,
},
},
},
},
});After the update:
- Inttegro recalculates the order total and payment amount from the revised items.
SealedAtsealed_atSealedAtsealedAtsealedAtsealed_atsealed_atsealedAtis refreshed because the order was sealed again.InvoiceinvoiceInvoiceinvoiceinvoiceinvoiceinvoiceinvoiceis regenerated so the latest hosted checkout and PDF reflect the revised commercial terms.
If you want the order to stay open for more manual edits, send the same mutation with FinalizefinalizeFinalizefinalizefinalizefinalizefinalizefinalize: falsefalsefalsefalsefalseFalsefalsefalse instead. Inttegro will reopen the sealed order and clear the active invoice until you seal it again with Finalize an order or another Update an order call.
Related resources
- Update an order - Complete endpoint reference
- Create an order - Create orders that you may revise later
- Custom Data - Design metadata shapes for operational annotations
- Finalize an order - Seal the current order state without charging
- Pay for an order - Start payment after the latest revision is ready
- Order lifecycle - Understand which statuses still allow updates
- Order now, pay later - Build deferred payment flows around mutable orders