Skip to content

Commit 9bc4b92

Browse files
committed
Added more docs
1 parent ae4c1de commit 9bc4b92

7 files changed

Lines changed: 93 additions & 0 deletions

File tree

spec/code_samples/PHP/sales_invoices/post.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,9 @@
2828

2929
$nInvoice->addContact($contact);
3030

31+
// OR
32+
33+
$nInvoice->addContact("12345678");
34+
3135
// Create the invoice
3236
$moneybirdInvoice = $moneybirdClient->salesInvoices->create($nInvoice)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Get one
2+
$moneybirdClient->salesInvoices->get("invoice ID");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Create Payment
2+
$moneybirdPayment = new MoneybirdPayment();
3+
$moneybirdPayment->price = 200;
4+
$moneybirdPayment->payment_date = date("Y-m-d");
5+
6+
// Register the Payment
7+
$moneybirdClient->salesInvoices->setPayment($moneybirdPayment)
8+
->registerPayment("invoice ID" || $invoice);

spec/definitions/Payment.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
type: object
2+
properties:
3+
id:
4+
type: integer
5+
6+
administration_id:
7+
type: integer
8+
9+
invoice_type:
10+
type: string
11+
12+
invoice_id:
13+
type: string
14+
15+
financial_account_id:
16+
type: string
17+
18+
user_id:
19+
type: string
20+
21+
payment_transaction_id:
22+
type: string
23+
24+
price:
25+
type: string
26+
27+
price_base:
28+
type: string
29+
30+
payment_date:
31+
type: string
32+
33+
credit_invoice_id:
34+
type: string
35+
36+
financial_mutation_id:
37+
type: string
38+
39+
created_at:
40+
type: dateTime
41+
example: 2017-02-21T17:04:41.056Z
42+
43+
updated_at:
44+
type: dateTime
45+
example: 2017-02-21T17:04:41.056Z

spec/definitions/SalesInvoice.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ properties:
8989

9090
payments:
9191
type: array
92+
items:
93+
$ref: '#/definitions/Payment'
9294

9395
total_paid:
9496
type: float
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
get:
2+
tags:
3+
- Sales Invoices
4+
summary: Sales Invoice
5+
description: |
6+
[Official docs](https://developer.moneybird.com/api/sales_invoices/#get_sales_invoices_id)
7+
operationId: getSalesInvoice
8+
9+
responses:
10+
200:
11+
description: Request was successful
12+
schema:
13+
$ref: '#/definitions/SalesInvoice'
14+
15+
404:
16+
description: Entity not found
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
patch:
2+
tags:
3+
- Sales Invoices
4+
summary: Register payment
5+
description: |
6+
[Official docs](https://developer.moneybird.com/api/sales_invoices/#patch_sales_invoices_id_register_payment)
7+
operationId: registerPayment
8+
9+
responses:
10+
200:
11+
description: Request was successful
12+
schema:
13+
$ref: '#/definitions/SalesInvoice'
14+
15+
404:
16+
description: Entity not found

0 commit comments

Comments
 (0)