Recurring Profiles
For the purpose of this test, we have a client company:
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
{ "single": { "id": 2, "class": "Company", "url_path": "\/companies\/2", "name": "Client Company GmbH", "members": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "is_archived": false, "created_on": 1430164848, "created_by_id": 1, "updated_on": 1430164848, "updated_by_id": 1, "address": "Street Name 12\nCity", "phone": null, "homepage_url": null, "tax_id": null, "currency_id": 1, "is_owner": false, "has_note": false }, "hourly_rates": { "1": 100 }, "active_projects_count": 0 }
Lets create a recurring profile:
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
{ "name": "Test Profile", "start_on": "2015-04-27", "frequency": "daily", "occurrences": 2, "company_id": 2, "items": [ { "description": "First itm", "quantity": 100, "unit_cost": 25 }, { "description": "Second itm", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third itm", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
{ "single": { "id": 1, "class": "RecurringProfile", "url_path": "\/recurring-profiles\/1", "name": "Test Profile", "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164848, "created_by_id": 1, "project_id": 0, "purchase_order_number": null, "start_on": 1430092800, "last_trigger_on": null, "next_trigger_on": 1430092800, "frequency": "daily", "occurrences": 2, "triggered_number": 0, "stored_card_id": 0, "auto_issue": false, "is_enabled": false, "is_completed": false, "private_note": "Client will not be able to see this", "invoice_due_after": 15 }, "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "First itm", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1 }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Second itm", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2 }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Third itm", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3 } ], "stored_card": null, "invoices": [] }
As we can see, this profile is disabled. This means that no new invoices will be created based on it, even if we try to issue reucrring invoices that are due today:
Payload:
1 2 3
{ "date": "2015-04-27" }
Response:
1
[]
We should enable the profile:
Payload:
1 2 3
{ "is_enabled": true }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
{ "single": { "id": 1, "class": "RecurringProfile", "url_path": "\/recurring-profiles\/1", "name": "Test Profile", "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164848, "created_by_id": 1, "project_id": 0, "purchase_order_number": null, "start_on": 1430092800, "last_trigger_on": null, "next_trigger_on": 1430092800, "frequency": "daily", "occurrences": 2, "triggered_number": 0, "stored_card_id": 0, "auto_issue": false, "is_enabled": true, "is_completed": false, "private_note": "Client will not be able to see this", "invoice_due_after": 15 }, "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1 }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2 }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3 } ], "stored_card": null, "invoices": [] }
Now when we trigger the profile, it will create one invoice:
Payload:
1 2 3
{ "date": "2015-04-27" }
Response:
1 2 3
[
1
]
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 1, "class": "Invoice", "url_path": "\/invoices\/1", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": "", "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164849, "created_by_id": 1, "updated_on": 1430164849, "based_on_type": "RecurringProfile", "based_on_id": 1, "number": "1", "project_id": 0, "purchase_order_number": null, "issued_on": 1430092800, "due_on": 1430092800, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "o4rTl9sfwDh6IP4fK4qyapDS0MMRXhPaa8Ul6bqq", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=o4rTl9sfwDh6IP4fK4qyapDS0MMRXhPaa8Ul6bqq&number=1", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 4, "class": "InvoiceItem", "url_path": "\/invoice-items\/4", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 5, "class": "InvoiceItem", "url_path": "\/invoice-items\/5", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 6, "class": "InvoiceItem", "url_path": "\/invoice-items\/6", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Lets check the profile properties. Notice that triggered_number is now 1:
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
{ "single": { "id": 1, "class": "RecurringProfile", "url_path": "\/recurring-profiles\/1", "name": "Test Profile", "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164848, "created_by_id": 1, "project_id": 0, "purchase_order_number": null, "start_on": 1430092800, "last_trigger_on": 1430092800, "next_trigger_on": 1430179200, "frequency": "daily", "occurrences": 2, "triggered_number": 1, "stored_card_id": 0, "auto_issue": false, "is_enabled": true, "is_completed": false, "private_note": "Client will not be able to see this", "invoice_due_after": 15 }, "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1 }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2 }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3 } ], "stored_card": null, "invoices": [ 1 ] }
Now, one more, but for tomorrow:
Payload:
1 2 3
{ "date": "2015-04-28" }
Response:
1 2 3
[
2
]
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 2, "class": "Invoice", "url_path": "\/invoices\/2", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": "", "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164852, "created_by_id": 1, "updated_on": 1430164852, "based_on_type": "RecurringProfile", "based_on_id": 1, "number": "2", "project_id": 0, "purchase_order_number": null, "issued_on": 1430092800, "due_on": 1430092800, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "E5RL5nSajNSyfNuedhp1iV3tQ5IaMZHgTnRMAzNK", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=E5RL5nSajNSyfNuedhp1iV3tQ5IaMZHgTnRMAzNK&number=2", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 7, "class": "InvoiceItem", "url_path": "\/invoice-items\/7", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 8, "class": "InvoiceItem", "url_path": "\/invoice-items\/8", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 9, "class": "InvoiceItem", "url_path": "\/invoice-items\/9", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
{ "single": { "id": 1, "class": "RecurringProfile", "url_path": "\/recurring-profiles\/1", "name": "Test Profile", "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164848, "created_by_id": 1, "project_id": 0, "purchase_order_number": null, "start_on": 1430092800, "last_trigger_on": 1430179200, "next_trigger_on": null, "frequency": "daily", "occurrences": 2, "triggered_number": 2, "stored_card_id": 0, "auto_issue": false, "is_enabled": true, "is_completed": true, "private_note": "Client will not be able to see this", "invoice_due_after": 15 }, "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1 }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2 }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "RecurringProfile", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3 } ], "stored_card": null, "invoices": [ 1, 2 ] }
When recurring profile is deleted:
Profile should be gone, and relation with invoices that profile deleted released (invoices are not deleted):
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 1, "class": "Invoice", "url_path": "\/invoices\/1", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": "", "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164849, "created_by_id": 1, "updated_on": 1430164854, "based_on_type": null, "based_on_id": 0, "number": "1", "project_id": 0, "purchase_order_number": null, "issued_on": 1430092800, "due_on": 1430092800, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "o4rTl9sfwDh6IP4fK4qyapDS0MMRXhPaa8Ul6bqq", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=o4rTl9sfwDh6IP4fK4qyapDS0MMRXhPaa8Ul6bqq&number=1", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 4, "class": "InvoiceItem", "url_path": "\/invoice-items\/4", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 5, "class": "InvoiceItem", "url_path": "\/invoice-items\/5", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 6, "class": "InvoiceItem", "url_path": "\/invoice-items\/6", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 2, "class": "Invoice", "url_path": "\/invoices\/2", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": "", "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164852, "created_by_id": 1, "updated_on": 1430164854, "based_on_type": null, "based_on_id": 0, "number": "2", "project_id": 0, "purchase_order_number": null, "issued_on": 1430092800, "due_on": 1430092800, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "E5RL5nSajNSyfNuedhp1iV3tQ5IaMZHgTnRMAzNK", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=E5RL5nSajNSyfNuedhp1iV3tQ5IaMZHgTnRMAzNK&number=2", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 7, "class": "InvoiceItem", "url_path": "\/invoice-items\/7", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 8, "class": "InvoiceItem", "url_path": "\/invoice-items\/8", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 9, "class": "InvoiceItem", "url_path": "\/invoice-items\/9", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }