1. Go to this page and download the library: Download liveecommerce/sigep library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
liveecommerce / sigep example snippets
use Live\Sigep\PostCard\Application\Service\GetPostCardStatusService;
use Live\Sigep\PostCard\Application\Service\GetPostCardStatusRequest;
use Live\Sigep\PostCard\Application\Service\GetPostCardStatusResponse;
use Live\Sigep\PostCard\Domain\Model\PostCardStatus;
$user = '';
$password = '';
$postCard = '';
$postCardStatusRequest = new GetPostCardStatusRequest($usuario, $password, $postCard);
// Setter para utilizar caso esteja em homologação
$postCardStatusRequest->setSandbox(true);
$postCardStatusService = new GetPostCardStatusService();
$postCardStatusResponse = $postCardStatusService($postCardStatusRequest);
use Live\Sigep\PostCard\Application\Service\GetPostCardAvaliableServicesService;
use Live\Sigep\PostCard\Application\Service\GetPostCardAvaliableServicesRequest;
use Live\Sigep\PostCard\Application\Service\GetPostCardAvaliableServicesResponse;
use Live\Sigep\PostCard\Domain\Model\PostCardAvaliableServices
$user = '';
$password = '';
$postCard = '';
$contract = '';
$postCardAvaliableServicesRequest = new GetPostCardAvaliableServicesRequest(
$user,
$password,
$postcard,
$contract
);
// Setter para utilizar caso esteja em homologação
$postCardAvaliableServicesRequest->setSandbox(true);
$postCardAvaliableServicesService = new GetPostCardAvaliableServicesService();
$postCardAvaliableServicesResponse = $postCardStatusService($postCardAvaliableServicesRequest);
use Live\Sigep\ShippingLabel\Application\Service\GetShippingLabelsRequest;
use Live\Sigep\ShippingLabel\Application\Service\GetShippingLabelsService;
use Live\Sigep\ShippingLabel\Application\Service\GetShippingLabelsResponse;
use Live\Sigep\ShippingLabel\Domain\Model\ShippingLabel
$user = '';
$password = '';
$serviceId = '';
$receiverType = 'C';
$cnpj = '';
$quantityLabels = 1;
$getShippingLabelsRequest = new GetShippingLabelsRequest(
$user,
$password,
$serviceId,
$receiverType,
$cnpj,
$quantityLabels
);
// Setter para utilizar caso esteja em homologação
$getShippingLabelsRequest->setSandbox(true);
$getShippingLabelsService = new GetShippingLabelsService();
$getShippingLabelsResponse = $getShippingLabelsService($getShippingLabelsRequest);
use Live\Sigep\Address\Application\Service\GetAddressByZipCodeRequest;
use Live\Sigep\Address\Application\Service\GetAddressByZipCodeService;
use Live\Sigep\Address\Application\Service\GetAddressByZipCodeResponse;
use Live\Sigep\Address\Domain\Model\Address
$cep = '';
$getAddressByZipCodeRequest = new GetAddressByZipCodeRequest('07124610');
// Setter para utilizar caso esteja em homologação
$getAddressByZipCodeRequest->setSandbox(true);
$getAddressByZipCodeService = new GetAddressByZipCodeService();
$getAddressByZipCodeResponse = $getAddressByZipCodeService($getAddressByZipCodeRequest);
use Live\Sigep\DeliveryAvailability\Application\Service\GetDeliveryAvailabilityRequest;
use Live\Sigep\DeliveryAvailability\Application\Service\GetDeliveryAvailabilityService;
use Live\Sigep\DeliveryAvailability\Application\Service\GetDeliveryAvailabilityResponse;
use Live\Sigep\DeliveryAvailability\Domain\Model\DeliveryAvailability;
$cep = '';
$getDeliveryAvailabilityRequest = new GetDeliveryAvailabilityRequest(
$user,
$password,
$administrativeCode,
$service,
$senderZipCode,
$receiverZipCode
);
// Setter para utilizar caso esteja em homologação
$getDeliveryAvailabilityRequest->setSandbox(true);
$getDeliveryAvailabilityService = new GetDeliveryAvailabilityService();
$getDeliveryAvailabilityResponse = $getDeliveryAvailabilityService($getDeliveryAvailabilityRequest);
use Live\Sigep\Address\Domain\Model\Address;
use Live\Sigep\ShippingLabel\Domain\Model\ShippingLabel;
use Live\Sigep\PrePostingList\Domain\Model\PrePostingList;
use Live\Sigep\PrePostingList\Domain\Model\AdditionalServiceType;
use Live\Sigep\PrePostingList\Application\Service\ClosePrePostingListRequest;
use Live\Sigep\PrePostingList\Application\Service\ClosePrePostingListService;
use Live\Sigep\PrePostingList\Application\Service\ClosePrePostingListResponse;
use Live\Sigep\Address\Domain\Model\Address;
use Live\Sigep\ShippingLabel\Domain\Model\ShippingLabel;
use Live\Sigep\PrePostingList\Domain\Model\PostalObject;
use Live\Sigep\PrePostingList\Domain\Model\PostalObjectType;
use Live\Sigep\PrePostingList\Domain\Model\AdditionalServiceType;
use Live\Sigep\PrePostingList\Domain\Model\RegionalCodeBoardType;
use Live\Sigep\PrePostingList\Domain\Model\PrePostingList;
use Live\Sigep\PrePostingList\Application\Service\GetPrePostingListXmlFromCorreiosRequest;
use Live\Sigep\PrePostingList\Application\Service\GetPrePostingListXmlFromCorreiosService;
use Live\Sigep\PrePostingList\Application\Service\GetPrePostingListXmlFromCorreiosResponse;
$user = '';
$password = '';
$plpNumber = 0;
$getPrePostingListXmlFromCorreiosRequest = new GetPrePostingListXmlFromCorreiosRequest(
$user,
$password,
$plpNumber
);
// Setter para utilizar caso esteja em homologação
$getPrePostingListXmlFromCorreiosRequest->setSandbox(true);
$getPrePostingListXmlFromCorreiosService = new GetPrePostingListXmlFromCorreiosService();
$getPrePostingListXmlFromCorreiosResponse = $getPrePostingListXmlFromCorreiosService($getPrePostingListXmlFromCorreiosRequest);
use Live\Sigep\DeliverySuspension\Application\Service\GetDeliverySuspensionRequest;
use Live\Sigep\DeliverySuspension\Application\Service\GetDeliverySuspensionService;
use Live\Sigep\DeliverySuspension\Application\Service\GetDeliverySuspensionResponse;
use Live\Sigep\PrePostingList\Domain\Model\PrePostingList;
use Live\Sigep\ShippingLabel\Domain\Model\ShippingLabel;
$user = '';
$password = '';
$label = '';
$plp = 0;
$shippingLabel = new ShippingLabel($label);
$prePostingList = new PrePostingList($plp);
$getDeliverySuspensionRequest = new GetDeliverySuspensionRequest(
$user,
$password,
$shippingLabel,
$prePostingList
);
// Setter para utilizar caso esteja em homologação
$getDeliverySuspensionRequest->setSandbox(true);
$getDeliverySuspensionService = new GetDeliverySuspensionService();
$getDeliverySuspensionResponse = $getDeliverySuspensionService($getDeliverySuspensionRequest);
use Live\Sigep\AddressingLabel\Application\Service\GetAddressingLabelRequest;
use Live\Sigep\AddressingLabel\Application\Service\GetAddressingLabelService;
use Live\Sigep\AddressingLabel\Application\Service\GetAddressingLabelResponse;
use Live\Sigep\Address\Domain\Model\Address;
use Live\Sigep\ShippingLabel\Domain\Model\ShippingLabel;
$getAddressingLabelService = new GetAddressingLabelService();
$getAddressingLabelResponse = $getAddressingLabelService($request);
use Live\Sigep\PostList\Application\Service\GetPostageVoucherRequest;
use Live\Sigep\PostList\Application\Service\GetPostageVoucherService;
use Live\Sigep\PostList\Application\Service\GetPostageVoucherResponse;
use Live\Sigep\PrePostingList\Domain\Model\PrePostingList;
$getPostageVoucherService = new GetPostageVoucherService();
$getPostageVoucherResponse = $getPostageVoucherService($getPostageVoucherRequest);
use Live\Sigep\PostList\Application\Service\GetPostListRequest;
use Live\Sigep\PostList\Application\Service\GetPostListService;
use Live\Sigep\PostList\Application\Service\GetPostListResponse;
use Live\Sigep\PostList\Domain\Model\PrePostingList;
use Live\Sigep\Address\Domain\Model\Address;
use Live\Sigep\PrePostingList\Domain\Model\PostalObject;
$getPostListService = new GetPostListService();
$getPostListResponse = $getPostListService($getPostListRequest);
use Live\Sigep\PostList\Application\Service\GetProofOfDeliveryRequest;
use Live\Sigep\PostList\Application\Service\GetProofOfDeliveryService;
use Live\Sigep\PostList\Application\Service\GetProofOfDeliveryResponse;
use Live\Sigep\PrePostingList\Domain\Model\PostalObject;
use Live\Sigep\Address\Domain\Model\Address;