Data API
Endpoint specification
Data API allows partners to retrieve information about your users and any orders associated with your Partner ID.
Request method: GET
Endpoint URL:
Sandbox: | Endpoint |
---|---|
Partner's Orders | https://partner-sandbox.wert.io/api/external/orders |
Partner's Users | https://partner-sandbox.wert.io/api/external/users |
Production: | Endpoint |
---|---|
Partner's Orders | https://partner.wert.io/api/external/orders |
Partner's Users | https://partner.wert.io/api/external/users |
Headers:
Key: X-API-KEY
Value: wert-sbox-xxxxxxxxxxxx
You must replace 'wert-sbox-xxxxxxxxxxxx' with your personal API key. You can request this by contacting our partner support.
Request parameters
The Data API can make use of the following parameters:
Parameter | Data Type | Description |
---|---|---|
limit | Number | The number of orders you want to retrieve. Defaults to 10. |
offset | Number | Skips specified number of orders. Defaults to 0. |
search_by | String with order or click ID | Allows setting an order or click ID to find a specific order. |
order_by | asc / desc | Allows setting the order as ascending or descending. Defaults to desc. |
Examples Of Request
Retrieving the ten most recent orders:
curl -X GET 'https://partner.wert.io/api/external/orders' \
-H 'X-API-KEY: wert-sbox-xxxxxxxxxxxx'
Retrieving the 20 orders which were made after the first 10 orders:
curl -X GET -G 'https://partner.wert.io/api/external/orders' \
-H 'X-API-KEY: wert-prod-aaaaaaaaaaaaaaa'\
-d 'limit=20' \
-d 'offset=10' \
-d 'order_by=asc'
Retrieving an order using the click ID:
curl -X GET -G 'https://partner.wert.io/api/external/orders' \
-H 'X-API-KEY: wert-prod-aaaaaaaaaaaaaaa'\
-d 'search_by=click_id'
Response parameters
The response contains the following:
Variable | Description |
---|---|
success | Whether the request was successfully processed and produced a result |
data | An object with the orders which were retrieved from the API |
total | The total number of orders which match the criteria for the search |
Order parameters
Each order in the data object will include the following:
Variable | Description | Filterable | Filter name |
---|---|---|---|
order_id | The unique identifier for the order in Wert's database | Yes | search_by |
click_id | The identifier you pass to Wert when you initialise the widget | Yes | search_by |
currency | The base currency for the order | No | |
currency_amount | The value of the order in the base currency | No | |
crypto | The crypto asset which was purchased or sent to the smart contract | Yes | commodity |
crypto_amount | The amount of the crypto asset which was purchased or sent to the smart contract | No | |
user_id | The unique identifier for the user in Wert's database | Yes | user_ids |
status | The status of the order | Yes | status |
card_id | The unique identifier for the card which was used in Wert's database | Yes | card_id |
created_at | Timestamp of when the order was created (UTC) | No | |
changed_at | Timestamp of when the order was last updated (UTC) | No | |
partner_fee | The USD amount of fees which were collected as partner revenue | No | |
partner_fee_percent | The percentage of fees which were collected as partner revenue | No | |
wert_fee | The USD amount of fees which were collected as Wert revenue | No | |
wert_fee_percent | The percentage of fees which were collected as Wert revenue | No | |
tx_id | Blockchain transaction hash | Yes | tx_id |
processed_through | The acquirer who processed the card payment | No | |
card_brand | Visa or Mastercard | No | |
fail_reason | Payment error code, refer to description of error code. | Yes | fail_reason |
payment_type | The authentication method of the payment, e.g "3ds_v2" | Yes | |
additional_data | Additional information | No | |
sc_input_data | Smart contract Input data that was sent in the transaction | No |
The following order statuses are available:
Status | Description |
---|---|
success | The order was successful and has been sent on the blockchain |
failed | The order has failed and will not be sent on the blockchain |
cancelled | The payment for the order was processed but the order was later cancelled |
pending | The order is being processed but it hasn't been sent on the blockchain |
progress | The order is being processed but payment has not yet been completed |
created | The order has been created but payment has not yet been processed |
Payment Error Codes
Error code | Description |
---|---|
4000 | We weren’t able to charge the user’s card and the order was not completed. The user can try again. |
4001 | The transaction failed due to an incorrect CVV/CVC. The user can try again ensuring they enter the correct CVV/CVC. |
4002 4010 4012 | Payment was declined by the card issuer. The user should contact them for further details. |
4003 | Incorrect card details. The user can try again ensuring they enter valid card details. |
4004 | Insufficient balance. The user should add funds to their card and try again. |
4005 | Card limit was exceeded. The user should use a different card to complete their purchase. |
4011 | Card validation failed. The user can add a valid card and try again. |
4013 | We weren’t able to charge the user’s card and the order was not completed. The user should contact support for further assistance. |
User parameters
Variable | Description | Filterable | Filter Name |
---|---|---|---|
user_id | User's Wert ID | Yes | user_ids |
country | User's KYC country | Yes | kyc_country |
phone_country | Users phone country | Yes | phone_country |
lkyc_status | Users non-document verification status | Yes | lkyc_status |
fkyc_status | Users document verification status | Yes | fkyc_status |
banned | Is the user banned by Wert | No |
Example of Response
Response from Orders endpoint:
{
"success": true,
"data": [
{
"order_id": "01HNWX0HSK85WW9W5A3RZS1BBH",
"click_id": "82960ad6-e52c-48b1-9293-5658709da384",
"currency": "usd",
"currency_amount": 1.07,
"crypto": "matic.simple.polygon",
"crypto_amount": 1.28928444,
"user_id": "01HNWWXZ8FQ9FSH08A8ACHH7K1",
"status": "success",
"card_id": "01HNWWZ6E1T0BJT46H35M42JT7",
"created_at": "2024-02-05 15:08:29",
"changed_at": "2024-02-05 15:08:32",
"partner_fee": 0,
"partner_fee_percent": 0,
"wert_fee": 0.04,
"wert_fee_percent": 0.04,
"tx_id": "0xbef4262a7c56f64423b80e4342ee4309595dcdb78d8c201fd752dc1d9c29c19e",
"processed_through": "safecharge",
"card_brand": "VISA",
"fail_reason": "",
"payment_type": "non_3ds",
"additional_data": null
},
{
"order_id": "01HMXQ6AN3XKQAZHPRSM13ED3X",
"click_id": "click_id",
"currency": "usd",
"currency_amount": 5,
"crypto": "tt_goerli.erc-20.ethereum",
"crypto_amount": 4.36051815,
"user_id": "01HMVWY6V7B9ZHA6P2C48AP5C7",
"status": "failed",
"card_id": "01HMVX1NJB6QDW5YKXA13HB2CG",
"created_at": "2024-01-24 12:30:20",
"changed_at": "2024-01-24 12:30:27",
"partner_fee": 0,
"partner_fee_percent": 0,
"wert_fee": 0.19,
"wert_fee_percent": 0.04,
"tx_id": "",
"processed_through": "safecharge",
"card_brand": "VISA",
"fail_reason": "4007",
"payment_type": "unknown",
"additional_data": null
}
],
"total": 2
}
Response from Users endpoint:
{
"success": true,
"data": [
{
"user_id": "01HPPKVTKC3VKXC95ADA8M5JTA",
"country": "FRA",
"phone_country": "FR",
"lkyc_status": "success",
"fkyc_status": "not initiated",
"banned": ""
},
{
"user_id": "01HNWG569RD40SF98FHSS3BTAN",
"country": "",
"phone_country": "US",
"lkyc_status": "not initiated",
"fkyc_status": "not initiated",
"banned": ""
}
],
"total": 2
}
Updated 4 months ago