Subscribe to notifications using a user-supplied webhook.
Triple notifications are implemented using AWS SNS. The AWS documentation for subscription confirmation message details is available in AWS SNS Message and JSON formats.
After receiving a successful response from this endpoint, you will receive a confirmation POST to the supplied webhook similar to the following to validate your subscription:
{
"Type": "SubscriptionConfirmation",
"MessageId": "...",
"TopicArn": "arn:aws:sns:region:account-id:sns-topic-arn",
"Message": "You have chosen to subscribe to the topic arn:aws:sns:region:account-id:sns-topic-arn.\n
To confirm the subscription, visit the SubscribeURL included in this message.",
"SubscribeURL": "https://sns.region.amazonaws.com/?Action=ConfirmSubscription&TopicArn=...",
"Timestamp" :"2022-01-01T00:00:00.000Z",
"SignatureVersion": "1",
"Signature": "...",
"SigningCertURL": "..."
}
After issuing a GET request for the SubscribeURL
you will receive a response like the following:
<ConfirmSubscriptionResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
<ConfirmSubscriptionResult>
<SubscriptionArn>...</SubscriptionArn>
</ConfirmSubscriptionResult>
<ResponseMetadata>
<RequestId>...</RequestId>
</ResponseMetadata>
</ConfirmSubscriptionResponse>
The SubscriptionArn in the response can be used to unsubscribe from the topic by hitting the DELETE /notifications/$SubscriptionArn link in the API. Alternatively for received messages they also contain an UnsubscribeURL
which will do the same.
For several reward statuses you'll get an SNS message from AWS for example:
{
"Type": "Notification",
"MessageId": "...",
"TopicArn": "...",
"Subject": "Reward Pending Merchant Approval",
"Message": "{\"publisher_external_id\": null, \"card_program_external_id\": null, \"card_account_external_id\": null, \"transaction_external_id\": \"tx-1\", \"merchant_name\": \"L'Osteria\", \"reward_status\": \"PENDING_MERCHANT_APPROVAL\", \"reward_amount\": \"0.00\", \"currency_code\": \"USD\", \"transaction_timestamp\": \"2022-08-03T01:00:00Z\", \"transaction_amount\": \"20\", \"transaction_currency_code\": \"USD\"}",
"Timestamp": "2022-01-01T00:00:00.000Z",
"SignatureVersion": "1",
"Signature": "...",
"SigningCertURL": "...",
"UnsubscribeURL": "...",
"MessageAttributes": {
"publisher_id": {
"Type": "String",
"Value": "2"
}
}
}
If you subscribe with a publisher account, you will receive any applicable statuses for that publisher that occur.
When you subscribe with a portfolio manager account you will receive notifications on statuses for all publishers in a single subscription.