Skip to main content

Webhooks

Webhooks follow this workflow:

Integration Flow

Payloads & Templates

A payload is capable of accommodating various shapes and can be modified to incorporate specific variables corresponding to the relevant event.


Below is an instance of a Payment.Succeeded event's payload template and its resolved response after variable replacement.

{
"action": "{{EventType}}",
"payload": {
"sessionIdentifier": "{{SessionIdentifier}}",
"status": "{{Status}}",
"referenceNumber": "{{ReferenceNumber}}",
"amount": "{{Amount}}",
"accountNumber": "{{AccountNumber}}",
"accountName": "{{AccountName}}",
"paymentIdentifier": "{{PaymentMetaJson_PaymentIdentifier}}",
"amountFormatted": "{{AmountFormatted}}",
"serviceFee": "{{ServiceFeeAmountMinor}}"
}
}

Events Details

AutoPay.Enrolled

Variable NameDescription
AccountIdID of the account enrolled in Autopay.
AccountNameName on the account.
AccountNumberAccount number on the account.
ActivityTypeType of activity (enroll, update settings, cancel).
CustomerEmailAddressEmail address of the customer.
CustomerIdID of the customer enrolled in Autopay.
DueDateDue date of the account.
MaximumBalanceAllowedMaximum balance allowed to be withdrawn for Autopay.
PaymentSourceDescriptionDescription of the payment source used for Autopay. (x ending in y).
ProcessingLeadTimeDays before due date the payment will process.
SubAccountNumberSubAccount number on the account.
{
"accountName": "{{AccountName}}",
"subAccountNumber": "{{SubAccountNumber}}",
"activityType": "{{ActivityType}}",
"paymentSource": "{{PaymentSourceDescription}}",
"processingLeadTime": "{{ProcessingLeadTime}}"
}

AutoPay.Unenrolled

Variable NameDescription
AccountIdID of the account unenrolled in Autopay.
AccountNameName on the account.
AccountNumberAccount number on the account.
ActivityTypeType of activity
CustomerEmailAddressEmail address of the customer.
CustomerIdID of the customer unenrolled in Autopay.
DueDateDue date of the account.
MaximumBalanceAllowedMaximum balance allowed to be withdrawn for Autopay.
PaymentSourceDescriptionDescription of the payment source used for Autopay. (x ending in y).
ProcessingLeadTimeDays before due date the payment will process.
SubAccountNumberSubAccount number on the account.
{
"accountName": "{{AccountName}}",
"accountNumber": "{{AccountNumber}}",
"emailAddress": "{{CustomerEmailAddress}}",
"dueDate": "{{DueDate}}",
}

PaperlessBilling.Enrolled

Variable NameDescription
AccountEmailAddressEmail address of the account that enrolled in paperless billing.
AccountNameName on the account that enrolled in paperless billing.
AccountNumberAccount number on the account that enrolled in paperless billing.
SubAccountNumberSubAccount number on the account that enrolled in paperless billing.
UserEmailAddressEmail address of the user that enrolled in paperless billing.
{
"businessUnitSlug": "{{JobExecution_BusinessUnitSlug}}",
"accountNumber": "{{AccountNumber}}",
"email": "{{AccountEmailAddress}}",
"enrollingInPaperlessBilling": true,
"onFailUrl": "{{InitiateFunctionOrchestration_FailExecutionUrl}}"
}

PaperlessBilling.Unenrolled

Variable NameDescription
AccountEmailAddressEmail address of the account that unenrolled from paperless billing.
AccountNameName on the account that unenrolled from paperless billing.
AccountNumberAccount number on the account that unenrolled from paperless billing.
SubAccountNumberSubAccount number on the account that unenrolled from paperless billing.
UserEmailAddressEmail address of the user that unenrolled from paperless billing.
{
"businessUnitSlug": "{{JobExecution_BusinessUnitSlug}}",
"accountNumber": "{{AccountNumber}}",
"email": "{{AccountEmailAddress}}",
"enrollingInPaperlessBilling": false,
}

Payment.AdjustmentFound

Variable NameDescription
AccountIdThe ID of the account on the payment.
AccountNumberThe account number of the account on the payment.
AdjustmentAmountAmount in the adjustment.
AdjustmentAmountFormattedUsdThe adjustment amount formatted in USD.
AdjustmentCodeCode of the adjustment.
AdjustmentDateDate of the adjustment.
AdjustmentIdID of the adjustment.
AdjustmentTypeType of the adjustment.
AmountValueAmount of the transaction.
AuthCodeAuthCode of the transaction.
BatchIdID of the batch.
BusinessUnitIdID of the business unit the adjustments were found in.
ChannelChannel the payment was made in.
MerchantNumberMerchant number of the adjustment.
PaymentIdID of the payment.
PaymentReferenceNumberReference number on the transaction.
PaymentStatusStatus of the payment.
PaymentTypeType of payment. (Ex. Base Payment, Service Fee)
ServiceFeeAmountAmount of the service fee in the payment.
SubAccountNumberThe subaccount number of the account on the payment.
TransactionIdID of the transaction.
TransactionReferenceNumberThe reference number of the transaction.
TransactionTypeType of transaction. (Ex. Sale)
{
"adjustmentType": "{{AdjustmentType}}",
"accountNumber": "{{AccountNumber}}",
"amountFormatted": "{{AdjustmentAmountFormattedUsd}}",
"transactionReferenceNumber": "{{TransactionReferenceNumber}}",
"paymentType": "{{PaymentType}}",
"channel": "{{Channel}}"
}

Payment.Declined

Variable NameDescription
AccountCreateMethodThe creation method of the account in the payment. (Ex. Manual, Imported)
AccountNameName on the account of the payment.
AccountNumberAccount number of the payment.
AccountNumberLast4Last 4 of the card/account number of the payment.
AccountTypeThe payment source's account type. (Ex. Visa)
AmountAmount that was paid in the payment.
AmountFormattedAmount that was paid in the payment formatted as currency.
AmountMinorAmount that was paid in minor format.
BalanceBalance of the payment.
BalanceMinorAccount balance in minor format.
BusinessUnitIdID of the business unit the payment was made in.
BusinessUnitNameName of the business unit the payment was made in.
ChannelPayment channel the payment was made in. (Ex. POS, Quickpay)
CreatedByUserNameName of the user who created the payment.
CurrencyCodeCurrency code of the business unit the payment was made in.
DueDateDue date of the payment.
GatewayErrorMessageError message from the gateway
LateFeeLate fee of the payment.
LateFeeMinorLate fee in minor format.
PaymentCreatedDateUtcDate the payment was created in UTC.
PaymentDescriptorDescription of what is being paid.
PaymentMetaJsonThe meta JSON of the payment.
PaymentSourceTypeSource type of the payment. (Ex. Credit Card, ACH)
PaymentTypeType of payment. (Ex. Base Payment, Service Fee)
ReferenceNumberThe payment's reference number.
ServiceFeeAmountMinorAmount of the payment that represents fees related to processing the payment.
ServiceFeeAmountFormattedService fee amount formatted for display.
SessionIdentifierPayment session identifier.
StatusStatus of the payment.
SubAccountNumberSubaccount number of the payment.
{
"action": "{{EventType}}",
"payload": {
"sessionIdentifier": "{{SessionIdentifier}}",
"status": "{{Status}}",
"referenceNumber": "{{ReferenceNumber}}",
"amount": "{{Amount}}",
"accountNumber": "{{AccountNumber}}",
"accountName": "{{AccountName}}",
"paymentIdentifier": "{{PaymentMetaJson_PaymentIdentifier}}",
"amountFormatted": "{{AmountFormatted}}",
"serviceFee": "{{ServiceFeeAmountMinor}}"
}
}

Payment.Refunded

Variable NameDescription
AccountIdID of the account that had the refunded payment.
AccountNumberLast4Last 4 of the card/account number that was used to make the payment.
AmountAmount that was refunded.
AmountFormattedAmount that was refunded formatted as currency.
ChannelPayment channel of the payment.
CreatedByUserNameName of whoever initiated the payment.
GatewayErrorMessageError message from the gateway.
PaymentDescriptorDescriptor of the payment. Could be the account number or what they paid for.
ReferenceNumberReference number of the payment.
StatusStatus of the payment.
{
"last4": "{{AccountNumberLast4}}",
"channel": "{{Channel}}",
"status": "{{Status}}",
"amount": "{{Amount}}",
"amountFormatted": "{{AmountFormatted}}"
}

Payment.Succeeded

Variable NameDescription
AccountCreateMethodThe creation method of the account in the payment. (Ex. Manual, Imported)
AccountNameName on the account of the payment.
AccountNumberAccount number of the payment.
AccountNumberLast4Last 4 of the card/account number of the payment.
AccountTypeThe payment source's account type. (Ex. Visa)
AmountAmount that was paid in the payment.
AmountFormattedAmount that was paid in the payment formatted as currency.
AmountMinorAmount that was paid in minor format.
BalanceBalance of the payment.
BalanceMinorAccount balance in minor format.
BusinessUnitIdID of the business unit the payment was made in.
BusinessUnitNameName of the business unit the payment was made in.
ChannelPayment channel the payment was made in. (Ex. POS, Quickpay)
CreatedByUserNameName of the user who created the payment.
CurrencyCodeCurrency code of the business unit the payment was made in.
DueDateDue date of the payment.
GatewayErrorMessageError message from the gateway
LateFeeLate fee of the payment.
LateFeeMinorLate fee in minor format.
PaymentCreatedDateUtcDate the payment was created in UTC.
PaymentDescriptorDescription of what is being paid.
PaymentMetaJsonThe meta JSON of the payment.
PaymentSourceTypeSource type of the payment. (Ex. Credit Card, ACH)
PaymentTypeType of payment. (Ex. Base Payment, Service Fee)
ReferenceNumberThe payment's reference number.
ServiceFeeAmountMinorAmount of the payment that represents fees related to processing the payment.
ServiceFeeAmountFormattedService fee amount formatted for display.
SessionIdentifierPayment session identifier.
StatusStatus of the payment.
SubAccountNumberSubaccount number of the payment.
{
"action": "{{EventType}}",
"payload": {
"sessionIdentifier": "{{SessionIdentifier}}",
"status": "{{Status}}",
"referenceNumber": "{{ReferenceNumber}}",
"amount": "{{Amount}}",
"accountNumber": "{{AccountNumber}}",
"accountName": "{{AccountName}}",
"paymentIdentifier": "{{PaymentMetaJson_PaymentIdentifier}}",
"amountFormatted": "{{AmountFormatted}}",
"serviceFee": "{{ServiceFeeAmountMinor}}"
}
}

Payment.Voided

Variable NameDescription
AccountIdID of the account that had the voided payment.
AccountNumberLast4Last 4 of the card/account number that was used to make the payment.
AmountAmount that was voided.
AmountFormattedAmount that was voided formatted as currency.
ChannelPayment channel of the payment.
CreatedByUserNameName of whoever initiated the payment.
GatewayErrorMessageError message from the gateway.
PaymentDescriptorDescriptor of the payment. Could be the account number or what they paid for.
ReferenceNumberReference number of the payment.
StatusStatus of the payment.
{
"last4": "{{AccountNumberLast4}}",
"channel": "{{Channel}}",
"amountFormatted": "{{AmountFormatted}}",
"status": "{{Status}}",
"referenceNumber": "ReferenceNumber",
"amount": "{{Amount}}"
}

Webhook Security

In order to validate webhooks are from Paystar, the partner will be provided a symmetric key used for verification. Once a key has been received, the sample code provided here (https://dotnetfiddle.net/6qbu2T) may be used as an example to validate them.

Example Webhook


Headers
"x-paystar-timestamp": "2021-02-26T21:29:58.0759011Z",
"x-paystar-signature": "sha1=dbf85449017bfe94069b1fb23e3674f1d2def1cb"

Body
{
"action": "Payment.Succeeded",
"payload": {
"sessionIdentifier": "f476323d-8252-4dda-871c-660e5c4f0a59",
"amount": 10.50,
"amountFormatted": "$10.50",
"referenceNumber": "MXEJGX-5QYV",
"status": "Succeeded",
"accountNumber": "1234",
"accountName": "Customer Name",
"[CustomField1]": "gg4b7b71-8dd0-416d-bc58-888348ba3c81",
"[CustomField2]": "Commercial"
}
}