Skip to content

Commit 98edf50

Browse files
committed
Document beneficiary information for transactions
1 parent 20f4a2b commit 98edf50

File tree

1 file changed

+139
-1
lines changed

1 file changed

+139
-1
lines changed

_transactions.md

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ An optional parameter `message` can also be sent which will overwrite the value
167167
Once the transaction is committed, its status will change to `processing`.
168168

169169
<aside class="notice">
170-
This must be done within the time window specified (in miliseconds) by the <a href="#parameters"><code>params.ttl</code></a> field of the transaction object.
170+
This must be done within the time window specified (in milliseconds) by the <a href="#parameters"><code>params.ttl</code></a> field of the transaction object.
171171
Attempting to commit a transaction past this timeframe results in a <a href="#errors">404 HTTP error</a>.
172172
</aside>
173173
<aside class="notice">
@@ -267,6 +267,144 @@ url | The URL of the 3DSecure confirmation request.
267267

268268
A webpage for 3DSecure confirmation for the user to interact with.
269269

270+
## Beneficiary Information
271+
272+
> Example of a transaction creation payload including `beneficiary` and `purpose` fields:
273+
274+
```json
275+
{
276+
"beneficiary": {
277+
"relationship": "child",
278+
"name": "Harper Wilson",
279+
"address": {
280+
"line1": "Bar",
281+
"zipCode": "12345",
282+
"city": "Braga",
283+
"country": "PT",
284+
"state": "PT-03"
285+
}
286+
},
287+
"purpose": "donations",
288+
"denomination": {
289+
"amount": "3000",
290+
"currency": "USD"
291+
},
292+
"destination": "[email protected]"
293+
}
294+
```
295+
296+
When creating a transaction, it may be required to send additional information
297+
regarding the beneficiary and purpose of the transaction.
298+
This is required if **both** the following conditions are met:
299+
300+
- The transaction is either a withdrawal to an external account (crypto networks, SEPA bank accounts, etc.) or a transfer to another user; and
301+
- The transaction amount is over _$3000 USD_ (or over $1000 USD, if the origin user is from Arizona, United States).
302+
303+
<aside class="notice">
304+
The threshold value is calculated from the <a href="#normalized">normalized</a> USD amount of the transaction,
305+
which can differ from the amount specified in the <code>denomination.amount</code> field
306+
if the transaction implies a currency conversion.
307+
</aside>
308+
<aside class="notice">
309+
Note: ACH withdrawals are <b>not required</b> to send beneficiary information,
310+
since we only support personal bank accounts, so the beneficiary (ACH account holder)
311+
is assumed to be the Uphold user who added that account.
312+
</aside>
313+
314+
The beneficiary information should be provided in the `beneficiary` object of the request payload.
315+
The `beneficiary.relationship` field must always be filled whenever beneficiary information is required.
316+
The other fields can be omitted if the data is already present in the Uphold platform
317+
(e.g. if the transaction is to an existing Uphold user, or the `beneficiary.relationship` is set to "myself").
318+
319+
The `relationship` field is a string reflecting the beneficiary's relationship to the transaction originator.
320+
Two particular types of transactions are recognized by the platform:
321+
business transactions (indicated by a `relationship` field with the value `business`)
322+
and personal transactions (indicated by the values `child`, `co_worker`, `friend`, `parent`, or `sibling`).
323+
The value `myself` can also be used when applicable.
324+
325+
Depending on the conditions of the transaction, additional fields may be required — namely, the beneficiary `name` and `address` (with subfields `city`, `country`, `line1`, `line2`, `state`, `zipCode`),
326+
as well as a `purpose` object indicating the reason for the transaction.
327+
328+
To obtain the beneficiary requirements (or validate the `beneficiary` object) when preparing a transaction,
329+
use the `?validate=true` parameter in the query string of the request to create a transaction.
330+
This will generate a validation error if any required beneficiary information is missing.
331+
Otherwise, the transaction will fail at the commit step with a similar error message.
332+
333+
<aside class="notice">
334+
Please note that at this moment, even with the <code>validate=true</code> parameter,
335+
the validation is only performed if a <code>beneficiary</code> object is passed.
336+
</aside>
337+
338+
> Example of including the beneficiary information when creating an uncommitted transaction (i.e. quote), alongside the remaining transaction data:
339+
340+
```bash
341+
curl 'https://api-sandbox.uphold.com/v0/me/cards/<card-id>/transactions' \
342+
-H 'authorization: Bearer <bearer-token>' \
343+
-H 'content-type: application/json' \
344+
-d '{ "beneficiary": { "relationship": "child", "name": "Harper Wilson", "address": { "line1": "Bar", "zipCode": "12345", "city": "Braga", "country": "PT", "state": "PT-03" } }, "purpose": "donations", "denomination": { "amount": "3000", "currency": "USD" }, "destination": "[email protected]" }'
345+
```
346+
347+
> Example of adding the beneficiary information when committing a previously created transaction:
348+
349+
```bash
350+
curl 'https://api-sandbox.uphold.com/v0/me/cards/<card-id>/transactions/<transaction-id>/commit' \
351+
-H 'authorization: Bearer <bearer-token>' \
352+
-H 'content-type: application/json' \
353+
-d '{ "beneficiary": { "relationship": "child", "name": "Harper Wilson", "address": { "line1": "Bar", "zipCode": "12345", "city": "Braga", "country": "PT", "state": "PT-03" } }, "purpose": "donations" }'
354+
```
355+
356+
> In both cases, incomplete beneficiary information will be reported in a format similar to this:
357+
358+
```json
359+
{
360+
"code": "validation_failed",
361+
"errors": {
362+
"beneficiary": {
363+
"code": "validation_failed",
364+
"errors": {
365+
"name": [
366+
{
367+
"code": "required",
368+
"message": "This value is required"
369+
}
370+
]
371+
}
372+
}
373+
}
374+
}
375+
```
376+
377+
The beneficiary information can be passed either when creating an uncommitted transaction (i.e. a quote)
378+
or when [committing it](#step-2-commit-transaction).
379+
380+
> Invalid beneficiary information will be reported like this:
381+
382+
```json
383+
{
384+
"code": "validation_failed",
385+
"errors": {
386+
"beneficiary": {
387+
"code": "validation_failed",
388+
"errors": {
389+
"name": [
390+
{
391+
"code": "invalid_beneficiary",
392+
"message": "The provided beneficiary is invalid"
393+
}
394+
]
395+
}
396+
}
397+
}
398+
}
399+
```
400+
401+
<aside class="notice">
402+
For regulatory compliance reasons, the beneficiary name is checked by a sanctions screening process,
403+
and is expected to consist entirely of characters in the Latin, Cyrillic, Greek or Georgian alphabets,
404+
along with a limited set of special characters.
405+
These validations may result in an <code>invalid_beneficiary</code> error.
406+
</aside>
407+
270408
## Cancel a Transaction
271409

272410
```bash

0 commit comments

Comments
 (0)