{"__v":2,"_id":"55ff89778c0c9d0d00dcac52","category":{"__v":6,"_id":"55ff80fd9e7ccf0d000a1d93","pages":["55ff8db80e2b090d0086335f","56107fd153dea90d001ecb62","56108055bb9d920d00303e71","5610818bbb9d920d00303e73","563e1ed31347cf0d004182c3","563e1f78d6db8d17008389af"],"project":"54e405191e51932d006abc39","version":"55fa37c88065a10d004e5bb6","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-21T04:01:01.927Z","from_sync":false,"order":4,"slug":"transactions","title":"Transactions"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"54e405191e51932d006abc39","user":"54e4044e8ef7552300409dcb","version":{"__v":7,"_id":"55fa37c88065a10d004e5bb6","project":"54e405191e51932d006abc39","createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["55fa37ca8065a10d004e5bb7","55fa37ca8065a10d004e5bb8","55fa37ca8065a10d004e5bb9","55fa37ca8065a10d004e5bba","55fca6bf34ae7c0d00ab8ea0","55ff80fd9e7ccf0d000a1d93","560220af7435de0d00fabd0d","56107f21bb9d920d00303e70","563e184077681a0d00d96a02","56fafc6596ec7e0e002ac85f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"REST V3","version_clean":"3.1.0","version":"3.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-21T04:37:11.954Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl -X POST -H \"X-SP-USER-IP: 127.0.0.1\" -H \"X-SP-USER: oauth_40e63a68ef9a11e6834f0a81c1ab804f|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\" -H \"Content-Type: application/json\" -d '{\n  \"to\": {\n    \"type\": \"ACH-US\",\n    \"id\": \"589dc0bdab6ce7001f7f89e8\"\n  },\n  \"amount\": {\n    \"amount\": 1000.1,\n    \"currency\": \"USD\"\n  },\n  \"extra\": {\n    \"ip\": \"192.168.0.1\",\n    \"webhook\": \"http://requestb.in/v95k4jv9\",\n    \"note\": \"Test transaction\",\n    \"process_on\": 0,\n    \"supp_id\": \"1122444\",\n    \"other\": {\n      \"attachments\": []\n    }\n  }\n}' \"https://sandbox.synapsepay.com/api/3/users/589dc8817562960020cb00c9/nodes/589dcbd27e0887001f940611/trans\"","name":""}]},"method":"post","results":{"codes":[{"name":"","code":"{\n    \"_id\": \"589dcefa704068001f80fdb4\",\n    \"_links\": {\n        \"self\": {\n            \"href\": \"https://uat-api.synapsefi.com/v3.1/users/589dc8817562960020cb00c9/nodes/589dcbd27e0887001f940611/trans/589dcefa704068001f80fdb4\"\n        }\n    },\n    \"_v\": 2,\n    \"amount\": {\n        \"amount\": \"1000.10\",\n        \"currency\": \"USD\"\n    },\n    \"client\": {\n        \"id\": \"589acd9ecb3cd400fa75ac06\",\n        \"name\": \"SynapseFI\"\n    },\n    \"extra\": {\n        \"created_on\": 1486737146832,\n        \"ip\": \"192.168.0.1\",\n        \"latlon\": \"0,0\",\n        \"note\": \"Test transaction\",\n        \"process_on\": 1486737146832,\n        \"supp_id\": \"1122444\",\n        \"webhook\": \"http://requestb.in/v95k4jv9\"\n    },\n    \"fees\": [\n        {\n            \"fee\": \"0.00\",\n            \"note\": \"Facilitator Fee\",\n            \"to\": {\n                \"id\": \"None\"\n            }\n        }\n    ],\n    \"from\": {\n        \"id\": \"589dcbd27e0887001f940611\",\n        \"nickname\": \"Fake Account\",\n        \"type\": \"ACH-US\",\n        \"user\": {\n            \"_id\": \"589dc8817562960020cb00c9\",\n            \"legal_names\": []\n        }\n    },\n    \"recent_status\": {\n        \"date\": 1486737146832,\n        \"note\": \"Transaction Created.\",\n        \"status\": \"CREATED\",\n        \"status_id\": \"1\"\n    },\n    \"timeline\": [\n        {\n            \"date\": 1486737146832,\n            \"note\": \"Transaction Created.\",\n            \"status\": \"CREATED\",\n            \"status_id\": \"1\"\n        }\n    ],\n    \"to\": {\n        \"id\": \"589dc0bdab6ce7001f7f89e8\",\n        \"nickname\": null,\n        \"type\": \"ACH-US\",\n        \"user\": {\n            \"_id\": {\n                \"$oid\": \"\"\n            },\n            \"legal_names\": []\n        }\n    }\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"5573b11e91ce6e190023b76a","ref":"","in":"body","required":true,"desc":"Receiving node type","default":"","type":"string","name":"to.type"},{"_id":"55fa4d6f764f5021009506c9","ref":"","in":"body","required":true,"desc":"Receiving node ID","default":"","type":"string","name":"to.id"},{"_id":"55fa3f2a17b9d00d00969ea3","ref":"","in":"body","required":true,"desc":"Amount user wishes to send","default":"","type":"double","name":"amount.amount"},{"_id":"55ff8bdb1503430d007cc657","ref":"","in":"body","required":true,"desc":"Currency of the transaction amount","default":"","type":"string","name":"amount.currency"},{"_id":"55ff8bdb1503430d007cc656","ref":"","in":"body","required":false,"desc":"ID supplied to the transaction","default":"","type":"string","name":"extra.supp_id"},{"_id":"55ff8bdb1503430d007cc655","ref":"","in":"body","required":false,"desc":"Memo tagged with the transaction","default":"","type":"string","name":"extra.note"},{"_id":"55ff8bdb1503430d007cc654","ref":"","in":"body","required":false,"desc":"[DEPRECATED] Webhook supplied to the transaction. Use [subscription webhooks](doc:subscriptions) instead.","default":"","type":"string","name":"extra.webhook"},{"_id":"55ff8bdb1503430d007cc653","ref":"","in":"body","required":false,"desc":"When the transaction should be processed. The value is the delta value. Which means when 1 is supplied it means that the transaction will be processed tomorrow.","default":"0","type":"int","name":"extra.process_on"},{"_id":"55ff8bdb1503430d007cc652","ref":"","in":"body","required":true,"desc":"IP address of the user device while creating transaction","default":"","type":"string","name":"extra.ip"},{"_id":"55ff8bdb1503430d007cc651","ref":"","in":"body","required":false,"desc":"Array of padded base64 of attachments","default":"","type":"array_string","name":"extra.other.attachments"},{"_id":"55ff8bdb1503430d007cc650","ref":"","in":"body","required":false,"desc":"Fee associated with the transaction","default":"","type":"double","name":"fees[fee]"},{"_id":"55ff8bdb1503430d007cc64f","ref":"","in":"body","required":false,"desc":"Reason for the fee","default":"","type":"string","name":"fees[note]"},{"_id":"55ff8bdb1503430d007cc64e","ref":"","in":"body","required":false,"desc":"Node ID where the fee would be credited when the transaction settled. Fee node has to be SYNAPSE-US type always","default":"","type":"string","name":"fees[to].id"}],"url":"/users/:user_id/nodes/:node_id/trans"},"isReference":true,"order":3,"body":"[block:embed]\n{}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Transaction Settle Times\",\n  \"body\": \"In most cases, transactions do not settle immediately. See [here](https://help.synapsepay.com/hc/en-us/articles/205312588-How-long-does-a-transaction-take-to-settle-) for more details.\\n\\n*Note: transactions settle in sandbox in about 15 minutes.*\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Transaction Updates:\",\n  \"body\": \"Stay updated on the status of transactions with [Transaction Statuses](https://docs.synapsepay.com/docs/trans-resources#section-transaction-status) and [Transaction Codes](https://docs.synapsepay.com/docs/transaction-codes).\"\n}\n[/block]\n## Idempotent Requests\n\nTransactions POST call supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a transaction fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single charge is created.\n\nTo perform an idempotent request, attach a unique key to any POST request made to the API via the `X-SP-IDEMPOTENCY-KEY: <key>` header.\n\nRemember: The idempotency keys expire after 24 hours.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -H \\\"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\\\" -H \\\"X-SP-USER-IP: 216.3.128.12\\\" -H \\\"X-SP-USER: oauth-3203b663-1763-4833-af67-af19a751159f|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\\\" -H \\\"X-SP-IDEMPOTENCY-KEY: 1234678987654322345680\\\" -d '{\\n    \\\"to\\\":{\\n      \\\"type\\\":\\\"ACH-US\\\",\\n      \\\"id\\\":\\\"5739eda886c2735cc02d55d2\\\"\\n    },\\n    \\\"amount\\\":{\\n      \\\"amount\\\":1000,\\n      \\\"currency\\\":\\\"USD\\\"\\n    },\\n    \\\"extra\\\":{\\n      \\\"ip\\\":\\\"192.168.0.1\\\"\\n    }\\n}' \\\"https://sandbox.synapsepay.com/api/3/users/5770486c86c273414e90cdba/nodes/577d563486c2733dd03b1f01/trans\\\"\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"{\\n  \\\"error\\\": {\\n    \\\"en\\\": \\\"Unable to save object. Error: Idempotency key already used once.\\\"\\n  },\\n  \\\"error_code\\\": \\\"400\\\",\\n  \\\"http_code\\\": \\\"409\\\",\\n  \\\"success\\\": false\\n}\",\n      \"language\": \"json\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-transaction","type":"endpoint","title":"Create Transaction"}

postCreate Transaction


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

to.type:
required
string
Receiving node type
to.id:
required
string
Receiving node ID
amount.amount:
required
double
Amount user wishes to send
amount.currency:
required
string
Currency of the transaction amount
extra.supp_id:
string
ID supplied to the transaction
extra.note:
string
Memo tagged with the transaction
extra.webhook:
string
[DEPRECATED] Webhook supplied to the transaction. Use [subscription webhooks](doc:subscriptions) instead.
extra.process_on:
integer0
When the transaction should be processed. The value is the delta value. Which means when 1 is supplied it means that the transaction will be processed tomorrow.
extra.ip:
required
string
IP address of the user device while creating transaction
extra.other.attachments:
array of strings
Array of padded base64 of attachments
fees[fee]:
double
Fee associated with the transaction
fees[note]:
string
Reason for the fee
fees[to].id:
string
Node ID where the fee would be credited when the transaction settled. Fee node has to be SYNAPSE-US type always

Examples


Result Format


Documentation

[block:embed] {} [/block] [block:callout] { "type": "info", "title": "Transaction Settle Times", "body": "In most cases, transactions do not settle immediately. See [here](https://help.synapsepay.com/hc/en-us/articles/205312588-How-long-does-a-transaction-take-to-settle-) for more details.\n\n*Note: transactions settle in sandbox in about 15 minutes.*" } [/block] [block:callout] { "type": "info", "title": "Transaction Updates:", "body": "Stay updated on the status of transactions with [Transaction Statuses](https://docs.synapsepay.com/docs/trans-resources#section-transaction-status) and [Transaction Codes](https://docs.synapsepay.com/docs/transaction-codes)." } [/block] ## Idempotent Requests Transactions POST call supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a transaction fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single charge is created. To perform an idempotent request, attach a unique key to any POST request made to the API via the `X-SP-IDEMPOTENCY-KEY: <key>` header. Remember: The idempotency keys expire after 24 hours. [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -H \"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\" -H \"X-SP-USER-IP: 216.3.128.12\" -H \"X-SP-USER: oauth-3203b663-1763-4833-af67-af19a751159f|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\" -H \"X-SP-IDEMPOTENCY-KEY: 1234678987654322345680\" -d '{\n \"to\":{\n \"type\":\"ACH-US\",\n \"id\":\"5739eda886c2735cc02d55d2\"\n },\n \"amount\":{\n \"amount\":1000,\n \"currency\":\"USD\"\n },\n \"extra\":{\n \"ip\":\"192.168.0.1\"\n }\n}' \"https://sandbox.synapsepay.com/api/3/users/5770486c86c273414e90cdba/nodes/577d563486c2733dd03b1f01/trans\"", "language": "curl" }, { "code": "{\n \"error\": {\n \"en\": \"Unable to save object. Error: Idempotency key already used once.\"\n },\n \"error_code\": \"400\",\n \"http_code\": \"409\",\n \"success\": false\n}", "language": "json", "name": "" } ] } [/block]