🛒 Ecommerce
Generate paypal order
The API allows a user to generate a PayPal order instance, facilitating the creation of an order and initiating the checkout flow before the payment.
The API accepts the addressId of the user's address as input to associate it with the order.
This functionality enables users to seamlessly generate an order and proceed to the checkout process, providing a smooth and efficient payment experience using PayPal integration.
post/ecommerce/orders/provider/paypal
Request body
Example request
{
"addressId": "64b0589005c0bdf2d75643b7"
}Response
Generate paypal order
Example response
{
"data": {
"id": "2AH88886SG978004Y",
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/2AH88886SG978004Y",
"method": "GET",
"rel": "self"
},
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=2AH88886SG978004Y",
"method": "GET",
"rel": "approve"
},
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/2AH88886SG978004Y",
"method": "PATCH",
"rel": "update"
},
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/2AH88886SG978004Y/capture",
"method": "POST",
"rel": "capture"
}
],
"status": "CREATED"
},
"message": "Paypal order generated successfully",
"statusCode": 201,
"success": true
}