{"swagger":"2.0","info":{"title":"Point Of Sale (POS)","description":"go microservice","license":{"name":"GPL-3.0","url":"https://github.com/psavelis/goa-pos-poc/blob/master/LICENSE"},"version":"v1"},"host":"psavelis.herokuapp.com","basePath":"/pos/v1","schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/purchases/":{"post":{"tags":["Purchase"],"summary":"create Purchase","description":"creates a purchase","operationId":"Purchase#create","parameters":[{"name":"payload","in":"body","description":"Detailed information regarding a POS purchase operation","required":true,"schema":{"$ref":"#/definitions/PurchasePayload"}}],"responses":{"201":{"description":"Resource created","headers":{"Location":{"description":"href to created resource","type":"string","pattern":"^/purchases/[A-Za-z0-9_.]+$"}}},"400":{"description":"Bad Request"},"409":{"description":"A conflict arose from your request. (e.g. resource already exists)","headers":{"X-Request-Id":{"type":"string","pattern":"[a-f0-9]+"}}}},"schemes":["https"]}},"/purchases/{transaction_id}":{"get":{"tags":["Purchase"],"summary":"show Purchase","description":"retrieves a purchase","operationId":"Purchase#show","parameters":[{"name":"transaction_id","in":"path","description":"Unique transaction identifier","required":true,"type":"string","pattern":"^[0-9a-fA-F]{24}$"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Purchase"}},"400":{"description":"Bad Request"},"404":{"description":"Not Found"}},"schemes":["https"]}}},"definitions":{"Purchase":{"title":"Mediatype identifier: application/json; view=default","type":"object","properties":{"href":{"type":"string","description":"API href of Purchase","example":"/pos/v1/purchases/5a06839d42e6552b004a7e03"},"locator":{"type":"string","description":"Operation reference code","example":"MPOS00123820-UAT-A02","minLength":1,"maxLength":30},"purchase_value":{"type":"number","description":"Total amount paid","example":119.99,"minimum":0.01},"status":{"type":"string","description":"Purchase status","example":""},"transaction_id":{"type":"string","description":"Unique transaction identifier","example":"79B29Ecb61EC9F7d59ab7b77","pattern":"^[0-9a-fA-F]{24}$"}},"description":"Purchase media type (default view)","example":{"href":"/pos/v1/purchases/5a06839d42e6552b004a7e03","locator":"MPOS00123820-UAT-A02","purchase_value":119.99,"status":"","transaction_id":"79B29Ecb61EC9F7d59ab7b77"},"required":["transaction_id","locator","purchase_value","status","href"]},"PurchasePayload":{"title":"PurchasePayload","type":"object","properties":{"id":{"type":"string","example":""},"locator":{"type":"string","description":"Operation reference code","example":"MPOS00123820-UAT-A02","minLength":1,"maxLength":30},"purchase_value":{"type":"number","description":"Total amount paid","example":119.99,"minimum":0.01},"status":{"type":"string","example":""}},"description":"Detailed information regarding a POS purchase operation","example":{"id":"","locator":"MPOS00123820-UAT-A02","purchase_value":119.99,"status":""},"required":["locator","purchase_value"]}},"responses":{"BadRequest":{"description":"Bad Request"},"Conflict":{"description":"A conflict arose from your request. (e.g. resource already exists)","headers":{"X-Request-Id":{"type":"string","pattern":"[a-f0-9]+"}}},"NotFound":{"description":"Not Found"}}}