Event Overview - Order closed¶
Target Audience: Users, Developers, Stakeholders
Introduction¶
This document defines the event order_closed
.
Description¶
This event is triggered when a order is closed in Payway. The event is available on the Payway service-bus as well as over a webhook.
Webhook¶
Payload emitted
{
"event": "order_closed",
"timestamp": "2022-03-14T09:08:42.054Z",
"payload": {
"account": {
"id": "622f061795cfebfded830774",
"organisation_id": "oid",
"first_name": "John",
"last_name": "Doe",
"contact_email": "test@email.se",
"mobile_number": "0761230000",
"alias": "",
"tulo_customer_number": "",
"customer_number": null,
"birth_date": "1941-03-21T02:00:00+02:00",
"ssn": "",
"company_registration_number": "",
"company_name": "",
"status": "active",
"loyalty_card_number": "",
"account_origin": "",
"verified": false,
"created": "2022-03-14T10:08:39+01:00",
"updated": "2022-03-14T10:08:41+01:00",
"confirmation_code": "62402e20-ab15-4665-8f48-xxxxxxxxx",
"contact_email_for_update": "",
"contact_email_update_code": "",
"address": {
"id": "622f061995cfebfded830785",
"first_name": "John",
"last_name": "Doe",
"street": "Gata",
"street_number": "3",
"staircase": "",
"floor": "",
"apartment_number": "",
"zip_code": "11460",
"city": "Stockholm",
"mobile_number": null,
"phone_number": "",
"email": "",
"country_code": "SE"
},
"gender": "",
"latest_account_title_code": "TITLE_CODE"
},
"order": {
"id": "622f061795cfebfded83077a",
"organisation_id": "oid",
"account_id": "622f061795cfebfded830774",
"order_id": "OID-1",
"payment_option": "klarna_payments",
"purchase_type": "recurring",
"masked_credit_card": "",
"state": "closed",
"total_price": "32.00",
"total_vat_cost": "1.81",
"total_discount": "0.00",
"traffic_source": "paywall",
"parent_order": "",
"delivery_address": {
"id": "622f061995cfebfded830787",
"first_name": "John",
"last_name": "Doe",
"street": "Gata",
"street_number": "3",
"staircase": "",
"floor": "",
"apartment_number": "",
"zip_code": "11460",
"city": "Stockholm",
"mobile_number": null,
"phone_number": "",
"email": "",
"country_code": "SE"
},
"details": [{
"id": "622f061795cfebfded83077c",
"product_id": "607d31ff95cfeb500a33c993",
"product_name": "Digital tidning",
"product_code": "digital_tidning",
"product_title_code": "TITLE_CODE",
"product_title_name": "Title name",
"integration_code": "",
"description": "Digital tidning (prenumeration, 1 månad)",
"vat_code": 6,
"price": "32.0",
"period": {
"type": "month",
"length": 1
},
"campaign_package_or_package_product_code": "digital_tidning",
"is_campaign": true
}],
"payments": [{
"id": "622f061795cfebfded83077e",
"product_id": "607d31ff95cfeb500a33c993",
"product_title_code": "TITLE_CODE",
"product_title_name": "Title name",
"user_product_id": "",
"type": "normal",
"state": "closed",
"amount": "32.00",
"vat_amount": "1.81",
"transaction_number": "2LG88Q3X",
"error_code": "",
"created": "2022-03-14T10:08:39+01:00",
"updated": "2022-03-14T10:08:41+01:00"
}],
"created": "2022-03-14T10:08:39+01:00",
"updated": "2022-03-14T10:08:41+01:00",
"subscription_start": null,
"merchant_reference": "dd9dbca6-8bd7-4986-a66d-xxxxxxxx",
"limited_campaign": false,
"flex_campaign_details": {
"price_string": "129 kr/månad, därefter ordinarie pris",
"total_length": "2022-06-14T10:08:41+01:00"
}
},
"payment": {},
"receipt": {
"id": "622f061995cfebfded83078d",
"organisation_id": "oid",
"created_at": "2022-03-14T10:08:41.823+01:00",
"updated_at": "2022-03-14T10:08:41.823+01:00",
"paid_at": "2022-03-14T09:08:39+00:00",
"company_name": "News AB",
"crn": "123123-1234",
"order_id": "OID-1",
"contact_email": "",
"phone_nr": "",
"address": "",
"receipt_text": "",
"articles": [{
"name": "Digital tidning - (prenumeration, 1 månad)",
"type": "subscription",
"amount": "32.0",
"numbers": ""
}],
"sum": "32.0",
"vat_specifications": [{
"vat_amount": "1.811320754716981132075471699",
"vat_percentage": "6",
"net_amount": "30.188679245283018867924528301",
"gross_amount": "32.0"
}],
"payment_method": "klarna_payments",
"masked_cc_nr": ""
},
"share": {},
"user_product": {
"id": "622f061995cfebfded830791",
"order_id": "622f061795cfebfded83077a",
"product_id": "607d31ff95cfeb500a33c993",
"product_title_code": "TITLE_CODE",
"product_title_name": "Title name",
"code": "digital_tidnign",
"name": "Digital tidning",
"description": "Läs den digitala tidningen...",
"campaign": true,
"valid_from": "2022-03-14T10:08:41+01:00",
"valid_to": "2022-04-14T11:08:41+02:00",
"state": "activated",
"is_recurring": true,
"cancellation_date": "",
"cancellation_reason": "",
"grace_period_to": "",
"created": "2022-03-14T10:08:41+01:00",
"updated": "2022-03-14T10:08:41+01:00",
"provision_service": "tulo",
"merchant_reference": "dd9dbca6-8bd7-4986-a66d-xxxxxxxx"
},
"new_user_product": {},
"gift": {},
"product": {},
"payment_retry": {},
"event_data": {},
"payment_about_to_expire": {}
}
}
Legacy e-mail¶
This event is supported by the transactional e-mailing system built into Payway.
Third-party e-mail¶
This event is supported by third party e-mailing systems such as Rule.