GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pheizx/facturapi-java: Crea Facturas Electrónicas válidas en México lo más fácil posible (CFDI)

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
README.es.md
README.es.md
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Facturapi Java SDK

Official Java SDK for Facturapi.

Español: README.es.md

Facturapi helps developers generate valid electronic invoices (CFDI) in Mexico.

If you've used Stripe or a similar API-first payments or billing SDK, the surface here should feel familiar: typed models on the way out, flexible JSON objects on the way in.

Make sure you have a Facturapi account and your API key.

CI Maven Central Java

Compatibility

  • Java 11+
  • Kotlin/JVM
  • Android 8.0 (API level 26) o superior
  • Spring Boot, Jakarta EE, Quarkus, Micronaut, and other JVM server apps

Installation

Maven:

<dependency>
  <groupId>io.facturapi</groupId>
  <artifactId>facturapi-java</artifactId>
  <version>1.1.0</version>
</dependency>

Gradle:

implementation("io.facturapi:facturapi-java:1.1.0")

Quickstart

import io.facturapi.Facturapi;
import java.util.Map;

Facturapi facturapi = new Facturapi("sk_test_...");

var customer = facturapi.customers().create(Map.of(
  "legal_name", "Mi Empresa SA de CV",
  "tax_id", "XAXX010101000",
  "tax_system", "601",
  "email", "[email protected]"
), null);

var invoice = facturapi.invoices().create(Map.of(
  "customer", customer.getId(),
  "items", java.util.List.of(Map.of("quantity", 1, "product", "prod_123"))
), null);

System.out.println(invoice.getId());

Uploads

import java.io.File;

var organization = facturapi.organizations().uploadLogo(
  "org_123",
  new File("logo.png")
);

var updated = facturapi.organizations().uploadCertificate(
  "org_123",
  new File("certificate.cer"),
  new File("certificate.key"),
  "secret"
);

Errors

import io.facturapi.FacturapiException;

try {
  facturapi.customers().retrieve("cus_123");
} catch (FacturapiException e) {
  System.out.println(e.getMessage());
  System.out.println(e.getStatusCode());
  System.out.println(e.getErrorCode());
  System.out.println(e.getErrorPath());
}

Design

  • Inputs use flexible JSON dictionaries (Map<String, Object>).
  • Outputs are typed Java models (Invoice, Customer, SearchResult<T>, etc.).
  • Errors expose the useful API error fields directly on FacturapiException.
  • Auth uses Authorization: Bearer <apiKey>.

Configuration

Facturapi facturapi = Facturapi.builder("sk_test_...")
  .apiVersion("v2")
  .timeout(java.time.Duration.ofSeconds(20))
  .build();

Custom HTTP Client

For tests or advanced setups, you can inject your own OkHttpClient:

import okhttp3.OkHttpClient;

Facturapi facturapi = Facturapi.builder("sk_test_...")
  .httpClient(new OkHttpClient())
  .build();

Documentation

Full docs: https://docs.facturapi.io

Support

  • Issues: open a GitHub issue
  • Email: [email protected]

About

Crea Facturas Electrónicas válidas en México lo más fácil posible (CFDI)

www.facturapi.io

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.