Callbacks
Learn how to register a callback URL and security key for commercetools InStore.
Register a callback URL and security key
- Log in to the InStore Center.
- On the left-hand navigation, click Environment.
- Click the Integration Settings tab.
- In the Token Retrieval URL field, enter your callback URL.
- In the Callback API Key field, enter your API key. This key ensures secure communication.
- Click SAVE CHANGES.
After the callback URL and security key are registered, the InStore application uses an HTTPS GET call to retrieve payment cart, return cart, or user token via the specified callback URL.
Example of a token retrieval requesthttp
GET /your-callback-endpoint/userKey HTTP/1.1Host: your.callback.urlX-Api-Key: YourApiKey
Replace /your-callback-endpoint
, your.callback.url
, userKey
, and YourSecurityKey
with your actual endpoint, user key, callback URL, and security key, respectively.
Example of a Cart retrieval requesthttp
GET /your-callback-endpoint/cartId HTTP/1.1Host: your.callback.urlX-Api-Key: YourApiKey
Replace /your-callback-endpoint
, your.callback.url
, cartId
, and YourSecurityKey
with your actual endpoint, cartId, callback URL, and security key, respectively.
Security considerations
- Ensure your callback URL is HTTPS-enabled to secure data transmission.
- Keep your security key confidential to prevent unauthorized access.
Troubleshooting
If you have any issues:
- Ensure that your callback URL is entered correctly.
- Verify that your security key matches the one registered in the application.