cancel
Showing results for 
Search instead for 
Did you mean: 

E00040 when Creating Subscription from Customer Profile

I am using the CIM and ARB modules in the sandbox environment. I am also using the PHP API. The code that is now failing (it was working just a few weeks ago) first creates a Customer Profile from a TXN. Next, the code makes a call using a method much like the createSubscriptionFromCustomerProfile method from your API documentation. It's during this method call that the E00040 error is thrown. The API documentation states that when this error is thrown, either the Customer Profile ID, or the Payment Profile ID could not be found. However, you can check the Authorize system, and the ID's ARE there.

 

I have read several posts going back a few years with developers asking about the exact same error as I am. If there is a solution, please be so kind as to point me to the correct message post. However, from all the posts that I have read, there never seemed to be a solid answer.

 

BTW, I too can take the exact same method parameters that were used when the E00040 was thrown, try them again, and this time the subscrition is created; no errors. Please help.

griffira59
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hello @griffira59

 

The challenge here is both architecture and performance scale in our sandbox and not your code.  Our production systems are scaled to process millions of requests per day, however our sandbox does not have the same scale.

 

Architecturally, when you create a customer profile from a transaction, the profile is created in real time.  When you want to USE a customer profile, in your case to create a subscription, the request is serviced using replicated data to improve performance.  As you've seen, you'll get an E00040 if replication has not completed in which case you must retry.

 

You should not have the same delay in production but we cannot guarantee there won't be some delay.

 

I know this doesn't answer your entire question, but we have communicated the challenge to our teams.

 

Richard

View solution in original post

25 REPLIES 25

Hello @griffira59

 

If you wait a few minutes before using createSubscriptionFromCustomerProfile, does it work properly?

 

I will also check with our operations team to see if we're experiencing latency in the sandbox.

 

Richard

RichardH
Administrator Administrator
Administrator

Hello Richard,

As a matter of fact, I have been experimenting with adding delays of various amounts to my code with PHP's sleep() function. To recap what I mentioned earlier, my PHP script first uses the Authorize CIM API to create a Customer Profile from a transaction. Next, I attempt to "createSubscriptionFromCustomerProfile" using the Customer Profile ID and Payment Profile ID that was just returned by CIM. It is at this exact point that the E00040 error is thrown, stating that the new Customer Profile ID and Payment Profile ID "Could not be found."

 

If I add at least a 15-20 second delay AFTER the Customer Profile is created, but BEFORE making the call to "createSubscriptionFromCustomerProfile," then the Subscription is created successfully. Obviously, this is a bit of a kludge. I would hate to think I had to depend on this when we go into production very soon.

 

With as many posts (going back several years) on this, or very similar issues, I would have hoped there would be a more solid solution. Any help/ideas will be greatly appreciated.

@griffira59 The sandbox should not require this long of a delay.  I will report the problem to operations.

 

Richard

Same trouble! Any benefit response? 

sehen30303
Member

It looks like after you create a new customer profile via a transaction you have to wait 15 sec or so to call the createSubscription request w/profile and payment ids otherwise it returns the E00040 error that says it is not found. 

 

Is there any ETA to getting this fixed so we don't have to introduce a delay before attempting to  create the subscription?

 

 

@BrandonSurowiec

 

Is this occuring in sandbox or production for you?

 

Richard

Sandbox.. and it makes me scared to push to production :P

@BrandonSurowiec

 

I've reported the issue and am waiting for a response from operations.  Our production servers are scaled significantly higher and have more rigorous monitoring and alerting for these types of issues.

 

Richard

@RichardH I just tried in production and it failed. 

 

In the same request I...

  • create a transaction using a Token (createTransactionRequest)
  • create a customer profile from the transaction charge (createCustomerProfileFromTransactionRequest)
  • use the given customer profile id and payment profile id that was returned to create a subscription via the two profile fields and receieved the 00040 error.
...
'profile' => [

'customerProfileId' => $authorize_customer_id,
'customerPaymentProfileId' => $authorize_payment_id,
],
...

I'll have to work around it by setting up the subscription on a separate request at a later time because it works if I wait a bit. I'm pretty sure doing it all in one go used to work a few months ago, but it no longer does now.