Gen-Endpoint
Back to API List
Payment Processing API
Handle payment flows, refunds, and transaction history with multiple payment methods.
E-commerce
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Payment Processing API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/payments/process, would be accessible at https://gen-endpoint.com/api/payments/process. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
POST

/api/payments/process

Process payment with validation and fraud detection.

Show Static Examples

Example Request Body:

{
  "amount": 99.99,
  "currency": "USD",
  "paymentMethod": {
    "type": "card",
    "token": "pm_1234567890"
  },
  "orderId": "order_123",
  "billingAddress": {
    "street": "123 Main St",
    "city": "Anytown",
    "state": "CA",
    "zipCode": "12345",
    "country": "US"
  }
}

Example Response:

{
  "paymentId": "pay_789",
  "status": "succeeded",
  "amount": 99.99,
  "currency": "USD",
  "transactionId": "txn_456",
  "processedAt": "2024-08-16T12:00:00Z"
}
Try it out
POST

/api/payments/{paymentId}/refund

Process full or partial refund for payment. Replace {paymentId} with an actual payment ID.

Show Static Examples

Example Request Body:

{
  "amount": 49.99,
  "reason": "customer_request",
  "refundId": "ref_123"
}

Example Response:

{
  "refundId": "ref_123",
  "status": "processing",
  "amount": 49.99,
  "originalPayment": "pay_789",
  "estimatedCompletion": "2024-08-19T12:00:00Z"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

GET

/api/payments/history

Get payment transaction history with filtering.

Show Static Examples

Example Request Parameters:

?userId=usr_123&status=succeeded&limit=10&page=1

Example Response:

{
  "payments": [
    {
      "id": "pay_789",
      "amount": 99.99,
      "status": "succeeded",
      "createdAt": "2024-08-16T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 25
  }
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).