Public scope
Merchant payment-session creation, payment status lookup, non-secret health status, webhooks եւ idempotent retries:
Console/admin endpoints, operator tokens, provider credentials, bank secrets, payout data եւ internal reconciliation controls:
Production credentials-ը տրամադրվում է միայն merchant onboarding-ից, domain review-ից, callback verification-ից եւ test payment flow-ից հետո:
Մի կանչեք merchant endpoints-ը browser code-ից կամ mobile apps-ից embedded secrets-ով: Bearer tokens-ը եւ webhook secrets-ը պահեք միայն trusted backend services-ում:
Quick start
Նվազագույն ինտեգրացիան ունի երեք server-side մաս. ստեղծել payment session, buyer-ին redirect անել hosted checkout, հետո final status-ը հաստատել status lookup-ով կամ signed webhook-ով:
curl -X POST https://api.vpos.am/v1/payment-sessions \
-H "Authorization: Bearer <merchant_api_token>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001-pay-attempt-1" \
-d '{
"merchantOrderId": "order-1001",
"amountMinor": 15000,
"currency": "AMD",
"provider": "manual",
"returnUrl": "https://merchant.example/payments/return",
"customer": {
"email": "buyer@example.com",
"phone": "+37400000000",
"name": "Test Buyer"
},
"metadata": {
"source": "custom-backend"
}
}'
Browser return URL-ը payment proof չէ: Դա միայն UI event է: Fulfillment-ը պետք է սպասի server-side verification-ի կամ signed webhook event-ի:
Endpoints
/api/health
Վերադարձնում է non-secret runtime status monitoring-ի եւ integration checks-ի համար: JSON body-ում կարող են լինել readiness blockers, բայց client-ը դրանք չպետք է համարի stable contract:
| Status | Նշանակություն |
|---|---|
| 200 | Service-ը հասանելի է: Readiness-ը վերադարձվում է JSON body-ում: |
| 405 | HTTP method-ը չի աջակցվում: |
/v1/capabilities
Վերադարձնում է conservative provider capability matrix: Օգտագործեք այն PayLink, QR, refunds, fiscalization եւ tokenization UI-ը միայն պատրաստ route-երի համար միացնելու նպատակով:
| Field | Կանոններ |
|---|---|
providers[].capabilities | Boolean support/enabled flags յուրաքանչյուր provider route-ի համար: |
payment_links, qr_presentation | Enabled է միայն երբ ընտրված route-ը կարող է ստեղծել payment sessions: |
refund, capture, void, tokenization, subscriptions | Public contracts-ը guarded է. execution-ը disabled է մինչեւ provider capabilities, idempotency եւ sandbox tests: |
/v1/payment-links
Ստեղծում է idempotent payment link payment session-ի հիման վրա: QR payload-ը միայն URL presentation layer է. final payment status-ը գալիս է webhook-ով կամ reconciliation-ով:
| Field | Կանոններ |
|---|---|
Idempotency-Key | Պարտադիր header: Reuse արեք retries-ի ժամանակ duplicate payment link-ից խուսափելու համար: |
amount, currency | Major-unit amount եւ AMD/USD/EUR currency: AMD-ի համար միայն whole number: |
description | Պարտադիր customer-facing payment description: |
expiresAt | Optional future ISO date/time: Expiry-ն payment outcome proof չէ: |
providerRoute | Optional provider route: Unsupported կամ not-ready route-ը rejected է: |
/v1/payment-sessions
Ստեղծում է normalized payment session եւ վերադարձնում hosted checkout URL, եթե ընտրված provider-ը կարող է սկսել checkout:
| Field | Կանոններ |
|---|---|
merchantOrderId | Պարտադիր merchant-side order reference: Օգտագործեք stable value reconciliation-ի համար: |
amountMinor | Պարտադիր integer amount minor currency units-ով: |
currency | Public values: AMD, USD, EUR: |
returnUrl | Absolute HTTPS URL, ուր buyer-ը վերադառնում է checkout-ից հետո: |
customer | Optional email, phone եւ name: Պահեք միայն այն, ինչ պետք է business process-ին: |
/v1/payments/{id}/refunds · /capture · /void
Guarded operation contracts refunds, capture, void, fiscal retry, tokenization եւ subscriptions-ի համար: Պահանջում են Idempotency-Key եւ չեն կատարվում մինչ provider capabilities-ը չմիացվեն ու չթեստավորվեն:
| Field | Կանոններ |
|---|---|
Idempotency-Key | Պարտադիր է money-moving կամ lifecycle operation-ի համար: |
refund | Պահանջում է verified paid/partially_refunded payment, amountMinor, matching currency եւ reason: |
capture, void | Պահանջում են authorized payment: Browser return-ը proof չէ: |
tokenization | Raw card data-ն rejected է. պետք է provider-hosted token lifecycle եւ consent: |
subscriptions | Պահանջում են provider token եւ failed-renewal behavior tests մինչ execution enable-ը: |
/v1/payments?paymentId=<id>
Վերադարձնում է արդեն ստեղծված session-ի current normalized payment state-ը:
| Status | Մշակման կանոն |
|---|---|
created, pending_*, authorized | Fulfillment չանել: Շարունակեք polling կամ սպասեք webhook-ին: |
paid | Fulfillment-ը կարելի է անել amount, currency եւ order reference match-ից հետո: |
failed, cancelled, expired | Ցույց տվեք failure state կամ ստեղծեք նոր payment attempt: |
refunded, partially_refunded, reversed, disputed | Sync արեք accounting, CRM եւ customer support workflows: |
Webhooks
Webhook delivery-ն կարգավորվում է յուրաքանչյուր merchant-ի համար onboarding-ի ընթացքում: Ձեր endpoint-ը պետք է verify անի HMAC signature-ը, պահի event id-ն, արագ պատասխանի եւ business side effects-ը տեղափոխի queue:
{
"id": "evt_01hxxexample",
"type": "payment.status_changed",
"createdAt": "2026-05-25T08:00:00.000Z",
"payment": {
"id": "pay_01hxxexample",
"merchantOrderId": "order-1001",
"amountMinor": 15000,
"currency": "AMD",
"status": "paid"
}
}
Signature header format: X-VPOS-Signature: sha256=<hex_hmac_sha256>: HMAC-ը հաշվվում է raw request body-ի վրա merchant webhook secret-ով:
Idempotency
Օգտագործեք Idempotency-Key retryable operations-ի համար, օրինակ payment-session creation: Պահեք key-ը order-ի եւ payment attempt-ի հետ: Network retry-ն չպետք է ստեղծի երկրորդ payable order կամ invoice:
- Օգտագործեք deterministic key յուրաքանչյուր order payment attempt-ի համար, ոչ թե random key յուրաքանչյուր retry-ի համար:
- Տարբեր user-initiated attempts-ի համար պահեք տարբեր keys:
- Միասին log արեք VPOS payment id, merchant order id, amount եւ currency:
Errors
| HTTP status | Նշանակություն | Integrator action |
|---|---|---|
401 | Merchant bearer token-ը բացակայում է կամ սխալ է: | Մի retry արեք blind ձեւով: Rotate կամ reissue credentials: |
403 | Request origin-ը trusted չէ: | Օգտագործեք server-to-server requests կամ register արեք backend origin-ը: |
422 | Validation failed: | Ուղղեք request data-ն մինչ retry: |
429 | Rate limited: | Կատարեք backoff եւ retry jitter-ով: |
503 | Provider, storage կամ authentication dependency-ն պատրաստ չէ: | Retry later կամ դիմեք support-ին, եթե դա block է production-ի համար: |
Security rules
- Երբեք մի բացեք merchant bearer tokens, webhook secrets կամ provider credentials frontend code-ում:
- Օգտագործեք միայն HTTPS եւ verify արեք server certificates backend clients-ում:
- Payment-ը final համարեք միայն server-side status confirmation-ից հետո:
- Validate արեք amount, currency եւ merchant order id մինչ order, CRM կամ ERP state փոփոխելը:
- Պահեք webhook event ids եւ reject արեք duplicate side effects:
- Log արեք failed signature checks եւ unexpected status transitions առանց unnecessary personal data պահելու:
Այս public page-ը դիտավորյալ չի ներառում production tokens, internal console routes, private provider callbacks, database details կամ bank credentials:
Access request
Pilot կամ production access-ի համար ուղարկեք company name, website, integration type, expected provider, currencies, callback URL եւ contact person info@vpos.am հասցեին:
Production-ից առաջ VPOS.am-ը ստուգում է merchant identity, domain ownership, callback security, test payment results, refund եւ reconciliation process, support ownership: