async send(document) {
        let response;
        let responseData;

        try {
            const path = '/v1/documents';
            const payload = {
                dataEncoding: 'base64',
                data: Buffer.from(document, 'binary').toString('base64')
            };
            const headers = await helpers.generateRequestHeaders({
                isPostRequest: true,
                payload
            });

            response = await axios.post(path, payload, { headers });
            responseData = response.data;

            // TODO: handle sent document
            console.log('[PostDocument] response.data = ', responseData);
            console.log('');
        } catch (error) {
            requestHelpers.handleNetworkError(error);
            responseData = error.response.data;
        }

        return responseData;
    }
/**
     * This method shows how the request should look when
     * you want to send a document. Please pay attention to
     * Correlation Id and Idempotency Key headers.
     * 
     * For more information, please visit: [documentation](https://developer.sovos.com/apis/e-invoicing#operation/Document_Post) or
     * [developer guide](https://developer-guide.sovos.com/connect-once-api/general-concepts/api-specifications/sending-and-retrieving-documents)
     * 
     * @param {string} document stringified Sovos Business Document
     */
This method shows how the request should look when
you want to send a document. Please pay attention to
Correlation Id and Idempotency Key headers.

For more information, please visit: [documentation] or
[developer guide]

@param {string} document stringified Sovos Business Document
This method shows how the request should look when you want to send a document . Please pay attention to Correlation Id and Idempotency Key headers . For more information please visit : [ documentation ] or [ developer guide ] @param { string } document stringified Sovos Business Document
async send(document) {
        let response;
        let responseData;
        try {
            const path = '/v1/documents';
            const payload = {
                dataEncoding: 'base64',
                data: Buffer.from(document, 'binary').toString('base64')
            };
            const headers = await helpers.generateRequestHeaders({
                isPostRequest: true,
                payload
            });
            response = await axios.post(path, payload, { headers });
            responseData = response.data;
            console.log('[PostDocument] response.data = ', responseData);
            console.log('');
        } catch (error) {
            requestHelpers.handleNetworkError(error);
            responseData = error.response.data;
        }
        return responseData;
    }
async send ( document ) { let response ; let responseData ; try { const path = '/v1/documents' ; const payload = { dataEncoding : 'base64' , data : Buffer . from ( document , 'binary' ) . toString ( 'base64' ) } ; const headers = await helpers . generateRequestHeaders ( { isPostRequest : true , payload } ) ; response = await axios . post ( path , payload , { headers } ) ; responseData = response . data ; console . log ( '[PostDocument] response.data = ' , responseData ) ; console . log ( '' ) ; } catch ( error ) { requestHelpers . handleNetworkError ( error ) ; responseData = error . response . data ; } return responseData ; }
This method shows how the request should look when
 you want to send a document.
This method shows how the request should look when you want to send a document .
// TODO: handle sent document