Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mercadopago/sdk-java/llms.txt
Use this file to discover all available pages before exploring further.
OrderClient is the entry point for the Mercado Pago Orders API (v1). An order is the top-level entity that groups one or more payment transactions, line items, payer information, and configuration options for online or point-of-sale checkout flows. The client exposes the complete order lifecycle — creation, retrieval, processing, cancellation, capture, and refund — as well as transaction management operations (create, update, delete individual transactions within an order) and paginated search.
Package: com.mercadopago.client.order
Note: All methods that accept anorderIdortransactionIdparameter validate that the value is non-blank. A blank ornullvalue throwsIllegalArgumentExceptionimmediately, before any HTTP request is made.
Constructors
OrderClient()
Creates an OrderClient using the default HTTP client configured via MercadoPagoConfig.
OrderClient(MPHttpClient httpClient)
Creates an OrderClient with a custom HTTP client.
The HTTP client implementation used to execute all requests.
Methods
create — Create an order
created state; call process to trigger payment execution.
The order creation request. Key fields:
| Field | Type | Description |
|---|---|---|
type | String | Order type: "online" or "point". |
totalAmount | String | Total amount as a decimal string (e.g. "150.00"). |
externalReference | String | Your system’s reference identifier for this order. |
transactions | OrderTransactionRequest | Transaction/payment details for the order. |
payer | OrderPayerRequest | Payer information for the order. |
items | List<OrderItemRequest> | Line items included in the checkout. |
captureMode | String | "automatic" or "manual" capture mode. |
processingMode | String | "aggregator" or "gateway" processing. |
description | String | Short description of the order. |
expirationTime | String | ISO 8601 duration or datetime for order expiry. |
config | OrderConfigRequest | Payment method and checkout configuration options. |
Optional per-request overrides for access token, custom headers, or timeouts. Pass
null to use global defaults.Order — the created order, including id, status, and checkoutUrl.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
get — Retrieve an order by ID
The unique identifier of the order. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.Order — the requested order.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if id is blank or null.
process — Process an order
created status before calling this method.
The unique identifier of the order to process. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.Order — the order with updated status reflecting the payment outcome.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if id is blank or null.
cancel — Cancel an order
The unique identifier of the order to cancel. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.Order — the cancelled order with updated status.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if orderId is blank or null.
capture — Capture an authorized order
captureMode = "manual"), settling all its payments.
The unique identifier of the order to capture. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.Order — the captured order with updated status.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if orderId is blank or null.
refund — Refund an order
Refunds all or part of an order’s payments. If no OrderRefundRequest is provided, a total refund is performed.
Total refund
The unique identifier of the order to refund. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.Partial refund
The unique identifier of the order to partially refund. Must not be blank or
null.Refund details. Contains a
transactions field — a list of OrderRefundPaymentRequest objects each specifying the payment ID and refund amount. Pass null to perform a total refund.Optional per-request overrides. Pass
null to use global defaults.Order — the order with updated status and transaction refund state.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if orderId is blank or null.
createTransaction — Add a transaction to an order
process.
The unique identifier of the order to add a transaction to.
Transaction details including payment method, amount, and payer information.
Optional per-request overrides. Pass
null to use global defaults.OrderTransaction — the created transaction object.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
updateTransaction — Update a transaction in an order
The unique identifier of the order. Must not be blank or
null.The unique identifier of the transaction to update. Must not be blank or
null.The updated transaction/payment details.
Optional per-request overrides. Pass
null to use global defaults.UpdateOrderTransaction — the updated transaction result.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if orderId or transactionId is blank or null.
deleteTransaction — Delete a transaction from an order
OrderTransaction object holds the API response but no body content.
The unique identifier of the order. Must not be blank or
null.The unique identifier of the transaction to delete. Must not be blank or
null.Optional per-request overrides. Pass
null to use global defaults.OrderTransaction — an object whose getResponse() holds the raw API response (typically a 204 No Content).
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses; IllegalArgumentException if either ID is blank or null.
search — Search orders with pagination
Search parameters. Build with
MPSearchRequest.builder().filters(map).offset(0).limit(20).build(). Common filters include external_reference, status, user_id.Optional per-request overrides. Pass
null to use global defaults.OrderSearchResponse — contains matching orders and pagination metadata.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
Resource classes
Order resource
Key fields on the Order object returned by the API:
Unique identifier of the order.
Current order status:
created, processed, expired, cancelled.Sub-status providing additional context about the current order status.
Total order amount as a decimal string.
Total amount already paid on this order.
Your system’s reference ID for this order.
URL to redirect the buyer to the checkout flow. Generated at creation.
Capture mode:
automatic or manual.Transaction details including payments, refunds, and chargebacks.
Line items included in the order.
Payer information associated with the order.
ISO 8601 timestamp when the order was created.