Create Payment

HTTP Method: POST
Endpoint URL: /payment
Description: Creates a new payment record.
Security: Requires both API-KEY and X-HMAC headers.

Request Headers

  • Content-Type: application/json
  • API-KEY: your_account_api_key
  • X-HMAC: your_hmac_signature

Request Body (JSON)

{
	"amount": "1000.00",
	"asset": { "short": "USDT", "network": "tron" },
	"customer": {
		"id": 12312312,
		"name": "John",
		"email": "[email protected]"
	},
	"clientId": "your_client_id",
	"invoice": "INV-001",
	"checkoutUrl": "https://your-shop.com/orders/40113049"
}

Request Body Fields

  • amount (required, string) — Payment amount as a decimal string
  • asset (required, object) — Cryptocurrency asset:
    • short — Asset ticker symbol (e.g. "USDT")
    • network — Blockchain network (e.g. "tron")
  • customer (required, object) — Customer information:
    • id — Your internal customer identifier (integer)
    • name — Customer name
    • email — Customer email address
  • clientId (optional, string) — Unique client identifier for persistent wallet address assignment. See Client ID documentation for details.
  • invoice (optional, string) — Your internal invoice or reference ID
  • checkoutUrl (optional, string) — URL to redirect the customer back to your shop after payment

Example cURL

curl https://api.alppay.io/v2/payment \
	-X POST \
	-H "Content-Type: application/json" \
	-H "API-KEY: ak_live_1234567890abcdef" \
	-H "X-HMAC: your_calculated_signature" \
	-d '{"amount":"1000.00","asset":{"short":"USDT","network":"tron"},"customer":{"id":12312312,"name":"John","email":"[email protected]"},"clientId":"your_client_id","invoice":"INV-001","checkoutUrl":"https://your-shop.com/orders/40113049"}'

Successful Response (200 OK)

{
	"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
	"transactions": [
		{
		"paymentId": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
		"txnId": "0xe7238caa68382485141be0443d6ba7efd0bd9f6bac5a624bd059acc53af1bf1d19",
		"receivedAmount": "20.00",
		"asset": {
			"short": "USDT",
			"name": "Tether",
			"logoUrl": "https://cryptologos.cc/logos/tether-usdt-logo.png",
			"network": "tron"
		},
		"destTag": null,
		"addressFrom": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
		"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
		"date": "2025-05-20T12:34:56Z"
		}
	],
	"amount": "1000.00",
	"totalReceivedAmount": "20.00",
	"asset": {
		"short": "USDT",
		"name": "Tether",
		"logoUrl": "https://cryptologos.cc/logos/tether-usdt-logo.png",
		"network": "tron"
	},
	"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"confirmsNeeded": 30,
	"timeout": 9000,
	"checkoutUrl": "https://your-shop.com/orders/40113049",
	"status": "OPEN",
    "displayStatus": "OPEN",
	"customer": {
		"id": 12312312,
		"name": "John",
		"email": "[email protected]"
	},
	"merchant": {
		"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
		"name": "Your Company",
		"siteUrl": "https://your-shop.com",
		"logoUrl": "https://your-shop.com/logo.svg",
		"email": "[email protected]"
	},
	"invoice": "INV-001",
	"paymentRedirectUrl": "https://a-pay-system.com/en/invoice?id=285d8dce-7663-4580-ba7f-8afb2f2d3292",
	"createdAt": "2025-05-20T12:34:56Z",
	"updatedAt": "2025-05-20T12:34:56Z"
}