Sandbox works but live => INVALID_RESOURCE_ID

feelinlovelynow
Contributor
Contributor

Greetings!

 

I have been using Sandbox successfully for a couple weeks via https://www.npmjs.com/package/@paypal/paypal-js

Sandbox => Click buttons => Create Order

sandbox--create-order.png

 

 

 

 

 

 

 

 

 

Sandbox => Post Create Order => Update Client Config

sandbox--update-client-config.png

 

 

 

 

 

 

 

 

 

I just switched to live using these instructions https://developer.paypal.com/reference/production/#link-obtainyourlivecredentials

 

On the live site when I click buttons this is the request sent @ /create-order

URL: https://api-m.paypal.com/v2/checkout/orders

Params:

 

{
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
    Authorization: 'Bearer removed'
  },
  body: `{"intent":"CAPTURE","purchase_units":[{"reference_id":"d00cb4bf-84f8-4544-86b1-dfc87cc5770e","description":"Feeling Lovely Now Online Store Purchase","amount":{"currency_code":"USD","value":"94.83","breakdown":{"item_total":{"value":"81.00","currency_code":"USD"},"shipping":{"value":"6.00","currency_code":"USD"},"tax_total":{"value":"7.83","currency_code":"USD"}}},"items":[{"sku":"0xfffd8d6ad3a1ea04","quantity":3,"name":"Size: L 100% Organic Cotton Gold Metatron's Cube + Fruit of Life Embroidery Men's T-Shirt Black","unit_amount":{"currency_code":"USD","value":"27.00"}}]}],"payment_source":{"paypal":{"experience_context":{"locale":"en-US","landing_page":"LOGIN","user_action":"PAY_NOW","brand_name":"Feeling Lovely Now","payment_method_selected":"PAYPAL","shipping_preference":"GET_FROM_FILE","payment_method_preference":"IMMEDIATE_PAYMENT_REQUIRED"}}}}

 

 

@ Live => Click buttons => Create Order

live--create-order.png

 

@ Live => Post Create Order => Update Client Config

live--update-client-config.png

 

Here is the full error

 

 

{
  "errors":[
    {
      "data":{
        "message":"The specified resource does not exist."
      },
      "message":"RESOURCE_NOT_FOUND",
      "path":[
        "updateClientConfig"
      ],
      "extensions":{
        "class":"ERROR"
      },
      "_name":"RESOURCE_NOT_FOUND",
      "checkpoints":[
        "patchClientConfig"
      ],
      "meta":{
        
      },
      "contingency":true,
      "statusCode":200
    }
  ],
  "data":{
    "updateClientConfig":null
  },
  "extensions":{
    "tracing":{
      "version":1,
      "startTime":"2023-11-14T16:11:16.830Z",
      "endTime":"2023-11-14T16:11:16.928Z",
      "duration":97534213,
      "execution":{
        "resolvers":[
          {
            "path":[
              "updateClientConfig"
            ],
            "parentType":"Mutation",
            "fieldName":"updateClientConfig",
            "returnType":"Boolean",
            "startOffset":1225364,
            "duration":95683296
          }
        ]
      }
    },
    "correlationId":"f4397533eb9ab"
  }
}

 

 

In the live version the request sent @ /create-order to https://api-m.paypal.com/v2/checkout/orders is not the sandbox url but for some reason all the requests made by paypal in the network tab after /create-order are to the sandbox url, failing with the error above and I don't know why yet

 

/create-order => https://github.com/feelinglovelynow/feelinglovelynow/blob/main/src/routes/paypal/create-order/%2Bser...

apiPayl => https://github.com/feelinglovelynow/feelinglovelynow/blob/main/src/lib/store/apiPaypal.ts

frontend load script => https://github.com/feelinglovelynow/feelinglovelynow/blob/main/src/lib/store/PaypalCheckout.ts

Login to Me Too
1 REPLY 1

Kavyar
Moderator
Moderator

Good day @feelinlovelynow 

 

Thank you for posting to the PayPal community.

 

This looks like an issue with your internal website code, which is triggering API calls to "Sandbox Endpoint" environment.

 

https://developer.paypal.com/api/rest/requests/

 

The URL to the API service is either:

 

PayPal system is a payment gateway, which will receive the payment request payload (i.e Payment and Item details, Shipping details, Invoice number, Amount details etc.) from merchant websites(built via third party platforms eCommerce ) and process the payments accordingly.

 

Merchants should handle their internal website code and pass the appropriate payment API calls to PayPal system.

 

I would suggest to please contact your website developer or the third party eCommerce support. Please ensure that when making API calls in a LIVE environment, you are using the correct LIVE  REST API Credentials(Client ID & Secret) .

 

https://developer.paypal.com/api/rest/authentication/

https://developer.paypal.com/api/rest/postman/ 

https://developer.paypal.com/api/rest/

 

If your still facing issues, please create an MTS ticket via - https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.