> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Addon

> Create a new addon product that can be attached to your main subscription products



## OpenAPI

````yaml post /addons
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.105.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /addons:
    post:
      tags:
        - Addons
      operationId: create_addon
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAddonRequest'
        required: true
      responses:
        '200':
          description: Create a new addon
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddonResponse'
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import DodoPayments from 'dodopayments';

            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });

            const addonResponse = await client.addons.create({
              currency: 'AED',
              name: 'name',
              price: 0,
              tax_category: 'digital_products',
            });

            console.log(addonResponse.id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            addon_response = client.addons.create(
                currency="AED",
                name="name",
                price=0,
                tax_category="digital_products",
            )
            print(addon_response.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\taddonResponse, err := client.Addons.New(context.TODO(), dodopayments.AddonNewParams{\n\t\tCurrency:    dodopayments.F(dodopayments.CurrencyAed),\n\t\tName:        dodopayments.F(\"name\"),\n\t\tPrice:       dodopayments.F(int64(0)),\n\t\tTaxCategory: dodopayments.F(dodopayments.TaxCategoryDigitalProducts),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", addonResponse.ID)\n}\n"
        - lang: Java
          source: |-
            package com.dodopayments.api.example;

            import com.dodopayments.api.client.DodoPaymentsClient;
            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
            import com.dodopayments.api.models.addons.AddonCreateParams;
            import com.dodopayments.api.models.addons.AddonResponse;
            import com.dodopayments.api.models.misc.Currency;
            import com.dodopayments.api.models.misc.TaxCategory;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    AddonCreateParams params = AddonCreateParams.builder()
                        .currency(Currency.AED)
                        .name("name")
                        .price(0)
                        .taxCategory(TaxCategory.DIGITAL_PRODUCTS)
                        .build();
                    AddonResponse addonResponse = client.addons().create(params);
                }
            }
        - lang: Kotlin
          source: |-
            package com.dodopayments.api.example

            import com.dodopayments.api.client.DodoPaymentsClient
            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
            import com.dodopayments.api.models.addons.AddonCreateParams
            import com.dodopayments.api.models.addons.AddonResponse
            import com.dodopayments.api.models.misc.Currency
            import com.dodopayments.api.models.misc.TaxCategory

            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val params: AddonCreateParams = AddonCreateParams.builder()
                    .currency(Currency.AED)
                    .name("name")
                    .price(0)
                    .taxCategory(TaxCategory.DIGITAL_PRODUCTS)
                    .build()
                val addonResponse: AddonResponse = client.addons().create(params)
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            addon_response = dodo_payments.addons.create(currency: :AED, name:
            "name", price: 0, tax_category: :digital_products)


            puts(addon_response)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;
            use Dodopayments\Misc\Currency;
            use Dodopayments\Misc\TaxCategory;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $addonResponse = $client->addons->create(
                currency: Currency::AED,
                name: 'name',
                price: 0,
                taxCategory: TaxCategory::DIGITAL_PRODUCTS,
                description: 'description',
              );

              var_dump($addonResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Addons;
            using DodoPayments.Client.Models.Misc;

            DodoPaymentsClient client = new();

            AddonCreateParams parameters = new()
            {
                Currency = Currency.Aed,
                Name = "name",
                Price = 0,
                TaxCategory = TaxCategory.DigitalProducts,
            };

            var addonResponse = await client.Addons.Create(parameters);

            Console.WriteLine(addonResponse);
components:
  schemas:
    CreateAddonRequest:
      type: object
      required:
        - name
        - tax_category
        - price
        - currency
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
          description: The currency of the Addon
        description:
          type:
            - string
            - 'null'
          description: Optional description of the Addon
        name:
          type: string
          description: Name of the Addon
        price:
          type: integer
          format: int32
          description: Amount of the addon
        tax_category:
          $ref: '#/components/schemas/TaxCategory'
          description: Tax category applied to this Addon
    AddonResponse:
      type: object
      required:
        - id
        - business_id
        - name
        - tax_category
        - price
        - currency
        - created_at
        - updated_at
      properties:
        business_id:
          type: string
          description: Unique identifier for the business to which the addon belongs.
        created_at:
          type: string
          format: date-time
          description: Created time
        currency:
          $ref: '#/components/schemas/Currency'
          description: Currency of the Addon
        description:
          type:
            - string
            - 'null'
          description: Optional description of the Addon
        id:
          type: string
          description: id of the Addon
        image:
          type:
            - string
            - 'null'
          description: Image of the Addon
        name:
          type: string
          description: Name of the Addon
        price:
          type: integer
          format: int32
          description: Amount of the addon
        tax_category:
          $ref: '#/components/schemas/TaxCategory'
          description: Tax category applied to this Addon
        updated_at:
          type: string
          format: date-time
          description: Updated time
    Currency:
      type: string
      enum:
        - AED
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BWP
        - BYN
        - BZD
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SZL
        - THB
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    TaxCategory:
      type: string
      description: >-
        Represents the different categories of taxation applicable to various
        products and services.
      enum:
        - digital_products
        - saas
        - e_book
        - edtech
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````