On this page
No Headings
Shows details for an order, by ID.Note: For error handling and troubleshooting, see Orders v2 errors.
Oauth2 https://uri.paypal.com/services/payments/payment, https://uri.paypal.com/services/payments/orders/deprecating-jssdk-migration-for-limited-merchantsOauth 2.0 authentication
In: header
Scope: https://uri.paypal.com/services/payments/payment, https://uri.paypal.com/services/payments/orders/deprecating-jssdk-migration-for-limited-merchants
The ID of the order for which to show details.
^[A-Z0-9]+$1 <= length <= 36A comma-separated list of fields that should be returned for the order. Valid filter field is payment_source.
^[a-z_]*$0 <= length <= 2147483647Holds authorization information for external API calls.
^.*$1 <= length <= 16000Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header.
^.*$1 <= length <= 10000application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
Request samples
using Microsoft.Extensions.Logging;
using PaypalServerSdk.Standard;
using PaypalServerSdk.Standard.Authentication;
using PaypalServerSdk.Standard.Controllers;
using PaypalServerSdk.Standard.Exceptions;
using PaypalServerSdk.Standard.Http.Response;
using PaypalServerSdk.Standard.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace TestConsoleProject
{
public class Program
{
public static async Task Main()
{
// Scenario: 200 - Get Order - Show Order Details After Customer Approval
PaypalServerSdkClient client = new PaypalServerSdkClient.Builder()
.ClientCredentialsAuth(
new ClientCredentialsAuthModel.Builder(
"OAuthClientId",
"OAuthClientSecret"
)
.Build())
.Environment(PaypalServerSdk.Standard.Environment.Sandbox)
.LoggingConfig(config => config
.LogLevel(LogLevel.Information)
.RequestConfig(reqConfig => reqConfig.Body(true))
.ResponseConfig(respConfig => respConfig.Headers(true))
)
.Build();
OrdersController ordersController = client.OrdersController;
GetOrderInput getOrderInput = new GetOrderInput
{
Id = "5O190127TN364715T",
};
try
{
ApiResponse<Order> result = await ordersController.GetOrderAsync(getOrderInput);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
}
}
}Response samples
{
"id": "5O190127TN364715T",
"payment_source": {
"paypal": {
"name": {
"given_name": "John",
"surname": "Doe"
},
"email_address": "customer@example.com",
"account_id": "QYR5Z8XDVJNXQ"
}
},
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "USD",
"value": "100.00"
}
}
],
"payer": {
"name": {
"given_name": "John",
"surname": "Doe"
},
"email_address": "customer@example.com",
"payer_id": "QYR5Z8XDVJNXQ"
},
"create_time": "2018-04-01T21:18:49Z",
"links": [
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "self",
"method": "GET"
},
{
"href": "https://www.paypal.com/checkoutnow?token=5O190127TN364715T",
"rel": "approve",
"method": "GET"
},
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "edit",
"method": "PATCH"
},
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T/capture",
"rel": "capture",
"method": "POST"
}
]
}{
"name": "RESOURCE_NOT_FOUND",
"message": "The specified resource does not exist.",
"debug_id": "ccb6f410b107f",
"details": [
{
"issue": "INVALID_RESOURCE_ID",
"description": "Specified resource ID does not exist. Please check the resource ID and try again."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/payments/v2/#error-INVALID_RESOURCE_ID",
"rel": "information_link"
}
]
}