json/v2.0/payment.json in sk_api_schema-0.10.6 vs json/v2.0/payment.json in sk_api_schema-0.11.0
- old
+ new
@@ -1,21 +1,29 @@
-{ "type":"object",
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
"title": "payment",
- "name": "payment",
- "description":"An payment must always be related to an document, so you must use the nested URL e.g. POST invoices/ID/payments. In this case the related_object_id/type are automatically set.",
+ "description":"An payment must always be related to an document, either an invoice(incoming) or a credit_note (outgoing).",
+ "required":["amount","date", "related_object_type", "related_object_id"],
"properties":{
"id":{
"description":"Unique identifier - UUID",
"identity":true,
- "readonly":true,
+ "readOnly":true,
"type":"string",
"maxLength": 22,
"minLength":22
},
+ "company_id":{
+ "description":"Company",
+ "readOnly":true,
+ "type":"string",
+ "maxLength": 22,
+ "minLength":22
+ },
"amount":{
"description": "The payment amount",
- "required":true,
"type":"number"
},
"cash_discount":{
"description": "The cash discount amount. If a client withdraws a cash discount say 2% of 100€, he pays 98€ used in amount and 2€ in cash_discount. Handled separate for correction of sales,vat accounts in bookkeeping.",
"type":"number"
@@ -30,11 +38,10 @@
"type":"string",
"maxLength": 255
},
"date":{
"description": "Date the payment was made. YYYY-MM-DD",
- "required":true,
"format":"date",
"type":"string"
},
"currency":{
"description": "Currency code as defined by the ISO 4217 standard (3-letter UPCASE: EUR, USD)",
@@ -42,16 +49,16 @@
"maxLength": 3,
"minLength": 3
},
"exchange_rate":{
"description": "The exchange rate from the foreign document currency(eg. USD) to the company currency(EUR). If the rate is empty we use the exchange rate on the document date or today if doc.date is empty. If there is no rate for this day, say on weekends, the closest previous day is taken(Sunday->Friday). If you open the doc at a later time make sure to manually refresh the rate, as we dont change it. ",
- "readonly":true,
+ "readOnly":true,
"type":"number"
},
"amount_exchanged":{
"description": "The exchanged amount.",
- "readonly":true,
+ "readOnly":true,
"type":"number"
},
"payment_method":{
"description": "How the payment was made.",
"enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
@@ -61,30 +68,28 @@
"description": "Add a late fee if an invoice has payment reminders. We create a second payment for the last reminder and close all others. Set to 0, if you want to waive the fee(has not been paid). In this case all reminders are closed and we also correct the sales+debtor account with the open fees. This is a pure setter-method used in creation!",
"type":"number"
},
"related_object_type":{
"description": "Object type of the payments parent. Is the camel-cased base class name: Document for invoice, credit_note. Is auto-set when using the nested URL POST invoices/ID/payments",
- "required":true,
"type":"string"
},
"related_object_id":{
"description": "uuid of the payments parent object. Is auto-set when using the nested URL POST invoices/ID/payments",
- "required":true,
"type":"string",
"maxLength": 22,
"minLength":22
},
"team_id":{
"description": "A team uuid taken from the related object(e.g.invoice). If set only the team and its parent teams can see the record.",
- "readonly" :true,
+ "readOnly" :true,
"type":"string",
"maxLength": 22,
"minLength":22
},
"created_at":{
"description": "Date the object was created in SK. Never changes afterwards",
"format":"date-time",
- "readonly":true,
+ "readOnly":true,
"type":"string"
}
},
"links":[
{ "rel": "self",
\ No newline at end of file