# External gateways

External payment gateways let you integrate any payment service that is not available out-of-the-box (even your custom one) and safely process any type of external payment.

To create an external gateway choose a meaningful name that helps you identify it within your organization and specify the endpoints you have configured externally. You need to provide your gateway's **authorize**, **capture**, **void**, **refund**, and **customer token** URLs. Your external endpoint will be responsible for the actual integration with the payment gateway. The payment source associated with the order must be an [external payment](/core-api-reference/external_payments.md).

External gateways are subject to a [circuit breaker](/core/external-resources.md#circuit-breaker) check: if the call to your external endpoint fails consecutively more than **30** times, the circuit breaker opens and any further request to the resource will be skipped. You can check the circuit breaker current status by fetching the `circuit_state` and `circuit_failure_count` attributes or manually reset it by passing the `_reset_circuit` trigger (the circuit is anyway automatically reset anytime a call to your external endpoint succeeds before reaching the counter's threshold).

External gateways process payments **synchronously** by default. You can use the webhook endpoint URL Commerce Layer exposes to manage [async payments](https://docs.commercelayer.io/developers/external-resources/external-payment-gateways#asynchronous-payments).

<details>

<summary>How-to</summary>

Check the related [guide](https://docs.commercelayer.io/developers/external-resources/external-payment-gateways) for any additional info on how to configure your external payment gateway and integrate it with Commerce Layer.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/core-api-reference/external_gateways.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
