{ "type":"object", "title": "payment", "description":"An payment in SK must always be related to an object.", "properties": { "id": { "description": "uuid of the object", "identity":true, "readonly":true, "type":"string" }, "amount": { "description": "The payment amount", "required":true, "type":"number" }, "external_ref":{ "description": "Reference number f.ex. issued by the bank.", "type":"string" }, "date":{ "description": "Date the payment was made.", "required":true, "format":"date", "type":"string" }, "method":{ "description": "How the payment was made.", "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"], "type":"string" }, "related_object_type": { "description": "Object type of the payments parent. Is the camelcased base class name: Document for invoice, credit_note,.., Contact for client", "required":true, "type":"string" }, "related_object_id": { "description": "uuid of the payments parent object.", "required":true, "type":"string" }, "team_id":{ "description": "A team uuid. If set only the team and its parent teams can see the record.", "type":"string" }, "created_at": { "description": "Date the object was created in SK. Never changes afterwards", "format":"date-time", "readonly":true, "type":"string" } }, "links":[ { "rel": "self", "href": "payments/{id}" }, { "rel": "instances", "href": "payments", "properties" : { "page":{ "title" : "Page", "description": "In paginated results set the page to look for", "type":"number" }, "filter[q]":{ "title" : "Search", "description": "Search in title, number, addressfield", "type":"string" }, "filter[from]":{ "title" : "From date", "description": "All objects with a date after the date" }, "filter[to]":{ "title" : "To date", "description": "All objects with date before the date" }, "sort_by":{ "title" : "Sort by", "description": "Sort the results by the given field => number", "enum":["amount","created_at", "updated_at"], "type": "string" }, "sort":{ "title" : "Sort", "enum":["ASC","DESC"], "description": "Sort the results in ASC or DESC" } } }, { "rel": "destroy", "href": "payments/{id}", "method": "DELETE" }, { "rel": "create", "href": "payments", "method": "POST", "properties" : { "new_doc_status":{ "title" : "New status for document", "description": "Convinience method to close a document with a payment.", "enum": ["open","closed"], "type":"string" } } } ] }