Create an API credential

post /companies/{companyId}/apiCredentials

Creates an API credential for the company account identified in the path. In the request, you can specify which merchant accounts the new API credential will have access to, as well as its roles and allowed origins.

The response includes several types of authentication details:

Make sure you store the API key securely in your system. You won't be able to retrieve it later.

If your API key is lost or compromised, you need to generate a new API key.

To make this request, your API credential must have the following roles:

  • Management APIā€”API credentials read and write

Endpoint destination URL{companyId}/apiCredentials
Click to copy

Path parameters

companyId string Required

The unique identifier of the company account.

Request parameters

allowedOrigins array [string]

List of allowed origins for the new API credential.

associatedMerchantAccounts array [string]

List of merchant accounts that the API credential has access to.

description string

Description of the API credential.

roles array [string]

List of roles for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.

Response parameters

After submitting a call, you receive a response message to inform you that your request was received and processed.

Depending on the HTTP status code of the response message, it is helpful to build some logic to handle any errors that a request or the system may return.

HTTP Responses

  • 200 - OK

    The request has succeeded.

    Show more Show less
  • 400 - Bad Request

    A problem reading or understanding the request.

    Show more Show less
  • 401 - Unauthorized

    Authentication required.

    Show more Show less
  • 403 - Forbidden

    Insufficient permissions to process the request.

    Show more Show less
  • 422 - Unprocessable Entity

    A request validation error.

    Show more Show less
  • 500 - Internal Server Error

    The server could not process the request.

    Show more Show less
  • Request
  • Click to copy
  • Response
  • Click to copy