Skip to content

Commit 1318cfa

Browse files
committed
Add example for complex attributes
1 parent 8126cea commit 1318cfa

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

examples/index.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,45 @@ layout: page
33
title: Examples
44
---
55

6+
### Complex Attributes <a href="#complex-attributes" id="complex-attributes" class="headerlink"></a>
7+
8+
The following resource object represents an invoice and contains three [complex
9+
attributes](/format/#document-structure-resource-object-complex-attributes):
10+
`notes`, `total`, and `customer-references`.
11+
12+
```json
13+
{
14+
"type": "invoices",
15+
"id": "1234",
16+
"date": "2015-02-14",
17+
"due": "2015-03-14",
18+
"notes": ["Lorem ipsum dolor sit amet", "Consectetuer adipiscing elit"],
19+
"total": {
20+
"currency": "EUR",
21+
"line-items": 3000.00,
22+
"discounts": 300.00,
23+
"tax": {
24+
"tax-type": "VAT",
25+
"taxable-amount": 2700.00,
26+
"tax-amount": 540.00
27+
},
28+
"amount-payable": 3240.00
29+
},
30+
"customer-references": [{
31+
"ref-type": "purchase-order",
32+
"text": "AB3210"
33+
}, {
34+
"ref-type": "other",
35+
"text": "Department XYZ"
36+
}],
37+
"links": {
38+
"customer": {
39+
"related": "http://example.com/invoices/1234/customer"
40+
},
41+
"line-items": {
42+
"related": "http://example.com/invoices/1234/line-items"
43+
}
44+
}
45+
}
46+
```
47+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy