improved
Invoices now show order data
6 months ago by Rich Steinmetz
Invoices endpoints now show Order data:
{
"id": 14,
"public_id": "tXEuDF",
"order_id": 36,
"status": "paid",
"due_amount": "0.00",
"total_amount": "9.99",
//
// More Invoice data...
//
"order": {
"id": 36,
"public_id": "iKSTuD",
"order_number": "774934",
"total_amount": "123.00",
"origination_channel_id": 40,
"origination_channel_type": "User",
"notes": "Est excepturi voluptates est.",
"in_trial": false,
"billing_status": "pending",
"service_status": "pending",
"order_type": "one-time-order",
"next_charge_at": null,
"trial_end_at": null,
"tag_ids": [
47
],
"activated_at": null,
"canceled_at": null,
"canceled_by": null,
"cancel_reason": null,
"cancel_description": null,
"churned_at": null,
"shipping_address_first_name": "Marry",
"shipping_address_last_name": "Lemke",
"shipping_address_organization_name": "Testing, Inc.",
"shipping_address_phone_number": "+19053871234",
"shipping_address_street_one": "24087 Stroman Coves",
"shipping_address_street_two": "Suite 360",
"shipping_address_city": "Rodstad",
"shipping_address_region": "WA",
"shipping_address_country": "US",
"shipping_address_postal_code": "50493-0445",
"billing_address_street_one": "37177 Feest Flat",
"billing_address_street_two": "Apt. 298",
"billing_address_city": "North Aimee",
"billing_address_region": "WA",
"billing_address_country": "US",
"billing_address_postal_code": "50936-3151",
"origination_channel_name": "",
"contact": {
"id": 133,
"public_id": "IxrynS",
"workspace_id": 42000,
"anonymous": null,
"email_address": "test-ba7769e22a16475a4590@example.com",
"first_name": "Tony",
"last_name": "Greenholt",
"phone_number": "1-166-515-8303",
"time_zone": "Pacific Time (US & Canada)",
"uuid": "be8f213b-5ffa-4552-8624-d834781d47b4",
"unsubscribed_at": null,
"last_notification_email_sent_at": null,
"fb_url": "https://www.facebook.com/example",
"twitter_url": "https://twitter.com/example",
"instagram_url": null,
"linkedin_url": "https://www.linkedin.com/in/example",
"website_url": "https://example.com",
"created_at": "2024-08-20T08:03:02.764Z",
"updated_at": "2024-08-20T08:03:02.764Z",
"tags": [
{
"id": 153,
"public_id": "GJEzie",
"name": "Example Tag",
"color": "#302b7e",
"applied_at": null
}
],
"custom_attributes": {
"CustomKey": "MyText"
}
},
"order_page": {
"id": 48,
"public_id": "jRWHDi",
"name": "Great Page"
}
}
}
This makes the invoice payload much more valuable and allows you to perform similar actions on the payload as you would with the Order payload.
The best way to know whether a subscription was paid via a webhook is to listen for the orders/invoice.paid
webhook. So now you can do many more things based on the incoming data in the Invoice webhooks and Zapier trigger "Subscription Invoice Paid"
trigger, without the need for additional API calls.