cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API - Error calling PostInstrumentIdentifier - invalid data in profile-id?

Good Afternoon - 

I have a sandbox account and am creating integration between an ERP system and Cybersource - I can Authorize / Capture Credit Cards without issue - However, I' munable to create an InstrumentIdentifier + Payment Instrument to use later (IE - Using these to Authorize a payment vs hand keyed Credit Card information) :

Error calling PostInstrumentIdentifier: {"errors":[{"type":"invalidHeaders","message":"Invalid header values","details":[{"name":"profile-id"}]}]}

I do not know what's invalid about the Profile ID I have (I don't know what the profile id actually is and can't find anything in the documentation related to it) - i get a similar (but different wording) error when using the "Live" console on the API reference website. 

{
"errors": [
{
"type": "missingHeaders",
"message": "Missing header values",
"details": [
{
"name": "profile-id"
}
]
}
]
}

 

 

Any help would be greatly appreciated

kmauzoul1
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Please try using the Sign up link here  https://developer.cybersource.com/hello-world/sandbox.html to create your Sandbox account.

View solution in original post

rajvpate
Administrator Administrator
Administrator
9 REPLIES 9

What are the headers you are passing as part of this API call ? 

rajvpate
Administrator Administrator
Administrator
string instrumentIdentifierId = GenerateRandomNumbers();

            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierCard card = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierCard()
            {
                Number = cardNumber
            };

            PostInstrumentIdentifierRequest requestObj = new PostInstrumentIdentifierRequest()
            {
                Card = card
            };

            InstrumentIdentifierApi apiInstance = new InstrumentIdentifierApi(clientConfig);

            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier result = apiInstance.PostInstrumentIdentifier(requestObj, "abcd");
            
            return instrumentIdentifierId;

I misunderstood what the profile-id was - I thought that was the instrumentidentifierId that you wanted to generate the card data against - but if I send any value as the Profile-Id i get "Invalid data" - if I leave it null (like I saw in another forum post, I get the "missing headers" error -

This is using version 0.0.1.31 of the RestClient API and 0.0.0.16 of the AuthenticationSDK

You should not need to send a profile-id as a header at all.

rajvpate
Administrator Administrator
Administrator

If I pass a "null" to the Profile-ID, it gives me error about missing header values - if I pass an empty string to the call, I get invalid data error:

CyberSource.Client.ApiException: 'Error calling PostInstrumentIdentifier: {"errors":[{"type":"invalidHeaders","message":"Invalid header values","details":[{"name":"profile-id"}]}]}'

 

Is there somewhere else I should be contacting for help on this?  Or could this be something related to my account being a sandbox ?

 What is the merchantId you are using ?

rajvpate
Administrator Administrator
Administrator

synergyresourcestest

kmauzoul1
Member

Please try using the Sign up link here  https://developer.cybersource.com/hello-world/sandbox.html to create your Sandbox account.

rajvpate
Administrator Administrator
Administrator

Thank you - I thought I signed up with this link before but maybe not - now when I log in I see a section for Payment Instruments, and I'm no longer getting the Profile Id error - THANK YOU SO MUCH!

I faced a similar issue before, and the advice mentioned in the previous comment really helped me troubleshoot and resolve the problem. Make sure to carefully review your profile ID and follow the API documentation closely. If you're still stuck, don't hesitate to seek further assistance from Cybersource support. Good luck!

Ritta_Clark
Member