Orders
in package
Orders resource for creating orders, processing payments, and managing order lifecycle.
Orders are the central transaction object in Inttegro. They represent a purchase with line items, customer information, and payment details. Use this resource to create orders, charge customers, handle confirmations, and process refunds.
Tags
Table of Contents
Methods
- __construct() : mixed
- cancel() : Order
- Cancel an order, stopping payment execution and preventing further processing.
- complete() : Order
- Mark an order as completed, indicating fulfillment is done.
- confirmPayment() : Order
- Confirm a pending payment using a verification token (e.g., OTP sent to customer's phone).
- create() : Order
- Create a new order with line items, customer, and payment details.
- createLegacy() : Order
- Compatibility route for POST /orders/new. Prefer create() for the canonical /orders/create endpoint.
- finalize() : Order
- Finalize an order to make it immutable and ready for payment or fulfillment.
- lookup() : Order
- Retrieve an existing order by its ID.
- page() : OrderPage
- Retrieve a paginated list of orders.
- pay() : Order
- Initiate payment for an existing order.
- refund() : Refund
- Create a refund through the `/orders/refund` compatibility alias.
- requestConfirmation() : Order
- Request a new confirmation token to be sent to the customer (e.g., resend OTP).
- sendInvoice() : OrderDocumentDeliveryResult
- Send the hosted invoice link for an existing order.
- sendReceipt() : OrderDocumentDeliveryResult
- Send the hosted receipt link for a paid order.
- update() : Order
- Update mutable fields on an existing order (POST /orders/update).
Methods
__construct()
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
cancel()
Cancel an order, stopping payment execution and preventing further processing.
public
cancel(string $orderId[, array<string|int, mixed> $requestMeta = [] ]) : Order
Canceling an order is irreversible and should be done when the customer requests cancellation or the order cannot be fulfilled. If payment was already captured, you'll need to refund it separately.
Parameters
- $orderId : string
-
Unique identifier of the order to cancel (required)
- $requestMeta : array<string|int, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
Order —The cancelled order
complete()
Mark an order as completed, indicating fulfillment is done.
public
complete(array<string|int, mixed> $payload) : Order
Call this after you've shipped physical goods or delivered digital products to the customer. Completing an order transitions it to its final state and can optionally mark payment as received offline (out-of-band) if paid_out_of_band is set to true.
Parameters
- $payload : array<string|int, mixed>
-
Completion parameters
- order_id: string - Unique identifier of the order to complete (required)
- paid_out_of_band: bool - Set to true if payment received outside Inttegro (default: false)
Tags
Return values
Order —The completed order
confirmPayment()
Confirm a pending payment using a verification token (e.g., OTP sent to customer's phone).
public
confirmPayment(array<string|int, mixed> $payload) : Order
Call this method when a payment requires customer confirmation and you've collected the verification token from the customer. The token is typically a 6-digit OTP sent via SMS or email.
Parameters
- $payload : array<string|int, mixed>
-
Confirmation parameters
- order_id: string - Unique identifier of the order being paid (required)
- token: string - Verification token provided by customer (required, typically 6 digits)
Tags
Return values
Order —The updated order
create()
Create a new order with line items, customer, and payment details.
public
create(array<string|int, mixed> $payload) : Order
Creates an order representing a purchase. You can create an order for a new or existing customer, include multiple line items, and optionally execute payment immediately. Orders must have at least one line item and billing details.
Parameters
- $payload : array<string|int, mixed>
-
Order creation parameters
- customer_data: array - New customer information (required if customer_id not provided)
- customer_id: string - Existing customer ID (required if customer_data not provided)
- line_items: array - List of products/services being purchased (required)
- billing_details: array - Billing contact information (required)
- payment_method_id: string - ID of saved payment method to use
- payment_method_data: array - Inline payment method details
- execute_payment: bool - Whether to immediately charge (default: false)
- checkout_settings: array - Checkout flow configuration with redirect_url and cancel_url
- payout_settings: array - Order-specific payout destination configuration
- custom_data: array - Key-value custom data (max 25KB, keys and values must be strings)
- request_meta: array - Request controls such as idempotency_key
- number: string - Optional order number for reference
- statement_descriptor: string - Text on customer's bank statement (max 22 characters)
- statement_descriptor_prefix: string - Static prefix, 2-10 characters, used to build prefix*order_id; mutually exclusive with statement_descriptor
- finalize: bool - Whether to explicitly finalize order (default: false)
Tags
Return values
Order —The created order
createLegacy()
Compatibility route for POST /orders/new. Prefer create() for the canonical /orders/create endpoint.
public
createLegacy(array<string|int, mixed> $payload) : Order
Parameters
- $payload : array<string|int, mixed>
Return values
Orderfinalize()
Finalize an order to make it immutable and ready for payment or fulfillment.
public
finalize(string $orderId[, array<string|int, mixed> $requestMeta = [] ]) : Order
Finalizing (sealing) an order locks its line items and totals, making it ready for payment execution or order completion. Most orders are finalized automatically, but you can explicitly finalize if needed.
Parameters
- $orderId : string
-
Unique identifier of the order to finalize (required)
- $requestMeta : array<string|int, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
Order —The finalized order
lookup()
Retrieve an existing order by its ID.
public
lookup(string $orderId[, array<string|int, mixed> $options = [] ]) : Order
Returns full order details including customer, line items, payment state, and invoice information. Use this to check order status, retrieve payment details, or display order confirmation to customers.
Parameters
- $orderId : string
-
Unique identifier of the order to retrieve (required)
- $options : array<string|int, mixed> = []
-
Additional options (currently unused)
Tags
Return values
Order —The complete order
page()
Retrieve a paginated list of orders.
public
page([array<string|int, mixed> $payload = [] ]) : OrderPage
Returns orders in reverse chronological order (most recent first).
Parameters
- $payload : array<string|int, mixed> = []
-
Pagination and filter parameters (optional)
- page_number: int - Zero-based page index to retrieve (0-10)
- page_size: int - Number of orders per page (1-256)
- customer_id: string - Optional customer whose orders should be returned
Tags
Return values
OrderPage —Paginated orders and pagination details
pay()
Initiate payment for an existing order.
public
pay(array<string|int, mixed> $payload) : Order
Supports three payment flows:
- Saved payment method: Provide only order_id to charge a previously saved payment method
- New payment method: Include payment_method_data with inline payment details
- Offline payment: Set paid_out_of_band to true for cash, bank transfer, or check payments
When payment requires customer confirmation (e.g., OTP), the returned order includes a nextAction field.
Parameters
- $payload : array<string|int, mixed>
-
Payment parameters
- order_id: string - Unique identifier of the order to pay (required)
- payment_method_data: array - Inline payment method details (mobile money, card, etc.)
- payment_method_id: string - ID of a saved payment method to use
- paid_out_of_band: bool - Set to true if payment received outside Inttegro (default: false)
Tags
Return values
Order —The updated order and payment state
refund()
Create a refund through the `/orders/refund` compatibility alias.
public
refund(array<string|int, mixed> $payload[, string|null $idempotencyKey = null ]) : Refund
This accepts the same line-item payload as $client->refunds->create() and returns
the created Refund directly. New integrations should use the canonical method.
Parameters
- $payload : array<string|int, mixed>
-
Create-refund payload containing order_id, reason, and line_items
- $idempotencyKey : string|null = null
-
Optional key for safely retrying the request
Tags
Return values
Refund —The created refund
requestConfirmation()
Request a new confirmation token to be sent to the customer (e.g., resend OTP).
public
requestConfirmation(string $orderId[, array<string|int, mixed> $requestMeta = [] ]) : Order
Use this when the customer didn't receive the original OTP or the token expired. A fresh verification token will be sent via SMS or email to the customer's registered contact information.
Parameters
- $orderId : string
-
Unique identifier of the order requiring confirmation (required)
- $requestMeta : array<string|int, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
Order —The updated order
sendInvoice()
Send the hosted invoice link for an existing order.
public
sendInvoice(array<string|int, mixed> $payload) : OrderDocumentDeliveryResult
Parameters
- $payload : array<string|int, mixed>
-
Send invoice parameters
- order_id: string - Unique identifier of the order whose invoice should be sent (required)
Return values
OrderDocumentDeliveryResult —Order and delivery details
sendReceipt()
Send the hosted receipt link for a paid order.
public
sendReceipt(array<string|int, mixed> $payload) : OrderDocumentDeliveryResult
Parameters
- $payload : array<string|int, mixed>
-
Send receipt parameters
- order_id: string - Unique identifier of the paid order whose receipt should be sent (required)
Return values
OrderDocumentDeliveryResult —Order and delivery details
update()
Update mutable fields on an existing order (POST /orders/update).
public
update(array<string|int, mixed> $payload) : Order
Parameters
- $payload : array<string|int, mixed>