Skip to content

EcuaByte-lat/ecuapi-sdk-php

Repository files navigation

ecuapi-sdk-php

API for electronic invoicing in Ecuador. Generate, sign, and send invoices to SRI.

For more information, please visit https://ecuapi.com.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/ecuapi-sdk-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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




$apiInstance = new EcuaapiSdk\Api\CertificatesApi(
    // 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()
);

try {
    $result = $apiInstance->listCertificates();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CertificatesApi->listCertificates: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.ecuapi.com

Class Method HTTP request Description
CertificatesApi listCertificates GET /v1/certificates List certificates
CertificatesApi uploadCertificate POST /v1/certificates/upload Upload P12 certificate
HealthApi getApiInfo GET /health Basic health check
HealthApi getApiInfo_0 GET /v1/health Basic health check
HealthApi getDetailedHealth GET /health/health Detailed health check
HealthApi getDetailedHealth_0 GET /v1/health/health Detailed health check
InvoicesApi authorizeInvoice POST /v1/invoices/{id}/authorize Authorize invoice
InvoicesApi createInvoice POST /v1/invoices Create invoice
InvoicesApi getInvoice GET /v1/invoices/{id} Get invoice by ID
InvoicesApi getInvoicePdf GET /v1/invoices/{id}/pdf Download RIDE PDF
InvoicesApi getInvoiceXml GET /v1/invoices/{id}/xml Download signed XML
InvoicesApi listInvoices GET /v1/invoices List invoices
InvoicesApi sendInvoice POST /v1/invoices/{id}/send Send invoice to SRI
InvoicesApi voidInvoice DELETE /v1/invoices/{id} Void invoice

Models

Authorization

Endpoints do not require authorization.

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@ecuabyte.lat

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
    • Generator version: 7.18.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

PHP SDK for ECUAPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published