### Example of basket contents after login and adding tickets
Source: https://integrate.spektrix.com/docs/iframe-load-trigger
This example demonstrates the structure of the message event data after a customer has logged in and added items to the basket. It includes detailed customer information and ticket specifics.
```json
basketContents:{
"totalDiscount":25.00,
"total":26.00,
"customer":{
"age":null,
"billingAddress":null,
"deliveryAddress":null,
"birthDate":null,
"email":"john.doe@spektrix.com",
"firstName":"John",
"lastName":"Doe",
"mobile":"",
"name":"John Doe",
"phone":"",
"title":"",
"passwordSet":true,
"giftAidDeclarationRequired":false,
"id":"I-8H22-22HV",
"creditBalance":0.0},
"tickets":[{
"band":{
"id":"201AGBHDRLQHNHPHKKMPKLGPMDRDTDMVL"},
"event":{"id":"401ANPJQJQPQMRSBDNMVNLSPGTRBVQVRH"},
"instance":{"id":"426ANNBCVJQNPTKKTSTRDGGPTTRSJBLSG"},
"planId":"401ANPJQJQPQMRSBDNMVNLSPGTRBVQVRH",
"seatName":"",
"planName":"Demo Theatre General Admission",
"type":{"id":"1AHGJDSMMPLMPPGNLJBQVLBRSKVDLQRPP"},
"ticketType":{"id":"1AHGJDSMMPLMPPGNLJBQVLBRSKVDLQRPP"},
"ticketType_Comment":"Will be removed in a future API release - Use 'Type' instead",
"delivered":false,
"barcode":null,
"offer":{"id":"1AHGJDSMMPLMPPGNLJBQVLBRSKVDLQRPP"},
"discount":25.00,
"price":25.00,
"total":26.00,
"id":"159ABTGJHMDHKQTHHPJTQNLKMCJMRSBMG"}],
"membershipSubscriptions":[],
"giftVouchers":[],
"merchandiseItems":[],
"donations":[],
"hash":"l8IJqdp0pk"
}
```
```text
basketHash:l8IJqdp0pk
```
--------------------------------
### Complete Spektrix Memberships Component Example
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
This comprehensive example demonstrates the integration of the Spektrix Memberships web component with various features like loading states, membership data display, customer ownership checks, variable pricing, and feedback containers.
```html
Loading membership details...
Membership Name
Duration:
You're Already a Member!
Thank you for your continued support.
Price: $0
Renewal: $0
Choose your membership amount:
Between $0 and $0
Success! Redirecting to checkout...
Something went wrong. Please try again.
```
--------------------------------
### Example of initial basket contents
Source: https://integrate.spektrix.com/docs/iframe-load-trigger
When an iframe loads, it logs basket contents including total, customer status, and items. This example shows the structure when no customer is logged in and the basket is empty.
```json
basketContents:{
"totalDiscount":0.0,
"total":0.0,
"customer":null,
"tickets":[],
"membershipSubscriptions":[],
"giftVouchers":[],
"merchandiseItems":[],
"donations":[],
"hash":"NotLoggedIn"
}
```
```text
basketHash:NotLoggedIn
```
--------------------------------
### Example API Request
Source: https://integrate.spektrix.com/docs/authentication
This is an example of an API request that requires authentication. Ensure the Date header is in UTC.
```http
GET api/v3/customers/I-AK11-1ATK
```
--------------------------------
### Loading States Example
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
Provides visual feedback during data loading. Shows a loading indicator by default and content once data is fetched.
```html
Loading membership details...
Membership Name
Description
Price: $0
Successfully added to basket!
Failed to add to basket
```
--------------------------------
### Queueing Response Example
Source: https://integrate.spektrix.com/docs/api/queuing
This JSON response indicates that queuing is triggered and provides a message and a code to join the queue.
```json
{
"eventInstanceId": "12345ABCDE",
"joinQueue": "/api/v3/basket/queue/12345ABCDE",
"message": "You must join the queue.",
"code": "JoinQueue"
}
```
--------------------------------
### Variable Price Membership Example
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
Handles memberships where customers can choose their own price. Includes input for variable pricing and a submit button.
```html
Membership Name
Fixed Price Membership
$0
Choose Your Price
Select an amount between $0 and $0
Successfully added to basket!
Failed to add to basket
```
--------------------------------
### Potential Discount API Response Example
Source: https://integrate.spektrix.com/docs/potentialdiscount
This is an example of the JSON response you will receive when querying the potential discount endpoint. It includes the new basket total, total discount, and transaction commission status.
```json
{
"basketTotal": 16.25,
"totalDiscount": 5.00,
"transactionCommission": {
"waived": true,
"amount": 2.25
}
}
```
--------------------------------
### Example Custom Payment Addition Response
Source: https://integrate.spektrix.com/docs/custompayments
Example JSON response after successfully adding a custom payment to a transaction. It confirms the payment details including name, amount, and attributes.
```JSON
{
"name": "EPOS System",
"amount": 10.0,
"attributes": [
{
"name": "Payment ref",
"value": "ABC_123"
}
]
}
```
--------------------------------
### Spektrix Memberships with Data Display
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
This example demonstrates how to use the component to automatically fetch and display membership details from the API, including name, description, and price.
```html
Loading...
Loading description...
Loading HTML description...
Price: $0
Renewal Price: $0
Successfully added to basket!
Failed to add to basket
```
--------------------------------
### Membership Period Display Example
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
Displays and formats membership period information with multi-language support. Configurable formats for different durations and languages.
```html
Membership Name
Membership Period:
```
--------------------------------
### Example Custom Payment Types Response
Source: https://integrate.spektrix.com/docs/custompayments
Example JSON response from the 'api/v3/custom-payment-types' endpoint, showing available custom payment types like 'EPOS System' and 'Quick Donation' with their respective attribute definitions.
```JSON
[
{
"name": "EPOS System",
"id": "93AGQTGJBKVCQVRRKBVCCRTPJTBKCNLBH",
"isRefund": false,
"attributeDefinitions": [
{
"name": "Reference",
"isRequired": false,
"type": "Text field"
},
{
"name": "Receipt Number",
"isRequired": false,
"type": "Text field"
}
]
},
{
"name": "Quick Donation",
"id": "7641ANMTGPDKSKCSGLJHMMLMMQCKCNQGP",
"isRefund": false,
"attributeDefinitions": [
{
"name": "Reference number",
"isRequired": false,
"type": "Text field"
}
]
}
]
```
--------------------------------
### Basic Spektrix Donate Component Example
Source: https://integrate.spektrix.com/docs/web-components/donations/spektrix-donate
Illustrates basic usage of the spektrix-donate element. Ensure 'client-name', 'custom-domain', and 'fund-id' are updated to match your client's details.
```html
Amount you are donating: £
Insert success content/markup here
Insert failure content/markup here
```
--------------------------------
### Basic Spektrix Merchandise Component Example
Source: https://integrate.spektrix.com/docs/web-components/merchandise/spektrix-merchandise
Embed this HTML to display a merchandise item. Ensure 'client-name', 'custom-domain', and 'merchandise-item-id' are updated with your client's specific details.
```html
A merchandise item
Quantity:
Insert success content/markup here
Insert failure content/markup here
```
--------------------------------
### Spektrix Memberships with Ownership Check
Source: https://integrate.spektrix.com/docs/web-components/memberships/spektrix-memberships
This example shows how to conditionally display content based on whether the customer already owns the specified membership, using 'data-customer-holds-membership' and 'data-customer-does-not-hold-membership' attributes.
```html
Premium Membership
You're a Member!
You already have this membership. Thank you for your support!