Skip to main content

User

7 API calls in this section.

User Payment Methods (enabled only)

Billing & Subscriptions / User
GET/payment/user/payment-methods?method_type=

Lists only enabled payment methods for the authenticated user's tenant. Optionally filter by method_type (e.g., GATEWAY, WALLET, COD).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/payment/user/payment-methods?method_type=" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

method_typeOptional
query string

Optional filter by payment method type (e.g., GATEWAY, WALLET, COD).

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Create Payment (NASS redirect)

Billing & Subscriptions / User
POST/payment/payments

Creates a payment and returns redirect URL for NASS when gateway is active.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/payment/payments" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "order_id": "order-123",7  "tenant_id": "{{tenant_id}}",8  "user_id": "{{user_id}}",9  "payment_method_type_id": "<pm_type_uuid_NASS>",10  "amount": 100,11  "currency": "IQD",12  "back_ref": "https://app.example.com/payment/return",13  "metadata": {14    "note": "checkout"15  }16}'
Request body
json
1{2  "order_id": "order-123",3  "tenant_id": "{{tenant_id}}",4  "user_id": "{{user_id}}",5  "payment_method_type_id": "<pm_type_uuid_NASS>",6  "amount": 100,7  "currency": "IQD",8  "back_ref": "https://app.example.com/payment/return",9  "metadata": {10    "note": "checkout"11  }12}

Request body fields

order_idExample
string

Example field from the request body.

tenant_idExample
string

Example field from the request body.

user_idExample
string

Example field from the request body.

payment_method_type_idExample
string

Example field from the request body.

amountExample
number

Example field from the request body.

currencyExample
string

Example field from the request body.

back_refExample
string

Example field from the request body.

metadataExample
object

Example field from the request body.

metadata.noteExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Confirm Payment

Billing & Subscriptions / User
POST/payment/payments/:id/confirm

Confirms a payment and triggers wallet crediting when applicable.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/payment/payments/:id/confirm" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "gateway_transaction_id": "<rrn_or_order>",7  "gateway_response": {},8  "status": "COMPLETED"9}'
Request body
json
1{2  "gateway_transaction_id": "<rrn_or_order>",3  "gateway_response": {},4  "status": "COMPLETED"5}

Path parameters

idRequired
path string

<payment_uuid>

Request body fields

gateway_transaction_idExample
string

Example field from the request body.

gateway_responseExample
object

Example field from the request body.

statusExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Confirm Payment by Gateway Txn

Billing & Subscriptions / User
POST/payment/payments/confirm

Confirms a payment by gateway transaction id (e.g., NASS ORDER/RRN).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/payment/payments/confirm" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "gateway_transaction_id": "<rrn_or_order>"7}'
Request body
json
1{2  "gateway_transaction_id": "<rrn_or_order>"3}

Request body fields

gateway_transaction_idExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Get Available Payment Methods

Billing & Subscriptions / User
GET/payment/user/methods?market_id={{market_id}}

Retrieves available payment methods for the authenticated user with real-time availability checking.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/payment/user/methods?market_id={{market_id}}" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

market_idOptional
query string

{{market_id}}

Market ID to get payment methods for (required)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

JWT token for authenticated users (required)

Responses

No response example is available for this endpoint yet.

Initiate Payment

Billing & Subscriptions / User
POST/payment/user/initiate-payment

Initiates a payment for the authenticated user through the selected payment method.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/payment/user/initiate-payment" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "orderId": "order-12345",7  "tenantId": "{{tenant_id}}",8  "marketId": "{{market_id}}",9  "paymentMethodTypeId": "razorpay-method-uuid",10  "amount": 299.99,11  "currency": "USD",12  "customerEmail": "user@example.com",13  "metadata": {14    "productId": "product-uuid-123",15    "campaignId": "campaign-summer2024"16  }17}'
Request body
json
1{2  "orderId": "order-12345",3  "tenantId": "{{tenant_id}}",4  "marketId": "{{market_id}}",5  "paymentMethodTypeId": "razorpay-method-uuid",6  "amount": 299.99,7  "currency": "USD",8  "customerEmail": "user@example.com",9  "metadata": {10    "productId": "product-uuid-123",11    "campaignId": "campaign-summer2024"12  }13}

Request body fields

orderIdExample
string

Example field from the request body.

tenantIdExample
string

Example field from the request body.

marketIdExample
string

Example field from the request body.

paymentMethodTypeIdExample
string

Example field from the request body.

amountExample
number

Example field from the request body.

currencyExample
string

Example field from the request body.

customerEmailExample
string

Example field from the request body.

metadataExample
object

Example field from the request body.

metadata.productIdExample
string

Example field from the request body.

metadata.campaignIdExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

JWT token for authenticated users (required)

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Get Payment Status

Billing & Subscriptions / User
GET/payment/user/status/:paymentId

Retrieves the current status of a payment for the authenticated user.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/payment/user/status/:paymentId" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

paymentIdRequired
path string

payment-uuid-123

UUID of the payment to check status

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

JWT token for authenticated users (required)

Responses

No response example is available for this endpoint yet.