Dinamikpay API Documentation

Integration Guide – Sandbox Environment

1. Overview

Dinamikpay is a REST-based payment integration interface designed for merchants who want to accept online payments securely and efficiently.

All requests and responses are transmitted in JSON format over HTTPS.

2. Environment

Environment Base URL
Sandbox (Default) https://api.dinamikpay1.com
Production Provided after merchant approval

3. Authentication

All API requests must include authentication headers.

X-API-KEY: **************
X-API-SECRET: **************
Content-Type: application/json
        
Important:
API Key and Secret Key are not displayed in this documentation.
Please request your credentials from your account manager.

4. Create Payment

Endpoint: POST /v1/payment/create

Request Body

{
  "merchant_id": "MERCHANT123",
  "order_id": "ORDER_1001",
  "amount": 1500.00,
  "currency": "TRY",

  "customer": {
    "customer_id": "CUST_45821",
    "username": "johndoe88",
    "phone": "+905551112233",
    "name": "John Doe",
    "email": "john@example.com",
    "ip": "192.168.1.10"
  },

  "callback_url": "https://merchant-site.com/callback",
  "return_url": "https://merchant-site.com/success"
}
        

Parameters

Field Required Description
merchant_id Yes Unique merchant identifier
order_id Yes Unique order reference
amount Yes Payment amount (TRY)
currency Yes Currency code (TRY)
customer.customer_id No Merchant-side customer number
customer.username No Customer username
customer.phone No Customer phone number (international format)
callback_url Yes Server-to-server notification URL
Note:
Customer identifiers are used for transaction tracking, fraud prevention, and support operations.

5. Payment Response

{
  "status": "success",
  "payment_id": "PAY987654",
  "redirect_url": "https://pay.dinamikpay1.com/checkout/PAY987654"
}
        

The customer must be redirected to the redirect_url to complete the payment process.

6. Callback (Webhook)

After payment status changes, Dinamikpay sends a POST request to the merchant's callback URL.

{
  "payment_id": "PAY987654",
  "order_id": "ORDER_1001",
  "status": "completed",
  "amount": 1500.00,
  "currency": "TRY",
  "signature": "generated_signature_hash"
}
        

Payment Status Values

7. Signature Verification

Signature is generated using the following algorithm:

SHA256(order_id + payment_id + API_SECRET)
        

Merchants must verify the signature to confirm the authenticity of the callback request.

8. Query Payment Status

Endpoint: GET /v1/payment/status

GET /v1/payment/status?payment_id=PAY987654
        
{
  "payment_id": "PAY987654",
  "status": "completed",
  "created_at": "2025-01-10 14:25:11"
}
        

9. Error Codes

Code Description
1001 Invalid API credentials
1002 Invalid amount
1003 Duplicate order_id
1004 Payment not found