Skip to main content

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)​

Billing & Subscriptions / User
GET/payment/user/payment-methods

Lists 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

ParameterTypeDescription
method_typeOptionalstring

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

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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)​

Billing & Subscriptions / User
POST/payment/payments

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

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
order_idstring—
tenant_idstring—
user_idstring—
payment_method_type_idstring—
amountnumber—
currencystring—
back_refstring—
metadataobject—
metadata.notestring—
Staging
Request
curl
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​

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

Confirms a payment and triggers wallet crediting when applicable.

Path parameters

ParameterTypeDescription
idRequiredstring

Example: <payment_uuid>

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
gateway_transaction_idstring—
gateway_responseobject—
statusstring—
Staging
Request
curl
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​

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

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

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
gateway_transaction_idstring—
Staging
Request
curl
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​

Billing & Subscriptions / User
GET/payment/user/methods

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

Query parameters

ParameterTypeDescription
market_idRequiredstring

Market ID to get payment methods for (required)

Example: {{market_id}}

Headers

ParameterTypeDescription
AuthorizationRequiredstring

JWT token for authenticated users (required)

Example: Bearer {{access_token}}

Staging
Request
curl
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​

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

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

Headers

ParameterTypeDescription
AuthorizationRequiredstring

JWT token for authenticated users (required)

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
orderIdstring—
tenantIdstring—
marketIdstring—
paymentMethodTypeIdstring—
amountnumber—
currencystring—
customerEmailstring—
metadataobject—
metadata.productIdstring—
metadata.campaignIdstring—
Staging
Request
curl
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": "[email protected]",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​

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

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

Path parameters

ParameterTypeDescription
paymentIdRequiredstring

UUID of the payment to check status

Example: payment-uuid-123

Headers

ParameterTypeDescription
AuthorizationRequiredstring

JWT token for authenticated users (required)

Example: Bearer {{access_token}}

Staging
Request
curl
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.