Backend API Integration

Automate Saloon-based external API integrations for Laravel projects.

Updated Oct 31, 2025
One-click install
npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill backend-api-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Backend API Integration
Source: https://github.com/FlorianRiquelme/statamic-assets/tree/main/.claude/skills/backend-api-integration
Command: npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill backend-api-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the complex task of integrating external APIs into Laravel projects, ensuring robust error handling, data integrity, and comprehensive testing, saving significant development time.

Core Features & Use Cases

  • Saloon-Based: Leverages the Saloon library for structured, maintainable API interactions.
  • Robustness: Includes readonly DTOs, service layer methods, and comprehensive error handling for reliable communication.
  • Use Case: Integrate a new payment gateway API, ensuring all requests and responses are type-safe, errors are handled gracefully, and the integration is fully tested with mocking.

Quick Start

Generate a Saloon-based API integration for a new external service endpoint, including request, DTO, and service layer.

Frequently Asked Questions about Backend API Integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate external APIs into Laravel using Saloon?

Saloon provides a structured library for integrating external APIs in Laravel. It lets you build connector classes, request classes, and readonly DTOs that handle API interactions with built-in error handling, keeping your code maintainable and type-safe across your Laravel application.

What's the best way to set up API connectors and requests for third-party services?

Create Saloon connectors and request classes in your app/Services/Api/ directory, paired with readonly DTOs in app/DataTransferObjects/Api/. This structure separates concerns, ensures type safety, and centralizes error handling for all external service calls.

Do I need to write tests for API integrations, and how?

Yes. Build Pest test suites alongside your Saloon integrations to mock API responses and validate request handling. Testing catches integration bugs early and ensures your API client behaves correctly under different scenarios without hitting live services.

Can I use Saloon with existing Laravel service layers?

Saloon integrates naturally into Laravel's service layer pattern. Add service-layer methods that wrap your Saloon connectors and requests, giving you a clean API for controllers and jobs while keeping Saloon's request and response logic encapsulated.

How does Saloon handle errors when calling external APIs?

Saloon supports comprehensive error handling through request classes and service methods. You can catch failed responses, retry logic, and custom exceptions, then map errors to domain-specific handling—keeping your application resilient when external services fail or return unexpected data.

Why use DTOs for API responses instead of raw arrays?

Readonly DTOs provide type safety, IDE autocomplete, and validation for API response data. They prevent accidental mutations, document expected response shapes, and make it easier to refactor when external APIs change.