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-methodsRetrieves 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
AuthorizationOptionalheader 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-methodsAdds 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
nameExamplestring
Example field from the request body.
is_enabledExampleboolean
Example field from the request body.
configExampleobject
Example field from the request body.
config.providerExamplestring
Example field from the request body.
config.api_keyExamplestring
Example field from the request body.
Headers
AuthorizationOptionalheader string
Bearer {{access_token}}
Content-TypeOptionalheader 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}