Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Gre Api Laravel Package

greenter/gre-api

View on GitHub
Deep Wiki
Context7

Greenter\Sunat\GRE\AuthApi

All URIs are relative to https://api-seguridad.sunat.gob.pe/v1, except if the operation defines another base path.

Method HTTP request Description
getToken() POST /clientessol/{client_id}/oauth2/token/ Generar un nuevo token

getToken()

getToken($client_id, $grant_type, $scope, $client_id2, $client_secret, $username, $password): \Greenter\Sunat\GRE\Model\ApiToken

Generar un nuevo token

Example

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



$apiInstance = new Greenter\Sunat\GRE\Api\AuthApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$client_id = 'client_id_example'; // string | El client_id generado en menú sol
$grant_type = 'password'; // string
$scope = 'https://api-cpe.sunat.gob.pe'; // string
$client_id2 = 'client_id_example'; // string | client_id generado en menú sol
$client_secret = 'client_secret_example'; // string | client_secret generado en menú sol
$username = 'username_example'; // string | <Numero de RUC> + <Usuario SOL>
$password = 'password_example'; // string | Contrasena SOL

try {
    $result = $apiInstance->getToken($client_id, $grant_type, $scope, $client_id2, $client_secret, $username, $password);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->getToken: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
client_id string El client_id generado en menú sol
grant_type string [default to 'password']
scope string [default to 'https://api-cpe.sunat.gob.pe']
client_id2 string client_id generado en menú sol
client_secret string client_secret generado en menú sol
username string <Numero de RUC> + <Usuario SOL>
password string Contrasena SOL

Return type

\Greenter\Sunat\GRE\Model\ApiToken

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/graphviz
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata