API Reference
Welcome to the Finternet Payment Gateway API reference. This section provides detailed documentation for all API endpoints, request parameters, and response formats.
Base URLโ
All API requests are made to:
https://sandbox.pg.api.finternetlab.io/v1
๐งช Current Environment: This is the sandbox environment for testing and development.
๐ Production API will be available once deployed.
For testing and development, use:
http://localhost:3000/api/v1
Authenticationโ
All API requests require authentication using an API key. Include your API key in the request header:
X-API-Key: sk_test_your_key_here
See Authentication for detailed information.
Request Formatโ
Content-Typeโ
All POST and PUT requests must include:
Content-Type: application/json
Request Bodyโ
Request bodies should be JSON objects:
{
"amount": "100.00",
"currency": "USDC",
"type": "DELIVERY_VS_PAYMENT"
}
Response Formatโ
All API responses follow a consistent structure:
{
"id": "intent_2xYz9AbC123",
"object": "payment_intent",
"status": "SUCCEEDED",
"data": {
// Resource-specific data
},
"created": 1704067200,
"updated": 1704067200
}
Response Fieldsโ
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the resource |
object | string | Type of object (e.g., payment_intent) |
status | string | Current status of the resource |
data | object | Resource-specific data |
created | integer | Unix timestamp of creation |
updated | integer | Unix timestamp of last update |
HTTP Status Codesโ
The API uses standard HTTP status codes:
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Missing or invalid API key |
403 | Forbidden - Access denied |
404 | Not Found - Resource doesn't exist |
500 | Internal Server Error |
503 | Service Unavailable |
Error Responsesโ
When an error occurs, the API returns an error object:
{
"error": {
"code": "invalid_request",
"message": "The amount must be greater than 0",
"type": "invalid_request_error",
"param": "amount"
}
}
Error Object Fieldsโ
| Field | Type | Description |
|---|---|---|
code | string | Machine-readable error code |
message | string | Human-readable error message |
type | string | Error type (e.g., invalid_request_error) |
param | string | (Optional) Parameter that caused the error |
See Error Codes for a complete list of error codes.
Rate Limitsโ
API requests are subject to rate limits:
- Test keys: 100 requests per minute
- Live keys: 1000 requests per minute
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1704067260
See Rate Limits for more information.
Paginationโ
List endpoints support pagination using limit and starting_after parameters:
GET /v1/payment-intents?limit=10&starting_after=intent_123
Versioningโ
The API is versioned. The current version is v1. Include the version in the URL:
https://sandbox.pg.api.finternetlab.io/v1/payment-intents
Idempotencyโ
POST requests support idempotency keys to prevent duplicate operations:
Idempotency-Key: unique-key-here
If you retry a request with the same idempotency key within 24 hours, you'll receive the same response.
Webhooksโ
Finternet can send webhooks to notify you of payment events. See Webhooks for setup and event types.
Next Stepsโ
- Browse Payment Intents API
- Explore Conditional Payments API
- Check out Code Examples