1curl -v -k -X POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders' \
2 -H 'PayPal-Request-Id: UNIQUE_ID' \
3 -H 'Authorization: Bearer PAYPAL_ACCESS_TOKEN' \
4 -H 'Content-Type: application/json' \
5 -H 'PayPal-Client-Metadata-Id: <CM_ID>' \
6 -d '{
7 "intent": "CAPTURE",
8 "payment_source": {
9 "card": {
10 "single_use_token": "1h371660pr490622k" //paymentToken from the client
11 }
12 },
13 "purchase_units": [
14 {
15 "amount": {
16 "currency_code": "USD",
17 "value": "50.00",
18 "breakdown": {
19 "item_total": {
20 "currency_code": "USD",
21 "value": "40.00"
22 },
23 "shipping": {
24 "currency_code": "USD",
25 "value": "10.00"
26 }
27 }
28 },
29 "items": [
30 {
31 "name": "Coffee",
32 "description": "1 lb Kona Island Beans",
33 "sku": "sku03",
34 "unit_amount": {
35 "currency_code": "USD",
36 "value": "40.00"
37 },
38 "quantity": "1",
39 "category": "PHYSICAL_GOODS",
40 "image_url": "https://example.com/static/images/items/1/kona_coffee_beans.jpg",
41 "url": "https://example.com/items/1/kona_coffee_beans",
42 "upc": {
43 "type": "UPC-A",
44 "code": "987654321015"
45 }
46 }
47 ],
48 "shipping": {
49 "type": "SHIPPING",
50 "name": {
51 "full_name": "Lawrence David"
52 },
53 "address": {
54 "address_line_1": "585 Moreno Ave",
55 "admin_area_2": "Los Angeles",
56 "admin_area_1": "CA", //must be sent in 2-letter format
57 "postal_code": "90049",
58 "country_code": "US"
59 },
60 "phone_number": {
61 "country_code": "1",
62 "national_number": "5555555555"
63 }
64 }
65 }
66 ]
67 }'