Skip to content

📋 Create Payment Order

Endpoint

POST /paymentOrder

Description

Creates a payment order to be executed on a specific date. This operation schedules a one-time payment for a registered card owner in the future. The payment order is automatically processed on the specified date.

Headers

http
Authorization: Bearer {token}
Content-Type: application/json

Request: PaymentOrderRequest

json
{
  "reference": "ORDER-2026-001",
  "amount": 150.50,
  "currencyCode": "TRY",
  "paymentSystemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "explanation": "Subscription fee - February 2026",
  "ownerDescription": {
    "fullName": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+905551234567",
    "cardId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "paymentChannel": "web",
  "paymentTime": "2026-02-28T09:00:00Z"
}

Parameters

ParameterTypeRequiredDescription
referencestringOrder reference code (max 150 characters)
amountnumberPayment amount (decimal number)
currencyCodestringCurrency code (e.g., TRY, USD, EUR)
paymentSystemIduuidPayment system ID to use
explanationstringPayment description (max 400 characters)
ownerDescriptionobjectCard owner information
paymentChannelstringPayment channel (max 50 characters)
paymentTimedatetimeDate and time when payment will be executed (ISO 8601)

OwnerDescription Parameters

ParameterTypeRequiredDescription
fullNamestringCard owner's full name (max 100 characters)
emailstringEmail address
phonestringPhone number (E.164 format)
cardIduuidRegistered card ID

Response

Successful Request (200 OK)

json
{
  "success": true,
  "error": null,
  "shouldBeOwnerConfirmation": false,
  "ownerId": "OWN-123456",
  "orderStatus": "active"
}

Response Parameters

ParameterTypeDescription
successbooleanOperation success status
errorobjectError information (if any)
shouldBeOwnerConfirmationbooleanIs card owner confirmation required?
ownerIdstringCard owner ID
orderStatusstringPayment order status

OrderStatus Values

ValueDescription
activeActive - will be processed when payment time arrives
disabledDisabled
completeCompleted
waitForOwnerConfirmationWaiting for card owner confirmation
waitForCardSaveWaiting for card save

Error Codes

HTTP CodeDescription
200Operation successful
400Invalid request (parameter errors)
401Unauthorized access
403Access denied

Example Usage

cURL

bash
curl -X POST https://pgw.klogs.io/paymentOrder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "ORDER-2026-001",
    "amount": 150.50,
    "currencyCode": "TRY",
    "explanation": "Subscription fee - February 2026",
    "ownerDescription": {
      "fullName": "John Doe",
      "email": "john.doe@example.com",
      "phone": "+905551234567",
      "cardId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "paymentChannel": "web",
    "paymentTime": "2026-02-28T09:00:00Z"
  }'

JavaScript

javascript
const response = await fetch('https://pgw.klogs.io/paymentOrder', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    reference: 'ORDER-2026-001',
    amount: 150.50,
    currencyCode: 'TRY',
    explanation: 'Subscription fee - February 2026',
    ownerDescription: {
      fullName: 'John Doe',
      email: 'john.doe@example.com',
      phone: '+905551234567',
      cardId: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    },
    paymentChannel: 'web',
    paymentTime: '2026-02-28T09:00:00Z'
  })
});

const data = await response.json();
console.log(data);

C#

csharp
using System.Net.Http;
using System.Text;
using System.Text.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");

var request = new {
    reference = "ORDER-2026-001",
    amount = 150.50,
    currencyCode = "TRY",
    explanation = "Subscription fee - February 2026",
    ownerDescription = new {
        fullName = "John Doe",
        email = "john.doe@example.com",
        phone = "+905551234567",
        cardId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    paymentChannel = "web",
    paymentTime = "2026-02-28T09:00:00Z"
};

var content = new StringContent(
    JsonSerializer.Serialize(request),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync("https://pgw.klogs.io/paymentOrder", content);
var result = await response.Content.ReadAsStringAsync();

Notes

  • paymentTime must be a future date
  • cardId must be a previously registered card ID
  • reference should be unique for each payment order
  • The payment order will be automatically executed on the specified date
  • There is a retry mechanism for failed payments
  • Payment results are notified via webhook