Li
Delete
Are you sure you want to delete this?
PaypalModel
-
Date
-
20211019
-
Target
-
C_019
-
Title
-
REST API 전개 순서, https://demo.paypal.com/us/demo/go_platform/pcRestServerV2/cart
-
Contents
-
REST API integration supports instant capture, authorize capture, refunds, and transaction reporting. Plus, it provides more ways for buyers to pay.
1. Get Access Token
2. Creat Order
3. Order Details
4. Patch Order
5.Immediate Capture
1. Get Access Token
POST https://api.sandbox.paypal.com/v1/oauth2/token
POST https://api.sandbox.paypal.com/v1/oauth2/token
{
"PayPal-Request-Id": "platform-1635604319366",
"Authorization": "Basic QVRz****************************************************************************************************************************************************************************************************************akE="
}
grant_type=client_credentials
2. Creat Order
POST https://api.sandbox.paypal.com/v2/checkout/orders
{
"PayPal-Request-Id": "platform-1635604319697",
"Content-Type": "application/json",
"cache-control": "no-cache",
"Authorization": "Bearer A21******************************************************************************************h4-Q"
}
{
"intent": "CAPTURE",
"purchase_units": [
{
"reference_id": "PU1",
"description": "Camera Shop",
"invoice_id": "INV-CameraShop-1635604326993",
"custom_id": "CUST-CameraShop",
"amount": {
"currency_code": "USD",
"value": 300,
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": 300
}
}
},
"items": [
{
"name": "DSLR Camera",
"description": "Black Camera - Digital SLR",
"sku": "sku01",
"unit_amount": {
"currency_code": "USD",
"value": 300
},
"quantity": "1",
"category": "PHYSICAL_GOODS"
}
]
}
]
}
3. Order Details
GET https://api.sandbox.paypal.com/v2/checkout/orders/7P5139080N115310D
{
"PayPal-Request-Id": "platform-1635604337916",
"Content-Type": "application/json",
"Authorization": "Bearer A21******************************************************************************************h4-Q"
}
4. Patch Order
PATCH https://api.sandbox.paypal.com/v2/checkout/orders/7P5139080N115310D
{
"PayPal-Request-Id": "platform-1635604338236",
"Content-Type": "application/json",
"Authorization": "Bearer A21******************************************************************************************h4-Q"
}
[
{
"op": "replace",
"path": "/purchase_units/@reference_id=='PU1'/amount",
"value": {
"currency_code": "USD",
"value": 350,
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": 300
},
"shipping": {
"currency_code": "USD",
"value": 20
},
"tax_total": {
"currency_code": "USD",
"value": 30
}
}
}
}
]
5. Immediate Capture
POST https://api.sandbox.paypal.com/v2/checkout/orders/7P5139080N115310D/capture/
POST https://api.sandbox.paypal.com/v2/checkout/orders/7P5139080N115310D/capture/
{
"PayPal-Request-Id": "platform-1635604341011",
"Content-Type": "application/json",
"Authorization": "Bearer A21******************************************************************************************h4-Q"
}