Setting an endpoint to receive alternative transaction requests

When StarkEx identifies an invalid transaction, StarkEx marks the transaction as invalid and sends a request to the application’s endpoint for a list of alternative transactions.

You need to set this endpoint by providing the following information:

  • The endpoint URL that you use to monitor requests for alternative transactions.

  • A URL to receive information about failed alternative transactions. If an alternative transaction that you send StarkEx fails, StarkEx sends a description of the failure to this URL.

    This URL can be the same as the endpoint URL.

  • Optionally, you can apply security measures using bearer tokens, or alternatively, for increased security, certificate-based communication.

    • A bearer token is a string of characters that you give to StarkEx. StarkEx uses this token for authentication when connecting to your endpoint. The token is encrypted, and can have an expiration date.

    • Certificate-based communication requires a client certificate that you send to StarkEx, together with a private key and a public server certificate that you obtain from a certificate authority and place on your server.

      When sending a request for an alternative transaction, StarkEx proves authenticity by providing the client certificate. The server certificate proves the authenticity of your server to StarkEx.

Dynamic vs static configuration

A dynamic configuration enables you to change the configuration, such as replacing the bearer-token periodically in order to increase security.

A static configuration is one that is not expected to change.

When deciding which option is best for you, you can consult with the StarkEx team.

Prerequisites

  • A web server dedicated to listening for requests for alternative transactions.

  • To configure the endpoint yourself, you must have a dynamic configuration setup.

Procedure

Either send the required information to the StarkEx support team, or configure the endpoint yourself.

Sending the required information to the StarkEx support team

  • The endpoint URL that you use to monitor requests for alternative transactions.

  • A URL to receive information about failed alternative transactions. This URL can be the same as the endpoint URL.

  • A security mechanism (Optional):

    • A bearer token

    • A client certificate with a private key. In this case, you must obtain a public server certificate and place it on your server.

Configuring the endpoint yourself by using the gateway API

Use the StarkEx gateway API method set_alternative_endpoint_config. For more information on how to use this method, including syntax and parameters, see one of the following:

After you send the request, StarkEx returns a message stating if the configuration request is accepted or rejected.