Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

GET /billing/settings

Allow user to retrieve payment settings

Parameters

Parameter

Type

Description

Response

{
  "data": {
    "stripe": {
      "publishable_key": "2342342"
    }
  }
}

POST /billing/sources?room_code=abc&provider_id=12312

Allow user to add a new payment source to their account

Parameters

Parameter

Type

Location

Description

type

String

"card" for credit card, more to be supported later e.g bitcoin,.. (no need???)

token

String

token obtain from Stripe after posting card detail to api.stripe.com

room_code

String

Query string

provider_id

String

Query string

(optional)

Response

{
  "data": {
        "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
          "type": "card",
          "brand": "Visa",
          "country": "US",
          "exp_month": 8,
          "exp_year": 2017,
          "funding": "credit",
          "last4": "4242",
          "name": "Jack Sparrow",
          "is_default": true
  }
}

DELETE /billing/sources/:id

Allow user to delete payment source from his account

Parameters

Parameter

Type

Description

id

String

Payment source id

Response

{
  "data": []
}

GET /billing/sources?room_code=abc&provider_id=12312

Allow user to retrieve all payment sources from their account

Parameters

Parameter

Type

Location

Description

type

String

(optional) "card" for credit card, more to be supported later e.g bitcoin,..

room_code

String

Query string

provider_id

String

Query string

(optional)

Response

{
  "data": [
        {
          "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
          "type": "card",
          "brand": "Visa",
          "exp_month": 8,
          "exp_year": 2017,
          "last4": "4242",
          "name": "Jack Sparrow",
          "is_default": true
        },
        {
          "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
          "type": "card",
          "brand": "Visa",
          "exp_month": 8,
          "exp_year": 2017,
          "last4": "4242",
          "name": "JackSparrow",
          "is_default": false
        }
  ]
}

GET /billing/sources/:id (new)

Allow user to retrieve a payment source from their account

Parameters

Parameter

Type

Description

id

String

Payment source id

Response

{
  "data": {
        "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
          "type": "card",
          "brand": "Visa",
          "exp_month": 8,
          "exp_year": 2017,
          "last4": "4242",
          "name": "Jack Sparrow",
          "is_default": true
  }
}

PUT /billing/sources/:id

Allow user to make this card as default card

Parameters

Parameter

Type

Description

is_default

int

1

room_code

String

If it’s CC app, we need to pass this parameter

provider_id

String

If it’s FS app, then we need to pass this parameter

Response

{
  "data": {
    "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
    "type": "card",
    "brand": "Visa",
    "exp_month": 8,
    "exp_year": 2017,
    "last4": "4242",
    "name": "Jack Sparrow",
    "is_default": true

  }
}

POST /billing/invoices/process

Allow user to process invoice

Parameters

Parameter

Type

Description

promo_code

String

Coupon code

intake_id

String

Required - intake id to apply coupon code to

create_invoice

int

1

Response

{
  "data": {
    "currency": "USD",

    "consultation": {
      "description": "30 mins",
      "amount": 30,
      "duration": 30,
      "id": "58244a53-0f28-4ff9-bdbc-7468ac1f0144"
    },
    "coupon": {
      "id": "10_percents_1479363579",
      "object": "coupon",
      "amount_off": null,
      "created": 1479363580,
      "currency": null,
      "duration": "once",
      "duration_in_months": null,
      "livemode": false,
      "max_redemptions": null,
      "metadata": [

      ],
      "percent_off": 10,
      "redeem_by": null,
      "times_redeemed": 0,
      "valid": true
    },
    "amount_due": 27
  }
}
  • No labels