Created
June 11, 2013 06:47
-
-
Save superstructor/5754905 to your computer and use it in GitHub Desktop.
Or for a coffee order maybe consider that the order and the payment could be independent resources, thus you get
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { | |
"href": "/api/orders/123" | |
}, | |
"profile": { | |
"href": "/profiles/order" | |
} | |
"/rels/payments": { | |
"href": "/api/orders/123/payments", | |
"profile": "/profiles/order/payments" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { | |
"href": "/api/orders/123/payments" | |
}, | |
"profile": { | |
"href": "/profiles/order/payments" | |
}, | |
"/rels/create-form": { | |
"href": "/forms/order/payment/create", | |
"profile": "/profiles/form" | |
}, | |
"/rels/create": { | |
"href": "/api/orders/123/payments", | |
"profile": "/profiles/order/payment/create" | |
} | |
}, | |
"_embedded": { | |
"payment": [ | |
{ | |
"_links": { | |
"self": { | |
"href": "/api/orders/123/payments/1001" | |
}, | |
"profile": { | |
"href": "/profiles/order/payment" | |
} | |
}, | |
"type": "credit-card", | |
"amount": "5.50", | |
"currency": "NZD", | |
"status": "declined", | |
"reason": "invalid card details" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment