Skip to main content

Manage Global Payment Methods

2 API calls in this section.

Get Global Payment Methods

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

Retrieves all globally configured payment methods.

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

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success200
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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/system/payment-methods" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": "Credit Card",7  "is_enabled": true,8  "config": {9    "provider": "stripe",10    "api_key": "pk_test_..."11  }12}'
Request body
json
1{2  "name": "Credit Card",3  "is_enabled": true,4  "config": {5    "provider": "stripe",6    "api_key": "pk_test_..."7  }8}

Request body fields

nameExample
string

Example field from the request body.

is_enabledExample
boolean

Example field from the request body.

configExample
object

Example field from the request body.

config.providerExample
string

Example field from the request body.

config.api_keyExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

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