Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Help with Subscription Webhooks

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
webclientjavascriptdevelopmentaccountingdebug
1 Svar
818 Visninger
Avatar
m.arabyat@gasable.com

Hey everyone,

I’m working on integrating Odoo subscriptions with my app through webhooks, and I’ve been able to make some progress — but I’m stuck on a few fields.


What I Have So Far


I managed to set up a webhook that triggers when the “next invoice date” of a subscription changes. The webhook is connected to my Edge Function, and it’s receiving data correctly.


What I’m Trying to Add


I’d like to include a few more details in the webhook payload, but I couldn’t find them in the subscription model:


Last invoice ID


Status (active, expired, canceled, etc.)


Current period end (right now I’m just using the “next invoice date” as a placeholder)


The Problem


When creating the webhook in Odoo, I couldn’t find a clear way to include these variables — especially the status field. I’m not sure if it’s missing from the subscription model or if it’s stored in a related model (like invoices or analytic accounts).


Has anyone worked with subscription webhooks before or figured out how to include these kinds of fields in the payload? Any pointers or examples would be really helpful.


Thanks!


0
Avatar
Kassér
Christoph Farnleitner

Can you clarify what you're missing exactly, how you're trying to create the webhook and what your configuration is?

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar

Hi,

To enhance your Odoo subscription webhook integration by including additional details such as the last invoice ID, subscription status, and current period end, you can utilize Odoo's built-in automation features.

Create a New Automated Action:

Navigate to Settings > Technical > Automation > Automated Actions.

Click on Create to define a new automated action.

Model: Select Subscription.

Trigger: Choose On Update to capture changes in subscription records.

Action To Do: Select Execute Python Code.


Python Code: Use the following script to compile the necessary subscription details:


subscription = record

last_invoice = subscription.recurring_invoice_ids.sorted('id')[-1] if subscription.recurring_invoice_ids else None

payload = {

    "subscription_id": subscription.id,

    "next_invoice_date": subscription.recurring_next_date,

    "current_period_end": getattr(subscription, 'recurring_next_date_end', None),

    "last_invoice_id": last_invoice.id if last_invoice else None,

    "last_invoice_name": last_invoice.name if last_invoice else None,

    "status": subscription.state

}

# Send the payload to your external system's webhook URL


Refer:

1. https://www.odoo.com/documentation/19.0/applications/studio/automated_actions/webhooks.html

Detailed information on setting up webhooks in Odoo

2. https://www.odoo.com/documentation/19.0/applications/studio/automated_actions.html

Automation rules — Odoo 19.0 documentation: Learn how to automate actions in Odoo, including sending data to external systems via webhooks


Hope it helps.

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
How to hide the title or the close (X) button from a dialogService dialog?
javascript development debug
Avatar
Avatar
2
sep. 25
951
Importable Module Controller (Using XML Data Files)
webclient development debug
Avatar
0
apr. 25
1370
Updating acc_holder_name via external function
javascript development configuration accounting function debug
Avatar
0
sep. 25
738
Help with Subscription Proration Logic (React + Odoo)
webclient javascript development configuration accounting project workflow
Avatar
0
okt. 25
557
Error with rpc call
javascript development function debug
Avatar
Avatar
Avatar
2
jul. 25
1859
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now