Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

GUID should contain 32 digits with 4 dashes

Started by Becky Sparks -   in API Endpoints

I get the following error when I try to Sync Invoices and Payments to Xero.

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). ()
Click here to view the logs.

The invoices come over but the payments do not. When I go to the logs this is what is listed for the payments

<Payments><Payment><Invoice><InvoiceNumber>CT-215158</InvoiceNumber></Invoice><Account><AccountID>Due from Stripe - CT WHMCS</AccountID></Account><Date>2021-11-23</Date><CurrencyRate>1.00000</CurrencyRate><Amount>9.95</Amount><Reference>txn_3JyurHJHJO3LiqlO1YsEPlc5</Reference></Payment><Payment><Invoice><InvoiceNumber>CT-215161</InvoiceNumber></Invoice><Account><AccountID>Due from Stripe - CT WHMCS</AccountID></Account><Date>2021-11-23</Date><CurrencyRate>1.00000</CurrencyRate><Amount>20.00</Amount><Reference>txn_3JyurLJHJO3LiqlO18WNh59p</Reference></Payment><Payment><Invoice><InvoiceNumber>CT-215164</InvoiceNumber></Invoice><Account><AccountID>Due from Stripe - CT WHMCS</AccountID></Account><Date>2021-11-23</Date><CurrencyRate>1.00000</CurrencyRate><Amount>9.95</Amount><Reference>txn_3JyurPJHJO3LiqlO1sbTu1iV</Reference></Payment><Payment><Invoice><InvoiceNumber>CT-214483</InvoiceNumber></Invoice><Account><AccountID>Due from Stripe - CT WHMCS</AccountID></Account><Date>2021-11-23</Date><CurrencyRate>1.00000</CurrencyRate><Amount>399.00</Amount><Reference>txn_3Jz161JHJO3LiqlO0wtZymUq</Reference></Payment><Payment><Invoice><InvoiceNumber>CT-214630</InvoiceNumber></Invoice><Account><AccountID>Due from Stripe - CT WHMCS</AccountID></Account><Date>2021-11-23</Date><CurrencyRate>1.00000</CurrencyRate><Amount>10.95</Amount><Reference>txn_3Jz4dZJHJO3LiqlO0WL3uN6J</Reference></Payment></Payments>

<ApiException xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Message>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</Message>

Could someone please help me fix this? I have been trying to get it fixed off and on for a couple months and have just been manually entering the payments into Xero.
Hi Becky,

It looks like you're sending through
<AccountID>Due from Stripe - CT WHMCS</AccountID>
Which is causing the error as the Account ID should be a GUID. Seems like there is something wrong with the mapping logic of the app.



Steven Brown (Xero Staff)  

When connecting WHMCS to Xero it doesn't give us that option. The only option it gives us (for this account) is: "Due from Stripe - CT WHMCS". There isn't anything else to select (for this account)
We have multiple accounts setup to sync to Xero and all of them are setup this way and they all work.
Except this one.

Becky Sparks  

Never mind, I changed the code to a numeric combination and it is fine now.

Becky Sparks  

Glad to hear you got it sorted

Steven Brown (Xero Staff)  

For the lay person, why do I also get this validation error too, and how can I resolve it?
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Joan ODonnell  

So, I don't know if it is the same problem but the way that I fixed it in my system is I went into the Xero Chart of Accounts and put 12345 in the Code box on the account that was throwing the error.

Becky Sparks  

Hi Joan,
A GUID is a unique identifier (it stands for Globally Unique Identifier) which is used in Xero to identify pretty much everything. Each Invoice, Account, Contact, or pretty much any other document in the system has one of these assigned to it.

Those GUIDs look like this: d3086d70-d015-41bf-8262-c91fdeeaa7f2
They're very specific in format so any time a request is sent to the API with a guid that is malformed you're going to see that message. That might be because it's got an extra letter on the end like this: d3086d70-d015-41bf-8262-c91fdeeaa7f2F <--- (The 'F' shouldn't be there)
Or that something that is not a GUID at all is sent in the wrong place in the request which is the case in Becky's example above: <AccountID>Due from Stripe - CT WHMCS</AccountID>

As you can see the AccountID has somehow received a some text that should probably be in something like the reference field.

This is an issue with whatever app is sending the request to the API and to fix it you would need to raise the issue with the developers who have made the App you're using. If it's an app from the marketplace there should be a way to contact them on their website, if it's an app that was made for you or your company specifically then getting in touch with that developer is probably the way to go.

I hope this clears things up. If not please feel free to let me know and I'll try again :)

Steven Brown (Xero Staff)  

Thanks Steven & Becky, much appreciated, this has helped me find my solution.
BTW the app is Hubdoc.
I believe it may be the Hubdoc Contact & Customer fields when the invoice is from a new supplier, as the comment “Failed to load the contact. Please try refreshing this page.” appears under Contact and Customer fields on the Hubdoc screen.
When I test with an existing Contact, all is fine.
When I test with a new Contact, I still get the error message “Failed to load the contact. Please try refreshing this page.” However, if I continue to publish, it accepts the publication and the bill appears in Xero.
Subsequent bills from the new supplier are auto configured as per normal.
So I have a solution, but is there a reason why I get these error messages, despite the work around?

Joan ODonnell  

I'm not sure to be honest as I don't have a lot of knowledge about hubdoc. I'll see if I can get in touch with people who might be able to help more

Steven Brown (Xero Staff)  

Hi Joan, would you be able to create a support case via Xero Central so we can get some more details such as your Xero organisation name etc and then we can investigate Hubdoc's integration for it?

Welli Abdullah (Xero Staff)  

Thanks Welli, Ive done the work around, for now, so I don't have the error currently. If it appears again, I will contact Xero Central and create a support case. regards Joan

Joan ODonnell