I am getting an "Uncaught Error: Expected an order id to be passed"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting an "Uncaught Error: Expected an order id to be passed" back even though I see an id being returned, and there are no errors in the event log for the Paypal sandbox request that was made.
JS return from createOrder:
ack | true | ||||
data | Object { id: "4R111128JP953492S" } | ||||
id | "4R111128JP953492S"
Corresponding event log entry:
|

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @C_Cataldo,
Thank you for posting to the PayPal Merchant Community.
Here are a few things to remember when creating and capturing orders:
- You must create an access token and pass an access token with every request
- Orders must be authorized
- Orders expire within 3 hours if not authorized
If you create an order, and attempt to capture the order without an access token (authorization header), you will receive an AUTHENTICATION_FAILURE error message.
If you capture an order without it being authorized, you will receive an error message ORDER_NOT_APPROVED.
If you attempt to capture an order that is over 3 hours old you will receive an error of RESOURCE_NOT_FOUND.
Make certain that when you create your order, you go through the sandbox buyer checkout process (you may need to paste the url into a browser).
After approving the order, capture the order, ensuring that you have an access token in the authorization header (to avoid order id errors).
Thank you,
Jennifer
MTS
PayPal

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Unable to issue a refund from our business sandbox account in Sandbox Environment
- CHECKOUT.ORDER.APPROVED webhook event not triggered if payment_source is passed in in REST APIs
- Why does PayPal redirect to different pages (login vs credit card form) depending on browser mode? in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- Cant get mobile number from details. object even though my paypal button mandates submission in Sandbox Environment
- AUTH_FLOW_REQUIRED in SDKs