openapi: 3.0.0
info:
  title: Reseller
  description: |-
    Learn how to manage your clients and reseller accounts via API.

    <div class="info-box custom-width">
      <h4><i class="fas fa-info-circle"></i> Note:</h4>
      <p>Unfortunately, our reseller dashboard, white-label and reseller API are only available to customers who were approved as resellers before 1st Jan, 2024. If you were not approved as a reseller before 1st Jan, 2024, you may still earn profits by adding a mark-up on your client rates when reselling ClickSend through our standard messaging endpoints.</p>
    </div>
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    pagination:
      type: object
      properties:
        total:
          type: integer
          description: The total number of items available for viewing.
          example: 2
        per_page:
          type: integer
          description: >-
            The number of items returned per page. This is specified in the
            limit parameter. You can have 100 items at maximum, and 15 at
            minimum.
          example: 15
        current_page:
          type: integer
          description: The current page number.
          example: 1
        last_page:
          type: integer
          description: The last page number.
          example: 1
        next_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the next page. It will return **null** if there’s no next
            page.
          example: null
        prev_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the previous page. It will return **null** if there’s no
            previous page.
          example: null
        from:
          type: integer
          description: The number of the first result in the current page.
          example: 1
        to:
          type: integer
          description: The number of the last result in the current page.
          example: 2
    reseller_account:
      type: object
      properties:
        user_id:
          type: integer
          description: The user's ID
          example: 117
        username:
          type: string
          description: The username
          example: johndoe2
        user_email:
          type: string
          description: The user's email
          example: johndoe2@awesome.com
        active:
          type: integer
          description: Indicates if the user is active
          example: 0
        banned:
          type: integer
          description: Indicates if the user is banned
          example: 0
        balance:
          type: string
          description: The user's balance
          example: '0.000000'
        user_phone:
          type: string
          description: The user's phone number
          example: 15184811002
        reply_to:
          type: string
          description: The reply-to email address
          example: originalemail
        delivery_to:
          type: string
          description: The delivery-to email address
          nullable: true
          example: null
        user_first_name:
          type: string
          description: The user's first name
          example: John
        user_last_name:
          type: string
          description: The user's last name
          example: Doe
        account:
          type: integer
          description: The user's account number
          example: 0
        account_name:
          type: string
          description: The name of the user's account
          example: The Awesome Company
        account_billing_email:
          type: string
          description: The account billing email
          example: johndoe2@awesome.com
        account_billing_mobile:
          type: string
          description: The account billing mobile number
          example: 15184811002
        country:
          type: string
          description: The user's country
          example: US
        default_country_sms:
          type: string
          description: The default country for SMS
          example: US
        auto_recharge:
          type: integer
          description: Indicates if auto-recharge is enabled
          example: 0
        auto_recharge_amount:
          type: string
          description: The auto-recharge amount
          example: '20.00'
        low_credit_amount:
          type: string
          description: The low credit amount
          example: '0.00'
        setting_unicode_sms:
          type: integer
          description: Setting for Unicode SMS
          example: 0
        setting_email_sms_subject:
          type: integer
          description: Setting for email SMS subject
          example: 0
        setting_fix_sender_id:
          type: integer
          description: Setting for fixed sender ID
          example: 0
        setting_sms_message_char_limit:
          type: integer
          description: Setting for SMS message character limit
          example: 6
        old_dashboard:
          type: integer
          description: Indicates if the user is using the old dashboard
          example: 0
        balance_commission:
          type: string
          description: The balance commission
          example: '0.299954'
        timezone:
          type: string
          description: The user's timezone
          example: Australia/Melbourne
    currency:
      type: object
      description: The parameters related to currency.
      properties:
        currency_name_short:
          type: string
          description: >-
            The currency used for the sender in three-letter format (e.g. USD,
            EUR, AUD, NZD, etc).
          example: AUD
        currency_prefix_d:
          type: string
          description: >-
            The symbol used to indicate the currency of the sender (e.g. $ , €,
            etc).
          example: $
        currency_prefix_c:
          type: string
          description: The currency basic unit (e.g. cents).
          example: c
        currency_name_long:
          type: string
          description: The full name of the currency.
          example: Australian Dollars
    subaccount:
      type: object
      properties:
        subaccount_id:
          type: integer
          description: The unique identifier for the subaccount.
          example: 126
        api_username:
          type: string
          description: The API username of the subaccount.
          example: johndoe1
        email:
          type: string
          format: email
          description: The email address of the subaccount.
          example: johndoe1@awesome.com
        phone_number:
          type: string
          description: The phone number of the subaccount.
          example: '+15184811001'
        first_name:
          type: string
          description: The first name of the subaccount.
          example: John
        last_name:
          type: string
          description: The last name of the subaccount.
          example: Doe
        api_key:
          type: string
          description: The API key of the subaccount.
          example: F3702045-EB2C-0091-C211-7728048DCAE2
        access_users:
          type: integer
          description: Flag indicating if the subaccount has access to users.
          example: 1
        access_billing:
          type: integer
          description: Flag indicating if the subaccount has access to billing.
          example: 1
        access_reporting:
          type: integer
          description: Flag indicating if the subaccount has access to reporting.
          example: 1
        access_contacts:
          type: integer
          description: Flag indicating if the subaccount has access to contacts.
          example: 1
        access_settings:
          type: integer
          description: Flag indicating if the subaccount has access to settings.
          example: 1
        access_sms:
          type: integer
          description: Flag indicating if the subaccount has access to SMS.
          example: 1
        access_email:
          type: integer
          description: Flag indicating if the subaccount has access to email.
          example: 1
        access_voice:
          type: integer
          description: Flag indicating if the subaccount has access to voice services.
          example: 1
        access_fax:
          type: integer
          description: Flag indicating if the subaccount has access to fax services.
          example: 1
        access_post:
          type: integer
          description: Flag indicating if the subaccount has access to post services.
          example: 1
        access_reseller:
          type: integer
          description: Flag indicating if the subaccount has access to reseller services.
          example: 1
        access_mms:
          type: integer
          description: Flag indicating if the subaccount has access to MMS services.
          example: 1
        share_campaigns:
          type: integer
          description: Flag indicating if the subaccount can share campaigns.
          example: 0
        notes:
          type: string
          nullable: true
          description: Additional notes for the subaccount.
          example: null
    view-client-accounts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are you data.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/reseller_account'
                _currency:
                  $ref: '#/components/schemas/currency'
                _subaccount:
                  $ref: '#/components/schemas/subaccount'
    create-reseller-account:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: New reseller has been added.
        data:
          allOf:
            - $ref: '#/components/schemas/reseller_account'
            - type: object
              properties:
                _currency:
                  $ref: '#/components/schemas/currency'
                _subaccount:
                  $ref: '#/components/schemas/subaccount'
    view-specific-client-account:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          allOf:
            - $ref: '#/components/schemas/reseller_account'
            - type: object
              properties:
                _currency:
                  $ref: '#/components/schemas/currency'
                _subaccount:
                  $ref: '#/components/schemas/subaccount'
    update-client-account:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Reseller account has been updated.
        data:
          allOf:
            - $ref: '#/components/schemas/reseller_account'
            - type: object
              properties:
                _currency:
                  $ref: '#/components/schemas/currency'
                _subaccount:
                  $ref: '#/components/schemas/subaccount'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Reseller account has been updated.
        data:
          user_id: 117
          username: johndoe2
          user_email: johndoe2@awesome.com
          active: 0
          banned: 0
          balance: '199.997000'
          user_phone: 518-481-1002
          reply_to: originalemail
          delivery_to: null
          user_first_name: John
          user_last_name: Doe
          account: 0
          account_name: The Awesome Company
          account_billing_email: johndoe2@awesome.com
          account_billing_mobile: '+15184811002'
          country: US
          default_country_sms: US
          auto_recharge: 0
          auto_recharge_amount: '20.00'
          low_credit_amount: '0.00'
          setting_unicode_sms: 0
          setting_email_sms_subject: 0
          setting_fix_sender_id: 0
          setting_sms_message_char_limit: 6
          old_dashboard: 0
          balance_commission: '0.299954'
          timezone: Australia/Melbourne
          _currency:
            currency_name_short: USD
            currency_prefix_d: $
            currency_prefix_c: ¢
            currency_name_long: US Dollars
          _subaccount: null
    reseller-transfer-credit:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your balance has been successfully transferred.
        data:
          allOf:
            - $ref: '#/components/schemas/reseller_account'
            - type: object
              properties:
                _currency:
                  $ref: '#/components/schemas/currency'
                _subaccount:
                  $ref: '#/components/schemas/subaccount'
paths:
  /v3/reseller/accounts:
    get:
      summary: View Client Accounts
      operationId: view-client-accounts
      description: >-
        _Get list of reseller accounts_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | [Page
        number](https://developers.clicksend.com/docs/rest/v3/?shell#pagination)
        |

        | limit | query | integer(int32) | false | [Number of records per
        page](https://developers.clicksend.com/docs/rest/v3/?shell#pagination) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-client-accounts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/reseller/accounts'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ResellerAccountApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->resellerAccountsGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ResellerAccountApi->resellerAccountsGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var resellerAccountApi = new ResellerAccountApi(configuration);
            var response = resellerAccountApi.ResellerAccountsGet();
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.ResellerAccountApi;

            public class view_client_account {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.resellerAccountsGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ResellerAccountApi#resellerAccountsGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");


            var page = 1;

            var limit = 10;


            resellerApi.resellerAccountsGet(page, limit).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ResellerAccountApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get list of reseller accounts
              result = api_instance.reseller_accounts_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ResellerAccountApi->reseller_accounts_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get list of reseller accounts
                api_response = api_instance.reseller_accounts_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ResellerAccountApi->reseller_accounts_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ResellerAccountApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ResellerAccountApi->new(username =>
            $username, password => $password);


            my $json_output = $api->reseller_accounts_get('page' => '1' ,'limit'
            => '10');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSResellerAccountApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSResellerAccountApi *resellerAccountApiInstance =
            [[CSResellerAccountApi alloc] init];

            [resellerAccountApiInstance resellerAccountsGetWithPage:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ResellerAccountAPI.resellerAccountsGet(page: nil, limit: nil) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create Reseller Account
      operationId: create-reseller-account
      description: >-
        _Create reseller account_


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | username | string | true | none | Account username |

        | password | string | true | none | Account password (unhashed) |

        | user_email | string | true | none | Account email |

        | user_phone | string | true | none | Account phone number |

        | user_first_name | string | true | none | Account owner first name |

        | user_last_name | string | true | none | Account owner last name |

        | account_name | string | true | none | Account name (usually company
        name) |

        | country | string | true | none | Country of account holder |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                country:
                  type: string
                password:
                  type: string
                user_email:
                  type: string
                user_first_name:
                  type: string
                user_last_name:
                  type: string
                account_name:
                  type: string
                user_phone:
                  type: string
                username:
                  type: string
              example:
                country: Country Example
                password: password123
                user_email: user@example.com
                user_first_name: John
                user_last_name: Doe
                account_name: JohnDoeAccount
                user_phone: '+1234567890'
                username: johndoe
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-reseller-account'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"username\":\"johndoe2\",
                    \"user_email\":\"johndoe2@awesome.com\",
                    \"user_phone\":\"518-481-1002\",
                    \"user_first_name\":\"John\",
                    \"user_last_name\":\"Doe\",
                    \"country\":\"US\",
                    \"password\":\"pass\",
                    \"account_name\":\"The Awesome Company\"
                }" \
            'https://rest.clicksend.com/v3/reseller/accounts'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ResellerAccountApi(new
            GuzzleHttp\Client(),$config);
             // \ClickSend\Model\ResellerAccount | ResellerAccount model
            $reseller_account = new \ClickSend\Model\ResellerAccount();

            $reseller_account->setUsername("johndoe2");

            $reseller_account->setPassword("passQ1!");

            $reseller_account->setUserEmail("johndoe2@awesome.com");

            $reseller_account->setUserPhone("518-481-1002");

            $reseller_account->setUserFirstName("John");

            $reseller_account->setUserLastName("Doe");

            $reseller_account->setAccountName("The Awesome Company");

            $reseller_account->setCountry("US");


            try {
                $result = $apiInstance->resellerAccountsPost($reseller_account);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ResellerAccountApi->resellerAccountsPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var resellerAccountApi = new ResellerAccountApi(configuration);

            var response = resellerAccountApi.ResellerAccountsPost(new
            ResellerAccount(
                username: "USERNAME",
                password: "password",
                userEmail: "john@doe.com",
                userPhone: "+11231231234",
                userFirstName: "John",
                userLastName: "Doe",
                accountName: "Account Name",
                country: "US"
            });
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ResellerAccountApi;
            import ClickSend.Model.ResellerAccount;

            public class create_reseller_account {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
                // ResellerAccount | ResellerAccount model
                ResellerAccount resellerAccount = new ResellerAccount(); 
                resellerAccount.accountName("account");
                resellerAccount.username("username");
                resellerAccount.password("pwd!1q");
                resellerAccount.country("country");
                resellerAccount.userEmail("xxx@gmail.com");
                resellerAccount.userPhone("000-000-0000");
                resellerAccount.userFirstName("first");
                resellerAccount.userLastName("last");
                try {
                    String result = apiInstance.resellerAccountsPost(resellerAccount);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ResellerAccountApi#resellerAccountsPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");


            var resellerAccount = new api.ResellerAccount();


            resellerAccount.username = "johndoe2";

            resellerAccount.password = "passA!1";

            resellerAccount.userEmail = "johndoe2@awesome.com";

            resellerAccount.userPhone = "518-481-1002";

            resellerAccount.userFirstName = "John";

            resellerAccount.userLastName = "Doe";

            resellerAccount.accountName = "The Awesome Company";

            resellerAccount.country = "US";


            resellerApi.resellerAccountsPost(resellerAccount).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ResellerAccountApi.new

            # ResellerAccount | ResellerAccount model
            reseller_account = ClickSendClient::ResellerAccount.new(
              "username": "username",
              "password": "password",
              "user_email": "user_email",
              "user_phone": "user_phone",
              "user_first_name": "user_first_name",
              "user_last_name": "user_last_name",
              "account_name": "account_name",
              "country": "country"
            )

            begin
              # Create reseller account
              result = api_instance.reseller_accounts_post(reseller_account)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ResellerAccountApi->reseller_accounts_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))

            # ResellerAccount | ResellerAccount model

            reseller_account = clicksend_client.ResellerAccount(
                              username="username",
                              user_email="xxx@gmail.com",
                              user_phone="000-000-000",
                              user_first_name="firstname",
                              user_last_name="lastname",
                              country="country",
                              password="pass",
                              account_name="account_name") 

            try:
                # Create reseller account
                api_response = api_instance.reseller_accounts_post(reseller_account)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ResellerAccountApi->reseller_accounts_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ResellerAccountApi;

            use WWW::ClickSendClient::Object::ResellerAccount;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ResellerAccountApi->new(username =>
            $username, password => $password);


            my %params = (
                'username'        => 'username_test',
                'password'        => 'password',
                'user_email'      => 'test1@test.com',
                'user_phone'      => '+61261111111',
                'user_first_name' => 'user_first_name',
                'user_last_name'  => 'user_last_name',
                'account_name'    => 'account_name',
                'country'         => 'AU'
            );


            my $reseller_obj =
            WWW::ClickSendClient::Object::ResellerAccount->new(%params);


            my $json_output = $api->reseller_accounts_post('reseller_account' =>
            $reseller_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSResellerAccountApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSResellerAccount *resellerAccount = [[CSResellerAccount alloc]
            init];

            resellerAccount.username = @"user_name";

            resellerAccount.password = @"password";

            resellerAccount.userEmail = @"user_email";

            resellerAccount.userPhone = @"user_phone";

            resellerAccount.userFirstName =@"user_firstname";

            resellerAccount.userLastName = @"user_lastname";

            resellerAccount.accountName = @"account_name";

            resellerAccount.country = @"country";


            CSResellerAccountApi *resellerAccountApiInstance =
            [[CSResellerAccountApi alloc] init];

            [resellerAccountApiInstance
            resellerAccountsPostWithResellerAccount:resellerAccount
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {

            ClickSendClientAPI.customHeaders = [authHeader.key :
            authHeader.value]

            }


            let resellerAccount = ResellerAccount(username: "user_name",
                                                  password: "password",
                                                  userEmail: "user_email",
                                                  userPhone: "user_phone",
                                                  userFirstName: "user_firstname",
                                                  userLastName: "user_lastname",
                                                  accountName: "account_name",
                                                  country: "country")

            ResellerAccountAPI.resellerAccountsPost(resellerAccount:resellerAccount)
            { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/reseller/accounts/{client_user_id}:
    get:
      summary: View Specific Client Account
      operationId: view-specific-client-account
      description: >-
        _Get Reseller clients Account_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | client_user_id | path | integer(int32) | true | User ID of client |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: client_user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-specific-client-account'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ResellerAccountApi(new
            GuzzleHttp\Client(),$config);

            $client_user_id = 56; // int | User ID of client


            try {
                $result = $apiInstance->resellerAccountsByClientUserIdGet($client_user_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ResellerAccountApi->resellerAccountsByClientUserIdGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var resellerAccountApi = new ResellerAccountApi(configuration);

            var response =
            resellerAccountApi.ResellerAccountsByClientUserIdGet(RESELLER_CLIENT_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ResellerAccountApi;

            public class view_specific_client_account {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
                Integer clientUserId = 56; // Integer | User ID of client
                try {
                    String result = apiInstance.resellerAccountsByClientUserIdGet(clientUserId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ResellerAccountApi#resellerAccountsByClientUserIdGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");


            var clientUserId = "client_user_id";


            resellerApi.resellerAccountsByClientUserIdGet(clientUserId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ResellerAccountApi.new

            client_user_id = 56 # Integer | User ID of client

            begin
              # Get Reseller clients Account
              result = api_instance.reseller_accounts_by_client_user_id_get(client_user_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))

            client_user_id = 56 # int | User ID of client


            try:
                # Get Reseller clients Account
                api_response = api_instance.reseller_accounts_by_client_user_id_get(client_user_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ResellerAccountApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ResellerAccountApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->reseller_accounts_by_client_user_id_get('client_user_id'  =>
            '12345');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSResellerAccountApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];


            CSResellerAccountApi *resellerAccountApiInstance =
            [[CSResellerAccountApi alloc] init];

            [resellerAccountApiInstance
            resellerAccountsByClientUserIdGetWithClientUserId:clientUserId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            ResellerAccountAPI.resellerAccountsByClientUserIdGet(clientUserId:
            1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    put:
      summary: Update Client Account
      operationId: update-client-account
      description: >-
        _Update Reseller clients Account_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | client_user_id | path | integer(int32) | true | User ID of client |


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | username | string | true | none | Account username |

        | password | string | true | none | Account password (unhashed) |

        | user_email | string | true | none | Account email |

        | user_phone | string | true | none | Account phone number |

        | user_first_name | string | true | none | Account owner first name |

        | user_last_name | string | true | none | Account owner last name |

        | account_name | string | true | none | Account name (usually company
        name) |

        | country | string | true | none | Country of account holder |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                number:
                  type: string
                expiry_month:
                  type: integer
                expiry_year:
                  type: integer
                cvc:
                  type: integer
                name:
                  type: string
                bank_name:
                  type: string
              example:
                number: '1234567812345678'
                expiry_month: 12
                expiry_year: 2025
                cvc: 123
                name: John Doe
                bank_name: Bank of Example
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/x-www-form-urlencoded
        - name: client_user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-client-account'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"username\":\"johndoe2\",
                    \"user_email\":\"johndoe2@awesome.com\",
                    \"user_phone\":\"518-481-1002\",
                    \"user_first_name\":\"John\",
                    \"user_last_name\":\"Doe\",
                    \"country\":\"US\",
                    \"password\":\"pass\",
                    \"account_name\":\"The Awesome Company\"
                }" \
            'https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ResellerAccountApi(new
            GuzzleHttp\Client(),$config);

            $client_user_id = 56; // int | User ID of client

            // \ClickSend\Model\ResellerAccount | ResellerAccount model

            $reseller_account = new \ClickSend\Model\ResellerAccount();

            $reseller_account->setUsername("johndoe2");

            $reseller_account->setPassword("passQ1!");

            $reseller_account->setUserEmail("johndoe2@awesome.com");

            $reseller_account->setUserPhone("518-481-1002");

            $reseller_account->setUserFirstName("John");

            $reseller_account->setUserLastName("Doe");

            $reseller_account->setAccountName("The Awesome Company");

            $reseller_account->setCountry("US");


            try {
                $result = $apiInstance->resellerAccountsByClientUserIdPut($client_user_id, $reseller_account);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ResellerAccountApi->resellerAccountsByClientUserIdPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var resellerAccountApi = new ResellerAccountApi(configuration);

            var response =
            resellerAccountApi.ResellerAccountsByClientUserIdPut(RESELLER_CLIENT_ID,
            new ResellerAccount( 
                username: "USERNAME",
                password: "password",
                userEmail: "john@doe.com",
                userPhone: "+11231231234",
                userFirstName: "John",
                userLastName: "Doe",
                accountName: "Account Name",
                country: "US"
            });
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.ResellerAccountApi;
            import ClickSend.Model.ResellerAccount;

            public class update_client_account {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
                Integer clientUserId = 56; // Integer | User ID of client
                // ResellerAccount | ResellerAccount model
                ResellerAccount resellerAccount = new ResellerAccount(); 
                resellerAccount.accountName("account");
                resellerAccount.username("username");
                resellerAccount.password("pwd!1q");
                resellerAccount.country("country");
                resellerAccount.userEmail("xxx@gmail.com");
                resellerAccount.userPhone("000-000-0000");
                resellerAccount.userFirstName("first");
                resellerAccount.userLastName("last");
                try {
                    String result = apiInstance.resellerAccountsByClientUserIdPut(clientUserId, resellerAccount);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ResellerAccountApi#resellerAccountsByClientUserIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");


            var clientUserId = 12;


            var resellerAccount = new api.ResellerAccount();


            resellerAccount.username = "johndoe2";

            resellerAccount.password = "pass";

            resellerAccount.userEmail = "johndoe2@awesome.com";

            resellerAccount.userPhone = "518-481-1002";

            resellerAccount.userFirstName = "John";

            resellerAccount.userLastName = "Doe";

            resellerAccount.accountName = "The Awesome Company";

            resellerAccount.country = "US";


            resellerApi.resellerAccountsByClientUserIdPut(clientUserId,
            resellerAccount).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ResellerAccountApi.new

            client_user_id = 56 # Integer | User ID of client

            # ResellerAccount | ResellerAccount model
            reseller_account = ClickSendClient::ResellerAccount.new(
              "username": "username",
              "password": "password",
              "user_email": "user_email",
              "user_phone": "user_phone",
              "user_first_name": "user_first_name",
              "user_last_name": "user_last_name",
              "account_name": "account_name",
              "country": "country"
            )

            begin
              # Update Reseller clients Account
              result = api_instance.reseller_accounts_by_client_user_id_put(client_user_id, reseller_account)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))

            client_user_id = 56 # int | User ID of client

            # ResellerAccount | ResellerAccount model

            reseller_account = clicksend_client.ResellerAccount(
                              username="username",
                              user_email="xxx@gmail.com",
                              user_phone="000-000-000",
                              user_first_name="firstname",
                              user_last_name="lastname",
                              country="country",
                              password="pass",
                              account_name="account_name") 

            try:
                # Update Reseller clients Account
                api_response = api_instance.reseller_accounts_by_client_user_id_put(client_user_id, reseller_account)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ResellerAccountApi;

            use WWW::ClickSendClient::Object::ResellerAccount;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ResellerAccountApi->new(username =>
            $username, password => $password);


            my %params = (
                'username'        => 'username',
                'password'        => 'password',
                'user_email'      => 'test1@test.com',
                'user_phone'      => '+447777777777',
                'user_first_name' => 'user_first_name',
                'user_last_name'  => 'user_last_name',
                'account_name'    => 'account_name',
                'country'         => 'AU'
            );


            my $reseller_obj =
            WWW::ClickSendClient::Object::ResellerAccount->new(%params);


            my $json_output =
            $api->reseller_accounts_by_client_user_id_put('client_user_id' =>
            1234, 'reseller_account' => $reseller_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSResellerAccountApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];


            CSResellerAccount *resellerAccount = [[CSResellerAccount alloc]
            init];

            resellerAccount.username = @"username";

            resellerAccount.password = @"password";

            resellerAccount.userEmail = @"user_email";

            resellerAccount.userPhone = @"user_phone";

            resellerAccount.userFirstName =@"user_firstname";

            resellerAccount.userLastName = @"user_lastname";

            resellerAccount.accountName = @"account_name";

            resellerAccount.country = @"country";


            CSResellerAccountApi *resellerAccountApiInstance =
            [[CSResellerAccountApi alloc] init];

            [resellerAccountApiInstance
            resellerAccountsByClientUserIdPutWithClientUserId:clientUserId
            resellerAccount:resellerAccount completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let resellerAccount = ResellerAccount(username: "user_name",
                                                  password: "password",
                                                  userEmail: "user_email",
                                                  userPhone: "user_phone",
                                                  userFirstName: "user_firstname",
                                                  userLastName: "user_lastname",
                                                  accountName: "account_name",
                                                  country: "country")

            ResellerAccountAPI.resellerAccountsByClientUserIdPut(clientUserId:
            1, resellerAccount: resellerAccount) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/reseller/transfer-credit:
    put:
      summary: Reseller Transfer Credit
      operationId: reseller-transfer-credit
      description: >-
        _Transfer Credit_


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | client_user_id | integer(int32) | true | none | User ID of client |

        | balance | integer(int32) | true | none | Balance to transfer |

        | currency | string | true | none | Currency of balance to transfer |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                number:
                  type: string
                expiry_month:
                  type: integer
                expiry_year:
                  type: integer
                cvc:
                  type: integer
                name:
                  type: string
                bank_name:
                  type: string
              example:
                number: '1234567812345678'
                expiry_month: 12
                expiry_year: 2025
                cvc: 123
                name: John Doe
                bank_name: Bank of Example
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/x-www-form-urlencoded
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reseller-transfer-credit'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"client_user_id\":60,
                    \"balance\":12,
                    \"currency\":\"USD\"
                }" \
            'https://rest.clicksend.com/v3/reseller/transfer-credit'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\TransferCreditApi(new
            GuzzleHttp\Client(),$config);

            $reseller_account_transfer_credit = new
            \ClickSend\Model\ResellerAccountTransferCredit(); //
            \ClickSend\Model\ResellerAccountTransferCredit |
            ResellerAccountTransferCredit model

            $reseller_account_transfer_credit->setClientUserId(60);

            $reseller_account_transfer_credit->setBalance(12);

            $reseller_account_transfer_credit->setCurrency("USD");


            try {
                $result = $apiInstance->resellerTransferCreditPut($reseller_account_transfer_credit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling TransferCreditApi->resellerTransferCreditPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var transferCreditApi = new TransferCreditApi(configuration);

            var response = transferCreditApi.ResellerTransferCreditPut(new
            ResellerAccountTransferCredit(
                clientUserId:  RESELLER_CLIENT_ID,
                balance:  AMOUNT_TO_TRANSFER,
                currency: "CURRENCY_CODE"
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.TransferCreditApi;
            import ClickSend.Model.ResellerAccountTransferCredit;

            public class reseller_transfer_credit {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                TransferCreditApi apiInstance = new TransferCreditApi(defaultClient);
                // ResellerAccountTransferCredit | ResellerAccountTransferCredit model
                ResellerAccountTransferCredit resellerAccountTransferCredit = new ResellerAccountTransferCredit();
                resellerAccountTransferCredit.balance(new Integer(12));
                resellerAccountTransferCredit.clientUserId(new Integer(60));
                resellerAccountTransferCredit.currency("USD");

                try {
                    String result = apiInstance.resellerTransferCreditPut(resellerAccountTransferCredit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling TransferCreditApi#resellerTransferCreditPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var transferCreditApi = new api.TransferCreditApi("USERNAME",
            "API_KEY");


            var resellerAccountTransferCredit = new
            api.ResellerAccountTransferCredit();


            resellerAccountTransferCredit.clientUserId = 63;

            resellerAccountTransferCredit.balance = 12;

            resellerAccountTransferCredit.currency = "USD";


            transferCreditApi.resellerTransferCreditPut(resellerAccountTransferCredit).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::TransferCreditApi.new


            # ResellerAccountTransferCredit | ResellerAccountTransferCredit
            model

            reseller_account_transfer_credit =
            ClickSendClient::ResellerAccountTransferCredit.new(
              "client_user_id": 0,
              "balance": 6,
              "currency": "currency"
            )


            begin
              # Transfer Credit
              result = api_instance.reseller_transfer_credit_put(reseller_account_transfer_credit)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling TransferCreditApi->reseller_transfer_credit_put: #{e.response_body}"
            end
        - lang: Python
          source: >
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.TransferCreditApi(clicksend_client.ApiClient(configuration))

            # ResellerAccountTransferCredit | ResellerAccountTransferCredit
            model

            reseller_account_transfer_credit =
            clicksend_client.ResellerAccountTransferCredit(
                                                client_user_id=60,
                                                balance=12,
                                                currency="USD") 

            try:
                # Transfer Credit
                api_response = api_instance.reseller_transfer_credit_put(reseller_account_transfer_credit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling TransferCreditApi->reseller_transfer_credit_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::Object::ResellerAccountTransferCredit;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ResellerAccountApi->new(username =>
            $username, password => $password);


            my %params = (
                'client_user_id' => '64777',
                'balance'        => '10',
                'currency'       => 'INR'
            );


            my $reseller_account_transfer_credit_obj =
            WWW::ClickSendClient::Object::ResellerAccountTransferCredit->new(%params);


            my $json_output =
            $api->reseller_transfer_credit_put('reseller_account_transfer_credit'
            => $reseller_account_transfer_credit_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSResellerAccountApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];


            CSResellerAccount *resellerAccount = [[CSResellerAccount alloc]
            init];

            resellerAccount.username = @"string";

            resellerAccount.password = @"string";

            resellerAccount.userEmail = @"string";

            resellerAccount.userPhone = @"string";

            resellerAccount.userFirstName =@"user_firstname";

            resellerAccount.userLastName = @"user_lastname";

            resellerAccount.accountName = @"account_name";

            resellerAccount.country = @"country";


            CSResellerAccountApi *resellerAccountApiInstance =
            [[CSResellerAccountApi alloc] init];

            [resellerAccountApiInstance
            resellerAccountsByClientUserIdPutWithClientUserId:clientUserId
            resellerAccount:resellerAccount completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let resellerAccount = ResellerAccount(username: "user_name",
                                                  password: "password",
                                                  userEmail: "user_email",
                                                  userPhone: "user_Phone",
                                                  userFirstName: "user_firstname",
                                                  userLastName: "user_lastname",
                                                  accountName: "account_Name",
                                                  country: "country")

            ResellerAccountAPI.resellerAccountsByClientUserIdPut(clientUserId:
            1, resellerAccount:resellerAccount) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
