Create Flow card
Description
Create the Flow gift card.
POST
https://impact.dots.eco/api/v1/flow-card/add
Please check Headers and authorization.
Example body
{
"app_token": "1-f2b086b3",
"sku": "123kdfgf",
"expiration_date": "2025-12-31",
"recipient_email": "test@test.com",
"recipient_name": "Flow user",
"from": "John doe",
"message": "Lorem Ipsum"
}
Parameters
app_token
- required*, string
- The application token.
sku
- required*, string
- The sku of flow card.
expiration_date
- optional, string
- The flow gift card expiration date. It should not more than 5 years from now, minimum: tomorrow, default is 5 years from creation, if given must be a valid date in YYYY-mm-dd format.
recipient_email
- optional, string
- A valid email address of recipient.
recipient_name
- optional, string
- The name of the recipient.
from
- optional, string
- The name of the from user.
message
- optional, string
- The message.
Example request
curl --location 'https://impact.dots.eco/api/v1/flow-card/add' \
--header 'auth-token: YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"app_token": "1-f2b086b3",
"sku": "123kdfgf",
"expiration_date": "2025-12-31",
"recipient_email": "test@test.com",
"recipient_name": "Flow user",
"from": "John doe",
"message": "Lorem Ipsum"
}'
Key/Value pairs response body
"success": [string]
- Return request status (true/false)."response": [array]
- Return the response only when the success is true."errors": [array]
- Return error message if exists. Shows only when success is false.
Example response
Success
{
"success": true,
"response": {
"sku": "123kdfgf",
"title": "Lorem flow card",
"redeem_url": "https://flow.dots.eco",
"card_image": "https://impact.dots.eco/sites/default/files/2024-08/Safeguarding%20Wildlife%20on%20the%20Borders%20of%20Kafue%20National%20Park.png",
"redeem_instructions": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.",
"code": "1-123kdfgf-10.3-e8ba0fc0",
"card_id": "28",
"amount": "10.30",
"expiration_date": "2025-12-31 00:00:00",
"recipient_email": "test@test.com",
"recipient_name": "Flow user",
"from": "John doe",
"message": "Lorem Ipsum"
}
}
Status: 200 Ok
Possible error responses
Application token is not provided
{
"success": false,
"errors": {
"app_token": [
"The app_token is required."
]
}
}
Status: 422 Unprocessable Entity
Invalid application token
{
"success": false,
"errors": {
"app_token": [
"The app_token is invalid."
]
}
}
Status: 422 Unprocessable Entity
SKU is not provided
{
"success": false,
"errors": {
"sku": [
"The sku is required."
]
}
}
Status: 422 Unprocessable Entity
Invalid SKU
{
"success": false,
"errors": {
"sku": [
"The sku is invalid."
]
}
}
Status: 422 Unprocessable Entity
Invalid expiration_date provided
{
"success": false,
"errors": {
"expiration_date": [
"The expiration_date is invalid."
]
}
}
Status: 422 Unprocessable Entity
Invalid date format for expiration_date
{
"success": false,
"errors": {
"expiration_date": [
"The expiration_date format should be YYYY-mm-dd."
]
}
}
Status: 422 Unprocessable Entity
Minimum date validation error (if current date is provided 2024-09-13)
{
"success": false,
"errors": {
"expiration_date": [
"The minimum expiration_date should be 2024-09-14."
]
}
}
Status: 422 Unprocessable Entity
Maximum date validation error (if date is provided more than 5 year from now 2030-09-13)
{
"success": false,
"errors": {
"expiration_date": [
"The maximum expiration_date should be 2029-09-13."
]
}
}
Status: 422 Unprocessable Entity
Invalid recipient_email provided
{
"success": false,
"errors": {
"recipient_email": [
"The recipient_email is invalid."
]
}
}
Status: 422 Unprocessable Entity
Allow Flow gift card purchase checkbox is disabled for the company
{
"message": "Access denied. Flow gift card purchase is not allowed for specified application's company."
}
Status: 403 Forbidden
Wrong auth-token
{
"message": "Access denied. You are not a manager of specified application."
}
Status: 403 Forbidden