Skip to main content

Create API secret

To access the Walley API, a valid token is required, which can be obtained using a client ID and API secret. The initial secret is generated within the Merchant Hub. However, additional secrets can be generated using the API.

Create the first secret in the Merchant Hub. After that, use this endpoint for the rest. An organization can hold two active secrets at a time.

The secret is shown once

The response is the only place you will ever see apiSecret. Store it somewhere safe before you close the response.

Example​

POST /manage/organizations/{{orgId}}/apisecrets HTTP/1.1
Host: api.uat.walleydev.com // Test environment. Production uses a different hostname.
Content-Type: application/json
Authorization: Bearer {{accessToken}}

{
"label": "Name of secret",
"expirationDate": null
}

Data Model​

Request​

Request path​

PathRequiredExplanation
orgIdYesThe id of the organization, to obtain the orgId please contact help@walley.se.

Request headers​

HeaderRequiredExplanation
AuthorizationYesSee Authentication for how to generate the Bearer token value

Request body​

PropertyRequiredExplanationTypeNotes
labelNoOnly a text that makes it easier to tell secrets apart.string
expirationDateNoA date between creation and 99 years in the future. The default is 6 months from creation.date

Response​

The response will be 201 Created for a successful creation.

Possible responses​

Http status codeDescription
201Secret created
401Unauthorized, token verification needed. See: Authentication for more information
403No permission for this organization
422Error code: TooManyAppPasswords, Not allowed to add 3 passwords. You can only add a maximum of 2 passwords.

Response body from 201 Created​

PropertyExplanationTypeNotes
entityIdThe id to identify the secret.string
metadata.clientIdThe client id is used in the authentication to retrieve a jwt token.string
metadata.apiSecretThe api secret is used in the authentication to retrieve a jwt token.string
metadata.expiresAtThe date the secret expires and cannot be used to retrieve any more jwt tokens.string