Payments

All payments endpoints have path prefix /payments-service.

Example of main payments doc

{
  "_id": "shping_payments_plans",
  "currency": "aud",
  "list": [
    {
      "id": "basic",
      "name": "BASIC",
      "cost": 0,
      "hidden": false,
      "commitment_period": 0,
      "description": "Basic plan",
      "modules": [],
      "coin_rate": 0,
      "upgrade_description": "You are currently on the Basic plan and have limited access to product analytics and promotional opportunities. Upgrade now!",
      "description_list": [
        {
          "label": "GTIN",
          "value": "Unlimited"
        },
        {
          "label": "Product catalogue",
          "value": true
        },
        {
          "label": "Ingredients and Raw Materials",
          "value": true
        },
        {
          "label": "Availability Map",
          "value": false
        },
        {
          "label": "Engagement and Consumer Analytics",
          "value": false
        },
        {
          "label": "Reviews",
          "value": false
        },
        {
          "label": "Shoutouts",
          "value": false
        },
        {
          "label": "Shping bot",
          "value": false
        },
        {
          "label": "Rewards",
          "value": false
        },
        {
          "label": "Advanced Engagement (ToDo cards)",
          "value": false
        }
      ]
    },
    {
      "id": "light",
      "cost": 195,
      "name": "LIGHT",
      "hidden": false,
      "coin_rate": 0.1,
      "upgrade_description": "You are currently on the Light plan and have limited access to product analytics and promotional opportunities. Upgrade now!",
      "description": "Lite plan",
      "commitment_period": 52,
      "modules": [
        "product360",
        "reviews"
      ],
      "description_list": [
        {
          "label": "GTIN",
          "value": "1-20"
        },
        {
          "label": "Product catalogue",
          "value": true
        },
        {
          "label": "Ingredients and Raw Materials",
          "value": true
        },
        {
          "label": "Availability Map",
          "value": true
        },
        {
          "label": "Engagement and Consumer Analytics",
          "value": true
        },
        {
          "label": "Reviews",
          "value": true
        },
        {
          "label": "Shoutouts",
          "value": false
        },
        {
          "label": "Shping bot",
          "value": false
        },
        {
          "label": "Rewards",
          "value": false
        },
        {
          "label": "Advanced Engagement (ToDo cards)",
          "value": false
        }
      ]
    },
    {
      "id": "pro",
      "cost": 395,
      "name": "PRO",
      "description": "Standart plan",
      "coin_rate": 0.2,
      "hidden": false,
      "commitment_period": 52,
      "upgrade_description": "You are currently on the Pro plan and have limited access to product analytics and promotional opportunities. Upgrade now!",
      "modules": [
        "product360",
        "reviews",
        "rewards"
      ],
      "description_list": [
        {
          "label": "GTIN",
          "value": "21-500"
        },
        {
          "label": "Product catalogue",
          "value": true
        },
        {
          "label": "Ingredients and Raw Materials",
          "value": true
        },
        {
          "label": "Availability Map",
          "value": true
        },
        {
          "label": "Engagement and Consumer Analytics",
          "value": true
        },
        {
          "label": "Reviews",
          "value": true
        },
        {
          "label": "Shoutouts",
          "value": true
        },
        {
          "label": "Shping bot",
          "value": true
        },
        {
          "label": "Rewards",
          "value": true
        },
        {
          "label": "Advanced Engagement (ToDo cards)",
          "value": true
        }
      ]
    },
    {
      "id": "pro-corp",
      "name": "PRO-CORP",
      "description": "Pro plan",
      "upgrade_description": "C​orp-Pro is our top level, you already have access to all Shping's great features​!",
      "cost": 495,
      "hidden": false,
      "coin_rate": 0.3,
      "commitment_period": 52,
      "modules": [
        "product360",
        "reviews",
        "livechat",
        "rewards"
      ],
      "description_list": [
        {
          "label": "GTIN",
          "value": "501-999"
        },
        {
          "label": "Product catalogue",
          "value": true
        },
        {
          "label": "Ingredients and Raw Materials",
          "value": true
        },
        {
          "label": "Availability Map",
          "value": true
        },
        {
          "label": "Engagement and Consumer Analytics",
          "value": true
        },
        {
          "label": "Reviews",
          "value": true
        },
        {
          "label": "Shoutouts",
          "value": true
        },
        {
          "label": "Shping bot",
          "value": true
        },
        {
          "label": "Rewards",
          "value": true
        },
        {
          "label": "Advanced Engagement (ToDo cards)",
          "value": true
        }
      ]
    }
  ],
  "type": "system_doc"
}

User stripe card

Set the card by token

PUT /payments-service/user/card/:token
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
TODO

Delete the card

DELETE /payments-service/user/card
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Read actual billing plans

Read this plans

GET /payments-service/billing_plans
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "currency": "aud",
  "id": "shping_payments_plans",
  "list": [
    {
      "commitment_period": 0,
      "cost": 0,
      "description": "Basic plan",
      "description_list": {
        "Advanced Engagement (ToDo cards)": false,
        "Availability Map": false,
        "Engagement and Consumer Analytics": false,
        "GTIN": "Unlimited",
        "Ingredients and Raw Materials": true,
        "Product catalogue": true,
        "Reviews": false,
        "Rewards": false,
        "Shoutouts": false,
        "Shping bot": false
      },
      "hidden": false,
      "id": "basic",
      "modules": [],
      "name": "BASIC",
      "coin_rate": 0
    },
    {
      "commitment_period": 52,
      "cost": 195,
      "description": "Lite plan",
      "description_list": {
        "Advanced Engagement (ToDo cards)": false,
        "Availability Map": true,
        "Engagement and Consumer Analytics": true,
        "GTIN": "1-20",
        "Ingredients and Raw Materials": true,
        "Product catalogue": true,
        "Reviews": true,
        "Rewards": false,
        "Shoutouts": false,
        "Shping bot": false
      },
      "hidden": false,
      "id": "light",
      "modules": [
        "product360",
        "reviews"
      ],
      "name": "LIGHT",
      "coin_rate": 0.1
    },
    {
      "commitment_period": 52,
      "cost": 395,
      "description": "Standart plan",
      "description_list": {
        "Advanced Engagement (ToDo cards)": true,
        "Availability Map": true,
        "Engagement and Consumer Analytics": true,
        "GTIN": "21-500",
        "Ingredients and Raw Materials": true,
        "Product catalogue": true,
        "Reviews": true,
        "Rewards": true,
        "Shoutouts": true,
        "Shping bot": true
      },
      "hidden": false,
      "id": "pro",
      "modules": [
        "product360",
        "reviews",
        "rewards"
      ],
      "name": "PRO",
      "coin_rate": 0.2
    },
    {
      "commitment_period": 52,
      "cost": 495,
      "description": "Pro plan",
      "description_list": {
        "Advanced Engagement (ToDo cards)": true,
        "Availability Map": true,
        "Engagement and Consumer Analytics": true,
        "GTIN": "501-999",
        "Ingredients and Raw Materials": true,
        "Product catalogue": true,
        "Reviews": true,
        "Rewards": true,
        "Shoutouts": true,
        "Shping bot": true
      },
      "hidden": false,
      "id": "pro-corp",
      "modules": [
        "product360",
        "reviews",
        "livechat",
        "rewards"
      ],
      "name": "PRO-CORP",
      "coin_rate": 0.3
    }
  ]
}

Participant Billing Plan

Read Current Billing Plan

Retrieves active billing plan of current participant. Returns JSON with plan and payment card info.

GET /payments-service/participants/current/billing_plan
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "plan": "lite",
  "card": {
    "brand": "MasterCard",
    "last4": "8210",
    "exp_month": 12,
    "exp_year": 2019,
    "name": "JANE DOE"
  }
}

Change Billing Plan

Change Billing Plan

Change active billing plan for current participant. Takes JSON object containing new plan name (basic, lite, standard or pro) and payment card details. For plans other than basic payment card is required. The default modules for plans:

* basic - hasn't active modules;
* lite has product360 and reviews;
* standard has product360, reviews, rewards;
* pro has product360, reviews, chat, rewards.

The default modules may be set in sys.config. The participant can upgrade the plan at any time. The plan can only be downgraded after 52 weeks of using the current plan. When the plan is changed, the payment is recalculated and fees for used rewards campaign coins. The coins will be convert to сurrency depending on the plan:

* lite - 1point = 0.1 (usd);
* standard - 1point = 0.2 (usd);
* pro - 1point = 0.3 (usd).

The actual currency may be set in sys.config. Default is usd. Payment depends of the participant's plan:

* basic - 0;
* lite - 195;
* standard - 395;
* pro - 495.
PUT /payments-service/participants/current/billing_plan
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "plan": "standard",
  "card": {
    "number": "5200828282828210",
    "exp_month": 12,
    "exp_year": 2019,
    "name": "JANE DOE",
    "cvc": 323
  }
}

Set email for user's notification

User, who was activate the billing plan (or set new card) can set/remove additionals emails for receiving notifications.

PUT /payments-service/participants/notifications/email
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
email Email (“foo@bar.com”) - optional
user_id User ID (“urn:authenticateit:user:email:foo@bar.com”) - optional. If id is user_id then email will be read from user profile
Example Response
[
  "some_user@gmail.com",
  "foo@bar.com",
  "foo1@bar.com"
]

Remove email

POST /payments-service/participants/notifications/delete_email
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
email string Email
Example Response
[
  "some_user@gmail.com",
  "foo1@bar.com"
]

Get participant payment history

API to read payment history of current participant. Returns JSON list of history entries. Each entry has timestamp ts, type of the payment in payment_type field (either subscription or rewards), amount field and card object field. Card object has last four digits of the card number in the last4 field.

GET /payments-service/participants/current/payment_history
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
  {
    "card_barnd": "MasterCard",
    "card_exp_month": 12,
    "card_exp_year": 2019,
    "card_last4": "8210",
    "card_name": "JANE DOE",
    "currency": "usd",
    "rows": [
      {
        "amount": "395.00",
        "description": "Selected plan - \"standard\". Paid period: from 2017-03-24 to 2017-04-24"
      },
      {
        "amount": "20.00",
        "description": "Used rewards coins. Paid period: from 2017-03-24 to 2017-04-24"
      }
    ],
    "status": "Payment successful",
    "summary_amount": "415.00",
    "ts": "2017-04-23T21:10:03Z"
  }
]

Participant Ethereum Account

Read Ethereum Account

Retrieves Ethereum account information of current participant. Returns JSON with address field (checksum encoded Ethereum address). If participant has no Ethereum account configured, address may be null or missing in the response.

GET /payments-service/participants/current/ethereum
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"
}

Update Ethereum Account

Change Ethereum account information of current participant. Accepts JSON object with field address (Ethereum address, or null to clear the address). Responds with updated participant's Ethereum account information. Participant must have no active reward campaigns to change Ethereum address.

PUT /payments-service/participants/current/ethereum
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "address": null
}

results matching ""

    No results matching ""