• Sandbox : https://api.sandbox.whenthen.co/api/graphql
  • Production : https://api.whenthen.com/api/graphql
api key generate

To generate your API keys:

  1. Log in to theWhenThen Web Application.
  2. Go toSettings -> Developers.
  3. Click Generate key (Make sure to store private keys securely in your system).

The Create a Payment and Tokenise a Payment Method APIs support idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. For example, if a request toCreate a Payment does not respond due to a network connection error, you can retry the request with the same idempotency key to guarantee that no more than one charge is created.

To perform an idempotent request, provide an additionalX-Idempotency-Key:<key> to the request.

Requests made with the same idempotency key will return the original result. As an example, if a request has failed due to validation and the request is amended and resubmitted with the same idempotency key value, then our server will return the same validation error as the initial request. A new idempotency key value should be generated for the amended (new) request.

An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.

Idempotency keys are deleted from the system automatically after 24 hours, and a new request is generated if a key is reused after this period.

We recommend setting your client timeout to 30 seconds.