Options
All
  • Public
  • Public/Protected
  • All
Menu

ups-brazil-js

Index

Variables

Const URL_ENDPOINT

URL_ENDPOINT: "https://www.ups.com.br/upsbilling/UPS_Billing.asmx" = "https://www.ups.com.br/upsbilling/UPS_Billing.asmx"

Const xmlResponse

xmlResponse: "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><UPS_Retorno_FreteResponse xmlns="http://tempuri.org/"><UPS_Retorno_FreteResult><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element name="Table"><xs:complexType><xs:sequence><xs:element name="CustoReais" type="xs:string" minOccurs="0" /><xs:element name="ValorDesconto" type="xs:string" minOccurs="0" /><xs:element name="ValorSeguro" type="xs:string" minOccurs="0" /><xs:element name="ValorSeguro1" type="xs:string" minOccurs="0" /><xs:element name="ValorFrete" type="xs:string" minOccurs="0" /><xs:element name="ValorFreteComSeguro" type="xs:string" minOccurs="0" /><xs:element name="ValorEA" type="xs:string" minOccurs="0" /><xs:element name="FreteTotalReceber" type="xs:string" minOccurs="0" /><xs:element name="CentroOrigem" type="xs:string" minOccurs="0" /><xs:element name="CentroDestino" type="xs:string" minOccurs="0" /><xs:element name="ValorAR" type="xs:double" minOccurs="0" /><xs:element name="AcessoSistema" type="xs:string" minOccurs="0" /><xs:element name="RetornoAreaRisco" type="xs:string" minOccurs="0" /><xs:element name="FreteSemImposto" type="xs:double" minOccurs="0" /><xs:element name="ValorIcms" type="xs:double" minOccurs="0" /><xs:element name="ValorPisCofins" type="xs:double" minOccurs="0" /><xs:element name="TaxaDomestico" type="xs:double" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><NewDataSet xmlns=""><Table diffgr:id="Table1" msdata:rowOrder="0"><CustoReais>130.18</CustoReais><ValorDesconto>78.11</ValorDesconto><ValorSeguro>1.52</ValorSeguro><ValorSeguro1>1.52</ValorSeguro1><ValorFrete>52.07</ValorFrete><ValorFreteComSeguro>53.59</ValorFreteComSeguro><ValorEA>59.17</ValorEA><FreteTotalReceber>112.76</FreteTotalReceber><CentroDestino>9999</CentroDestino><ValorAR>0</ValorAR><AcessoSistema>Liberado</AcessoSistema><RetornoAreaRisco>N</RetornoAreaRisco><FreteSemImposto>102.52</FreteSemImposto><ValorIcms>17.21</ValorIcms><ValorPisCofins>10.45</ValorPisCofins><TaxaDomestico>0</TaxaDomestico></Table></NewDataSet></diffgr:diffgram></UPS_Retorno_FreteResult></UPS_Retorno_FreteResponse></soap:Body></soap:Envelope>" = "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><UPS_Retorno_FreteResponse xmlns="http://tempuri.org/"><UPS_Retorno_FreteResult><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element name="Table"><xs:complexType><xs:sequence><xs:element name="CustoReais" type="xs:string" minOccurs="0" /><xs:element name="ValorDesconto" type="xs:string" minOccurs="0" /><xs:element name="ValorSeguro" type="xs:string" minOccurs="0" /><xs:element name="ValorSeguro1" type="xs:string" minOccurs="0" /><xs:element name="ValorFrete" type="xs:string" minOccurs="0" /><xs:element name="ValorFreteComSeguro" type="xs:string" minOccurs="0" /><xs:element name="ValorEA" type="xs:string" minOccurs="0" /><xs:element name="FreteTotalReceber" type="xs:string" minOccurs="0" /><xs:element name="CentroOrigem" type="xs:string" minOccurs="0" /><xs:element name="CentroDestino" type="xs:string" minOccurs="0" /><xs:element name="ValorAR" type="xs:double" minOccurs="0" /><xs:element name="AcessoSistema" type="xs:string" minOccurs="0" /><xs:element name="RetornoAreaRisco" type="xs:string" minOccurs="0" /><xs:element name="FreteSemImposto" type="xs:double" minOccurs="0" /><xs:element name="ValorIcms" type="xs:double" minOccurs="0" /><xs:element name="ValorPisCofins" type="xs:double" minOccurs="0" /><xs:element name="TaxaDomestico" type="xs:double" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><NewDataSet xmlns=""><Table diffgr:id="Table1" msdata:rowOrder="0"><CustoReais>130.18</CustoReais><ValorDesconto>78.11</ValorDesconto><ValorSeguro>1.52</ValorSeguro><ValorSeguro1>1.52</ValorSeguro1><ValorFrete>52.07</ValorFrete><ValorFreteComSeguro>53.59</ValorFreteComSeguro><ValorEA>59.17</ValorEA><FreteTotalReceber>112.76</FreteTotalReceber><CentroDestino>9999</CentroDestino><ValorAR>0</ValorAR><AcessoSistema>Liberado</AcessoSistema><RetornoAreaRisco>N</RetornoAreaRisco><FreteSemImposto>102.52</FreteSemImposto><ValorIcms>17.21</ValorIcms><ValorPisCofins>10.45</ValorPisCofins><TaxaDomestico>0</TaxaDomestico></Table></NewDataSet></diffgr:diffgram></UPS_Retorno_FreteResult></UPS_Retorno_FreteResponse></soap:Body></soap:Envelope>"

Functions

UPSBrazil

  • UPSBrazil(user: string, password: string, originZipCode: string, destinationZipCode: string, packageData: UPSBrazilPack, invoiceValue: number, timeout?: number): Promise<{ AcessoSistema: any; CentroDestino: number; CustoReais: number; FreteSemImposto: number; FreteTotalReceber: number; RetornoAreaRisco: boolean; TaxaDomestico: number; ValorAR: number; ValorDesconto: number; ValorEA: number; ValorFrete: number; ValorFreteComSeguro: number; ValorIcms: number; ValorPisCofins: number; ValorSeguro: number; ValorSeguro1: number }>
  • 💵 Get Quote for Shipping

    Parameters

    • user: string

      User for auth

    • password: string

      Password for auth

    • originZipCode: string

      Origin ZipCode

    • destinationZipCode: string

      Destination ZipCode

    • packageData: UPSBrazilPack

      Box data for shipping

    • invoiceValue: number

      Total money value of the items in shipment

    • Default value timeout: number = 5000

      Timeout of the request

    Returns Promise<{ AcessoSistema: any; CentroDestino: number; CustoReais: number; FreteSemImposto: number; FreteTotalReceber: number; RetornoAreaRisco: boolean; TaxaDomestico: number; ValorAR: number; ValorDesconto: number; ValorEA: number; ValorFrete: number; ValorFreteComSeguro: number; ValorIcms: number; ValorPisCofins: number; ValorSeguro: number; ValorSeguro1: number }>

sanitizePostalCode

  • sanitizePostalCode(postalCode: string): string

Generated using TypeDoc