API Documentation
Welcome to the GECKO EDI API documentation. This guide will help you integrate EDI document management into your application with our RESTful API.
RESTful API
Standard HTTP methods with JSON request and response bodies
Current Version
Stable API with semantic versioning and backward compatibility
Secure
All requests encrypted with industry-standard security
Base URL
https://api.geckoedi.com/v1All API endpoints are relative to this base URL. All requests must be made over HTTPS.
Authentication
The GECKO EDI API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Keep your API key secure
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, or anywhere else.
Using your API key
All API requests must include your API key in the Authorization header as a Bearer token:
curl https://api.geckoedi.com/v1/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Authentication Errors
If authentication fails, you'll receive a 401 Unauthorized response:
{
"error": {
"type": "authentication_error",
"message": "Invalid API key provided"
}
}Quick Start
- 1.Sign up for a GECKO EDI account
- 2.Navigate to the API Keys section in your Dashboard
- 3.Generate a new API key
- 4.Include the key in your request headers
API Endpoints
The GECKO EDI API provides endpoints for managing EDI documents, including creation, retrieval, validation, and status tracking.
/v1/documentsCreate and send a new EDI document
Request Body
{
"type": "EDI_850",
"sender_id": "SENDER123",
"receiver_id": "RECEIVER456",
"data": {
"purchase_order": {
"po_number": "PO-2024-001",
"date": "2024-01-15",
"items": [
{
"line_number": 1,
"product_id": "PROD-123",
"quantity": 100,
"unit_price": 25.50
}
]
}
}
}Response
{
"id": "doc_1234567890",
"type": "EDI_850",
"status": "pending",
"sender_id": "SENDER123",
"receiver_id": "RECEIVER456",
"created_at": "2024-01-15T10:30:00Z",
"validation": {
"passed": true,
"errors": []
}
}Parameters
- type *
- EDI document type (e.g., EDI_850, EDI_810, EDI_856)
- sender_id *
- Sender identification code
- receiver_id *
- Receiver identification code
- data *
- Document payload matching the EDI type schema
/v1/documentsRetrieve a list of all EDI documents
Query Parameters
- limit
- Number of documents to return (default: 10, max: 100)
- starting_after
- Cursor for pagination (document ID)
- status
- Filter by status: pending, delivered, failed
- type
- Filter by EDI document type
Response
{
"data": [
{
"id": "doc_1234567890",
"type": "EDI_850",
"status": "delivered",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "doc_0987654321",
"type": "EDI_810",
"status": "pending",
"created_at": "2024-01-14T15:20:00Z"
}
],
"has_more": false,
"total": 2
}/v1/documents/:idRetrieve a specific EDI document by ID
Path Parameters
- id *
- The unique identifier of the document
Response
{
"id": "doc_1234567890",
"type": "EDI_850",
"status": "delivered",
"sender_id": "SENDER123",
"receiver_id": "RECEIVER456",
"data": {
"purchase_order": {
"po_number": "PO-2024-001",
"date": "2024-01-15",
"items": [...]
}
},
"created_at": "2024-01-15T10:30:00Z",
"delivered_at": "2024-01-15T10:31:23Z"
}/v1/documents/validateValidate an EDI document without sending it
Request Body
{
"type": "EDI_850",
"data": {
"purchase_order": {
"po_number": "PO-2024-001",
"date": "2024-01-15"
}
}
}Response
{
"valid": true,
"errors": [],
"warnings": [
{
"field": "data.purchase_order.items",
"message": "No items specified in purchase order"
}
]
}/v1/documents/:idDelete a specific EDI document (only if status is 'pending' or 'failed')
Path Parameters
- id *
- The unique identifier of the document to delete
Note: Documents with status 'delivered' cannot be deleted. You'll receive a 403 Forbidden error if you attempt to delete a delivered document.
Error Codes
The GECKO EDI API uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, codes in the 4xx range indicate an error with the provided information, and codes in the 5xx range indicate an error with our servers.
Error Response Format
All error responses follow a consistent JSON structure:
{
"error": {
"type": "validation_error",
"message": "Invalid EDI document structure",
"details": {
"field": "data.purchase_order.po_number",
"issue": "Required field missing"
},
"request_id": "req_1234567890"
}
}HTTP Status Codes
Bad Request
The request was malformed or invalid. Check the error details for specific issues.
validation_errorinvalid_request_errorUnauthorized
Authentication failed. Your API key is missing, invalid, or expired.
authentication_errorForbidden
The API key doesn't have permission to perform the requested action.
permission_errorNot Found
The requested resource doesn't exist.
resource_not_foundConflict
The request conflicts with the current state of the resource.
conflict_errorToo Many Requests
You've exceeded the rate limit. Please wait before making additional requests.
rate_limit_errorInternal Server Error
An unexpected error occurred on our end. Please try again later.
server_errorService Unavailable
The service is temporarily unavailable. Please try again later.
service_unavailableBest Practices
- •Always check the HTTP status code to determine if the request succeeded
- •Use the error type field to programmatically handle different error scenarios
- •Store the request_id for debugging and support inquiries
- •Implement exponential backoff for 429 and 5xx errors
Rate Limits
The GECKO EDI API implements rate limiting to ensure fair usage and maintain service quality for all users. Rate limits are applied per API key and vary based on your subscription tier.
Free
- ✓Basic EDI documents
- ✓Standard validation
Professional
- ✓All EDI document types
- ✓Advanced validation
- ✓Priority support
Enterprise
- ✓Unlimited documents
- ✓Custom integrations
- ✓Dedicated support
- ✓SLA guarantee
Rate Limit Headers
Every API response includes headers that provide information about your current rate limit status:
HTTP/1.1 200 OK
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1705420800- X-RateLimit-Limit
- The maximum number of requests allowed in the current time window
- X-RateLimit-Remaining
- The number of requests remaining in the current time window
- X-RateLimit-Reset
- Unix timestamp indicating when the rate limit will reset
Handling Rate Limit Errors
When you exceed your rate limit, you'll receive a 429 Too Many Requests response:
{
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded",
"details": {
"retry_after": 60,
"limit": 1000,
"window": "3600"
}
}
}Best Practices
- •Monitor headers: Check X-RateLimit-Remaining to track your usage
- •Implement backoff: Use exponential backoff when you receive 429 errors
- •Batch requests: Group multiple operations into single requests when possible
- •Cache responses: Store frequently accessed data to reduce API calls
- •Upgrade your plan: Contact us if you consistently hit rate limits
Need Higher Limits?
If your application requires higher rate limits, we offer custom Enterprise plans with tailored limits to meet your needs.
Contact SalesChangelog
Stay up to date with the latest changes, improvements, and fixes to the GECKO EDI API. We follow semantic versioning.
v1.2.0
minor- •Support for EDI 867 (Product Transfer and Resale Report)
- •New validation endpoint for batch document validation
- •Webhook support for real-time document status updates
- •Improved error messages with more detailed validation information
- •Enhanced rate limiting with per-endpoint granular controls
- •Fixed issue with EDI 850 line item parsing
- •Resolved timezone handling in document timestamps
v1.1.0
minor- •Support for EDI 856 (Ship Notice/Manifest)
- •Bulk document retrieval endpoint
- •Filter documents by date range
- •Updated authentication to support API key rotation
- •Improved pagination performance for large document sets
v1.0.1
patch- •Fixed validation error for optional fields in EDI 810
- •Corrected rate limit header values
- •Resolved issue with special characters in sender/receiver IDs
- •Enhanced API key encryption
- •Implemented additional request validation
v1.0.0
major- •Initial release of GECKO EDI API
- •Support for EDI 850 (Purchase Order)
- •Support for EDI 810 (Invoice)
- •Document validation and status tracking
- •RESTful API with JSON responses
- •Comprehensive error handling
Version Guidelines
- MAJOR
- Breaking changes that may require updates to your integration
- MINOR
- New features and enhancements that are backward compatible
- PATCH
- Bug fixes and minor improvements