Deals
Deals are required to start ticket sales on specific Event since
they are defines the final price for them depending on various conditions.
Deal
-
GET
/v1/resources/deals/{iddeal}
Request Headers: |
|
|
Parameters: |
- idevent (string) – Event ID
|
Query Parameters: |
|
- partner (string) – filter for obj or subj
- status (string) – filter for status
- fields-schema (string) – Fields Schema DSL
|
Response Headers: |
|
|
Response JSON Object: |
|
- created_at (datetime) – Deal creation timestamp
- event (string) – Event ID
- id (string) – Deal ID
- message (string) – Short message with deal
- obj (string) – Partner ID
- reversed_deal (boolean) – Deal made from subj to obj
- status (string) – Deal status
- subj (string) – Partner ID
- term (object) – Deal Deal Terms
- title (object) – Title and description
- updated_at (datetime) – Deal update timestamp
|
Status Codes: |
|
-
PATCH
/v1/resources/deals/{iddeal}
Updates a Deal.
Request Headers: |
|
|
Parameters: |
- idevent (string) – Event ID
|
Query Parameters: |
|
|
Request JSON Object: |
|
- reversed_deal (boolean) – Make deal reversed
- status (string) – New deal status
|
Response Headers: |
|
|
Response JSON Object: |
|
- created_at (datetime) – Deal creation timestamp
- event (string) – Event ID
- id (string) – Deal ID
- message (string) – Short message with deal
- obj (string) – Partner ID
- reversed_deal (boolean) – Deal made from subj to obj
- status (string) – Deal status
- subj (string) – Partner ID
- term (object) – Deal Deal Terms
- title (object) – Title and description
- updated_at (datetime) – Deal update timestamp
|
Status Codes: |
|
Deals
-
GET
/v1/resources/deals
Request Headers: |
|
|
Parameters: |
- idevent (string) – Event ID
|
Query Parameters: |
|
|
Response Headers: |
|
|
Response JSON Array of Objects: |
|
- created_at (datetime) – Deal creation timestamp
- event (string) – Event ID
- id (string) – Deal ID
- message (string) – Short message with deal
- obj (string) – Partner ID
- reversed_deal (boolean) – Deal made from subj to obj
- status (string) – Deal status
- subj (string) – Partner ID
- term (object) – Deal Deal Terms
- title (object) – Title and description
- updated_at (datetime) – Deal update timestamp
|
Status Codes: |
|
GET /v1/resources/deals HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
[
{
"created_at": null,
"event": "5357baaff51600525c9e1397",
"id": "535fb1f1dca6a9d1638f2008",
"obj": "5357b929f51600525c9e1396",
"reversed_deal": null,
"status": "accepted",
"subj": "535fb19bdca6a9d1638f2007",
"term": {
"core": "3.00%",
"extra": "10.0%",
"org": "91.00%",
"pfc": false
},
"updated_at": null
}
]
-
POST
/v1/resources/deals
Creates a new Deal.
Request Headers: |
|
|
Parameters: |
- idevent (string) – Event ID
|
Query Parameters: |
|
|
Request JSON Object: |
|
- event (string) – Event ID
- message (string) – Short message with deal
- subj (string) – Partner ID
- term (object) – Deal Deal Terms
|
Response Headers: |
|
|
Response JSON Array of Objects: |
|
- created_at (datetime) – Deal creation timestamp
|
Response JSON Object: |
|
- event (string) – Event ID
- id (string) – Deal ID
- message (string) – Short message with deal
- obj (string) – Partner ID
- reversed_deal (boolean) – Deal made from subj to obj
- status (string) – Deal status
- subj (string) – Partner ID
- term (object) – Deal Deal Terms
- title (object) – Title and description
- updated_at (datetime) – Deal update timestamp
|
Status Codes: |
|
POST /v1/resources/deals HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Content-Length: 118
Content-Type: application/json; charset=utf-8
Host: ticketscloud.org
{
"event": "5368b3d49583cb96a0357590",
"subj": "5357b929f51600525c9e1396",
"term": {
"extra": 10,
"org": 10,
"pfc": true
}
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
{
"created_at": "2014-08-18 16:42:29.534470+00:00",
"event": "5368b3d49583cb96a0357590",
"id": "545fb1f1dca6a9d1638f3192",
"obj": "53f1f4a9e0ce77186cf52d1f",
"reversed_deal": null,
"status": "accepted",
"subj": "5357b929f51600525c9e1396",
"term": {
"core": "10.00%",
"extra": "10.0%",
"org": "10.00%",
"pfc": true
},
"updated_at": "2014-08-18 16:42:29.534470+00:00"
}
Deal Terms
Deal terms is an immutable object which stored within the Deal object
with the following fields:
org (string): Amount of price which organizer will
get
extra (string): Extra price set by agent
core (string): TicketsCloud commission
- pfc (boolean): Payment-For-Customer. When
true
customer pays
the bill.
Each org, extra and core value may have absolute value and relative
(percentage) ration from the base ticket price.