{"_id":"563a7d21a19edf0d009723a3","project":"55dd0853d2d97337001800e2","category":{"_id":"55e4e0ee3325e60d007fbeea","project":"55dd0853d2d97337001800e2","version":"55de36ec9067202b00de0015","pages":["55ea2a3c0b48a121002ab404","55ea2a66ba33bc3500b28ce0","563a7d21a19edf0d009723a3"],"__v":3,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-08-31T23:19:10.911Z","from_sync":false,"order":20,"slug":"events","title":"Events"},"version":{"_id":"55de36ec9067202b00de0015","__v":33,"project":"55dd0853d2d97337001800e2","createdAt":"2015-08-26T22:00:12.384Z","releaseDate":"2015-08-26T22:00:12.383Z","categories":["55de36ed9067202b00de0016","55de36ed9067202b00de0017","55de36ed9067202b00de0018","55df7dcd437b3f0d004ba204","55e4e014177b6e0d00333141","55e4e01fe252ac0d00303a99","55e4e05240cda60d003bad67","55e4e070177b6e0d00333142","55e4e0753325e60d007fbee6","55e4e0803325e60d007fbee7","55e4e086177b6e0d00333143","55e4e0a1177b6e0d00333144","55e4e0aa3325e60d007fbee8","55e4e0b140cda60d003bad6b","55e4e0bae252ac0d00303a9d","55e4e0c5177b6e0d00333145","55e4e0ee3325e60d007fbeea","55e4e0fae252ac0d00303a9e","55e4e100177b6e0d00333147","55f85c8ba3271b0d00498d55","56092e1ac5cff70d007d0131","564b64a3ee12850d0095866e","564b64b5791099170071e9ea","565cd0bfd18ae50d007183d8","565f5f5d6bafd40d0030a063","565f790d6bafd40d0030a09f","56611c464851190d003f9f5d","56637d5b7988ab0d00d0522e","56637d687988ab0d00d0522f","567835df6928b40d009dd650","56e59c043c29b117008dae5b","5704013559c5190e000ab646","572be252de40590e00026934","58af1bf6ebd7370f0078ba09","5cdad81d912ece0039e9a939"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"parentDoc":null,"__v":40,"githubsync":"","user":"55dd080d0efd5821000d53b3","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-04T21:48:17.742Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Resource Specifications\",\n  \"body\": \"An Event will contain a full copy of the resource under the resource key. The resource object will contain an `object` key which will be the name of the PayStand resource. A full spec can be found under that resource's API docs. For example, if the object is `payment` you can find the full specs under [Payment resource](doc:the-payment-resource).\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Events\",\n  \"body\": \"Any changes to properties in the following PayStand resources will cause an event to be emitted to a registered client system: [Customer](doc:retrieve-customer), [Payment](doc:retrieve-payment), [Refund](doc:retrieve-refund), [Dispute](doc:retrieve-dispute), [Withdrawal](doc:retrieve-withdrawal)\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Configuring event webhooks\",\n  \"body\": \"Event webhook can be configured on a per-customer basis by updating the [Customer's settings](doc:customer-settings).\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Security Consideration\",\n  \"body\": \"PayStand highly recommends that customers verify that any received HTTP POST event callback originated at PayStand by [retrieving the event back](doc:retrieve-event) from its systems by using the supplied id.\"\n}\n[/block]\n## Response\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"1-0\": \"object\",\n    \"2-0\": \"resource\",\n    \"4-0\": \"diff.previous\",\n    \"6-0\": \"urls\",\n    \"7-0\": \"created\",\n    \"8-0\": \"lastUpdated\",\n    \"5-0\": \"diff.changes\",\n    \"0-1\": \"The unique identifier for the event.\",\n    \"1-1\": \"Will have value \\\"event\\\" indicating that the object is an event response.\",\n    \"8-1\": \"The date the event was last updated.\",\n    \"7-1\": \"The date the event was created.\",\n    \"6-1\": \"An array of urls the event is registered to be sent to.\",\n    \"4-1\": \"The previous state of the resource before the updates.\",\n    \"5-1\": \"An object containing the key-value pairs of parameters that have changed during the resource update.\",\n    \"2-1\": \"Embedded resource object. This is the current resource after any updates.\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"3-0\": \"resource.object\",\n    \"3-1\": \"This value will determine the resource that this event is for. \\nFor example: `payment` will represent a [Payment resource](doc:the-payment-resource).\\n**A full spec of attributes can be found under the corresponding resources page.**\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"resource\\\": {\\n    \\\"object\\\": \\\"payment\\\",\\n    \\\"id\\\": \\\"3kramjln354zmhcl17bfft6j\\\",\\n    \\\"amount\\\": \\\"15.00\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"externalId\\\": \\\"pay01\\\",\\n    \\\"payerId\\\": \\\"h2ficw8bkirmlece404ulf14\\\",\\n    \\\"payer\\\": {\\n      \\\"object\\\": \\\"customer\\\",\\n      \\\"id\\\": \\\"h2ficw8bkirmlece404ulf14\\\",\\n      \\\"name\\\": \\\"Christina C\\\",\\n      \\\"email\\\": \\\"cchen+test:::at:::paystand.com\\\",\\n      \\\"address\\\": {\\n        \\\"street1\\\": \\\"41 Grandview St Unit C\\\",\\n        \\\"city\\\": \\\"Santa Cruz\\\",\\n        \\\"state\\\": \\\"CA\\\",\\n        \\\"postalCode\\\": \\\"95060\\\",\\n        \\\"country\\\": \\\"USA\\\"\\n      }\\n    },\\n    \\\"refunds\\\": [],\\n    \\\"disputes\\\": [],\\n    \\\"fees\\\": [{...}],\\n    \\\"holds\\\": [{...}],\\n    \\\"sourceId\\\": \\\"31e48fdzmvidlxmdqr23r1op\\\",\\n    \\\"sourceType\\\": \\\"Card\\\",\\n    \\\"ownerId\\\": \\\"0c7c56vbmzcwiw94wdl9k1ec\\\",\\n    \\\"status\\\": \\\"posted\\\",\\n    \\\"created\\\": \\\"2016-09-09T18:37:51.000Z\\\",\\n    \\\"lastUpdated\\\": \\\"2016-09-09T18:37:54.000Z\\\",\\n    \\\"customValues\\\": []\\n  },\\n  \\\"diff\\\": {\\n    \\\"previous\\\": {\\n      \\\"object\\\": \\\"payment\\\",\\n      \\\"id\\\": \\\"3kramjln354zmhcl17bfft6j\\\",\\n      \\\"amount\\\": \\\"15.00\\\",\\n      \\\"currency\\\": \\\"USD\\\",\\n      \\\"externalId\\\": \\\"pay01\\\",\\n      \\\"payerId\\\": \\\"h2ficw8bkirmlece404ulf14\\\",\\n      \\\"payer\\\": {\\n        \\\"object\\\": \\\"customer\\\",\\n        \\\"id\\\": \\\"h2ficw8bkirmlece404ulf14\\\",\\n        \\\"name\\\": \\\"Christina C\\\",\\n        \\\"email\\\": \\\"cchen+test@paystand.com\\\",\\n        \\\"address\\\": {\\n          \\\"street1\\\": \\\"41 Grandview St Unit C\\\",\\n          \\\"city\\\": \\\"Santa Cruz\\\",\\n          \\\"state\\\": \\\"CA\\\",\\n          \\\"postalCode\\\": \\\"95060\\\",\\n          \\\"country\\\": \\\"USA\\\"\\n        }\\n      },\\n      \\\"refunds\\\": [],\\n      \\\"disputes\\\": [],\\n      \\\"fees\\\": [\\n        {..}\\n      ],\\n      \\\"holds\\\": [\\n        {..}\\n      ],\\n      \\\"sourceId\\\": \\\"31e48fdzmvidlxmdqr23r1op\\\",\\n      \\\"sourceType\\\": \\\"Card\\\",\\n      \\\"ownerId\\\": \\\"0c7c56vbmzcwiw94wdl9k1ec\\\",\\n      \\\"status\\\": \\\"processing\\\",\\n      \\\"created\\\": \\\"2016-09-09T18:37:51.000Z\\\",\\n      \\\"lastUpdated\\\": \\\"2016-09-09T18:37:52.000Z\\\",\\n      \\\"customValues\\\": []\\n    },\\n    \\\"changes\\\": {\\n      \\\"holds\\\": [\\n        {..}\\n      ],\\n      \\\"status\\\": \\\"posted\\\",\\n      \\\"lastUpdated\\\": \\\"2016-09-09T18:37:54.000Z\\\"\\n    }\\n  },\\n  \\\"urls\\\": [\\n    \\\"http://requestb.in/w1oosfw1\\\"\\n  ],\\n  \\\"created\\\": \\\"2016-09-09T18:37:55.000Z\\\",\\n  \\\"lastUpdated\\\": \\\"2016-09-09T18:37:55.000Z\\\",\\n  \\\"status\\\": \\\"active\\\",\\n  \\\"id\\\": \\\"g6lq7pdu0mjqhsmwidxu5xmu\\\",\\n  \\\"object\\\": \\\"event\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Payment Event\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"events-basics","type":"basic","title":"Event resource"}
[block:callout] { "type": "info", "title": "Resource Specifications", "body": "An Event will contain a full copy of the resource under the resource key. The resource object will contain an `object` key which will be the name of the PayStand resource. A full spec can be found under that resource's API docs. For example, if the object is `payment` you can find the full specs under [Payment resource](doc:the-payment-resource)." } [/block] [block:callout] { "type": "success", "title": "Events", "body": "Any changes to properties in the following PayStand resources will cause an event to be emitted to a registered client system: [Customer](doc:retrieve-customer), [Payment](doc:retrieve-payment), [Refund](doc:retrieve-refund), [Dispute](doc:retrieve-dispute), [Withdrawal](doc:retrieve-withdrawal)" } [/block] [block:callout] { "type": "warning", "title": "Configuring event webhooks", "body": "Event webhook can be configured on a per-customer basis by updating the [Customer's settings](doc:customer-settings)." } [/block] [block:callout] { "type": "danger", "title": "Security Consideration", "body": "PayStand highly recommends that customers verify that any received HTTP POST event callback originated at PayStand by [retrieving the event back](doc:retrieve-event) from its systems by using the supplied id." } [/block] ## Response [block:parameters] { "data": { "0-0": "id", "1-0": "object", "2-0": "resource", "4-0": "diff.previous", "6-0": "urls", "7-0": "created", "8-0": "lastUpdated", "5-0": "diff.changes", "0-1": "The unique identifier for the event.", "1-1": "Will have value \"event\" indicating that the object is an event response.", "8-1": "The date the event was last updated.", "7-1": "The date the event was created.", "6-1": "An array of urls the event is registered to be sent to.", "4-1": "The previous state of the resource before the updates.", "5-1": "An object containing the key-value pairs of parameters that have changed during the resource update.", "2-1": "Embedded resource object. This is the current resource after any updates.", "h-0": "Parameter", "h-1": "Description", "3-0": "resource.object", "3-1": "This value will determine the resource that this event is for. \nFor example: `payment` will represent a [Payment resource](doc:the-payment-resource).\n**A full spec of attributes can be found under the corresponding resources page.**" }, "cols": 2, "rows": 9 } [/block] [block:code] { "codes": [ { "code": "{\n \"resource\": {\n \"object\": \"payment\",\n \"id\": \"3kramjln354zmhcl17bfft6j\",\n \"amount\": \"15.00\",\n \"currency\": \"USD\",\n \"externalId\": \"pay01\",\n \"payerId\": \"h2ficw8bkirmlece404ulf14\",\n \"payer\": {\n \"object\": \"customer\",\n \"id\": \"h2ficw8bkirmlece404ulf14\",\n \"name\": \"Christina C\",\n \"email\": \"cchen+test@paystand.com\",\n \"address\": {\n \"street1\": \"41 Grandview St Unit C\",\n \"city\": \"Santa Cruz\",\n \"state\": \"CA\",\n \"postalCode\": \"95060\",\n \"country\": \"USA\"\n }\n },\n \"refunds\": [],\n \"disputes\": [],\n \"fees\": [{...}],\n \"holds\": [{...}],\n \"sourceId\": \"31e48fdzmvidlxmdqr23r1op\",\n \"sourceType\": \"Card\",\n \"ownerId\": \"0c7c56vbmzcwiw94wdl9k1ec\",\n \"status\": \"posted\",\n \"created\": \"2016-09-09T18:37:51.000Z\",\n \"lastUpdated\": \"2016-09-09T18:37:54.000Z\",\n \"customValues\": []\n },\n \"diff\": {\n \"previous\": {\n \"object\": \"payment\",\n \"id\": \"3kramjln354zmhcl17bfft6j\",\n \"amount\": \"15.00\",\n \"currency\": \"USD\",\n \"externalId\": \"pay01\",\n \"payerId\": \"h2ficw8bkirmlece404ulf14\",\n \"payer\": {\n \"object\": \"customer\",\n \"id\": \"h2ficw8bkirmlece404ulf14\",\n \"name\": \"Christina C\",\n \"email\": \"cchen+test@paystand.com\",\n \"address\": {\n \"street1\": \"41 Grandview St Unit C\",\n \"city\": \"Santa Cruz\",\n \"state\": \"CA\",\n \"postalCode\": \"95060\",\n \"country\": \"USA\"\n }\n },\n \"refunds\": [],\n \"disputes\": [],\n \"fees\": [\n {..}\n ],\n \"holds\": [\n {..}\n ],\n \"sourceId\": \"31e48fdzmvidlxmdqr23r1op\",\n \"sourceType\": \"Card\",\n \"ownerId\": \"0c7c56vbmzcwiw94wdl9k1ec\",\n \"status\": \"processing\",\n \"created\": \"2016-09-09T18:37:51.000Z\",\n \"lastUpdated\": \"2016-09-09T18:37:52.000Z\",\n \"customValues\": []\n },\n \"changes\": {\n \"holds\": [\n {..}\n ],\n \"status\": \"posted\",\n \"lastUpdated\": \"2016-09-09T18:37:54.000Z\"\n }\n },\n \"urls\": [\n \"http://requestb.in/w1oosfw1\"\n ],\n \"created\": \"2016-09-09T18:37:55.000Z\",\n \"lastUpdated\": \"2016-09-09T18:37:55.000Z\",\n \"status\": \"active\",\n \"id\": \"g6lq7pdu0mjqhsmwidxu5xmu\",\n \"object\": \"event\"\n}", "language": "json", "name": "Payment Event" } ], "sidebar": true } [/block]