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.
- Why does using Test Mode in Formstack always complain about user credentials? in Sandbox Environment
- Pay later messaging only working with default merchant currency and not others in SDKs
- Transaction detail always shows "Not specified" for customer phone number. in PayPal Payments Standard
- PayPal Pay Later message it says invalid currency in PayPal Payments Standard
- Getting "Expecting an order id" error in Javascript SDK in Sandbox Environment