cancel
Showing results for 
Search instead for 
Did you mean: 
Corey10e
New Member - Level 1

ExpenseTypeCode - Invalid pet code

Issue: No matter what ExpenseTypeCode we send in (or not send in) we get the error below... This worked roughly 9 months ago when we first programmed this, but never released it.  Now that we are back to testing it no longer works.

 

Level = LINE_ITEM; Field = ExpenseTypeCode; Value = ; Code = 7000; Message = Invalid pet code.

 

I cant attach the JSON here... its always blocked... but suffice to say we have validated that the number (2009) that we are sending in, is valid in concur.

7 REPLIES 7
KevinD
Community Manager
Community Manager

@Corey10e if you are a site admin at your company, I suggest requesting to join the Admin Group here on the Community and posting your question there.

 

We do check your profile to make sure you do have site admin permissions before admitting you to the group, so as long as you have some admin permissions, you should be good.


Thank you,
Kevin
SAP Concur Community Manager
Did this response answer your question? Be sure to select “Accept as Solution” so your fellow community members can be helped by it as well.
Corey10e
New Member - Level 1

unfortunately I am not, but I can have the site admin post there for me.

Thanks

Corey

PoojaKumatkar
Frequent Member - Level 1

Hi @Corey10e ,

 

Can you try below:

1. Create Cognos custom report in Concur. You may take someone's help who has Concur Reporting access and ask them to build this report as below. It will give you Expense type wise expense type code available in Concur system.

Sample screenshot:

PoojaKumatkar_0-1734502530511.png

2. Now using API try to get expense type wise Expense type code and compare both codes (fetched through Concur reporting and API) are matching or not. If both are matching, then try to pass same code through API and check whether your error gets resolved.

If not matching, then you will get same error.  

 

 

Additional information for your reference that I searched on chatgpt:

 

The error message "ExpenseTypeCode - Invalid pet code" in the Concur Invoice API typically indicates that the ExpenseTypeCode being passed in the API request is not valid or not recognized by the system. This can happen when the code provided for the ExpenseType is incorrect, misspelled, or does not match any existing values in the system.

Here’s how you can address and resolve this issue:

1. Verify the ExpenseTypeCode:

  • Ensure the ExpenseTypeCode you're using is correct. These codes are predefined in your Concur instance and must match the exact values in the system.
  • Check that the ExpenseTypeCode is not misspelled or malformed.

If you're using a PET (Predefined Expense Type) code, verify that it is a valid code in the Concur setup.

2. Fetch Available Expense Types:

If you're unsure of the correct code or want to retrieve a list of valid ExpenseTypeCodes, you can use the Expense Type API to get a list of available expense types and their codes.

For Concur, the relevant API call would be:

GET /expense/types

This will return all the available expense types, along with their associated codes, which you can then use when creating or updating invoices.

3. Check the Configuration:

  • Sometimes, custom expense types or expense codes might be configured in your Concur instance.
  • If your instance has been customized or includes specific configurations, you may need to reference the custom codes for ExpenseTypeCode. These custom codes should be documented by your system administrators or in your Concur instance configuration.

4. Correct the Request:

Once you have the valid ExpenseTypeCode, ensure you pass the correct code in your API request.

Example (correct ExpenseTypeCode😞

{
  "expenseTypeCode": "RENTAL_CAR"  // This should be a valid, recognized code
}

5. Check the API Documentation:

  • Refer to the latest version of the Concur Invoice API documentation for details on valid expense types and their codes.
  • You can find the ExpenseTypeCode and other relevant data definitions in the official documentation: Concur Invoice API Documentation.

6. Debugging:

  • If you're working with dynamic data or integrating with other systems, it’s essential to ensure that the data is being passed correctly and that the ExpenseTypeCode field is populated correctly before making the API call.

Example Request with Valid ExpenseTypeCode:

Here’s an example of how you might structure the API call to create or update an invoice with the correct ExpenseTypeCode:

{
   "invoiceNumber": "123456",
   "expenseTypeCode": "RENTAL_CAR",  // Make sure this is valid in your system
   "amount": 200.0,
   "description": "Rental car for business trip"
}

Conclusion:

  • Error: "ExpenseTypeCode - Invalid pet code" typically happens when the ExpenseTypeCode is not valid. Verify the valid codes in your Concur system and ensure you're using the correct one.
  • Use the GET /expense/types API call to retrieve the valid codes if you're unsure.
  • Ensure that you have the proper configuration and check if there are any custom codes set up in your system.

If the issue persists, it may be useful to contact your SAP Concur support team to verify the correct codes and configurations.

 

 

Let me know if it works for you.

 

If this answers your query, then please mark solution as accepted.

 

 

Thanks!
Regards,
Pooja
Corey10e
New Member - Level 1

Thanks for your reply.  We know that the code is correct, we have tried multiple.  We have tried to submit on 2 different policies.  We have done a GET to retrieve another invoice that had the ExpenseTypeCode set manually in the UI and tried to use that one as well.

PoojaKumatkar
Frequent Member - Level 1

Hi @Corey10e ,

 

I hope you are using standard expense type field in invoice line item form and not using any custom field. Can you please confirm.

 

With reference to your statement may I know how did you set expense type code manually? If possible can you please provide a screenshot from Concur where you have set this code manually.

 

If you are using standard expense type field then please note that for standard expense types (default expense types) system has its own default expense type code and for custom created new expense types, system will generate unique code in the backend. You cannot set any random code to it as technically it is not feasible. This codes you can check using cognos reporting which I have shown in my previous response.

 

Thanks!
Regards,
Pooja
STCornish
Occasional Member - Level 1

Hi @PoojaKumatkar,

I am assisting @Corey10e with this issue. 

 

We are using the standard expense type field.

 

We are also using the system generated code for our custom created expense types. We did used Congnos reporting to get the values and also confirmed it with a Localization export.

PoojaKumatkar
Frequent Member - Level 1

Hi @STCornish , @Corey10e ,

 

If you are passing correct expense type code then It should not happen. 

 

I would suggest raising a support ticket with Concur and provide them all required screenshots related to API, error msg, Concur expense type name and code from cognos report and from Concur UI screen. 

They will investigate this issue and may be provide you some solution if anything needs to corrected from your side. 

 

Thanks!
Regards,
Pooja