Webhook Setup
Last updated
Last updated
©2023 Startbahn, Inc.
Startbahn offers integration messages on events happening on your Licensed User Wallet via webhooks.
A webhook is an HTTP POST call to an endpoint of your choice. To authenticate the call, Startbahn will send a secret API Key in the HTTP Header ‘x-api-key’. The System expects your endpoint to respond with a success code 2xx.
Note that, in case of no response from the configured endpoint or HTTP error codes such as 4xx and 5xx, the system retries up to a desired number of times (maximum 5). After all of the retries have failed, Startbahn sends an informational email to a configurable admin email address (which can be different from your regular user addresses), containing the data in a CSV format, and will not continue to send the same data again.
You can get subscribed to webhooks. Currently, the webhook subscriptions are not available for self-service, but the Startbahn team can subscribe you to the desired webhook events outlined in the following chapters and configure your API key and URL endpoint.
Please note that we may add a new field. So make sure that your implementation can support accepting new fields without breaking your implementation. In case we remove the field, we will deprecate it first and let you know beforehand.
The following chapters provide details about the webhook events you can subscribe to.
*
indicates that the field will always exist from Startbahn side.
Parameter | Webhook Type | Description | Format | |
---|---|---|---|---|
Additional from Generic Parameter Details, these fields exist in webhook payload of all events related to SRR.
issueComplete
After an SRR has been minted, the subscribed issuer receives this notification
An array of data for the issued SRR where each entry consists of the metadata, srrId
and an optional externalId
as provided by the issuer when using the CommerceAPI.
Parameter Details
*
indicates that the field will always exist from Startbahn side.
Content Example
transferReservationComplete
After the start of an SRR Transfer using the Generate Transfer Key
has been confirmed, the subscribed old owner will receive this notification.
An array of data that can be used to trigger a transfer. Notably contains the SRR metadata
, srrId
and the encryptedTransferKey
. The latter can be decrypted and then used to finalize the transfer to a target address of your choice. See “Public key” for how to get a public key.
Parameter Details
*
indicates that the field will always exist from Startbahn side.
Content Example
transferExecutionComplete
After an SRR has been transferred to a new user, the subscribed old owner receives this notification
The array of data about a transfer on one of your SRRs to a new owner. Specifically contains the srrID
, the new owner's Ethereum Address newOwnerEoa
and the SRR metadata
.
Parameter Details
*
indicates that the field will always exist from Startbahn side.
Content Example
Additional to Generic Parameter Details above, these fields exist in webhook payload of all events related to the collection.
*
indicates that the field will always exist from Startbahn side.
collectionCreated
After a collection is created.
Array of data about the creation of collection.
Parameter Details
*
indicates that the field will always exist from Startbahn side.
Content Example
collectionCreateFailed
After a collection creation transaction failed to be mined.
Array of data about failure of collection creation.
Parameter Details No additional value other than the Generic Collection Related Parameter.
Content Example
To subscribe to webhooks, the API requires the following data
*
indicates required.
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Webhook Type | Description | Format |
---|---|---|---|
Parameter | Description | Format |
---|---|---|
type*
All
The type of the webhook
ENUM consists of transfer_key
, transfer_complete
, issue_complete
version*
All
The version of the webhook.
number
data*
All
The data related to the webhook that client’s need to process.
Array
data[*].groupId*
All
This groupId may not be really important for client. String to identify the grouping. Webhook data payload with same group ID will be sent to client in 1 batch.
string
data[*].srrId*
All
SRR Token ID
string
data[*].metadata*
All
Metadata of the SRR
Object
data[*].metadata.digest*
All
Digest of the metadata
string
data[*].metadata.json*
All
JSON of the metadata. Details
Object
data[*].metadata.cid
All
CID of the SRR metadata in IPFS. Refer to CID Documentation
string
data[*].metadata.createdAt*
All
Date of the metadata creation
Datetime
data[*].metadata.updatedAt*
All
Date of the metadata update if any.
Datetime
data[*].srrCid
issueComplete
CID of the SRR metadata in IPFS. Refer to CID Documentation
string
data[*].externalId
issueComplete
ID of the SRR on the client’s system that is used when calling the Issue API.
string
data[*].transferCid
transferReservationComplete
CID of the transfer metadata in IPFS. Refer to CID Documentation
string
data[*].dataUrl*
transferReservationComplete
URL of the data used in SRR.
string
data[*].encryptedTransferKey*
transferReservationComplete
Encrypted transfer key that can be used by the clients to determine the SRR on their system.
string
data[*].transferCid
transferExecutionComplete
CID of the transfer metadata in IPFS. Refer to CID Documentation
string
data[*].newOwnerEoa*
transferExecutionComplete
The EOA of the SRR’s new owner
string
data[*].name*
collection
Name of the collection
string
data[*].symbol*
collection
Symbol of the collection
string
data[*].contractAddress
collectionCreated
Address of the collection
string
data[*].ownerAddress
collectionCreated
LUW Address of the owner
string
Webhook URL*
The URL for API given by client where Startbahn needs to call to send the transfer key using webhook.
URL example: https://www.your-company.com/srr-integration-webhooks/
API Key*
Key used in Webhook for Authentication.
Startbahn will put this key in the Webhook authentication header, so that your system can verify incoming API call that are made by Startbahn.
this API key should be different from the one you use for Issue API.
Any string matching ^[a-zA-Z0-9_+-]{30,100}$
example: e46b1263-e3f5-461d-bfe7-18aff21c5ed3
Public Key
RSA Key used to encrypt the Transfer Key in the Webhook.
The Client will hold the private key, so they can decrypt the Transfer Key.
This is only needed when using the transfer key integration.
JSON object describing the key.
example: {"alg":"RSA-OAEP-256","e":"AQAB","ext":true,"key_ops":["encrypt"],"kty":"RSA","n":"yNtyR6PTWi_7Fabm6YIpLALA5YHqiY7vrjU8mdPdO1sCawbelPoP0VUi52YUFqh-io25YCOdkWNNUagD-wirb1YNFPN4kpYNZUZaJtu__33cVO36hyoPlFDUGepiPMryKjcujhTcbJvtgQQncO6JQ35LzQZR4P4xF7E5Yy1vaim1dPiUpabHBq_ILgyHAirlbVCw7DhWo3TNs0rr3MsbxOnEec2ieIa1nEP3zN60kcn9Ky6Tehr-hUtjQpKB8EftW7zdO3JF8Lz6CTyWgodAj5owrLmA9rmCTXC5o7Fhm5I8R4H5JrBmYFi2saqqtxDUi9LQk6cbQjnyfbO3OqSkRw"}
* You can generate a public/private key pair on this page (https://codesandbox.io/s/subtlecrypto-rsa-ttql3 ) or use another solution with the same encryption parameters.
Number of tries
Number of tries of the webhook that should be made , Integer i with 1 ≤ i ≤ 5
If no value is specified, we will use 1 as default value
Number / Integer
Example
Value 1
= One webhook call
Value 2
= One webhook call + 1 Retry
Contact email Address
Email address where the email regarding failure of webhook should be sent.
The email will contain the same information as webhook that failed, in a csv file (e.g. for a reservation webhook: SRR ID, Encrypted Transfer Key, dataUrl, Metadata)
Email Address admin@webhook-client.com
Webhook Events you want to subscribe to*
Your selected webhooks. You will only receive the events you want to. It is possible to change your subscriptions for future events if needed.
List of values Subscription Name.