Skip to main content

Manage Global Payment Methods

2 API calls in this section.

Endpoints for system admins to manage the globally available payment methods.

Get Global Payment Methods​

System Configuration / Storefront Administration / Manage Global Payment Methods
GET/system/payment-methods

Retrieves all globally configured payment methods.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/system/payment-methods" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200Success
Response body
json
1{2  "success": true,3  "data": {4    "payment_methods": [5      {6        "id": "pm-global-cod",7        "name": "Cash on Delivery",8        "is_enabled": true,9        "config": {}10      },11      {12        "id": "pm-global-wallet",13        "name": "Wallet",14        "is_enabled": true,15        "config": {}16      }17    ]18  }19}

Create Global Payment Method​

System Configuration / Storefront Administration / Manage Global Payment Methods
POST/system/payment-methods

Adds a new globally available payment method.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
namestring—
is_enabledboolean—
configobject—
config.providerstring—
config.api_keystring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/system/payment-methods" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "name": "Credit Card",6  "is_enabled": true,7  "config": {8    "provider": "stripe",9    "api_key": "pk_test_..."10  }11}'

Response examples

201Success
Response body
text
1{2    "success": true,3    "data": {4        "payment_method": { ... new payment method object ... }5    },6    "message": "Payment method created successfully"7}