Toshl Developer

Start payment process

Start a new payment process. The return status depends on the method type.

POST /me/payments

Required scope:

Parameters

type
required
string

Payment type.

Possible values: apple, google, microsoft, g2s, adyen, amazon, bitpay, paypal, unknown
brand
optional
string

Brand of payment type. Only valid for adyen payment, ignored otherwise.

issuer
optional
string

Issuer of brand payment type. Only valid for adyen payment, ignored otherwise.

period
required
string

Pro period duration.

Possible values: monthly, yearly, 3-years
promo
optional
string

Promo code used with the payment. Discount is calculated by the backend.

vat
optional
string

VAT information.

receipt
optional
object

Payment receipt. Only valid for apple, google and microsoft payment types, ignored for other types.

data
required
string

Payment receipt data.

signature
optional
string

Payment receipt signature. Required for android payment type.

perks
optional
array

One or more selected perks. Can be one t-shirt and one bag max.

type
optional
string

Perk type

Possible values: t-shirt, bag
size
optional
string

T-shirt size. Available only for type t-shirt, ignored otherwise.

Possible values: s, m, l, xl, xxl
model
optional
string

T-shirt model. Available only for type t-shirt, ignored otherwise.

Possible values: woman, man
address
optional
object

Address where perk will be shipped. Only available for payments that offer perks.

name
optional
string

Name of the person that will receive the perk.

address
required
string

Address where the perk will be sent.

Request

$ curl https://api.toshl.com/me/payments \
  -H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{json}'

Response

HTTP/1.1 201 Created
Location: https://api.toshl.com/me/payments/42