1.1.0 • Published 3 years ago

growth-template-api-typescript v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

MGM API

Endpoints

Available endpoints

  • Upsert affiliate

    POST /api/v1/affiliates

    { email: 'affiliate@email' }

If any payments subscription exists, this must return affiliate coupon

    {
        "coupon": "LU3214MGM"
    }
  • List coupon usage

    GET /api/v1/affiliates/coupon/COUPON_CODE/usage

It will list all coupon usage for resmed products

[
    {
        "date": "2020-12-02 18:36:21",
        "status": "A",
        "clientName": "Luciano"
    },
    {
        "date": "2020-12-02 18:42:19",
        "status": "A",
        "clientName": "Luciano"
    }
]

Orders statuses:

  • A: Waiting Payment
  • N: Abandoned
  • C: Canceled
  • P: Paid
  • F: Finished
  • E: Shipped

Create a new TGT sharable link

Create a sharable link on sanar.link for a given course_slug and user_id

[Post] /api/v1/trial/link

{
  "user_id": "5d5c4e40ee0453001c4541da",
  "course_slug": "course_slug"
}

Response:

{
  "link": "http://sanar.link/YwBcJ"
}

Validation

user_id and course_slug are required, when not provided, will return 400 error.

{
  "errors": [
    {
      "value": "5d5c4e40ee0453001c4541da___",
      "msg": "o campo user_id deve ter 24 caracteres",
      "param": "user_id",
      "location": "body"
    },
    {
      "value": "",
      "msg": "o campo course_slug deve ser informado",
      "param": "course_slug",
      "location": "body"
    }
  ]
}