Toshl Developer

Payments

Payments made by the user. If a payment is not available for the client, a 403 Forbidden error is returned.

Resource representation

{
  "id": "42",
  "type": "apple",
  "period": "monthly",
  "amount": 1.99,
  "currency": "USD",
  "discount": 10,
  "status": "completed",
  "modified": "2012-09-04T13:55:15Z",
  "refund": false,
  "subscription": true
}

Properties

id
readonly
string

Payment id.

type
read, write
string

Payment type.

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

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

issuer
read, write
string

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

method
read, write
string

Payment method used by the user (mastercard, visa etc.). Only valid for adyen, null for the rest.

period
read, write
string

Pro period duration.

Possible values: custom, monthly, yearly, 3-years
level
read, write
string

Paying users have different access depending on the subscription level.

Possible values: pro, medici
amount
readonly
number

Amount payed (does not include discount).

currency
readonly
string

Currency used for payment.

Regex: [A-Z0-9_]{2,10}
discount
readonly
number

Discount amount in percentages.

Minimum: > 0
Maximum: < 100
promo
read, write
string

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

vat
read, write
object

VAT information.

name *
read, write
string

Company name

address *
read, write
string

Company address

city *
read, write
string

Company city

post *
read, write
string

Company postal code

state
read, write
string

Company state

country *
read, write
string

Company country

vat *
read, write
string

Company VAT number

receipt
read, write
object

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

data *
read, write
string

Payment receipt data.

signature
read, write
string

Payment receipt signature. Required for android payment type.

status
readonly
string

Payment status. If set to select_perk, the user should select the desired perk. If set to missing_address the user should enter the shipping address used to send the perk (t-shirt, bag).

Possible values: new, redirect, verifying, missing_address, completed, error, refund-pending, refunded, cancelled, refused, pending
modified
readonly
string

Specifies when the payment was last modified.

perks
read, write
array

One or more selected perks.

type
read, write
string

Perk type

Possible values: t-shirt, bag, socks
size
read, write
string

T-shirt size (type t-shirt - s,m,l,xl,xxl), socks size (type socks - s,m,l)

Possible values: s, m, l, xl, xxl
model
read, write
string

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

Possible values: woman, man
address
read, write
object

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

name
read, write
string

Name of the person that will receive the perk.

address
read, write
string

Address where the perk will be sent.

trial
readonly
boolean

True if user wants to use trial.

redirect
read, write
string

If status is redirect this field will contain the redirect url

refunduble
readonly
boolean

True if refund is available.

subscription
readonly
boolean

True if subscription is enabled.

make_refund
read, write
boolean

Set to true to receive a refund. This will also cancel the pro account for the user.

Default value: false
cancel_subscription
read, write
boolean

Set to true to cancel subscription for payment. This will not cancel the pro account for the user.

Default value: false

* denotes required field/parameter.