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.

The first secret is required to be created in the Merchant Hub but to generate new secrets the api can be used.

Please note

The apiSecret obtained in the response must be stored securely as it's only retrievable once.

Only two active secrets is allowed at one time for an organization.

Example​

POST /manage/organizations/{{orgId}}/apisecrets HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Content-Type: application/json
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

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

Request​

Request path​
PathRequiredExplanation
orgIdYesThe id of the organization, to obtain the orgId please contact help@walley.se.
Request headers​
HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the Bearer token value can be found here
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
403Permissions needed e.g. trying to handle content for a organization you don't have permission to
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 retrive a jwt token.string
metadata.apiSecretThe api secret is used in the authentication to retrive a jwt token.string
metadata.expiresAtThe date the secret expires and can not be use to retrive any more jwt tokens.string