Retrieve payment methods and providers

  • Payments
  • Payment
  • 2 routes
How do I list payment providers and the methods they expose?

This scenario explains how to list the payment providers exposed by the API and then retrieve the payment methods available for one selected provider.

Overview

This scenario helps an application discover the payment providers exposed for a locale and then inspect the payment methods available for one selected provider.

Prerequisites

  • A valid accept-language header.
  • A valid x-api-key.
  • A provider_id returned by the first step to read the detailed payment methods.

Expected result

The application can list the available providers, select one provider and retrieve the supported payment methods together with their payment conditions.

Process workflow

Legend:
Mandatory
Optional
1

List payment providers

Mandatory

Use GET/v1/payment_providers to list the payment providers available for the current locale before selecting one provider for the payment journey.

Prerequisites

  • Send accept-language and x-api-key.
  • Call this step before creating a payment.
  • Keep the same locale as the rest of the payment flow so the catalog remains consistent.

Calling CURL

curl -X 'GET' \
  'https://api.clubmed.com/v1/payment_providers' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US' \
  -H 'x-api-key: YOUR_API_KEY'

Example answer

[
  {
    "id": "EOGONE",
    "label": "Ogone",
    "connection_type": "E-Commerce",
    "payment_methods": [
      {
        "id": "AE",
        "label": "American Express",
        "category": "CreditCard",
        "time_payment_conditions": [
          {
            "id": "A1",
            "payment_count": 3,
            "required_delay_before_departure": 45
          }
        ]
      }
    ]
  }
]

info: v1 already embeds payment_methods under each provider, so one response is enough to populate the provider selector and prepare the next step.


Response codes

  • OK Response (200): returns the payment providers available for the requested locale.
  • Error (400): the request is malformed or one input value is invalid.
  • Error (401): authentication or API key validation failed.
  • Error (403): access to the provider catalog is forbidden in the current context.
  • Error (404): not documented in Swagger.
GET/v1/payment_providers
See more
2

Inspect payment methods on the selected provider

Mandatory

Use GET/v1/payment_providers to inspect the payment_methods exposed by the provider selected in the previous step.

Prerequisites

  • Reuse the provider chosen from the previous GET/v1/payment_providers response.
  • Send accept-language and x-api-key.
  • Call this step before POST/v0/payments so you can pick a compatible method and payment condition.

Calling CURL

curl -X 'GET' \
  'https://api.clubmed.com/v1/payment_providers' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US' \
  -H 'x-api-key: YOUR_API_KEY'

Example answer

[
  {
    "id": "EOGONE",
    "label": "Ogone",
    "payment_methods": [
      {
        "id": "AE",
        "label": "American Express",
        "category": "CreditCard",
        "time_payment_conditions": [
          {
            "id": "A1",
            "payment_count": 3,
            "required_delay_before_departure": 45
          }
        ]
      }
    ]
  }
]

info: there is no dedicated second endpoint anymore in v1: read the payment_methods array directly on the selected provider object and reuse those identifiers in the payment payload.


Response codes

  • OK Response (200): returns the providers and their embedded payment methods for the requested locale.
  • Error (400): the request is malformed or one input value is invalid.
  • Error (401): authentication or API key validation failed.
  • Error (403): access to the provider catalog is forbidden in the current context.
  • Error (404): not documented in Swagger.
GET/v1/payment_providers
See more