Supported Currency

Personas in this Story: Default, Client.

Response: HTTP 200, application/json (Hide)
PUT /payment-gateways

Payload:

1
2
3
4
5
6
7
8
9
10
11
{
    "credit_card": {
        "type": "BrainTreeGateway",
        "merchant_id": "XYZ",
        "merchant_account_ids": {
            "USD": "456"
        },
        "public_key": "ABC",
        "private_key": "FGH"
    }
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
    "paypal": null,
    "credit_card": {
        "id": 1,
        "class": "BrainTreeGateway",
        "url_path": "#",
        "is_live": false,
        "merchant_id": "XYZ",
        "merchant_account_ids": {
            "USD": "456"
        },
        "public_key": "ABC",
        "private_key": "FGH"
    }
}
Response: HTTP 200, application/json (Hide)
PUT /payment-gateways

Payload:

1
2
3
4
5
6
7
8
{
    "paypal": {
        "type": "PaypalExpressCheckoutGateway",
        "api_username": "XYZ",
        "api_password": "ABC",
        "api_signature": "FGH"
    }
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "paypal": {
        "id": 2,
        "class": "PaypalExpressCheckoutGateway",
        "url_path": "#",
        "is_live": false,
        "api_username": "XYZ",
        "api_password": "ABC",
        "api_signature": "FGH"
    },
    "credit_card": {
        "id": 1,
        "class": "BrainTreeGateway",
        "url_path": "#",
        "is_live": false,
        "merchant_id": "XYZ",
        "merchant_account_ids": {
            "USD": "456"
        },
        "public_key": "ABC",
        "private_key": "FGH"
    }
}

For the purpose of this test, we have configured ActiveCollab to accept credit card payments via Stripe:

Response: HTTP 200, application/json (Hide)
GET /payment-gateways

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "paypal": {
        "id": 2,
        "class": "PaypalExpressCheckoutGateway",
        "url_path": "#",
        "is_live": false,
        "api_username": "XYZ",
        "api_password": "ABC",
        "api_signature": "FGH"
    },
    "credit_card": {
        "id": 1,
        "class": "BrainTreeGateway",
        "url_path": "#",
        "is_live": false,
        "merchant_id": "XYZ",
        "merchant_account_ids": {
            "USD": "456"
        },
        "public_key": "ABC",
        "private_key": "FGH"
    }
}

To test payments, first we need to create an invoice:

Response: HTTP 200, application/json (Hide)
GET /currencies

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
[
    {
        "id": 3,
        "class": "Currency",
        "url_path": "\/currencies\/3",
        "name": "British Pound",
        "updated_on": null,
        "code": "GBP",
        "is_default": false,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    {
        "id": 1,
        "class": "Currency",
        "url_path": "\/currencies\/1",
        "name": "Euro",
        "updated_on": null,
        "code": "EUR",
        "is_default": false,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    {
        "id": 4,
        "class": "Currency",
        "url_path": "\/currencies\/4",
        "name": "Japanese Yen",
        "updated_on": null,
        "code": "JPY",
        "is_default": false,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    {
        "id": 2,
        "class": "Currency",
        "url_path": "\/currencies\/2",
        "name": "US Dollar",
        "updated_on": null,
        "code": "USD",
        "is_default": true,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    }
]
Response: HTTP 200, application/json (Hide)
POST /invoices

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
{
    "company_id": 2,
    "currency_id": 1,
    "number": "1\/2014",
    "items": [
        {
            "description": "First item",
            "quantity": 100,
            "unit_cost": 25
        },
        {
            "description": "Second item",
            "quantity": 250,
            "unit_cost": 13,
            "first_tax_rate_id": 1
        },
        {
            "description": "Third item",
            "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
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": 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": 1430164841,
        "created_by_id": 1,
        "updated_on": 1430164841,
        "based_on_type": null,
        "based_on_id": null,
        "number": "1\/2014",
        "project_id": 0,
        "purchase_order_number": null,
        "issued_on": 1430164841,
        "due_on": 1430164841,
        "allow_payments": 1,
        "closed_on": null,
        "sent_on": null,
        "hash": "AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W",
        "status": "issued",
        "public_url": "http:\/\/feather.dev\/s\/invoice?hash=AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W&number=1%2F2014",
        "is_credit_invoice": false
    },
    "reminders": [],
    "items": [
        {
            "id": 1,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/1",
            "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": 2,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/2",
            "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": 3,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/3",
            "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": []
}

Recipients will get an email with a link that will laed them to public invoice page where they can make a payment:

Response: HTTP 200, application/json (Hide)
GET /s/invoice (as Client)

Query Parameters:

1
2
3
4
{
    "number": "1\/2014",
    "hash": "$first_invoice_hash"
}

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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
    "invoice": {
        "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": 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": 1430164841,
        "created_by_id": 1,
        "updated_on": 1430164841,
        "based_on_type": null,
        "based_on_id": null,
        "number": "1\/2014",
        "project_id": 0,
        "purchase_order_number": null,
        "issued_on": 1430092800,
        "due_on": 1430092800,
        "allow_payments": 1,
        "closed_on": null,
        "sent_on": null,
        "hash": "AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W",
        "status": "issued",
        "public_url": "http:\/\/feather.dev\/s\/invoice?hash=AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W&number=1%2F2014",
        "is_credit_invoice": false
    },
    "items": [
        {
            "id": 1,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/1",
            "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": 2,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/2",
            "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": 3,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/3",
            "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": []
        }
    ],
    "template": {
        "paper_size": "A4",
        "uploaded_logo_code": null,
        "header_layout": 0,
        "company_name": "Owner Company",
        "company_details": "",
        "print_header_border": true,
        "body_layout": 0,
        "print_footer": true,
        "footer_layout": 0,
        "print_footer_border": true,
        "logo": "http:\/\/feather.dev\/proxy.php?proxy=invoice_logo&module=invoicing&v=current&b=DEV&width=--WIDTH--&height=--HEIGHT--&scale=--SCALE--"
    },
    "payments": null,
    "currency": {
        "id": 1,
        "class": "Currency",
        "url_path": "\/currencies\/1",
        "name": "Euro",
        "updated_on": null,
        "code": "EUR",
        "is_default": false,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    "creator": {
        "id": 1,
        "class": "Owner",
        "url_path": "\/users\/1",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Ilija.studen",
        "last_name": null,
        "display_name": "ilija.studen",
        "short_display_name": "ilija.studen",
        "email": "ilija.studen@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=1&size=--SIZE--&timestamp=1430164837",
        "custom_permissions": [],
        "company_id": 1,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    },
    "creator_company": {
        "id": 1,
        "class": "Company",
        "url_path": "\/companies\/1",
        "name": "Owner Company",
        "members": [
            1
        ],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "is_archived": false,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "address": null,
        "phone": null,
        "homepage_url": null,
        "tax_id": null,
        "currency_id": null,
        "is_owner": true,
        "has_note": false
    },
    "accept_paypal": true,
    "accept_credit_card": false,
    "accept_partial_payments": false
}

If we update the invoice to use USD instead of EUR:

Response: HTTP 200, application/json (Hide)
PUT /invoices/1

Payload:

1
2
3
{
    "currency_id": 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": 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": null,
        "currency_id": 2,
        "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": 1430164841,
        "created_by_id": 1,
        "updated_on": 1430164841,
        "based_on_type": null,
        "based_on_id": null,
        "number": "1\/2014",
        "project_id": 0,
        "purchase_order_number": null,
        "issued_on": 1430092800,
        "due_on": 1430092800,
        "allow_payments": 1,
        "closed_on": null,
        "sent_on": null,
        "hash": "AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W",
        "status": "issued",
        "public_url": "http:\/\/feather.dev\/s\/invoice?hash=AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W&number=1%2F2014",
        "is_credit_invoice": false
    },
    "reminders": [],
    "items": [
        {
            "id": 1,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/1",
            "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": 2,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/2",
            "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": 3,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/3",
            "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": []
}

System should properly enable credit card payments because our gateway can accept them:

Response: HTTP 200, application/json (Hide)
GET /s/invoice (as Client)

Query Parameters:

1
2
3
4
{
    "number": "1\/2014",
    "hash": "$first_invoice_hash"
}

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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
    "invoice": {
        "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": null,
        "currency_id": 2,
        "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": 1430164841,
        "created_by_id": 1,
        "updated_on": 1430164841,
        "based_on_type": null,
        "based_on_id": null,
        "number": "1\/2014",
        "project_id": 0,
        "purchase_order_number": null,
        "issued_on": 1430092800,
        "due_on": 1430092800,
        "allow_payments": 1,
        "closed_on": null,
        "sent_on": null,
        "hash": "AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W",
        "status": "issued",
        "public_url": "http:\/\/feather.dev\/s\/invoice?hash=AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W&number=1%2F2014",
        "is_credit_invoice": false
    },
    "items": [
        {
            "id": 1,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/1",
            "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": 2,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/2",
            "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": 3,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/3",
            "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": []
        }
    ],
    "template": {
        "paper_size": "A4",
        "uploaded_logo_code": null,
        "header_layout": 0,
        "company_name": "Owner Company",
        "company_details": "",
        "print_header_border": true,
        "body_layout": 0,
        "print_footer": true,
        "footer_layout": 0,
        "print_footer_border": true,
        "logo": "http:\/\/feather.dev\/proxy.php?proxy=invoice_logo&module=invoicing&v=current&b=DEV&width=--WIDTH--&height=--HEIGHT--&scale=--SCALE--"
    },
    "payments": null,
    "currency": {
        "id": 2,
        "class": "Currency",
        "url_path": "\/currencies\/2",
        "name": "US Dollar",
        "updated_on": null,
        "code": "USD",
        "is_default": true,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    "creator": {
        "id": 1,
        "class": "Owner",
        "url_path": "\/users\/1",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Ilija.studen",
        "last_name": null,
        "display_name": "ilija.studen",
        "short_display_name": "ilija.studen",
        "email": "ilija.studen@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=1&size=--SIZE--&timestamp=1430164837",
        "custom_permissions": [],
        "company_id": 1,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    },
    "creator_company": {
        "id": 1,
        "class": "Company",
        "url_path": "\/companies\/1",
        "name": "Owner Company",
        "members": [
            1
        ],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "is_archived": false,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "address": null,
        "phone": null,
        "homepage_url": null,
        "tax_id": null,
        "currency_id": null,
        "is_owner": true,
        "has_note": false
    },
    "accept_paypal": true,
    "accept_credit_card": true,
    "accept_partial_payments": false
}

If we disable PayPal gateway:

Response: HTTP 200, text/html
DELETE /payment-gateways/clear-paypal

system will also disable payments via PayPal:

Response: HTTP 200, application/json (Hide)
GET /s/invoice (as Client)

Query Parameters:

1
2
3
4
{
    "number": "1\/2014",
    "hash": "$first_invoice_hash"
}

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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
    "invoice": {
        "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": null,
        "currency_id": 2,
        "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": 1430164841,
        "created_by_id": 1,
        "updated_on": 1430164841,
        "based_on_type": null,
        "based_on_id": null,
        "number": "1\/2014",
        "project_id": 0,
        "purchase_order_number": null,
        "issued_on": 1430092800,
        "due_on": 1430092800,
        "allow_payments": 1,
        "closed_on": null,
        "sent_on": null,
        "hash": "AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W",
        "status": "issued",
        "public_url": "http:\/\/feather.dev\/s\/invoice?hash=AVYxtuV1imrvws9Vws0hAEFRZmSPcoKCx1tRKi1W&number=1%2F2014",
        "is_credit_invoice": false
    },
    "items": [
        {
            "id": 1,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/1",
            "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": 2,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/2",
            "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": 3,
            "class": "InvoiceItem",
            "url_path": "\/invoice-items\/3",
            "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": []
        }
    ],
    "template": {
        "paper_size": "A4",
        "uploaded_logo_code": null,
        "header_layout": 0,
        "company_name": "Owner Company",
        "company_details": "",
        "print_header_border": true,
        "body_layout": 0,
        "print_footer": true,
        "footer_layout": 0,
        "print_footer_border": true,
        "logo": "http:\/\/feather.dev\/proxy.php?proxy=invoice_logo&module=invoicing&v=current&b=DEV&width=--WIDTH--&height=--HEIGHT--&scale=--SCALE--"
    },
    "payments": null,
    "currency": {
        "id": 2,
        "class": "Currency",
        "url_path": "\/currencies\/2",
        "name": "US Dollar",
        "updated_on": null,
        "code": "USD",
        "is_default": true,
        "decimal_spaces": 2,
        "decimal_rounding": 0
    },
    "creator": {
        "id": 1,
        "class": "Owner",
        "url_path": "\/users\/1",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Ilija.studen",
        "last_name": null,
        "display_name": "ilija.studen",
        "short_display_name": "ilija.studen",
        "email": "ilija.studen@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=1&size=--SIZE--&timestamp=1430164837",
        "custom_permissions": [],
        "company_id": 1,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    },
    "creator_company": {
        "id": 1,
        "class": "Company",
        "url_path": "\/companies\/1",
        "name": "Owner Company",
        "members": [
            1
        ],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "is_archived": false,
        "created_on": 1430164837,
        "created_by_id": 1,
        "updated_on": 1430164837,
        "updated_by_id": 1,
        "address": null,
        "phone": null,
        "homepage_url": null,
        "tax_id": null,
        "currency_id": null,
        "is_owner": true,
        "has_note": false
    },
    "accept_paypal": false,
    "accept_credit_card": true,
    "accept_partial_payments": false
}