openapi: 3.0.0
info:
  title: Addresses
  description: Everything about Post Addresses
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
    post_return_address:
      type: object
      properties:
        return_address_id:
          type: integer
          description: The ID of the return address.
          example: 4
        user_id:
          type: integer
          description: The ID of the user associated with the return address.
          example: 1
        address_name:
          type: string
          description: The name associated with the return address.
          example: My Address
        address_line_1:
          type: string
          description: The first line of the return address.
          example: Maritime Avenue
        address_line_2:
          type: string
          description: The second line of the return address (optional).
          example: ''
        address_city:
          type: string
          description: The city of the return address.
          example: Flynn
        address_state:
          type: string
          description: The state or region of the return address.
          example: WA
        address_postal_code:
          type: string
          description: The postal code or ZIP code of the return address.
          example: '6302'
        address_country:
          type: string
          description: The country of the return address.
          example: AU
    view-your-return-addresses:
      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 records.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/post_return_address'
    create-return-address:
      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 return address has been added.
        data:
          $ref: '#/components/schemas/post_return_address'
    view-specific-return-address:
      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 is your data.
        data:
          $ref: '#/components/schemas/post_return_address'
    update-return-address:
      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 return address has been updated.
        data:
          $ref: '#/components/schemas/post_return_address'
    delete-return-address:
      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 return address has been deleted.
        data:
          type: array
          items: []
          example: []
paths:
  /v3/post/return-addresses:
    get:
      summary: View Your Return Addresses
      operationId: view-your-return-addresses
      description: >-
        _Get list of post return addresses_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#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-your-return-addresses'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/post/return-addresses'
        - 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\PostReturnAddressApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->postReturnAddressesGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling PostReturnAddressApi->postReturnAddressesGet: ', $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 postReturnAddressApi = new PostReturnAddressApi(configuration);
            var response = postReturnAddressApi.PostReturnAddressesGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.PostReturnAddressApi;

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


            var returnAddressApi = new api.PostReturnAddressApi("USERNAME",
            "API_KEY");


            var page = 1;

            var limit = 10;


            returnAddressApi.postReturnAddressesGet(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::PostReturnAddressApi.new

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

            begin
              # Get list of post return addresses
              result = api_instance.post_return_addresses_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling PostReturnAddressApi->post_return_addresses_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.PostReturnAddressApi(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 post return addresses
                api_response = api_instance.post_return_addresses_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling PostReturnAddressApi->post_return_addresses_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::PostReturnAddressApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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

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


            CSPostReturnAddressApi *postReturnAddressApiInstance =
            [[CSPostReturnAddressApi alloc] init];

            [postReturnAddressApiInstance postReturnAddressesGetWithPage: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]
            }


            PostReturnAddressAPI.postReturnAddressesGet(page: 1, limit: 15) {
            (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 Return Address
      operationId: create-return-address
      description: |-
        _Create post return address_

        ### Properties

        | Name | Type | Required | Restrictions | Description |
        | --- | --- | --- | --- | --- |
        | address_name | string | true | none | Your address name. |
        | address_line_1 | string | true | none | Your address line 1 |
        | address_city | string | true | none | Your city |
        | address_postal_code | string | true | none | Your postal code |
        | address_country | string | true | none | Your country |
        | address_line_2 | string | false | none | Your address line 2 |
        | address_state | string | false | none | Your state |


         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:
                address_name:
                  type: string
                address_line_1:
                  type: string
                address_line_2:
                  type: string
                  nullable: true
                address_city:
                  type: string
                address_postal_code:
                  type: string
                address_country:
                  type: string
              example:
                address_name: test
                address_line_1: 1 test street
                address_line_2: null
                address_city: Test
                address_postal_code: '6000'
                address_country: AU
      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-return-address'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"address_name\":\"John Smith\",
                \"address_line_1\":\"Maritime Avenue\",
                \"address_line_2\":\"\",
                \"address_city\":\"Flynn\",
                \"address_state\":\"WA\",
                \"address_postal_code\":6302,
                \"address_country\":\"AU\"
            }" \
            'https://rest.clicksend.com/v3/post/return-addresses'
        - 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\PostReturnAddressApi(new
            GuzzleHttp\Client(),$config);

            $return_address = new \ClickSend\Model\Address(); //
            \ClickSend\Model\Address | Address model

            $return_address->setAddressName("John Smith");

            $return_address->setAddressLine1("Maritime Avenue");

            $return_address->setAddressCity("Flynn");

            $return_address->setAddressPostalCode("6302");

            $return_address->setAddressCountry("AU");

            $return_address->setAddressLine2("");

            $return_address->setAddressState("WA");


            try {
                $result = $apiInstance->postReturnAddressesPost($return_address);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling PostReturnAddressApi->postReturnAddressesPost: ', $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 postReturnAddressApi = new PostReturnAddressApi(configuration);

            var response = postReturnAddressApi.PostReturnAddressesPost(new
            Address(
                addressName: "Address Name",
                addressLine1: "Address Line 1",
                addressCity: "City",
                addressPostalCode: "Postal Code",
                addressCountry: "CA",
                addressLine2: "Address Line 2",
                addressState: "State"
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.PostReturnAddressApi;
            import ClickSend.Model.Address;

            public class create_return_address {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
                  Address returnAddress = new Address(); // Address | Address model
                  returnAddress.addressName("John Smith");
                  returnAddress.addressLine1("Maritime Avenue");
                  returnAddress.addressCity("Flynn");
                  returnAddress.addressPostalCode("6302");
                  returnAddress.addressCountry("AU");
                  returnAddress.addressLine2("");
                  returnAddress.addressState("WA");
                  try {
                      String result = apiInstance.postReturnAddressesPost(returnAddress);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesPost");
                      e.printStackTrace();
                  }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var returnAddressApi = new api.PostReturnAddressApi("USERNAME",
            "API_KEY");


            var returnAddress = new api.Address();


            returnAddress.addressName = "John Smith";

            returnAddress.addressLine1 = "Maritime Avenue";

            returnAddress.addressCity = "Flynn";

            returnAddress.addressPostalCode = "6302";

            returnAddress.addressCountry = "AU";

            returnAddress.addressLine2 = "";

            returnAddress.addressState = "WA";


            returnAddressApi.postReturnAddressesPost(returnAddress).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::PostReturnAddressApi.new

            # Address | Address model
            return_address = ClickSendClient::Address.new(
              "address_postal_code": "address_postal_code",
              "address_country": "address_country",
              "address_line_1": "address_line_1",
              "address_state": "address_state",
              "address_name": "address_name",
              "address_line_2": "address_line_2",
              "address_city": "address_city"
            )

            begin
              # Create post return address
              result = api_instance.post_return_addresses_post(return_address)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling PostReturnAddressApi->post_return_addresses_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.PostReturnAddressApi(clicksend_client.ApiClient(configuration))

            return_address = clicksend_client.Address(
                            address_name="John Smith",
                            address_line_1="Maritime Avenue",
                            address_line_2="",
                            address_city="Flynn",
                            address_state="WA",
                            address_postal_code=6302,
                            address_country="AU") # Address | Address model

            try:
                # Create post return address
                api_response = api_instance.post_return_addresses_post(return_address)
                print(api_response)
            except ApiException as e:
                print("Exception when calling PostReturnAddressApi->post_return_addresses_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::PostReturnAddressApi;

            use WWW::ClickSendClient::Object::Address;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'address_name'        => 'address_name',
                'address_line_1'      => 'address_line_1',
                'address_city'        => 'address_city',
                'address_postal_code' => '12345',
                'address_country'     => 'AU',
                'address_line_2'      => 'address_line_2',
                'address_state'       => 'address_state'
            );


            my $address_obj =
            WWW::ClickSendClient::Object::Address->new(%params);


            my $json_output = $api->post_return_addresses_post('return_address'
            => $address_obj);


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSAddress *address = [[CSAddress alloc] init];

            address.addressName = @"adress_name";

            address.addressLine1 = @"address_line_1";

            address.addressCity = @"address_city";

            address.addressPostalCode = @"address_postal_code";

            address.addressCountry = @"address_country";

            address.addressLine2 = @"address_line_2";

            address.addressState = @"address_state";


            CSPostReturnAddressApi *postReturnAddressApiInstance =
            [[CSPostReturnAddressApi alloc] init];

            [postReturnAddressApiInstance
            postReturnAddressesPostWithReturnAddress:address
            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 returnAddress = Address(addressName: "address_name",
                                        addressLine1: "address_line_1",
                                        addressCity: "address_city",
                                        addressPostalCode: "adress_postal_code",
                                        addressCountry: "address_country",
                                        addressLine2: nil,
                                        addressState: "state")

            PostReturnAddressAPI.postReturnAddressesPost(returnAddress:
            returnAddress) { (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/post/return-addresses/{return_address_id}:
    get:
      summary: View Specific Return Address
      operationId: view-specific-return-address
      description: >-
        _Get specific post return address_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | return_address_id | path | integer(int32) | true | Return address ID |



        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: return_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-specific-return-address'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/post/return-addresses/{return_address_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\PostReturnAddressApi(new
            GuzzleHttp\Client(),$config);

            $return_address_id = 67384; // int | Return address ID


            try {
                $result = $apiInstance->postReturnAddressesByReturnAddressIdGet($return_address_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdGet: ', $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 postReturnAddressApi = new PostReturnAddressApi(configuration);

            var response =
            postReturnAddressApi.PostReturnAddressesByReturnAddressIdGet(RETURN_ADDRESS_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.PostReturnAddressApi;

            public class view_specific_return_address {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
                  Integer returnAddressId = 66963; // Integer | Return address ID
                  try {
                      String result = apiInstance.postReturnAddressesByReturnAddressIdGet(returnAddressId);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdGet");
                      e.printStackTrace();
                  }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var returnAddressApi = new api.PostReturnAddressApi("USERNAME",
            "API_KEY");


            var returnAddressId = 66814;


            returnAddressApi.postReturnAddressesByReturnAddressIdGet(returnAddressId).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::PostReturnAddressApi.new

            return_address_id = 56 # Integer | Return address ID

            begin
              # Get specific post return address
              result = api_instance.post_return_addresses_by_return_address_id_get(return_address_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_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.PostReturnAddressApi(clicksend_client.ApiClient(configuration))

            return_address_id = 66757 # int | Return address ID


            try:
                # Get specific post return address
                api_response = api_instance.post_return_addresses_by_return_address_id_get(return_address_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::PostReturnAddressApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output =
            $api->post_return_addresses_by_return_address_id_get('return_address_id'
            => '123456' );


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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


            CSPostReturnAddressApi *postReturnAddressApiInstance =
            [[CSPostReturnAddressApi alloc] init];

            [postReturnAddressApiInstance
            postReturnAddressesByReturnAddressIdGetWithReturnAddressId:returnAddressId
            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]
            }


            PostReturnAddressAPI.postReturnAddressesByReturnAddressIdGet(returnAddressId:
            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 Return Address
      operationId: update-return-address
      description: >-
        _Update post return address_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | return_address_id | path | integer(int32) | true | Return address ID |


        ### Properties


        | Name | Type | Required | Restrictions | Description |

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

        | address_name | string | true | none | Your address name. |

        | address_line_1 | string | true | none | Your address line 1 |

        | address_city | string | true | none | Your city |

        | address_postal_code | string | true | none | Your postal code |

        | address_country | string | true | none | Your country |

        | address_line_2 | string | false | none | Your address line 2 |

        | address_state | string | false | none | Your state |



        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:
                address_country:
                  type: string
                address_state:
                  type: string
                  nullable: true
              example:
                address_country: AU
                address_state: null
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: return_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-return-address'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"address_name\":\"John Smith\",
                \"address_line_1\":\"Maritime Avenue\",
                \"address_line_2\":\"\",
                \"address_city\":\"Flynn\",
                \"address_state\":\"WA\",
                \"address_postal_code\":6302,
                \"address_country\":\"AU\"
            }" \

            'https://rest.clicksend.com/v3/post/return-addresses/{return_address_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\PostReturnAddressApi(new
            GuzzleHttp\Client(),$config);

            $return_address_id = 67384; // int | Return address ID

            $return_address = new \ClickSend\Model\Address(); //
            \ClickSend\Model\Address | Address model

            $return_address->setAddressName("John Smith");

            $return_address->setAddressLine1("Maritime Avenue");

            $return_address->setAddressCity("Flynn");

            $return_address->setAddressPostalCode("6302");

            $return_address->setAddressCountry("AU");

            $return_address->setAddressLine2("");

            $return_address->setAddressState("WA");


            try {
                $result = $apiInstance->postReturnAddressesByReturnAddressIdPut($return_address_id, $return_address);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdPut: ', $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 postReturnAddressApi = new PostReturnAddressApi(configuration);

            var response =
            postReturnAddressApi.PostReturnAddressesByReturnAddressIdPut(ADDRESS_ID,
            new Address(
                addressName: "Address Name",
                addressLine1: "Address Line 1",
                addressCity: "City",
                addressPostalCode: "Postal Code",
                addressCountry: "CA",
                addressLine2: "Address Line 2",
                addressState: "State"
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.PostReturnAddressApi;
            import ClickSend.Model.Address;
            import ClickSend.auth.HttpBasicAuth;

            public class update_return_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
                Integer returnAddressId = 66963; // Integer | Return address ID
                Address returnAddress = new Address(); // Address | Address model
                returnAddress.addressName("John Smith");
                returnAddress.addressLine1("Maritime Avenue");
                returnAddress.addressCity("Flynn");
                returnAddress.addressPostalCode("6302");
                returnAddress.addressCountry("AU");
                returnAddress.addressLine2("");
                returnAddress.addressState("WA");
                try {
                    String result = apiInstance.postReturnAddressesByReturnAddressIdPut(returnAddressId, returnAddress);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var returnAddressApi = new api.PostReturnAddressApi("USERNAME",
            "API_KEY");


            var returnAddressId = 67182;


            var returnAddress = new api.Address();


            returnAddress.addressName = "John Smith";

            returnAddress.addressLine1 = "Maritime Avenue";

            returnAddress.addressCity = "Flynn";

            returnAddress.addressPostalCode = "6302";

            returnAddress.addressCountry = "AU";

            returnAddress.addressLine2 = "";

            returnAddress.addressState = "WA";


            returnAddressApi.postReturnAddressesByReturnAddressIdPut(returnAddressId,
            returnAddress).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::PostReturnAddressApi.new

            return_address_id = 56 # Integer | Return address ID

            # Address | Address model
            return_address = ClickSendClient::Address.new(
              "address_postal_code": "address_postal_code",
              "address_country": "address_country",
              "address_line_1": "address_line_1",
              "address_state": "address_state",
              "address_name": "address_name",
              "address_line_2": "address_line_2",
              "address_city": "address_city"
            )

            begin
              # Update post return address
              result = api_instance.post_return_addresses_by_return_address_id_put(return_address_id, return_address)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_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.PostReturnAddressApi(clicksend_client.ApiClient(configuration))

            return_address_id = 66757 # int | Return address ID

            return_address = clicksend_client.Address(
                              address_name="John Smith1",
                              address_line_1="Maritime Avenue1",
                              address_line_2="",
                              address_city="Flynn",
                              address_state="WA",
                              address_postal_code=6302,
                              address_country="AU") # Address | Address model

            try:
                # Update post return address
                api_response = api_instance.post_return_addresses_by_return_address_id_put(return_address_id, return_address)
                print(api_response)
            except ApiException as e:
                print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::PostReturnAddressApi;

            use WWW::ClickSendClient::Object::Address;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'address_name'        => 'address_name',
                'address_line_1'      => 'address_line_1',
                'address_city'        => 'address_city',
                'address_postal_code' => '12345',
                'address_country'     => 'AU',
                'address_line_2'      => 'address_line_2',
                'address_state'       => 'address_state'
            );


            my $address_obj =
            WWW::ClickSendClient::Object::Address->new(%params);


            my $json_output =
            $api->post_return_addresses_by_return_address_id_put('return_address_id'
            => '123456' ,'return_address' => $address_obj );


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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


            CSAddress *address = [[CSAddress alloc] init];

            address.addressName = @"address_name";

            address.addressLine1 = @"address_line_1";

            address.addressCity = @"address_city";

            address.addressPostalCode = @"address_postal_cade";

            address.addressCountry = @"country";

            address.addressLine2 = @"address_line_2";

            address.addressState = @"address_state";


            CSPostReturnAddressApi *postReturnAddressApiInstance =
            [[CSPostReturnAddressApi alloc] init];

            [postReturnAddressApiInstance
            postReturnAddressesByReturnAddressIdPutWithReturnAddressId:returnAddressId
            returnAddress:address 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 returnAddress = Address(addressName: "address_name",
                                        addressLine1: "address_line_1",
                                        addressCity: "address_city",
                                        addressPostalCode: "address_postal_code",
                                        addressCountry: "address_country",
                                        addressLine2: nil,
                                        addressState: nil)

            PostReturnAddressAPI.postReturnAddressesByReturnAddressIdPut(returnAddressId:
            1, returnAddress:returnAddress) { (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)
                    }
                }
            }
    delete:
      summary: Delete Return Address
      operationId: delete-return-address
      description: >-
        _Delete specific post return address_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | return_address_id | path | integer(int32) | true | Return address ID |



        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: return_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-return-address'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request DELETE \

            'https://rest.clicksend.com/v3/post/return-addresses/{return_address_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\PostReturnAddressApi(new
            GuzzleHttp\Client(),$config);

            $return_address_id = 67384; // int | Return address ID


            try {
                $result = $apiInstance->postReturnAddressesByReturnAddressIdDelete($return_address_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdDelete: ', $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 postReturnAddressApi = new PostReturnAddressApi(configuration);

            var response =
            postReturnAddressApi.PostReturnAddressesByReturnAddressIdDelete(RETURN_ADDRESS_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.PostReturnAddressApi;

            public class delete_return_address {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
                  Integer returnAddressId = 66963; // Integer | Return address ID
                  try {
                      String result = apiInstance.postReturnAddressesByReturnAddressIdDelete(returnAddressId);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdDelete");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var returnAddressApi = new api.PostReturnAddressApi("USERNAME",
            "API_KEY");


            var returnAddressId = 66814;


            returnAddressApi.postReturnAddressesByReturnAddressIdDelete(returnAddressId).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::PostReturnAddressApi.new

            return_address_id = 56 # Integer | Return address ID

            begin
              # Delete specific post return address
              result = api_instance.post_return_addresses_by_return_address_id_delete(return_address_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_delete: #{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.PostReturnAddressApi(clicksend_client.ApiClient(configuration))

            return_address_id = 66757 # int | Return address ID


            try:
                # Delete specific post return address
                api_response = api_instance.post_return_addresses_by_return_address_id_delete(return_address_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_delete: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::PostReturnAddressApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output =
            $api->post_return_addresses_by_return_address_id_delete('return_address_id'
            => '123456' );


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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



            CSPostReturnAddressApi *postReturnAddressApiInstance =
            [[CSPostReturnAddressApi alloc] init];

            [postReturnAddressApiInstance
            postReturnAddressesByReturnAddressIdDeleteWithReturnAddressId:returnAddressId
            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]
             }

             PostReturnAddressAPI.postReturnAddressesByReturnAddressIdDelete(returnAddressId: 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)
                     }
                 }
             }
