View as Markdown
API Spec (JSON)
API Spec (YAML)
Compact modeHides field descriptions and other prose for a more compact, scannable view of the API reference.Note: For error handling and troubleshooting, see Orders v2 errors.
Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/payments/paymenthttps://uri.paypal.com/services/payments/orders/deprecating-jssdk-migration-for-limited-merchantsapplication/json
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" } ]}