Last active
July 4, 2019 09:16
-
-
Save chenghung/1c45ec95e2d7b49ad1a64fa2f9d77eff to your computer and use it in GitHub Desktop.
rest api discuss
This file contains 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
POST /orders | |
{ | |
id: 5, | |
state: 'payment-expected', | |
_links: { | |
self: { | |
method: 'GET', | |
href: '/orders/5', | |
} | |
payment: { | |
method: 'PUT', | |
href: '/orders/5/payments', | |
}, | |
change: { | |
method: 'PUT', | |
href: '/orders/5/changes', | |
} | |
cancel: { | |
method: 'PUT', | |
href: '/orders/5/cancels', | |
} | |
} | |
} | |
GET /orders/:id // refresh | |
PUT /order/:id/changes | |
{ | |
id: 5, | |
state: 'unpaid', | |
_links: { | |
self: { | |
method: 'GET', | |
href: '/orders/5', | |
} | |
payment: { | |
method: 'PUT', | |
href: '/orders/5/payments', | |
}, | |
change: { | |
method: 'PUT', | |
href: '/orders/5/changes', | |
} | |
cancel: { | |
method: 'PUT', | |
href: '/orders/5/cancels', | |
} | |
} | |
} | |
PUT /orders/:id/payments | |
{ | |
id: 5, | |
state: 'paid', | |
_links: { | |
self: { | |
method: 'GET', | |
href: '/orders/5', | |
} | |
take: { | |
method: 'PUT', | |
href: '/orders/5/takes', | |
} | |
} | |
} | |
PUT /orders/:id/cancels | |
{ | |
id: 5, | |
state: 'canceled', | |
_links: { | |
self: { | |
method: 'GET', | |
href: '/orders/5', | |
} | |
} | |
} | |
PUT /orders/:id/takes | |
{ | |
id: 5, | |
state: 'completed', | |
_links: { | |
self: { | |
method: 'GET', | |
href: '/orders/5', | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment