Gift subscription

You can include a feature in your application that enables users to gift subscriptions to others. This can help boost revenue and attract new users.

How it works

A user can gift a subscription to an existing user in your system by specifying their account information or to a new user by specifying their email address. In this case, the user sending the gift can hide their name or add a text message to the gift email notification. After creating a subscription, the gift recipient becomes its owner. The created subscription is of the one-time payment renewal type.

Interaction flow when gifting a subscription to an existing user:

Interaction flow when gifting a subscription to a new user:

How to set it up

You can set up the ability to gift a subscription in your app:

Gift to an existing user

  1. Implement in your application an interface for purchasing a gift subscription with the following elements:
    • fields for entering data of the gift recipient
    • field for entering a message from the sender (optional)
    • option to select anonymous sending (optional)
    • elements for selecting a subscription plan (optional)

  1. Implement receiving a token after filling in the gift details when proceeding to the payment. To do this, pass the purchase.subscription.gift object to the Create token API call with the following parameters:
    • recipient — ID of the subscription recipient. Required.
    • email — recipient’s email address. Required.
    • redirect_url — redirect URL. Provide a link to a page with additional information about the gifted subscription or to the main page of the project.
Notice
If the redirect_url is not passed in the token, the gift recipient will not be able to navigate to the gifted subscription from the gift notification email.

  • Additionally, you can pass the following parameters in the purchase.subscription object:
    • gift.anonymous — whether the gift was sent anonymously. If true, the sender’s name is hidden in the email notification. Defaults to false.
    • gift.message — message from the sender of the gift. Sent in an email notification of the gifted subscription.
    • plan_id — subscription plan ID.

Example of a request to receive a token:

Copy
Full screen
Small screen
{
  "purchase": {
    "checkout": {
      "currency": "USD",
      "amount": 10
    },
    "subscription": {
      "gift": {
        "recipient": "test_recipient_v1",
        "email": "recipient_email@email.com",
        "redirect_url": "https://example.com/",
        "anonymous": true,
        "message": "Happy birthday!"
      }
    }
  },
  "settings": {
    "currency": "USD",
    "language": "en",
    "project_id": 16184,
    "ui": {
      "components": {
        "virtual_currency": {
          "custom_amount": true
        }
      },
      "desktop": {
        "virtual_item_list": {
          "button_with_price": true,
          "layout": "list"
        }
      },
      "size": "medium"
    }
  },
  "user": {
    "country": {
      "allow_modify": true,
      "value": "US"
    },
    "age": 19,
    "email": {
      "value": "john.smith@mail.com"
    },
    "id": {
      "value": "user_2"
    },
    "name": {
      "value": "John Smith"
    }
  }
}
  1. Using the token received in step 2, open the payment interface in a new window, in an Iframe, or using Pay Station Embed.

Gift to a new user

  1. Implement in your application an interface for purchasing a gift subscription with the following elements:
    • fields for entering the email address of the gift recipient
    • field for entering a message from the sender (optional)
    • option to select anonymous sending (optional)
    • elements for selecting a subscription plan (optional)
  2. Implement the new user creation and assign an ID to it in your system.
  3. Create a link to activate the user account.
Note
Subscriptions may only be sold to authorized users.
  1. Implement receiving a token after filling in the gift details when proceeding to payment. To do this, pass the purchase.subscription.gift object with the parameters to the Create token API call:
    • recipient — the subscription recipient ID created in step 2.
    • email — recipient’s email address.
    • redirect_url — activation URL created in step 3.
Notice
If the redirect_url is not passed in the token, the gift recipient will not be able to navigate to the gifted subscription from the gift notification email.

  • Additionally, you can pass the following parameters in the purchase.subscription object:
    • gift.anonymous — whether the gift was sent anonymously. If true, the sender’s name is hidden in the email notification. Defaults to false.
    • gift.message — message from the sender of the gift. Sent in an email notification of the gifted subscription.
    • plan_id — subscription plan ID.

Example of a request to receive a token:

Copy
Full screen
Small screen
{
  "purchase": {
    "checkout": {
      "currency": "USD",
      "amount": 10
    },
    "subscription": {
      "gift": {
        "recipient": "test_recipient_v1",
        "email": "recipient_email@email.com",
        "redirect_url": "https://example.com/",
        "anonymous": true,
        "message": "Happy birthday!"
      }
    }
  },
  "settings": {
    "currency": "USD",
    "language": "en",
    "project_id": 16184,
    "ui": {
      "components": {
        "virtual_currency": {
          "custom_amount": true
        }
      },
      "desktop": {
        "virtual_item_list": {
          "button_with_price": true,
          "layout": "list"
        }
      },
      "size": "medium"
    }
  },
  "user": {
    "country": {
      "allow_modify": true,
      "value": "US"
    },
    "age": 19,
    "email": {
      "value": "john.smith@mail.com"
    },
    "id": {
      "value": "user_2"
    },
    "name": {
      "value": "John Smith"
    }
  }
}
  1. Using the token received in step 4, open the payment interface in a new window, in an Iframe, or using Pay Station Embed.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!
Last updated: January 22, 2024

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!