From a304bc5abfd06342a983e0f58098213d535ab2aa Mon Sep 17 00:00:00 2001 From: Ray2126 Date: Wed, 18 Oct 2023 21:08:24 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2092b40?= =?UTF-8?q?8d62b8ff4abac5d569273c3693c8056bb2c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/asset-transfers.html | 24 ++++++++++++++--- assets/js/search-data.json | 54 +++++++++++++++++++------------------- redirects.json | 2 +- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/api/asset-transfers.html b/api/asset-transfers.html index 43088fd3b..b7b696709 100644 --- a/api/asset-transfers.html +++ b/api/asset-transfers.html @@ -1,4 +1,4 @@ - Asset Transfers - Centrapay Docs Asset Transfers | Centrapay Docs Link Search Menu Expand Document

Asset Transfers

An asset transfer is an asynchronous exchange of an asset or an amount to a recipient.

A recipient is an existing Centrapay user or someone who can create an account to claim the asset transfer by verifying their phone number.

After an asset transfer is completed the recipientAlias, lastSentTo and message fields are scrubbed to avoid storing PII.

Contents

Asset Transfer lifecycle

Asset Transfer goes through different lifecycle stages.

State Description
created Asset transfer successfully created
sent Asset transfer notification (sms, email) was sent to a new user
expired Asset transfer expired as new user didn’t create his account and claimed the asset. This is very short lived state
returned Asset transfer expired and was returned to original owner
claimed Asset transfer was successfully completed

Create an Asset Transfer

Transfer an asset to a recipient. Some assets can be transfered only in whole (eg giftcards or tokens) while others can be transfered only in part (eg money).

POST /api/asset-transfers

Whole asset transfer

curl -X POST https://service.centrapay.com/api/asset-transfers \
+     Asset Transfers - Centrapay Docs       Asset Transfers | Centrapay Docs           Link      Search      Menu      Expand      Document       

Asset Transfers

An asset transfer is an asynchronous exchange of an asset or an amount to a recipient.

A recipient is an existing Centrapay user or someone who can create an account to claim the asset transfer by verifying their phone number.

After an asset transfer is completed the recipientAlias, lastSentTo and message fields are scrubbed to avoid storing PII.

Contents

Asset Transfer lifecycle

Asset Transfer goes through different lifecycle stages.

State Description
created Asset transfer successfully created
sent Asset transfer notification (sms, email) was sent to a new user
expired Asset transfer expired as new user didn’t create his account and claimed the asset. This is very short lived state
returned Asset transfer expired and was returned to original owner
claimed Asset transfer was successfully completed

Create an Asset Transfer

Transfer an asset to a recipient. Some assets can be transfered only in whole (eg giftcards or tokens) while others can be transfered only in part (eg money).

Some assets can be transferred without supplying a recipient. A url field will be returned in these cases. The url will link to a page to claim the asset.

POST /api/asset-transfers

Whole asset transfer

curl -X POST https://service.centrapay.com/api/asset-transfers \
   -H "X-Api-Key: $api_key" \
   -H "Content-Type: application/json" \
   -d '{
@@ -11,7 +11,12 @@
     "assetId": "sai2Pai7ohgongo",
     "value": "6000",
     "recipientAlias": "+642212312"
-  }'

Required Fields

Parameter Type Description
assetId String Id of a discrete asset to transfer or wallet to draw from.
recipientAlias String Phone number, email or handle of receiver.

Optional Parameters

Parameter Type Description
description String Shows up in transaction history against the transfer. 200 character limit.
message String A message which shows up in the SMS of the receiver. 100 character limit.
value BigNumber Amount to send. Required for money transfers. Units depend on the asset type.
senderName String Human readable name for the sender. 30 character limit.
suppressNotifications Boolean Suppress notifications from Centrapay (SMS/Email).

Example response payload

{
+  }'

Without Recipient

curl -X POST https://service.centrapay.com/api/asset-transfers \
+  -H "X-Api-Key: $api_key" \
+  -H "Content-Type: application/json" \
+  -d '{
+    "assetId": "sai2Pai7ohgongo"
+  }'

Required Fields

Parameter Type Description
assetId String Id of a discrete asset to transfer or wallet to draw from.

Optional Parameters

Parameter Type Description
recipientAlias String Phone number, email or handle of receiver.
description String Shows up in transaction history against the transfer. 200 character limit.
message String A message which shows up in the SMS of the receiver. 100 character limit.
value BigNumber Amount to send. Required for money transfers. Units depend on the asset type.
senderName String Human readable name for the sender. 30 character limit.
suppressNotifications Boolean Suppress notifications from Centrapay (SMS/Email).

Example response payload (With Recipient)

{
   "id": "M7Kn2stAxNa6ri7h",
   "status": "created",
   "value": "1000",
@@ -26,7 +31,20 @@
   "createdAt": "2020-05-01T12:30:00.000Z",
   "updatedAt": "2020-05-02T01:03:37.222Z",
   "suppressNotifications": false
-}

The above example has $10 left on a $60 dollar giftcard at the time of transfer.

Error Responses

Status Code Description
403 INSUFFICIENT_WALLET_BALANCE The value of the asset-transfer exceeds the balance on the wallet
403 QUOTA_EXCEEDED The transfer exceeds one or more spend quota limits. See Quota Error Response.
403 ASSET_NOT_ACTIVE The asset is not active and cannot be transferred.

Get an Asset Transfer

GET /api/asset-transfers/{assetTransferId}

curl https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h \
+}

The above example has $10 left on a $60 dollar giftcard at the time of transfer.

Example response payload (Without Recipient)

{
+  "id": "M7Kn2stAxNa6ri7h",
+  "status": "created",
+  "value": "1000",
+  "assetId": "YGRo6TYYSxH3js7",
+  "assetType": "centrapay.token.main",
+  "description": "Centrapay Token",
+  "message": "Happy birthday",
+  "senderName": "CentraCafe",
+  "createdAt": "2020-05-01T12:30:00.000Z",
+  "updatedAt": "2020-05-02T01:03:37.222Z",
+  "suppressNotifications": false,
+  "url": "https://app.centrapay.com/transfer/M7Kn2stAxNa6ri7h"
+}

Error Responses

Status Code Description
403 INSUFFICIENT_WALLET_BALANCE The value of the asset-transfer exceeds the balance on the wallet
403 QUOTA_EXCEEDED The transfer exceeds one or more spend quota limits. See Quota Error Response.
403 ASSET_NOT_ACTIVE The asset is not active and cannot be transferred.
403 RECIPIENT_MISSING The asset must be transferred with a recipient supplied.

Get an Asset Transfer

GET /api/asset-transfers/{assetTransferId}

curl https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h \
   -H "X-Api-Key: $api_key"

Example response payload (In-progress money transfer)

{
   "id": "M7Kn2stAxNa6ri7h",
   "status": "sent",
diff --git a/assets/js/search-data.json b/assets/js/search-data.json
index 1b900fbe3..8aeba7789 100644
--- a/assets/js/search-data.json
+++ b/assets/js/search-data.json
@@ -91,7 +91,7 @@
   },"15": {
     "doc": "Asset Transfers",
     "title": "Create an Asset Transfer",
-    "content": "Transfer an asset to a recipient. Some assets can be transfered only in whole (eg giftcards or tokens) while others can be transfered only in part (eg money). POST /api/asset-transfers Whole asset transfer . curl -X POST https://service.centrapay.com/api/asset-transfers \\ -H \"X-Api-Key: $api_key\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"assetId\": \"YGRo6TYYSxH3js7\", \"recipientAlias\": \"+642212312\" }' . Partial asset transfer . curl -X POST https://service.centrapay.com/api/asset-transfers \\ -H \"X-Api-Key: $api_key\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"assetId\": \"sai2Pai7ohgongo\", \"value\": \"6000\", \"recipientAlias\": \"+642212312\" }' . Required Fields . | Parameter | Type | Description | . | assetId | String | Id of a discrete asset to transfer or wallet to draw from. | . | recipientAlias | String | Phone number, email or handle of receiver. | . Optional Parameters . | Parameter | Type | Description | . | description | String | Shows up in transaction history against the transfer. 200 character limit. | . | message | String | A message which shows up in the SMS of the receiver. 100 character limit. | . | value | BigNumber | Amount to send. Required for money transfers. Units depend on the asset type. | . | senderName | String | Human readable name for the sender. 30 character limit. | . | suppressNotifications | Boolean | Suppress notifications from Centrapay (SMS/Email). | . Example response payload . { \"id\": \"M7Kn2stAxNa6ri7h\", \"status\": \"created\", \"value\": \"1000\", \"assetId\": \"YGRo6TYYSxH3js7\", \"assetType\": \"epay.nzd.main\", \"description\": \"$60 Giftcard\", \"message\": \"Happy birthday\", \"senderName\": \"My Cafe\", \"recipientAccountId\": \"9EDxUT91TMsUjoqoQeBuLQ\", \"claimedByAccountId\": \"9EDxUT91TMsUjoqoQeBuLQ\", \"recipientAlias\": \"+64212312345\", \"createdAt\": \"2020-05-01T12:30:00.000Z\", \"updatedAt\": \"2020-05-02T01:03:37.222Z\", \"suppressNotifications\": false } . The above example has $10 left on a $60 dollar giftcard at the time of transfer. Error Responses . | Status | Code | Description | . | 403 | INSUFFICIENT_WALLET_BALANCE | The value of the asset-transfer exceeds the balance on the wallet | . | 403 | QUOTA_EXCEEDED | The transfer exceeds one or more spend quota limits. See Quota Error Response. | . | 403 | ASSET_NOT_ACTIVE | The asset is not active and cannot be transferred. | . ",
+    "content": "Transfer an asset to a recipient. Some assets can be transfered only in whole (eg giftcards or tokens) while others can be transfered only in part (eg money). Some assets can be transferred without supplying a recipient. A url field will be returned in these cases. The url will link to a page to claim the asset. POST /api/asset-transfers Whole asset transfer . curl -X POST https://service.centrapay.com/api/asset-transfers \\ -H \"X-Api-Key: $api_key\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"assetId\": \"YGRo6TYYSxH3js7\", \"recipientAlias\": \"+642212312\" }' . Partial asset transfer . curl -X POST https://service.centrapay.com/api/asset-transfers \\ -H \"X-Api-Key: $api_key\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"assetId\": \"sai2Pai7ohgongo\", \"value\": \"6000\", \"recipientAlias\": \"+642212312\" }' . Without Recipient . curl -X POST https://service.centrapay.com/api/asset-transfers \\ -H \"X-Api-Key: $api_key\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"assetId\": \"sai2Pai7ohgongo\" }' . Required Fields . | Parameter | Type | Description | . | assetId | String | Id of a discrete asset to transfer or wallet to draw from. | . Optional Parameters . | Parameter | Type | Description | . | recipientAlias | String | Phone number, email or handle of receiver. | . | description | String | Shows up in transaction history against the transfer. 200 character limit. | . | message | String | A message which shows up in the SMS of the receiver. 100 character limit. | . | value | BigNumber | Amount to send. Required for money transfers. Units depend on the asset type. | . | senderName | String | Human readable name for the sender. 30 character limit. | . | suppressNotifications | Boolean | Suppress notifications from Centrapay (SMS/Email). | . Example response payload (With Recipient) . { \"id\": \"M7Kn2stAxNa6ri7h\", \"status\": \"created\", \"value\": \"1000\", \"assetId\": \"YGRo6TYYSxH3js7\", \"assetType\": \"epay.nzd.main\", \"description\": \"$60 Giftcard\", \"message\": \"Happy birthday\", \"senderName\": \"My Cafe\", \"recipientAccountId\": \"9EDxUT91TMsUjoqoQeBuLQ\", \"claimedByAccountId\": \"9EDxUT91TMsUjoqoQeBuLQ\", \"recipientAlias\": \"+64212312345\", \"createdAt\": \"2020-05-01T12:30:00.000Z\", \"updatedAt\": \"2020-05-02T01:03:37.222Z\", \"suppressNotifications\": false } . The above example has $10 left on a $60 dollar giftcard at the time of transfer. Example response payload (Without Recipient) . { \"id\": \"M7Kn2stAxNa6ri7h\", \"status\": \"created\", \"value\": \"1000\", \"assetId\": \"YGRo6TYYSxH3js7\", \"assetType\": \"centrapay.token.main\", \"description\": \"Centrapay Token\", \"message\": \"Happy birthday\", \"senderName\": \"CentraCafe\", \"createdAt\": \"2020-05-01T12:30:00.000Z\", \"updatedAt\": \"2020-05-02T01:03:37.222Z\", \"suppressNotifications\": false, \"url\": \"https://app.centrapay.com/transfer/M7Kn2stAxNa6ri7h\" } . Error Responses . | Status | Code | Description | . | 403 | INSUFFICIENT_WALLET_BALANCE | The value of the asset-transfer exceeds the balance on the wallet | . | 403 | QUOTA_EXCEEDED | The transfer exceeds one or more spend quota limits. See Quota Error Response. | . | 403 | ASSET_NOT_ACTIVE | The asset is not active and cannot be transferred. | . | 403 | RECIPIENT_MISSING | The asset must be transferred with a recipient supplied. | . ",
     "url": "/api/asset-transfers#create-an-asset-transfer",
     "relUrl": "/api/asset-transfers#create-an-asset-transfer"
   },"16": {
@@ -515,23 +515,23 @@
     "url": "/api/http-status-codes#5xx-server-error",
     "relUrl": "/api/http-status-codes#5xx-server-error"
   },"86": {
+    "doc": "Settlements",
+    "title": "Settlements",
+    "content": " ",
+    "url": "/api/section/settlements",
+    "relUrl": "/api/section/settlements"
+  },"87": {
     "doc": "Assets",
     "title": "Assets",
     "content": " ",
     "url": "/api/section/assets",
     "relUrl": "/api/section/assets"
-  },"87": {
-    "doc": "Merchants",
-    "title": "Merchants",
-    "content": " ",
-    "url": "/api/section/merchants",
-    "relUrl": "/api/section/merchants"
   },"88": {
-    "doc": "Integrations",
-    "title": "Integrations",
+    "doc": "Payment Requests",
+    "title": "Payment Requests",
     "content": " ",
-    "url": "/api/section/integrations",
-    "relUrl": "/api/section/integrations"
+    "url": "/api/section/payment-requests",
+    "relUrl": "/api/section/payment-requests"
   },"89": {
     "doc": "Accounts",
     "title": "Accounts",
@@ -539,17 +539,17 @@
     "url": "/api/section/accounts",
     "relUrl": "/api/section/accounts"
   },"90": {
-    "doc": "Payment Requests",
-    "title": "Payment Requests",
+    "doc": "Merchants",
+    "title": "Merchants",
     "content": " ",
-    "url": "/api/section/payment-requests",
-    "relUrl": "/api/section/payment-requests"
+    "url": "/api/section/merchants",
+    "relUrl": "/api/section/merchants"
   },"91": {
-    "doc": "Bank Accounts",
-    "title": "Bank Accounts",
+    "doc": "Batches",
+    "title": "Batches",
     "content": " ",
-    "url": "/api/section/bank-accounts",
-    "relUrl": "/api/section/bank-accounts"
+    "url": "/api/section/batches",
+    "relUrl": "/api/section/batches"
   },"92": {
     "doc": "Scanned Codes",
     "title": "Scanned Codes",
@@ -557,17 +557,17 @@
     "url": "/api/section/scanned-codes",
     "relUrl": "/api/section/scanned-codes"
   },"93": {
-    "doc": "Settlements",
-    "title": "Settlements",
+    "doc": "Integrations",
+    "title": "Integrations",
     "content": " ",
-    "url": "/api/section/settlements",
-    "relUrl": "/api/section/settlements"
+    "url": "/api/section/integrations",
+    "relUrl": "/api/section/integrations"
   },"94": {
-    "doc": "Batches",
-    "title": "Batches",
+    "doc": "Bank Accounts",
+    "title": "Bank Accounts",
     "content": " ",
-    "url": "/api/section/batches",
-    "relUrl": "/api/section/batches"
+    "url": "/api/section/bank-accounts",
+    "relUrl": "/api/section/bank-accounts"
   },"95": {
     "doc": "API Reference",
     "title": "API Reference",
diff --git a/redirects.json b/redirects.json
index 2c2b88832..3ef6157fb 100644
--- a/redirects.json
+++ b/redirects.json
@@ -1 +1 @@
-{"/accounts":"/api/accounts","/assets/asset-transfers":"/api/asset-transfers","/assets/":"/api/assets","/assets/asset-categories":"/api/assets","/api/asset-categories":"/api/assets","/auth":"/api/auth","/fiat":"/api/bank-accounts","/fiat/bank-accounts":"/api/bank-accounts","/fiat/bank-authorities":"/api/bank-accounts","/fiat/authorities":"/api/bank-accounts","/assets/discrete-assets":"/api/external-assets","/api/discrete-assets":"/api/external-assets","/api/batch-types/farmlands":"/api/batch-types/farmlands-external-asset","/fiat/funds-transfers":"/api/funds-transfers","/api/section/assets":"/api/assets","/api/section/merchants":"/api/merchants","/api/section/integrations":"/api/integrations","/api/section/accounts":"/api/accounts","/api/section/payment-requests":"/api/payment-requests","/api/section/bank-accounts":"/api/bank-accounts","/api/section/scanned-codes":"/api/scanned-codes","/api/section/settlements":"/api/settlements","/api/section/batches":"/api/batches","/api":"/api/introduction","/transacting":"/api/legacy-payment-requests","/api/transacting":"/api/legacy-payment-requests","/merchants":"/api/merchants","/api/payment-activities":"/api/payment-requests","/profile":"/api/profiles","/quotas":"/api/quotas","/settlements":"/api/settlements","/assets/wallets":"/api/wallets"}
\ No newline at end of file
+{"/accounts":"/api/accounts","/assets/asset-transfers":"/api/asset-transfers","/assets/":"/api/assets","/assets/asset-categories":"/api/assets","/api/asset-categories":"/api/assets","/auth":"/api/auth","/fiat":"/api/bank-accounts","/fiat/bank-accounts":"/api/bank-accounts","/fiat/bank-authorities":"/api/bank-accounts","/fiat/authorities":"/api/bank-accounts","/assets/discrete-assets":"/api/external-assets","/api/discrete-assets":"/api/external-assets","/api/batch-types/farmlands":"/api/batch-types/farmlands-external-asset","/fiat/funds-transfers":"/api/funds-transfers","/api/section/settlements":"/api/settlements","/api/section/assets":"/api/assets","/api/section/payment-requests":"/api/payment-requests","/api/section/accounts":"/api/accounts","/api/section/merchants":"/api/merchants","/api/section/batches":"/api/batches","/api/section/scanned-codes":"/api/scanned-codes","/api/section/integrations":"/api/integrations","/api/section/bank-accounts":"/api/bank-accounts","/api":"/api/introduction","/transacting":"/api/legacy-payment-requests","/api/transacting":"/api/legacy-payment-requests","/merchants":"/api/merchants","/api/payment-activities":"/api/payment-requests","/profile":"/api/profiles","/quotas":"/api/quotas","/settlements":"/api/settlements","/assets/wallets":"/api/wallets"}
\ No newline at end of file