Payment API reference
The checkout module provides REST and GraphQL APIs to configure out-of-process payment methods.
REST
For more information on the available endpoints, refer to payment API usage.
/V1/oope_payment_method/V1/oope_payment_method/:code/V1/oope_payment_methodCreate or update a payment method
The POST /V1/oope_payment_method/ creates or updates an out-of-process payment method in the Adobe Commerce instance. The code parameter is used to identify the payment method. If a payment method with the same code already exists, it will be updated; otherwise, a new payment method will be created.
Payload parameters:
codetitleactivebackend_integration_urlstorescountriescurrenciescustom_configdata-slots=heading, code
data-repeat=2
data-languages=bash, json
Example request
curl --request POST \
--url <ADOBE_COMMERCE_API_URL>/V1/oope_payment_method \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"payment_method": {
"code": "method-1",
"title": "Method 1",
"active": true,
"backend_integration_url": "http://example.com",
"stores": ["store-1", "store-2"],
"order_status": "processing",
"countries": ["ES", "US"],
"currencies": ["EUR", "USD"],
"custom_config": [
{
"key": "key1",
"value": "value1"
}
]
}
}'
Example response
{
"success": true,
"message": {
"id": 3,
"code": "method-1",
"title": "Method 1",
"active": true,
"backend_integration_url": "http://example.com",
"stores": ["store-1", "store-2"],
"order_status": "processing",
"countries": ["ES", "US"],
"currencies": ["EUR", "USD"],
"custom_config": [
{
"key1": "value1"
}
]
}
}
Get an OOPE payment method by code
The GET /V1/oope_payment_method/:code endpoint retrieves one out-of-process payment method by code from the Adobe Commerce instance.
Payload parameters:
codedata-slots=heading, code
data-repeat=2
data-languages=bash, json
Example request
curl --request GET \
--url <ADOBE_COMMERCE_API_URL>/V1/oope_payment_method/method-1 \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json'
Example response
{
"success": true,
"message": {
"id": 2,
"code": "method-1",
"title": "Method one",
"active": true,
"backend_integration_url": "http://<oope-payment-method.pay>/event",
"stores": ["default"],
"order_status": "complete",
"countries": ["ES", "US"],
"currencies": ["EUR", "USD"],
"custom_config": [
{
"key": "can_refund",
"value": "true"
}
]
}
}
List all payment methods
The GET /V1/oope_payment_method retrieves a list of all out-of-process payment methods from the Adobe Commerce instance.
data-slots=heading, code
data-repeat=2
data-languages=bash, json
Example request
curl --request GET \
--url <ADOBE_COMMERCE_API_URL>/V1/oope_payment_method \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json'
Example response
{
"success": true,
"message": [
{
"id": 1,
"code": "method-1",
"title": "Method one",
"active": true,
"backend_integration_url": "http://oope-payment-method.pay/event",
"stores": [],
"order_status": "complete",
"countries": [],
"currencies": [],
"custom_config": [
{
"key1": "value1"
}
]
}
]
}
GraphQL
The Payment module's GraphQL schema for this is defined in etc/schema.graphqls. You can access details about out-of-process payment types by specifying the oope_payment_method_config field within the available_payment_methods or selected_payment_method field of the cart API.
For more information on extending the out-of-process GraphQL schema, refer to the EDS Integration Guide.
data-slots=heading, code
data-repeat=2
data-languages=graphql, graphql
Example query
query getCart($cartId: String!) {
cart(cart_id: $cartId) {
...CHECKOUT_DATA_FRAGMENT
}
}
fragment CHECKOUT_DATA_FRAGMENT on Cart {
id
available_payment_methods {
code
title
oope_payment_method_config {
backend_integration_url
custom_config {
... on CustomConfigKeyValue {
key
value
}
}
}
}
selected_payment_method {
code
title
oope_payment_method_config {
backend_integration_url
custom_config {
... on CustomConfigKeyValue {
key
value
}
}
}
}
}
Example response
{
"available_payment_methods": [
{
"code": "checkmo",
"title": "Check / Money order",
"oope_payment_method_config": null
},
{
"code": "oope_adyen",
"title": "OOPE Adyen",
"oope_payment_method_config": {
"backend_integration_url": "http://oope-payment-method.pay/event",
"custom_config": [
{
"key": "can_refund",
"value": "true"
}
]
}
}
],
"selected_payment_method": {
"code": "checkmo",
"title": "Check / Money order",
"oope_payment_method_config": null
}
}