New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebee docs
HomeBillingCPQPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Developer Resources
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

Agentic AI


  • Chargebee Copilot
  • MCP Servers

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Invoices and Credit Notes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Managing payments with ChargebeeJS
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Order Management
  • Mobile Subscriptions (Legacy)
  • Other Integrations
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Hosted Capabilities
  3. Articles and FAQ
  4. Portal V2 - Pop Up
  1. Billing
  2. Hosted Capabilities
  3. Articles and FAQ
  4. Portal V2 - Pop Up

meta_title: I am trying to pass the MetaData parameter while updating subscriptions using API. However, the resp meta_description: I am trying to pass the MetaData parameter while updating subscriptions using API. However, the meta_keywords: metadata, api, hostedpage, Page title: I am trying to pass the MetaData parameter while updating subscriptions using API. However, the response does not have the metaData passed. category:

  • name: Hosted Capabilities sub_category: Portal V2 - Pop Up related_articles:
  • /kb/billing/how-to-mark-some-fields-as-mandatory-in-checkout
  • /kb/billing/how-to-edit-font-in-checkout-and-self-serve-portal---

I am trying to pass the MetaData parameter while updating subscriptions using API. However, the response does not have the metaData passed.

Problem Statement

This article helps you understand i am trying to pass the metadata parameter while updating subscriptions using api. however, the response does not have the metadata passed..

Solution

Scope

I am trying to pass the metaData parameter while updating subscriptions using API. However, the response does not have the metaData passed.

Summary

The solution article covers how to pass the metaData parameter while updating subscriptions.

Solution You would need to pass the value for the metaData parameter as a JSON string for this to work. "{"api_key_1":"dfads","api_key_2":"ewrqew"}". You can convert the JSON into JSON string using tool online.

Example API call

  curl  https://acme-test.chargebee.com/api/v2/subscriptions/16CLw5Taletv39AC/update_for_items   
  -u {site_api_key}  
  -d subscription_items[item_price_id][0]="monthly1-USD-Monthly"   
  -d subscription_items[unit_price][0]=9000   
  -d invoice_immediately="true"   
  -d meta_data="\{"api_key_1":"dfads","api_key_2":"ewrqew"}"

Response

  { 
  "subscription": { 
  "id": "16CLw5Taletv39AC",  
  "billing_period": 1,  
  "billing_period_unit": "month",  
  "remaining_billing_cycles": 3,  
  "customer_id": "ac-test",  
  "status": "active",  
  "current_term_start": 1680891849,  
  "current_term_end": 1683483849,  
  "next_billing_at": 1683483849,  
  "created_at": 1680891849,  
  "started_at": 1680891849,  
  "activated_at": 1680891849,  
  "updated_at": 1681498006,  
  "has_scheduled_changes": false,  
  "channel": "web",  
  "resource_version": 1681498006793,  
  "deleted": false,  
  "object": "subscription",  
  "currency_code": "USD",  
  "subscription_items": [{ 
  "item_price_id": "monthly1-USD-Monthly",  
  "item_type": "plan",  
  "quantity": 1,  
  "unit_price": 9000,  
  "amount": 9000,  
  "free_quantity": 0,  
  "billing_cycles": 3,  
  "object": "subscription_item"  
  },  
  { 
  "item_price_id": "addon1-USD-Monthly",  
  "item_type": "addon",  
  "quantity": 1,  
  "unit_price": 1200,  
  "amount": 1200,  
  "object": "subscription_item"  
  },  
  { 
  "item_price_id": "imp-charges1-USD-Monthly",  
  "item_type": "addon",  
  "quantity": 1,  
  "unit_price": 45200,  
  "amount": 45200,  
  "object": "subscription_item"  
  }  
  ],  
  "due_invoices_count": 0,  
  "mrr": 96400,  
  "exchange_rate": 1.0,  
  "base_currency_code": "USD",  
  "has_scheduled_advance_invoices": false,  
  "create_pending_invoices": false,  
  "auto_close_invoices": true,  
  "meta_data": { 
  "api_key_1": "dfads",  
  "api_key_2": "ewrqew"  
  }  
  },  
  "customer": { 
  "id": "ac-test",  
  "auto_collection": "on",  
  "net_term_days": 0,  
  "allow_direct_debit": false,  
  "created_at": 1675706413,  
  "taxability": "taxable",  
  "updated_at": 1681047602,  
  "pii_cleared": "active",  
  "channel": "web",  
  "resource_version": 1681047602832,  
  "deleted": false,  
  "object": "customer",  
  "card_status": "valid",  
  "promotional_credits": 0,  
  "refundable_credits": 0,  
  "excess_payments": 0,  
  "unbilled_charges": 0,  
  "preferred_currency_code": "USD",  
  "primary_payment_source_id": "pm_16CLyXTV6jRsn2nX",  
  "payment_method": { 
  "object": "payment_method",  
  "type": "card",  
  "reference_id": "tok_16CLyXTV6jRsa2nW",  
  "gateway": "chargebee",  
  "gateway_account_id": "gw_16BYibTKd9w0i7k1",  
  "status": "valid"  
  },  
  "auto_close_invoices": true  
  },  
  "card": { 
  "status": "valid",  
  "gateway": "chargebee",  
  "gateway_account_id": "gw_16BYibTKd9w0i7k1",  
  "iin": "411111",  
  "last4": "1111",  
  "card_type": "visa",  
  "funding_type": "credit",  
  "expiry_month": 12,  
  "expiry_year": 2024,  
  "created_at": 1675706439,  
  "updated_at": 1675706439,  
  "resource_version": 1675706439696,  
  "object": "card",  
  "masked_number": "**1111",  
  "customer_id": "ac-test",  
  "payment_source_id": "pm_16CLyXTV6jRsn2nX"  
  },  
  "credit_notes": []  
  }

Related Articles

Was this article helpful?