Skip to content

Email Service Integration

Target Audience: Developers, Stakeholders

Release version: TBA

Work in progress

This documentation is a work in progress and might be subject for change.

Introduction

By integration Payway with Rule, you have the possibility to tailor your own e-mail templates, automate marketing and follow up on your customers' interaction with the delivered e-mails.

Requirements

  • Rule account
  • Rule API-key. This can be generated from your Rule account.

If you have any questions regarding this, please contact support@rule.se

Getting started

Once you meet the requirements above, please contact the Payway-team to get your integration configured.

Tags

An event in PW corresponds to a tag in Rule. Each tag also has its own set of field data associated with it.

OrderClosed

PaymentSuccess

PaymentFailure

PaymentUserAgreementInvalidState

PaymentUserProductDeactivated

PaymentUserProductFrozen

PaymentUserProductRenewed

UserProductCancelled

NewAccountCreatedFromKis

NewAccountRegistered

NewCheckoutAccountRegistered

AccountActivatedForExistingCustomer

AccountRequestedEmailChange

ConfirmationEmailRequested

AccountRequestedPasswordReset

AccountPasswordResetComplete

GiftCreated

GiftOrderClosed

PackageSharingInitialized

PaymentRetry

PaymentRetrySuccessful

PaymentAgreementAboutToExpire

PackageUpgrade

PackageDowngrade

PackageChangeCompleted

TransitionedToRetentionCampaign

Member fields

PWAccount

PWAccount

CustomerNumber
FirstName
LastName
MobileNumber
SocialSecurityNumber
BirthDate
Gender
Status - "created", "active", "inactive", "archived"
Created - When the account was created
AccountOrigin - Might have been set when the account was created

PWAccount_Address

PWAccount_Address

FirstName
LastName
Street
StreetNumber
StairCase
Floor
ApartmentNumber
ZipCode
City
MobileNumber
PhoneNumber
CountryCode

PWOrder

PWOrder

SubscriptionStart - If the subscription starts in the future, otherwise 0001-01-01 00:00
SubscriptionStartDate - If the subscription starts in the future, otherwise 0001-01-01
Price - Charged price
VatAmount - Charged vat
TrafficSource - If set
Created - Date and time when the order was created
CreatedDate - Date when the order was created
PurchaseType - "limited", "recurring", "single"
PaymentOption - "creditcard", "invoice", "autogiro", "sms", "directdebit", "directdebit_recurring", "free", "klarna", "klarna_payments"
ParentOrder - If transformed from campaign
Id - Order id
MerchantReference - Merchant reference, more information here

PWOrder_OrderDetail

PWOrder_OrderDetail

Length - Period length
Type - "day", "week", "month", "year"
VatCode - Vat percentage
Price - Charged price
ProductCode - Payway product code
Campaign - Campaign or not
BasedOnPackage
Description - Description of the product

PWOrder_BillingAddress

PWOrder_BillingAddress

FirstName
LastName
Street
StreetNumber
StairCase
Floor
ApartmentNumber
ZipCode
City
MobileNumber
PhoneNumber
CountryCode

PWOrder_DeliveryAddress

PWOrder_DeliveryAddress

FirstName
LastName
Street
StreetNumber
StairCase
Floor
ApartmentNumber
ZipCode
City
MobileNumber
PhoneNumber
CountryCode

PWPayment

PWPayment

Type - "normal", "autopay", "credit", "payment_profile_update"
Price
ValueAddedTax

PWPaymentProfile

PWPaymentProfile

MaskedCreditcard
ExpireDate

PWSubscription

PWSubscription

Title
TitleCode
Code
Name
Recurring
Campaign State ValidFrom
ValidFromDate
ValidTo
ValidToDate

PWEmailChange

PWEmailChange

NewEmail
UpdateCode
EmailChangeUrl
CompleteEmailChangeUrl

PWPasswordChange

PWPasswordChange

ResetUrl
ReturnUrl
ConfirmationCode

PWGift

PWGift

GiftCode
ReceiverFirstName
ReceiverLastName ReceiverContactEmail
GiftUrl

PWProduct

PWProduct

ProductCode
Name
ValidFrom
ValidFromDate
ValidTo
ValidToDate

PWInvite

PWInvite

ActivationCode
ContactEmail

PWPackageSharing

PWPackageSharing

Created
State
PackageSharingId

PWReason

PWReason

Reason: "payment_failure", "invalid_agreement", "no_profile"

PWReceipt

PWReceipt

CompanyName
Crn
OrderId
CompanyEmail
PhoneNumber
Address
ReceiptText
Sum
PaymentMethod
MaskedCreditcardNumber
PaidAt
PaidAtDate
Articles - List of articles, JSON-format
VatSpecifications - List of vat specifications, JSON-format

PWPaymentRetryData

PWPaymentRetryData

PaymentAttemptCount - Number of attempts in total
PaymentAttemptDays - Number of attempted days
PaymentFailedDate - The date of the first failure
OriginalValidTo

PWPaymentExpire

PWPaymentExpire

ExpireDate - E.g. "2020-01-13"
ExpireDateTime - E.g. "2020-01-13 00:00:00"
ExpireDays - Days left until expiration
MaskedCreditcard