{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/promotionCodes.json","auth":"required","method":"post","examples":{"codes":[{"language":"json","code":"{\n    \"text\": \"THIS IS MY NEW EXTERNAL PROJECT CODE\",\n    \"type\": \"project\",\n    \"fb_project_id\": 10\n}"}]},"settings":"","results":{"codes":[{"status":201,"language":"json","code":"{\n    \"id\":58,\n    \"text\": \"THIS IS MY NEW EXTERNAL PROJECT CODE\",\n    \"type\": \"project\",\n    \"fb_project_id\": 10\n}","name":""}]},"params":[]},"next":{"description":"","pages":[]},"title":"/promotionCodes.json","type":"endpoint","slug":"promotioncodes-create","excerpt":"Creates a new promotion code.","body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Mandatory\",\n    \"0-0\": \"text\",\n    \"1-0\": \"type\",\n    \"2-0\": \"fb_project_id\",\n    \"3-0\": \"fb_source_id\",\n    \"3-1\": \"ID of a source\",\n    \"3-2\": \"integer\",\n    \"2-2\": \"integer\",\n    \"0-2\": \"string (100)\",\n    \"1-2\": \"enum (\\\"project\\\", \\\"source\\\", \\\"type\\\")\",\n    \"0-3\": \"yes\",\n    \"0-1\": \"Text of the promotion code. In most cases this is an ID that is used in an external system.\",\n    \"1-1\": \"An internal description\",\n    \"2-1\": \"ID of a project\",\n    \"4-0\": \"fb_type_id\",\n    \"4-2\": \"integer\",\n    \"1-3\": \"yes\",\n    \"4-1\": \"ID of a payment type\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Mandatory fields\",\n  \"body\": \"Exactly one field of \\\"fb_project_id\\\", \\\"fb_source_id\\\", \\\"fb_type_id\\\" must be set.\"\n}\n[/block]","updates":[],"order":58,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"6061d2dce296410070207300","createdAt":"2021-03-29T13:15:08.969Z","user":"5720ba18c669e80e00c35051","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"JSON-REST-API (API-Package)","slug":"rest-api-json","order":9,"from_sync":false,"reference":false,"_id":"5cbeda4b862d090013abd413","project":"571f5e8cd8667f0e00a3c498","version":"571f5e8cd8667f0e00a3c49b","createdAt":"2019-04-23T09:26:35.210Z","__v":1},"version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["571f5e8cd8667f0e00a3c49c","571f73cfcb4baa0e00d13a80","571f7451cb4baa0e00d13a88","571f7d2720695f3400f38797","571f7fb0ac2a080e0014c661","571f884be54f2d0e003ebb0a","572200c9ecb38d0e00d80ebd","572c301e7c8eff0e00aaa174","57df91b2c6348d0e0020c452","57e104db9ff1e21900a721ab","57fd04caeaa77f19008b8202","5899c7113514ce0f0014da84","5cbeda4b862d090013abd413","5e60d6278f8b380072f0b1e3"],"_id":"571f5e8cd8667f0e00a3c49b","hasDoc":true,"releaseDate":"2016-04-26T12:26:52.312Z","__v":14,"hasReference":true,"createdAt":"2016-04-26T12:26:52.312Z","project":"571f5e8cd8667f0e00a3c498"},"project":"571f5e8cd8667f0e00a3c498","__v":0,"parentDoc":null}

post/promotionCodes.json

Creates a new promotion code.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format


Documentation

[block:parameters] { "data": { "h-0": "Field", "h-1": "Description", "h-2": "Type", "h-3": "Mandatory", "0-0": "text", "1-0": "type", "2-0": "fb_project_id", "3-0": "fb_source_id", "3-1": "ID of a source", "3-2": "integer", "2-2": "integer", "0-2": "string (100)", "1-2": "enum (\"project\", \"source\", \"type\")", "0-3": "yes", "0-1": "Text of the promotion code. In most cases this is an ID that is used in an external system.", "1-1": "An internal description", "2-1": "ID of a project", "4-0": "fb_type_id", "4-2": "integer", "1-3": "yes", "4-1": "ID of a payment type" }, "cols": 4, "rows": 5 } [/block] [block:callout] { "type": "warning", "title": "Mandatory fields", "body": "Exactly one field of \"fb_project_id\", \"fb_source_id\", \"fb_type_id\" must be set." } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}