getting error

33 views
Skip to first unread message

Momula Krishna chaithanya

unread,
Jul 1, 2025, 2:21:10 AMJul 1
to Kill Bill users mailing-list
catalog.xml:
<?xml version="1.0" encoding="UTF-8"?>
xsi:noNamespaceSchemaLocation="Catalog.xsd"
name="WizeboxCatalog"
effectiveDate="2025-07-01">

<currencies>
<currency>USD</currency>
</currencies>

<products>
<product name="FreeTrial" category="BASE">
<plans>
<plan name="free-trial-monthly">
<phases>
<phase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<billingMode>IN_ADVANCE</billingMode>
<prices>
<price currency="USD" value="0.00"/>
</prices>
<usages/>
</phase>
</phases>
</plan>
</plans>
</product>
</products>

<priceLists>
<defaultPriceList name="DEFAULT">
<plans>
<plan>free-trial-monthly</plan>
</plans>
</defaultPriceList>
</priceLists>

</catalog>

end point request:
const catalogFilePath = path.resolve(
"path"
);
const catalogXml = fs.readFileSync(catalogFilePath, 'utf8');
const catalogUploadRes = await axios.post(
`${killbillUrl}/catalog/xml`,
catalogXml,
{
headers: {
'Content-Type': 'application/xml',
'X-Killbill-CreatedBy': 'admin',
'X-Killbill-ApiKey': tenantCode,
'X-Killbill-ApiSecret': tenant._id.toString(),
"Accept": "application/json",
},
auth: {
username: killbill_username,
password: killbill_password,
},
transformRequest: [(data) => data], //to prevent axios from transforming the XML data
}
);

console.log('Catalog uploaded:', catalogUploadRes.status); ------->gettiing the unsupported media:'<!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.89</h3></body></html>' getting status code 415

Momula Krishna chaithanya

unread,
Jul 1, 2025, 3:10:44 AMJul 1
to Kill Bill users mailing-list
postMan 
--header 'X-Killbill-ApiKey: lokesh112354io' \
--header 'X-Killbill-ApiSecret: 68637ac42a330af80dd3207b' \
--header 'Content-Type: application/xml' \
--header 'X-Killbill-CreatedBy: admin' \
--header 'Accept: application/json' \
--header 'Authorization: ••••••' \
--data '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<catalog xmlns="urn:kill-bill:catalog" name="SampleCatalog" effectiveDate="2025-07-01">

<currencies>
<currency>USD</currency>
</currencies>

<products>
<product name="BasicProduct" category="BASE">
<plans>
<plan name="basic-monthly-plan">
<phases>
<phase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<billingMode>IN_ADVANCE</billingMode>
<prices>
<price currency="USD" value="9.99"/>
</prices>
</phase>
</phases>
</plan>
</plans>
</product>
</products>

<priceLists>
<defaultPriceList name="DEFAULT">
<plans>
<plan>basic-monthly-plan</plan>
</plans>
</defaultPriceList>
</priceLists>

</catalog>
' and responce is:
<!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.89</h3></body></html>

karan bansal

unread,
Jul 2, 2025, 5:55:27 AMJul 2
to Kill Bill users mailing-list
Hi Krishna,

Could you please change the content type to text/xml and then try? Though the catalog shows up as invalid when I try to upload it in Kaui. Please kindly refer to https://docs.killbill.io/latest/catalog-examples for different catalog examples. You could also use this endpoint https://killbill.github.io/slate/catalog.html#validate-a-catalog-xml to validate the xml catalog.

Regards
Karan

Momula Krishna chaithanya

unread,
Jul 3, 2025, 8:31:46 AMJul 3
to karan bansal, Kill Bill users mailing-list


--header 'X-Killbill-ApiKey: lokesh112354io' \
--header 'X-Killbill-ApiSecret: 68637ac42a330af80dd3207b' \

--header 'Content-Type: text/xml' \


--header 'X-Killbill-CreatedBy: admin' \
--header 'Accept: application/json' \

--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \


--data '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

  <catalogs>
    <versions>
      <version>
        <effectiveDate>2013-02-08T00:00:00Z</effectiveDate>
        <catalogName>SpyCarBasic</catalogName>
        <currencies>
          <currency>USD</currency>
          <currency>GBP</currency>
        </currencies>
        <units/>
        <products>
          <product name="Basic" prettyName="Basic">
            <category>BASE</category>
            <included/>
            <available/>
            <limits/>
          </product>
          <product name="Sports" prettyName="Sports">
            <category>BASE</category>
            <included/>
            <available/>
            <limits/>
          </product>
          <product name="Standard" prettyName="Standard">
            <category>BASE</category>
            <included/>
            <available/>
            <limits/>
          </product>
          <product name="Super" prettyName="Super">
            <category>ADD_ON</category>
            <included/>
            <available/>
            <limits/>
          </product>
        </products>
        <rules>
          <changePolicy>
            <changePolicyCase>
              <policy>IMMEDIATE</policy>
            </changePolicyCase>
          </changePolicy>
          <changeAlignment>
            <changeAlignmentCase>
              <alignment>START_OF_BUNDLE</alignment>
            </changeAlignmentCase>
          </changeAlignment>
          <cancelPolicy>
            <cancelPolicyCase>
              <policy>IMMEDIATE</policy>
            </cancelPolicyCase>
          </cancelPolicy>
          <createAlignment>
            <createAlignmentCase>
              <alignment>START_OF_BUNDLE</alignment>
            </createAlignmentCase>
          </createAlignment>
          <billingAlignment>
            <billingAlignmentCase>
              <alignment>ACCOUNT</alignment>
            </billingAlignmentCase>
          </billingAlignment>
          <priceList>
            <priceListCase>
              <toPriceList>DEFAULT</toPriceList>
            </priceListCase>
          </priceList>
        </rules>
        <plans>
          <plan name="basic-annual" prettyName="basic-annual">
            <product>Basic</product>
            <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
            <initialPhases/>
            <finalPhase type="EVERGREEN">
              <duration>
                <unit>UNLIMITED</unit>
                <number>-1</number>
              </duration>
              <recurring>
                <billingPeriod>ANNUAL</billingPeriod>
                <recurringPrice>
                  <price>
                    <currency>USD</currency>
                    <value>1000</value>
                  </price>
                </recurringPrice>
              </recurring>
              <usages/>
            </finalPhase>
            <plansAllowedInBundle>-1</plansAllowedInBundle>
          </plan>
          <plan name="sports-monthly" prettyName="sports-monthly">
            <product>Sports</product>
            <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
            <initialPhases>
              <phase type="TRIAL">
                <duration>
                  <unit>DAYS</unit>
                  <number>30</number>
                </duration>
                <fixed type="ONE_TIME">
                  <fixedPrice/>
                </fixed>
                <usages/>
              </phase>
            </initialPhases>
            <finalPhase type="EVERGREEN">
              <duration>
                <unit>UNLIMITED</unit>
                <number>-1</number>
              </duration>
              <recurring>
                <billingPeriod>MONTHLY</billingPeriod>
                <recurringPrice>
                  <price>
                    <currency>GBP</currency>
                    <value>375.00</value>
                  </price>
                  <price>
                    <currency>USD</currency>
                    <value>500.00</value>
                  </price>
                </recurringPrice>
              </recurring>
              <usages/>
            </finalPhase>
            <plansAllowedInBundle>-1</plansAllowedInBundle>
          </plan>
          <plan name="standard-monthly" prettyName="standard-monthly">
            <product>Standard</product>
            <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
            <initialPhases>
              <phase type="TRIAL">
                <duration>
                  <unit>DAYS</unit>
                  <number>30</number>
                </duration>
                <fixed type="ONE_TIME">
                  <fixedPrice/>
                </fixed>
                <usages/>
              </phase>
            </initialPhases>
            <finalPhase type="EVERGREEN">
              <duration>
                <unit>UNLIMITED</unit>
                <number>-1</number>
              </duration>
              <recurring>
                <billingPeriod>MONTHLY</billingPeriod>
                <recurringPrice>
                  <price>
                    <currency>GBP</currency>
                    <value>75.00</value>
                  </price>
                  <price>
                    <currency>USD</currency>
                    <value>100.00</value>
                  </price>
                </recurringPrice>
              </recurring>
              <usages/>
            </finalPhase>
            <plansAllowedInBundle>-1</plansAllowedInBundle>
          </plan>
          <plan name="super-monthly" prettyName="super-monthly">
            <product>Super</product>
            <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
            <initialPhases>
              <phase type="TRIAL">
                <duration>
                  <unit>DAYS</unit>
                  <number>30</number>
                </duration>
                <fixed type="ONE_TIME">
                  <fixedPrice/>
                </fixed>
                <usages/>
              </phase>
            </initialPhases>
            <finalPhase type="EVERGREEN">
              <duration>
                <unit>UNLIMITED</unit>
                <number>-1</number>
              </duration>
              <recurring>
                <billingPeriod>MONTHLY</billingPeriod>
                <recurringPrice>
                  <price>
                    <currency>GBP</currency>
                    <value>750.00</value>
                  </price>
                  <price>
                    <currency>USD</currency>
                    <value>1000.00</value>
                  </price>
                </recurringPrice>
              </recurring>
              <usages/>
            </finalPhase>
            <plansAllowedInBundle>-1</plansAllowedInBundle>
          </plan>
        </plans>


        <priceLists>
          <defaultPriceList name="DEFAULT">
            <plans>

              <plan>basic-annual</plan>
              <plan>sports-monthly</plan>
              <plan>standard-monthly</plan>
              <plan>super-monthly</plan>
            </plans>
          </defaultPriceList>
        </priceLists>
      </version>
    </versions>
    <catalogName>SpyCarBasic</catalogName>
  </catalogs>'


this the catalog given in the catalog api endpoints i used it as u said i used the text/xml as the content type soo i got the below o/p:

{
"className": "org.killbill.billing.catalog.api.CatalogApiException",
"code": 2080,
"message": "Invalid catalog for tenant : 85",
"causeClassName": null,
"causeMessage": null,
"stackTrace": []
}

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/killbilling-users/97c7ad81-5786-49dc-8a75-8982ae96767dn%40googlegroups.com.

karan bansal

unread,
Jul 4, 2025, 8:57:43 AMJul 4
to Kill Bill users mailing-list
Hi Krishna,

I have tried it and it is working as expected. 


Screenshot 2025-07-04 182657.png

Regards
Karan
Reply all
Reply to author
Forward
0 new messages