Professional Documents
Culture Documents
api_doc
api_doc
1. Introduction
1.1 Overview
This document describes the endpoints, request parameters, and response formats for
the "XYZ Payment Gateway API".
2. Authentication
All requests to the API must include an API key in the header:
css
Copy code
Authorization: Bearer {API_KEY}
3. Endpoints
3.1 Create Payment
URL: https://api.xyzpayment.com/v1/payments
Method: POST
Headers:
Content-Type: application/json
Authorization: Bearer {API_KEY}
Request Body:
json
Copy code
{
"amount": 100.00,
"currency": "USD",
"payment_method": "credit_card",
"description": "Payment for Order #1234"
}
Response:
json
Copy code
{
"payment_id": "pay_1Gq2ZWz3vFXee3",
"status": "pending",
"amount": 100.00,
"currency": "USD"
}
3.2 Retrieve Payment
URL: https://api.xyzpayment.com/v1/payments/{payment_id}
Method: GET
Headers:
Authorization: Bearer {API_KEY}
Response:
json
Copy code
{
"payment_id": "pay_1Gq2ZWz3vFXee3",
"status": "completed",
"amount": 100.00,
"currency": "USD",
"description": "Payment for Order #1234",
"created_at": "2024-07-10T14:48:00Z"
}
4. Error Codes
400 Bad Request: Invalid request parameters.
401 Unauthorized: Invalid API key.
404 Not Found: Payment not found.
Each of these examples provides a structured and detailed overview of different
types of technical documents used in software and hardware development.