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.Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/payments/paymentapplication/json
TypeScript Definitions
Use the request body type in TypeScript.
tracking_numberstring<currency_code>Requiredcarrierenum<shipment_carrier>Requiredcarrier_name_otherstring<currency_code>Optionalnotify_payerbooleanOptionalitemsobject<tracker_item>[]Optionalskustring<currency_code>Optionalupcobject<universal_product_code>Optionalapplication/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()
{
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;
// Request body for this sample:
// {
// "capture_id": "8MC585209K746392H",
// "tracking_number": "443844607820",
// "notify_payer": false,
// "items": [
// {
// "name": "T-Shirt",
// "sku": "sku02",
// "quantity": "1",
// "upc": {
// "type": "UPC-A",
// "code": "012345678901"
// },
// "image_url": "https://www.example.com/example.jpg",
// "url": "https://www.example.com/example"
// }
// ]
// }
CreateOrderTrackingInput createOrderTrackingInput = new CreateOrderTrackingInput
{
Id = "5O190127TN364715T",
Body = new OrderTrackerRequest
{
CaptureId = "74L756601X447022Y",
NotifyPayer = false,
},
};
try
{
ApiResponse<Order> result = await ordersController.CreateOrderTrackingAsync(createOrderTrackingInput);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
}
}
}Request Body
{
"capture_id": "8MC585209K746392H",
"tracking_number": "443844607820",
"notify_payer": false,
"items": [
{
"name": "T-Shirt",
"sku": "sku02",
"quantity": "1",
"upc": {
"type": "UPC-A",
"code": "012345678901"
},
"image_url": "https://www.example.com/example.jpg",
"url": "https://www.example.com/example"
}
]
}Response samples
{ "id": "5O190127TN364715T", "purchase_units": [ { "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b", "items": [ { "name": "Air Jordan Shoe", "sku": "sku01", "quantity": "1", "unit_amount": { "currency_code": "USD", "value": "50.00" } }, { "name": "T-Shirt", "sku": "sku02", "quantity": "1", "unit_amount": { "currency_code": "USD", "value": "50.00" } } ], "shipping": { "trackers": [ { "id": "8MC585209K746392H-443844607820", "links": [ { "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "up", "method": "GET" }, { "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T/trackers/8MC585209K746392H-443844607820", "rel": "edit", "method": "PATCH" } ], "create_time": "2022-08-12T21:20:49Z", "update_time": "2022-08-12T21:20:49Z" } ] }, "payments": { "captures": [ { "id": "8MC585209K746392H", "status": "COMPLETED", "amount": { "currency_code": "USD", "value": "100.00" }, "seller_protection": { "status": "NOT_ELIGIBLE" }, "final_capture": true, "seller_receivable_breakdown": { "gross_amount": { "currency_code": "USD", "value": "100.00" }, "paypal_fee": { "currency_code": "USD", "value": "3.00" }, "net_amount": { "currency_code": "USD", "value": "97.00" } }, "create_time": "2018-04-01T21:20:49Z", "update_time": "2018-04-01T21:20:49Z", "links": [ { "href": "https://api-m.paypal.com/v2/payments/captures/8MC585209K746392H", "rel": "self", "method": "GET" }, { "href": "https://api-m.paypal.com/v2/payments/captures/8MC585209K746392H/refund", "rel": "refund", "method": "POST" } ] } ] } } ], "links": [ { "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "self", "method": "GET" } ]}