Skip to content

Commit 939e4a2

Browse files
wip
1 parent 88ba61d commit 939e4a2

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed

specs/docs/endpoint_classes.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Moneybird API PHP - Endpoint Classes
2+
3+
This document provides a comprehensive list of all endpoint classes in the Moneybird API PHP library.
4+
5+
## Endpoint Classes
6+
7+
1. [x] **AdministrationsEndpoint** - `/src/Api/Administrations/AdministrationsEndpoint.php`
8+
2. [x] **ContactsEndpoint** - `/src/Api/Contacts/ContactsEndpoint.php`
9+
3. [x] **CustomFieldsEndpoint** - `/src/Api/CustomFields/CustomFieldsEndpoint.php`
10+
4. [x] **DocumentStylesEndpoint** - `/src/Api/DocumentStyles/DocumentStylesEndpoint.php`
11+
5. [x] **EstimatesEndpoint** - `/src/Api/Estimates/EstimatesEndpoint.php`
12+
6. [x] **ExternalSalesInvoicesEndpoint** - `/src/Api/ExternalSalesInvoices/ExternalSalesInvoicesEndpoint.php`
13+
7. [x] **ExternalSalesInvoiceAttachmentsEndpoint** - `/src/Api/ExternalSalesInvoices/Attachments/ExternalSalesInvoiceAttachmentsEndpoint.php`
14+
8. [x] **ExternalSalesInvoicePaymentsEndpoint** - `/src/Api/ExternalSalesInvoices/Payments/ExternalSalesInvoicePaymentsEndpoint.php`
15+
9. [x] **FinancialAccountsEndpoint** - `/src/Api/FinancialAccounts/FinancialAccountsEndpoint.php`
16+
10. [x] **FinancialMutationsEndpoint** - `/src/Api/FinancialMutations/FinancialMutationsEndpoint.php`
17+
11. [x] **FinancialStatementsEndpoint** - `/src/Api/FinancialStatements/FinancialStatementsEndpoint.php`
18+
12. [x] **GeneralDocumentsEndpoint** - `/src/Api/Documents/GeneralDocuments/GeneralDocumentsEndpoint.php`
19+
13. [x] **GeneralJournalDocumentsEndpoint** - `/src/Api/Documents/GeneralJournalDocuments/GeneralJournalDocumentsEndpoint.php`
20+
14. [x] **IdentitiesEndpoint** - `/src/Api/Identities/IdentitiesEndpoint.php`
21+
15. [x] **ImportMappingsEndpoint** - `/src/Api/ImportMappings/ImportMappingsEndpoint.php`
22+
16. [x] **LedgerAccountsEndpoint** - `/src/Api/LedgerAccounts/LedgerAccountsEndpoint.php`
23+
17. [x] **PaymentsEndpoint** - `/src/Api/Payments/PaymentsEndpoint.php`
24+
18. [x] **ProductsEndpoint** - `/src/Api/Products/ProductsEndpoint.php`
25+
19. [x] **ProjectsEndpoint** - `/src/Api/Projects/ProjectsEndpoint.php`
26+
20. [x] **PurchaseInvoicesEndpoint** - `/src/Api/Documents/PurchaseInvoices/PurchaseInvoicesEndpoint.php`
27+
21. [x] **PurchaseTransactionsEndpoint** - `/src/Api/PurchaseTransactions/PurchaseTransactionsEndpoint.php`
28+
22. [x] **ReceiptsEndpoint** - `/src/Api/Documents/Receipts/ReceiptsEndpoint.php`
29+
23. [x] **RecurringSalesInvoicesEndpoint** - `/src/Api/RecurringSalesInvoices/RecurringSalesInvoicesEndpoint.php`
30+
24. [x] **SalesInvoicesEndpoint** - `/src/Api/SalesInvoices/SalesInvoicesEndpoint.php`
31+
25. [x] **SalesInvoicePaymentsEndpoint** - `/src/Api/SalesInvoices/Payments/SalesInvoicePaymentsEndpoint.php`
32+
26. [x] **SubscriptionsEndpoint** - `/src/Api/Subscriptions/SubscriptionsEndpoint.php`
33+
27. [x] **SubscriptionTemplatesEndpoint** - `/src/Api/SubscriptionTemplates/SubscriptionTemplatesEndpoint.php`
34+
28. [x] **TaxRatesEndpoint** - `/src/Api/TaxRates/TaxRatesEndpoint.php`
35+
29. [x] **TimeEntriesEndpoint** - `/src/Api/TimeEntries/TimeEntriesEndpoint.php`
36+
30. [x] **TypelessDocumentsEndpoint** - `/src/Api/Documents/TypelessDocuments/TypelessDocumentsEndpoint.php`
37+
31. [x] **UsersEndpoint** - `/src/Api/Users/UsersEndpoint.php`
38+
32. [x] **VerificationsEndpoint** - `/src/Api/Verifications/VerificationsEndpoint.php`
39+
33. [x] **WebhooksEndpoint** - `/src/Api/Webhooks/WebhooksEndpoint.php`
40+
41+
## Base Endpoint
42+
43+
All endpoint classes extend the abstract `BaseEndpoint` class located at `/src/Api/Support/BaseEndpoint.php`, which provides common functionality for API operations like create, get, update, delete, and pagination. Each endpoint corresponds to a specific resource in the Moneybird API.

specs/docs/endpoint_template.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: [ENDPOINT_NAME]
3+
description: Interacting with Moneybird's [ENDPOINT_NAME] API.
4+
---
5+
6+
Manage your [ENDPOINT_NAME] in Moneybird.
7+
8+
## Working with [ENDPOINT_NAME]
9+
10+
This section covers how to interact with Moneybird's [ENDPOINT_NAME] API. You can create, retrieve, update, and delete [ENDPOINT_NAME], as well as [MENTION_ANY_SPECIALIZED_FEATURES].
11+
12+
### Basic Operations
13+
14+
#### Get a [SINGULAR_ENDPOINT_NAME]
15+
16+
Retrieve a [SINGULAR_ENDPOINT_NAME] by its ID.
17+
18+
```php
19+
$[SINGULAR_ENDPOINT_NAME_LOWERCASE] = $client->[ENDPOINT_NAME_LOWERCASE]()->get('[EXAMPLE_ID]');
20+
```
21+
22+
#### List [ENDPOINT_NAME]
23+
24+
Get a paginated list of [ENDPOINT_NAME].
25+
26+
```php
27+
$[ENDPOINT_NAME_LOWERCASE] = $client->[ENDPOINT_NAME_LOWERCASE]()->paginate();
28+
29+
// Iterate through the pages
30+
foreach ($[ENDPOINT_NAME_LOWERCASE] as $[SINGULAR_ENDPOINT_NAME_LOWERCASE]) {
31+
echo $[SINGULAR_ENDPOINT_NAME_LOWERCASE]->[MAIN_PROPERTY];
32+
}
33+
```
34+
35+
#### Create a [SINGULAR_ENDPOINT_NAME]
36+
37+
Create a new [SINGULAR_ENDPOINT_NAME].
38+
39+
```php
40+
$data = [
41+
// Include example properties with realistic values
42+
'[PROPERTY1]' => '[VALUE1]',
43+
'[PROPERTY2]' => '[VALUE2]',
44+
];
45+
46+
$[SINGULAR_ENDPOINT_NAME_LOWERCASE] = $client->[ENDPOINT_NAME_LOWERCASE]()->create($data);
47+
```
48+
49+
#### Update a [SINGULAR_ENDPOINT_NAME]
50+
51+
Update an existing [SINGULAR_ENDPOINT_NAME].
52+
53+
```php
54+
$updateData = [
55+
'[PROPERTY1]' => '[UPDATED_VALUE1]',
56+
];
57+
58+
$[SINGULAR_ENDPOINT_NAME_LOWERCASE] = $client->[ENDPOINT_NAME_LOWERCASE]()->update('[EXAMPLE_ID]', $updateData);
59+
```
60+
61+
#### Delete a [SINGULAR_ENDPOINT_NAME]
62+
63+
Delete a [SINGULAR_ENDPOINT_NAME].
64+
65+
```php
66+
$client->[ENDPOINT_NAME_LOWERCASE]()->delete('[EXAMPLE_ID]');
67+
```
68+
69+
### [SPECIALIZED_FEATURE_1]
70+
71+
[DESCRIBE_SPECIALIZED_FEATURE_1]
72+
73+
#### [SPECIALIZED_METHOD_1]
74+
75+
```php
76+
[EXAMPLE_CODE_FOR_SPECIALIZED_METHOD_1]
77+
```
78+
79+
### [SPECIALIZED_FEATURE_2]
80+
81+
[DESCRIBE_SPECIALIZED_FEATURE_2]
82+
83+
#### [SPECIALIZED_METHOD_2]
84+
85+
```php
86+
[EXAMPLE_CODE_FOR_SPECIALIZED_METHOD_2]
87+
```
88+
89+
## [SINGULAR_ENDPOINT_NAME] Properties
90+
91+
When working with [ENDPOINT_NAME_LOWERCASE], you'll have access to the following properties:
92+
93+
| Property | Type | Description |
94+
|----------|------|-------------|
95+
| id | string | Unique identifier |
96+
| [PROPERTY1] | [TYPE1] | [DESCRIPTION1] |
97+
| [PROPERTY2] | [TYPE2] | [DESCRIPTION2] |
98+
| [PROPERTY3] | [TYPE3] | [DESCRIPTION3] |
99+
| [CONTINUE_WITH_ALL_RELEVANT_PROPERTIES] | | |
100+
101+
> **Note:** See the [official API reference](https://developer.moneybird.com/api/[ENDPOINT_NAME_LOWERCASE]/#[ENDPOINT_NAME_LOWERCASE]-object) for the complete list of available properties.
102+
103+
## Further reading
104+
105+
- Read [the full API reference](https://developer.moneybird.com/api/[ENDPOINT_NAME_LOWERCASE]/) in the Moneybird developer docs
106+
107+
<!--
108+
Style guidelines:
109+
1. Focus on functionality rather than implementation details
110+
2. Use practical examples with realistic values
111+
3. Don't mention class names or implementation details
112+
4. Format all code examples in PHP
113+
5. Include a properties table with types and descriptions
114+
6. Keep explanations concise and user-focused
115+
7. Group related operations into logical sections
116+
8. Include any specialized methods specific to this endpoint
117+
9. Use consistent formatting and terminology throughout
118+
-->

0 commit comments

Comments
 (0)