@MutedJam thanks!
What I am trying to acheive is to add a new card into Trello for each new order in WooCommerce. Currently it is creating the card with the order date, order ID and customer name as the card name.
What I also want is to have each of the order line items appear in the card description.
So, in this case I am lookiing for something like:
1x Gymnastics Club Sleeveless Leotard Size: 26
1x Gymnastics Club Velour Shorts: Size 26
1x Gymnastics Club Hoody: Sapphire 5-6: First Name or Initials (Optional): Mariah
Size is coming from meta_data key ‘pa_size-gray’
Colour from key ‘pa_colour’
Name from key ‘_tmcartepo_data’
The full JSON from theorder is below.
Thanks for your help!
[
{
"id": 58858,
"parent_id": 0,
"status": "processing",
"currency": "GBP",
"version": "6.0.0",
"prices_include_tax": true,
"date_created": "2022-01-19T20:21:33",
"date_modified": "2022-01-19T20:21:36",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "5.42",
"shipping_tax": "1.08",
"cart_tax": "0.00",
"total": "72.25",
"total_tax": "1.08",
"customer_id": 1073,
"order_key": "wc_order_itBATxMTLztnF",
"billing": {
"first_name": "XXXXXXXXXXXX",
"last_name": "XXXXXXXXXXXX",
"company": "",
"address_1": "XXXXXXXXXXXX",
"address_2": "XXXXXXXXXXXX",
"city": "XXXXXXXXXXXX",
"state": "XXXXXXXXXXXX",
"postcode": "XXXXXXXXXXXX",
"country": "XXXXXXXXXXXX",
"email": "XXXXXXXXXXXX",
"phone": "XXXXXXXXXXXX"
},
"shipping": {
"first_name": "XXXXXXXXXXXX",
"last_name": "XXXXXXXXXXXX",
"company": "",
"address_1": "XXXXXXXXXXXX",
"address_2": "XXXXXXXXXXXX",
"city": "XXXXXXXXXXXX",
"state": "XXXXXXXXXXXX",
"postcode": "XXXXXXXXXXXX",
"country": "XXXXXXXXXXXX",
"phone": ""
},
"payment_method": "ppcp-gateway",
"payment_method_title": "PayPal",
"transaction_id": "XXXXXXXXXXXX",
"customer_ip_address": "XXXXXXXXXXXX",
"customer_user_agent": "MXXXXXXXXXXXX",
"created_via": "checkout",
"customer_note": "",
"date_completed": null,
"date_paid": "2022-01-19T20:21:36",
"cart_hash": "XXXXXXXXXXXX",
"number": "58858",
"meta_data": [
{
"id": 4867213,
"key": "is_vat_exempt",
"value": "no"
},
{
"id": 4867214,
"key": "_ppcp_paypal_order_id",
"value": "XXXXXXXXXXXX"
},
{
"id": 4867215,
"key": "_ppcp_paypal_intent",
"value": "CAPTURE"
},
{
"id": 4867216,
"key": "_ppcp_paypal_payment_mode",
"value": "live"
},
{
"id": 4867224,
"key": "_wcpdf_invoice_settings",
"value": {
"enabled": "1",
"attach_to_email_ids": {
"new_order": "1",
"customer_processing_order": "1",
"customer_invoice": "1"
},
"display_shipping_address": "1",
"display_email": "1",
"display_phone": "1",
"display_date": "invoice_date",
"display_number": "invoice_number",
"number_format": {
"prefix": "",
"suffix": "",
"padding": ""
},
"my_account_buttons": "available",
"paper_size": "a4",
"font_subsetting": false,
"header_logo": "53787",
"header_logo_height": "",
"shop_name": {
"default": "XXXXXXXXXXXX"
},
"shop_address": {
"default": "XXXXXXXXXXXX"
},
"footer": {
"default": ""
},
"extra_1": {
"default": ""
},
"extra_2": {
"default": ""
},
"extra_3": {
"default": ""
}
}
},
{
"id": 4867225,
"key": "_wcpdf_invoice_date",
"value": "1642623696"
},
{
"id": 4867226,
"key": "_wcpdf_invoice_date_formatted",
"value": "2022-01-19 20:21:36"
},
{
"id": 4867227,
"key": "_wcpdf_invoice_number",
"value": "5713"
},
{
"id": 4867228,
"key": "_wcpdf_invoice_number_data",
"value": {
"number": 5713,
"formatted_number": "5713",
"prefix": "",
"suffix": "",
"document_type": "invoice",
"order_id": 58858,
"padding": ""
}
},
{
"id": 4867229,
"key": "_new_order_email_sent",
"value": "true"
},
{
"id": 4867230,
"key": "_seopress_ga_tracked",
"value": "1"
}
],
"line_items": [
{
"id": 17757,
"name": "Gymnastics Club Sleeveless Leotard - 26",
"product_id": 40968,
"variation_id": 46878,
"quantity": 1,
"tax_class": "zero-rate",
"subtotal": "27.25",
"subtotal_tax": "0.00",
"total": "27.25",
"total_tax": "0.00",
"taxes": [
{
"id": 2,
"total": "0",
"subtotal": "0"
}
],
"meta_data": [
{
"id": 147607,
"key": "pa_size-gray",
"value": "26",
"display_key": "Size",
"display_value": "26"
}
],
"sku": "rgc025",
"price": 27.25,
"parent_name": "Gymnastics Club Sleeveless Leotard"
},
{
"id": 17758,
"name": "Gymnastics Club Velour Shorts - 26",
"product_id": 46895,
"variation_id": 46901,
"quantity": 1,
"tax_class": "zero-rate",
"subtotal": "17.50",
"subtotal_tax": "0.00",
"total": "17.50",
"total_tax": "0.00",
"taxes": [
{
"id": 2,
"total": "0",
"subtotal": "0"
}
],
"meta_data": [
{
"id": 147617,
"key": "pa_size-gray",
"value": "26",
"display_key": "Size",
"display_value": "26"
}
],
"sku": "rgc028",
"price": 17.5,
"parent_name": "Gymnastics Club Velour Shorts"
},
{
"id": 17759,
"name": "Gymnastics Club Hoody",
"product_id": 40088,
"variation_id": 40100,
"quantity": 1,
"tax_class": "zero-rate",
"subtotal": "21.00",
"subtotal_tax": "0.00",
"total": "21.00",
"total_tax": "0.00",
"taxes": [
{
"id": 2,
"total": "0",
"subtotal": "0"
}
],
"meta_data": [
{
"id": 147627,
"key": "pa_size-gray",
"value": "5-6",
"display_key": "Size",
"display_value": "5-6"
},
{
"id": 147628,
"key": "pa_colour",
"value": "sapphire",
"display_key": "Colour",
"display_value": "Sapphire"
},
{
"id": 147629,
"key": "_tmcartepo_data",
"value": [
{
"mode": "builder",
"cssclass": "",
"hidelabelincart": "",
"hidevalueincart": "",
"hidelabelinorder": "",
"hidevalueinorder": "",
"element": {
"type": "textfield",
"rules": [
[
"3"
]
],
"rules_type": [
[
""
]
],
"_": {
"price_type": false
}
},
"name": "First Name or Initials (Optional)",
"value": "Mariah",
"price": "3",
"section": "5e6a58f3dd56c3.45255270",
"section_label": "First Name or Initials (Optional)",
"percentcurrenttotal": 0,
"fixedcurrenttotal": 0,
"currencies": [],
"price_per_currency": {
"GBP": "3"
},
"quantity": 1
}
],
"display_key": "_tmcartepo_data",
"display_value": [
{
"mode": "builder",
"cssclass": "",
"hidelabelincart": "",
"hidevalueincart": "",
"hidelabelinorder": "",
"hidevalueinorder": "",
"element": {
"type": "textfield",
"rules": [
[
"3"
]
],
"rules_type": [
[
""
]
],
"_": {
"price_type": false
}
},
"name": "First Name or Initials (Optional)",
"value": "Mariah",
"price": "3",
"section": "5e6a58f3dd56c3.45255270",
"section_label": "First Name or Initials (Optional)",
"percentcurrenttotal": 0,
"fixedcurrenttotal": 0,
"currencies": [],
"price_per_currency": {
"GBP": "3"
},
"quantity": 1
}
]
},
{
"id": 147630,
"key": "_tm_epo_product_original_price",
"value": [
"18"
],
"display_key": "_tm_epo_product_original_price",
"display_value": [
"18"
]
},
{
"id": 147631,
"key": "_tm_epo",
"value": [
1
],
"display_key": "_tm_epo",
"display_value": [
1
]
},
{
"id": 147632,
"key": "_tmdata",
"value": [
{
"tmcp_post_fields": {
"tmcp_textfield_0": "Mariah"
},
"product_id": 40088,
"per_product_pricing": true,
"cpf_product_price": "18",
"variation_id": "40100",
"form_prefix": "",
"tc_added_in_currency": "GBP",
"tc_default_currency": "GBP",
"tmcartepo_data": [
{
"key": "Mariah",
"attribute": "tmcp_textfield_0"
}
]
}
],
"display_key": "_tmdata",
"display_value": [
{
"tmcp_post_fields": {
"tmcp_textfield_0": "Mariah"
},
"product_id": 40088,
"per_product_pricing": true,
"cpf_product_price": "18",
"variation_id": "40100",
"form_prefix": "",
"tc_added_in_currency": "GBP",
"tc_default_currency": "GBP",
"tmcartepo_data": [
{
"key": "Mariah",
"attribute": "tmcp_textfield_0"
}
]
}
]
}
],
"sku": "rgc002",
"price": 21,
"parent_name": "Retford Gymnastics Club Hoody"
}
],
"tax_lines": [
{
"id": 17761,
"rate_code": "GB-ZERO VAT-1",
"rate_id": 2,
"label": "Zero VAT",
"compound": false,
"tax_total": "0.00",
"shipping_tax_total": "0.00",
"rate_percent": 0,
"meta_data": []
},
{
"id": 17762,
"rate_code": "GB-VAT-1",
"rate_id": 1,
"label": "VAT",
"compound": false,
"tax_total": "0.00",
"shipping_tax_total": "1.08",
"rate_percent": 20,
"meta_data": []
}
],
"shipping_lines": [
{
"id": 17760,
"method_title": "Standard Delivery",
"method_id": "oik_weight_zone_shipping",
"instance_id": "6",
"total": "5.42",
"total_tax": "1.08",
"taxes": [
{
"id": 1,
"total": "1.084",
"subtotal": ""
}
],
"meta_data": []
}
],
"fee_lines": [],
"coupon_lines": [],
"refunds": [],
"date_created_gmt": "2022-01-19T20:21:33",
"date_modified_gmt": "2022-01-19T20:21:36",
"date_completed_gmt": null,
"date_paid_gmt": "2022-01-19T20:21:36",
"currency_symbol": "£",
"_links": {
"self": [
{
"href": ""
}
],
"collection": [
{
"href": ""
}
],
"customer": [
{
"href": ""
}
]
}
}
]