{"_id":"5c4029652d3b1e004bd27dec","project":"550f74bb6fc8130d0038aad3","version":{"_id":"550f75de61d9d30d00af9e01","__v":17,"project":"550f74bb6fc8130d0038aad3","forked_from":"550f74bb6fc8130d0038aad6","createdAt":"2015-03-23T02:09:34.221Z","releaseDate":"2015-03-23T02:09:34.221Z","categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3"},"category":{"_id":"5c402942010f0d001496dded","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2019-01-17T07:05:38.139Z","from_sync":false,"order":9,"slug":"realtime-notifications","title":"Data Subscriptions"},"user":"56ddd4424acab82000ae9d30","__v":17,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-01-17T07:06:13.654Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"JF4DQ2NE1\",\n  \"subscribed\": \"account:AC-F930QD8A2RRR\",\n  \"notifyTarget\": \"https://www.potatoes.com/webhook1\",\n  \"createdAt\": 1548368619000,\n  \"failure\": null,\n  \"failCount\": 0\n}","name":""}]},"settings":"","examples":{"codes":[]},"method":"post","apiSetting":"5c50b085aae6150014b3e80e","auth":"required","params":[{"_id":"5c402cfb7fb4c200271da9e5","ref":"","in":"body","required":false,"desc":"The [SRN](doc:srns) for the object being subscribed/listened to. Whenever this referenced object is updated, the callback will get triggered","default":"","type":"string","name":"subscribeTo"},{"_id":"5c402cfb7fb4c200271da9e4","ref":"","in":"body","required":false,"desc":"The HTTP callback URI to notify when the subscribed object has been updated","default":"","type":"string","name":"notifyTarget"}],"url":"/v3/subscriptions"},"isReference":true,"order":1,"body":"This creates a new webhook subscription. Once created, Wyre will notify the target URL using HTTP(s) with a JSON payload that indicates the object has been updated. Payloads are lightweight with only two identifiers, see [below](#json-payload)\n\nYou may subscribe to [Accounts](doc:account-resource), [Transfers](doc:transfer-resources), and [payment methods](doc:payment-types). In some cases, a subscription may be created automatically. If you pass a callback URI to the [Create Transfer API](doc:create-transfer), for example, the callback will be implicitly created when the transfer is initiated.\n\nAll updates will eventually result in callbacks. However, the number of callbacks may be less than the number of individual updates, as we debounce the outbound requests for protection.\n[block:api-header]\n{\n  \"title\": \"JSON Payload\"\n}\n[/block]\nWhen the callback is triggered, the payload will contain a JSON object with 2 fields:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`subscriptionId`\",\n    \"1-0\": \"`trigger`\",\n    \"0-1\": \"The same ID returned when the subscription was created\",\n    \"1-1\": \"The SRN of the object which triggered the callback (the same SRN assigned via `subscribeTo`)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"subscriptionId\\\": \\\"JF4DQ2NE1\\\",\\n  \\\"trigger\\\": \\\"account:AC-AAABBCC22\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIt is your responsibility to reach back out to the Wyre API with your credentials to retrieve the updated object.\n\nAt any time if you would like to halt the webhooks, you may [delete the subscription](doc:delete-subscription).","excerpt":"Receive HTTP webhooks when subscribed objects are updated","slug":"subscribe-webhook","type":"endpoint","title":"Subscribe Webhook"}

postSubscribe Webhook

Receive HTTP webhooks when subscribed objects are updated

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

subscribeTo:
string
The [SRN](doc:srns) for the object being subscribed/listened to. Whenever this referenced object is updated, the callback will get triggered
notifyTarget:
string
The HTTP callback URI to notify when the subscribed object has been updated

Result Format


Documentation

This creates a new webhook subscription. Once created, Wyre will notify the target URL using HTTP(s) with a JSON payload that indicates the object has been updated. Payloads are lightweight with only two identifiers, see [below](#json-payload) You may subscribe to [Accounts](doc:account-resource), [Transfers](doc:transfer-resources), and [payment methods](doc:payment-types). In some cases, a subscription may be created automatically. If you pass a callback URI to the [Create Transfer API](doc:create-transfer), for example, the callback will be implicitly created when the transfer is initiated. All updates will eventually result in callbacks. However, the number of callbacks may be less than the number of individual updates, as we debounce the outbound requests for protection. [block:api-header] { "title": "JSON Payload" } [/block] When the callback is triggered, the payload will contain a JSON object with 2 fields: [block:parameters] { "data": { "0-0": "`subscriptionId`", "1-0": "`trigger`", "0-1": "The same ID returned when the subscription was created", "1-1": "The SRN of the object which triggered the callback (the same SRN assigned via `subscribeTo`)" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "{\n\t\"subscriptionId\": \"JF4DQ2NE1\",\n \"trigger\": \"account:AC-AAABBCC22\"\n}", "language": "json" } ] } [/block] It is your responsibility to reach back out to the Wyre API with your credentials to retrieve the updated object. At any time if you would like to halt the webhooks, you may [delete the subscription](doc:delete-subscription).