Skip to main content

Payment API Examples

This page shows how to embed specific API endpoints in documentation.

Create Payment

POST/payments

Create a new payment

Create a new payment transaction with the specified amount and currency.

Parameters

NameTypeRequiredDescription
AuthorizationstringBearer token for authentication

Request Body

{
  "amount": 1000,
  "currency": "USD",
  "description": "Test payment",
  "customer_id": "cust_123"
}

Responses

201 - Payment created successfully
{
  "application/json": {
    "success": true,
    "data": {
      "id": "pay_123",
      "amount": 1000,
      "currency": "USD",
      "status": "pending"
    }
  }
}
400 - Bad request

Usage Example

Here's how to create a payment using curl:

curl -X POST "https://api.qashier.com/v1/payments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "USD",
"description": "Test payment",
"customer_id": "cust_123"
}'

Response Example

{
"success": true,
"data": {
"id": "pay_123",
"amount": 1000,
"currency": "USD",
"status": "pending",
"created_at": "2024-01-01T00:00:00Z"
},
"message": "Payment created successfully",
"timestamp": "2024-01-01T00:00:00Z"
}

For the complete API reference, see the In-Store Payments API or Online Payments API documentation.

Was this page helpful?