Title: Checkout issue: Expected order id
Last modified: September 16, 2020

---

# Checkout issue: Expected order id

 *  Resolved [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/expected-order-id-issue/)
 * Hey there!
 * We’re getting this error during checkout when clicking the Paypal button, while
   on sandbox:
 * `"PayPal payment options are invalid."`
 * This is what we see in the console:
 * `POST https://api.sandbox.braintreegateway.com/merchants/mb4fbzgkgq493xvc/client_api/
   v1/paypal_hermes/create_payment_resource 422`
 *     ```
       update_client_config_error 
       {err: "Error: Expected an order id to be passed↵    at ht…currency=USD&vault=false&intent=capture:2:367121)", timestamp: "1600222970815", referer: "www.sandbox.paypal.com", sdkCorrelationID: "15fab7bc95a16", sessionID: "17a832bd1f_mdi6mji6mjy", …}
       buttonCorrelationID: "aa2a7ef97ddd9"
       buttonSessionID: "51f61d2f45_mdi6mji6mjg"
       env: "sandbox"
       err: "Error: Expected an order id to be passed↵    at ht"
       referer: "www.sandbox.paypal.com"
       sdkCorrelationID: "15fab7bc95a16"
       sessionID: "17a832bd1f_mdi6mji6mjy"
       timestamp: "1600222970815"
       ```
   
 *     ```
       buttons?fundingSourc…re&commit=true:1098 
       unhandled_error 
       {err: "Error: Expected an order id to be passed↵    at ht…currency=USD&vault=false&intent=capture:2:367121)", timestamp: "1600227674195", referer: "www.sandbox.paypal.com", sdkCorrelationID: "15fab7bc95a16", sessionID: "0d2026ba6a_mdm6nde6mdc", …}
       buttonCorrelationID: "d681d362bcb5f"
       buttonSessionID: "66dfc2cfb1_mdm6nde6mta"
       env: "sandbox"
       err: "Error: Expected an order id to be passed↵    at ht"
       referer: "www.sandbox.paypal.com"
       ```
   
 * sdkCorrelationID: “15fab7bc95a16”
    sessionID: “0d2026ba6a_mdm6n
 * I have double checked we have the correct credentials from Braintree and also
   we have linked a sandbox paypal account to Braintree.
 * Any ideas on what might be causing this? I have already deactivated all plugins
   but WC and Braintree Payments.
 * Let me know if there are more details that can be useful. The background story
   is a bit long so I’m cutting to the chase a bit here to keep it simple.
 * Thanks in advance.
    -  This topic was modified 5 years, 8 months ago by [i1100a](https://wordpress.org/support/users/i1100a/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fexpected-order-id-issue%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13411441)
 * Hi [@i1100a](https://wordpress.org/support/users/i1100a/),
 * Thank you for contacting us. I reviewed your checkout page and here is the PayPal
   error associated with the more generic invalid payment option notice you see:
 * `{"error":{"message":"Merchant account not found"},"fieldErrors":[]}`
 * I can see a merchant account is being used but it seems that account isn’t associated
   with the API keys you have configured.
 * Navigate to the plugin’s Advanced Settings > Merchant Account Settings and click
   the import button. Once you do that test again and let me know if that resolves
   the issue.
 * Kind Regards,
 *  Thread Starter [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13411505)
 * Thank you so much! This did in fact resolved the issue.
 * I was able to login in Paypal using the personal sandbox account I created earlier
   and pay, however, once I returned to the website I got this error:
 * “There was an error processing your payment. Reason: Customer ID is invalid.”
 * What am I doing wrong?
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13411535)
 * Hi [@i1100a](https://wordpress.org/support/users/i1100a/),
 * I wasn’t able to re-create that error when I created a test order (#53618).
 * That error message is usually associated with a Javascript error triggered by
   another plugin on the checkout page which prevents the Braintree plugin from 
   injecting the payment nonce into the checkout form before it’s submitted.
 * Kind Regards,
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13411548)
 * [@i1100a](https://wordpress.org/support/users/i1100a/),
 * One thing I noticed is your cart page appears to be aggressively cached because
   although your checkout page shows the correct merchant account, the cart page
   is still showing the old merchant account before you followed my instructions
   on importing using the new API keys.
 * It’s possible that caching is the culprit on your checkout page. I created several
   test orders and did not encounter any issues though.
 * Kind Regards,
 *  Thread Starter [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13496011)
 * [@mrclayton](https://wordpress.org/support/users/mrclayton/)
 * Quick update:
 * I disabled cache and tested some more. I tried as a guest customer and this time
   the order went through, so somehow logged in users (admins at least) seem to 
   trigger the “customer id” invalid error.
 * It does not make a lot of sense, I’ll investigate it further. Just wanted to 
   update in case anybody else gets this error. Also, any ideas are more than welcome!
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13496019)
 * [@i1100a](https://wordpress.org/support/users/i1100a/)
 * To Resolve the customer ID error you can navigate to the edit user profile page
   within the admin dashboard of WordPress and delete your Braintree vault ID.
 * The customer ID error is almost always caused by a merchant switching their API
   keys to a different account and so their old customer ID is mapping to the old
   Braintree account and not the new one. That is why you don’t experience that 
   issue as a guest user or as a regular customer logged in.
 * Kind regards
 *  Thread Starter [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13498468)
 * [@mrclayton](https://wordpress.org/support/users/mrclayton/)
 * That was it! Thank you, I inherited this website from a developer that is no 
   longer around and I had tried everything I could think of but was unaware of 
   this issue and it was driving me insane.
 * One last thing, do you know is there a way to bulk delete old customer ID’s? 
   I’m working on a staging environment, a sort of recent copy of production, and
   would like, if possible, to get a cleaner slate to work on.
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13501005)
 * Hi [@i1100a](https://wordpress.org/support/users/i1100a/),
 * In order to bulk delete the Braintree Vault ID’s from your wordpress database
   you would need to run an SQL query. The fields you would want to delete are located
   in the usermeta table:
 * meta_key: `braintree_sandbox_vault_id`
    meta_key: `braintree_production_vault_id`
 * Kind Regards,
 *  Thread Starter [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13569963)
 * [@mrclayton](https://wordpress.org/support/users/mrclayton/)
 * I’ve been working on another website simultaneously and run again into what I
   think is the same error after moving from staging to production: no customer 
   id.
 * Just visiting the checkout triggers this error: There was an error loading the
   PayPal SDK. Please provide the following details to your plugin developer.PayPal
   config: undefinedPayPal SDK query: [https://www.paypal.com/sdk/js?components=buttons,messages¤cy=USD&vault=false&commit=false&intent=capture](https://www.paypal.com/sdk/js?components=buttons,messages¤cy=USD&vault=false&commit=false&intent=capture)
 * Visting that url display this: SDK Validation error: ‘Expected client-id to be
   passed'”, which makes me think is related to the fact we moved the website.
 * However, this time deleting the Braintree Vault ID and updating profile does 
   not create it, instead the logging shows: ERROR Error saving customer’s payment
   methods on User Profile page. Reason: is an invalid customer id.
 * All of this seems to be related to mismatching API keys or something. I went 
   to Merchant Accounts, deleted it, and re-imported it. Still no luck.
 * What else can I try? Btw, this is the website: [https://shop.ibericoscovap.us/checkout/](https://shop.ibericoscovap.us/checkout/)
 * Thanks in advance
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13569975)
 * Hi [@i1100a](https://wordpress.org/support/users/i1100a/),
 * The issue you’re experiencing is related to you not linking your PayPal account
   to your Braintree account.
 * Now that you have migrated from staging to production, you must link your PayPal
   business account in the Braintree control panel of your production environment.
 * Kind Regards,
 *  Thread Starter [i1100a](https://wordpress.org/support/users/i1100a/)
 * (@i1100a)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13573425)
 * [@mrclayton](https://wordpress.org/support/users/mrclayton/)
 * Once again, you were right. Client had not setup Paypal in Braintree for production.
 * Thank you very much!
 * BTW: The support for this plugin is by far the best I’ve experienced. So happy
   with your help.
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13573431)
 * Hi [@i1100a](https://wordpress.org/support/users/i1100a/),
 * Awesome, glad I could help! If you have a moment I always appreciate a good review
   on the WordPress.org page:
 * [https://wordpress.org/support/plugin/woo-payment-gateway/reviews/](https://wordpress.org/support/plugin/woo-payment-gateway/reviews/)
 * Kind Regards,

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Checkout issue: Expected order id’ is closed to new replies.

 * ![](https://ps.w.org/woo-payment-gateway/assets/icon-256x256.png?rev=2142799)
 * [Payment Plugins Braintree For WooCommerce](https://wordpress.org/plugins/woo-payment-gateway/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-payment-gateway/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-payment-gateway/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-payment-gateway/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-payment-gateway/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-payment-gateway/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/expected-order-id-issue/#post-13573431)
 * Status: resolved