Skip to main content
Temu

What the Exchange Auth Code button in Temu Connector for Odoo does

The Exchange Auth Code button swaps the one-time code from Temu for an access token and stores it on the record. With the factory settings it does not appear, and neither does the Auth Code field: the view hides them while Temu connection has its default value. When they are visible, the button stops with a message if Auth Code is empty and, when all goes well, empties Auth Code and shows a success notification.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 5 November 2026

Key facts

Module
Temu
Versions
Odoo 17, 18, 19 and 20
Checked
in the connector's source code, version 19.0 · against the sources linked at the end
Reading time
5 min

When the button appears

The Exchange Auth Code button sits on the Temu Dashboard form, and the forms are opened from the Temu menu. It is there in Odoo 17, 18 and 19.

It is not visible in every configuration. In those three versions the view hides it when the Temu connection field has its default value, so with the factory settings neither the button nor the Auth Code field (where you type the code) shows up. The button and the field are therefore only used when Temu connection holds a value other than the one it ships with.

Code-generated diagram: the Temu menu, the exchange button and the messages that go with it
Diagram built from the module's published code (not an Odoo screen): the menu, the button and the messages Set the authorization code first. and Temu authorization code was exchanged successfully., with the labels in the original English of the code.

With Odoo in English the button is called Exchange Auth Code.

Code-generated diagram: the button label according to the language of Odoo
Diagram built from the module's published translation files (not an Odoo screen): it shows how the button label reads when Odoo is set to Spanish.
Temu orders in Odoo every 15 minutes. Stock out every 5
Video: Temu orders in Odoo every 15 minutes. Stock out every 5

Step by step

  1. Open the Temu menu and go into the Temu Dashboard form. With the factory settings you will see neither the Exchange Auth Code button nor the Auth Code field: in that case there is nothing to press and the steps below do not apply. If you can see both, carry on.
  2. Type into Auth Code the one-time code that comes back from Temu's authorisation callback. The field's help describes it like this: One-time code from Temu auth callback.
  3. Press Exchange Auth Code.
  4. Read the outcome. If Set the authorization code first. appears, the field was empty. If the notification Temu authorization code was exchanged successfully. appears, the exchange has finished.
  5. After a success, Auth Code is empty. If you want to see which Temu method was used to request the token, look at Method Token Create in the API Methods tab of the same form.

What the button does inside (Odoo 19)

This is the order followed by the published Odoo 19 code:

  • It reads Auth Code and trims the spaces at both ends. If nothing is left, it stops with the message and saves no change.
  • It asks Temu for the token using the method held in Method Token Create, sending the code as a parameter.
  • If the call fails, the error is written to the server log and the module may try another Temu method; if it does not, or all of them fail, the action stops with that error.
  • If the method used for the request is not the one that was in Method Token Create, the module writes the one it used into that field. Its default value in the code is bg.open.accesstoken.create.
  • It applies the response to the record (details below).
  • It empties Auth Code and shows the green notification, which does not stay fixed on screen.

What changes on the record

When it applies Temu's response, the module writes to the record:

  • The access token: the one in the response or, if the response carries none, the very code you typed.
  • The token's expiry, if the response includes it and the module manages to read it as a date.
  • The list of API scopes returned by Temu, one per line.
  • The date and time of the last token check.
  • The shop identifier, only if the response carries one and it differs from the one already stored. In that case the module also posts a message on the record announcing the change.

One point that can be read in the code: if Temu's response is not a set of data with fields, the module applies no token change. It still empties Auth Code and shows the notification, because the call raised no error.

Errors you can get when pressing it

Set the authorization code first.

It appears when you press the button with Auth Code empty or holding only spaces. The action stops and nothing changes. Type the code and press again. Bear in mind that after a successful exchange the field is emptied: if you press again without typing a new code, you will see this same message.

No Temu API method candidates are configured.

The part of the module that tries Temu's methods raises it when there is no candidate method. The action stops with that message and no token is saved.

Any other error from the call to Temu

If the call to Temu returns an error and trying another method does not resolve it, the button does not turn it into a text of its own: the action stops with that error before touching the record. Since Auth Code is emptied after the exchange, the code is still in the field and you can try again.

What to check afterwards

After a successful exchange, open the form again and check that Auth Code is empty. If the module changed the token creation method, you will see it in Method Token Create, in the API Methods tab. If the response carried a different shop identifier, you will find the message the module posts on the record announcing the change.

Requirements and price

Temu Connector for Odoo is a one-off payment per Odoo version (published on Odoo Apps for 17, 18, 19 and 20) and needs the FlexigoTech Cloud subscription, Connector plan: €49/month or €490/year excluding VAT, with up to 3 accounts of the platform. The connection goes through FlexigoTech Cloud, which stores the credentials encrypted. Remember that, with the default value of Temu connection, this button is not shown. You can find the Odoo Apps listing and the module page.

How FlexigoTech can help

FlexigoTech implements Odoo 17, 18, 19 and 20 and builds connectors and custom integrations.

Keep reading

Checked in the connector's source code (version 19.0) and the linked sources

Sources