User
7 API calls in this section.
Payment APIs for end users to view available payment methods and process payments.
User Payment Methods (enabled only)
/payment/user/payment-methodsLists only enabled payment methods for the authenticated user's tenant. Optionally filter by method_type (e.g., GATEWAY, WALLET, COD). The COD record keeps canonical name Cash on Delivery, type COD, and gateway_code cod; its localized display_name is Cash.
Query parameters
| Parameter | Type | Description |
|---|---|---|
method_typeOptional | string | Optional filter by payment method type ( |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/payment/user/payment-methods?method_type=" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.
Create Payment (NASS redirect)
/payment/paymentsCreates a payment and returns redirect URL for NASS when gateway is active.
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
order_id | string | — |
tenant_id | string | — |
user_id | string | — |
payment_method_type_id | string | — |
amount | number | — |
currency | string | — |
back_ref | string | — |
metadata | object | — |
metadata.note | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/payment/payments" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "order_id": "order-123",6 "tenant_id": "{{tenant_id}}",7 "user_id": "{{user_id}}",8 "payment_method_type_id": "<pm_type_uuid_NASS>",9 "amount": 100,10 "currency": "IQD",11 "back_ref": "https://app.example.com/payment/return",12 "metadata": {13 "note": "checkout"14 }15}'Replace {{placeholders}} with your own values before sending.
Response examples
No saved response example. Use Try it to inspect a staging response.
Confirm Payment
/payment/payments/:id/confirmConfirms a payment and triggers wallet crediting when applicable.
Path parameters
| Parameter | Type | Description |
|---|---|---|
idRequired | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
gateway_transaction_id | string | — |
gateway_response | object | — |
status | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/payment/payments/${ID}/confirm" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "gateway_transaction_id": "<rrn_or_order>",6 "gateway_response": {},7 "status": "COMPLETED"8}'Response examples
No saved response example. Use Try it to inspect a staging response.
Confirm Payment by Gateway Txn
/payment/payments/confirmConfirms a payment by gateway transaction id (e.g., NASS ORDER/RRN).
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
gateway_transaction_id | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/payment/payments/confirm" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "gateway_transaction_id": "<rrn_or_order>"6}'Response examples
No saved response example. Use Try it to inspect a staging response.
Get Available Payment Methods
/payment/user/methodsRetrieves available payment methods for the authenticated user with real-time availability checking.
Query parameters
| Parameter | Type | Description |
|---|---|---|
market_idRequired | string | Market ID to get payment methods for (required) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
AuthorizationRequired | string | JWT token for authenticated users (required) Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/payment/user/methods?market_id=${MARKET_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.
Initiate Payment
/payment/user/initiate-paymentInitiates a payment for the authenticated user through the selected payment method.
Headers
| Parameter | Type | Description |
|---|---|---|
AuthorizationRequired | string | JWT token for authenticated users (required) Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
orderId | string | — |
tenantId | string | — |
marketId | string | — |
paymentMethodTypeId | string | — |
amount | number | — |
currency | string | — |
customerEmail | string | — |
metadata | object | — |
metadata.productId | string | — |
metadata.campaignId | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/payment/user/initiate-payment" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "orderId": "order-12345",6 "tenantId": "{{tenant_id}}",7 "marketId": "{{market_id}}",8 "paymentMethodTypeId": "razorpay-method-uuid",9 "amount": 299.99,10 "currency": "USD",11 "customerEmail": "user@example.com",12 "metadata": {13 "productId": "product-uuid-123",14 "campaignId": "campaign-summer2024"15 }16}'Replace {{placeholders}} with your own values before sending.
Response examples
No saved response example. Use Try it to inspect a staging response.
Get Payment Status
/payment/user/status/:paymentIdRetrieves the current status of a payment for the authenticated user.
Path parameters
| Parameter | Type | Description |
|---|---|---|
paymentIdRequired | string | UUID of the payment to check status Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
AuthorizationRequired | string | JWT token for authenticated users (required) Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/payment/user/status/${PAYMENTID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.