Payments & Billing

Payments & Billing

Webshare has 2 main objects for managing payment & billing:

  • Payment Method:
    The payment method used in the payment process. Currently always is a credit/debit card.
  • Transaction:
    The transaction created when a payment is completed.

Payment Method

The payment method used in the payment process. Currently always is a credit/debit card.

Payment method object

The current payment method is limited to card transactions, however, additional payment options such as PayPal may be introduced in the future.

AttributesTypeDescription
idstring

Unique identifier of the payment method instance.

brandstring

Brand of the card. Could be mastercard, amex, visa, diners club, jcb or `unionpay

last4string

Last 4 digits of the card.

expiration_yearnumber

Expiration year of the card.

expiration_monthnumber

Expiration month of the card. 6 means June.

created_atstring

The timestamp of when the payment method was created.

In JSON format

payment_method_object.json
{
  "id": 1,
  "brand": "visa",
  "last4": "4242",
  "name": null,
  "expiration_year": 2023,
  "expiration_month": 6,
  "created_at": "2022-06-14T11:58:10.246406-07:00",
  "updated_at": "2022-06-14T11:58:10.246406-07:00"
}

Transaction

The transaction created when a payment is completed.

Transaction object

AttributesTypeDescription
idstring

Unique identifier of the transaction instance.

statusstring

Status of the object. Can be completed or refunded. Partial refunds will show up as refunded.

payment_methodobject

Nested payment method instance.

reasonstring

The reason of this transaction.

amountnumber

The amount of the transaction in USD.

refund_amountnumber

The amount refunded in USD.

refund_datestring

The date the last refund was issued. May be null if no refund was issued. If a user is refunded multiple times for the same transaction, only the last date will be shown.

created_atstring

The timestamp of when this instance was created.

updated_atstring

The timestamp when this instance was last updated.

In JSON format

transaction_object.json
{
  "id": 1,
  "status": "completed",
  "payment_method": {
    "id": 1,
    "brand": "visa",
    "last4": "4242",
    "name": null,
    "expiration_year": 2023,
    "expiration_month": 6,
    "created_at": "2022-06-14T11:58:10.246406-07:00",
    "updated_at": "2022-06-14T11:58:10.246406-07:00"
  },
  "reason": "Upgraded from Free Plan to 100 Proxies with 250 GB bandwidth.",
  "amount": 1.0,
  "refund_amount": 0.0,
  "refund_date": null,
  "created_at": "2022-06-14T11:58:10.246406-07:00",
  "updated_at": "2022-06-14T11:58:10.246406-07:00"
}

Pending Payments

[]

Pending payment object

AttributesTypeDescription
idstring

Unique identifier of the pending payment object.

statusstring

Current state of the pending payment. Can be pending, processing, successful or failed.

failure_reasonstring

Set to a user-friendly string if a status is failed. Default is null.

payment_methodobject

Nested payment method instance.

planobject

Nested plan instance.

transactionobject

Nested transaction instance. Only set if the status is successful.

is_renewalboolean

Whether the payment should be used to renew the subscription or immediately change it.

termstring

Term of the payment. Can be monthly or yearly.

created_atstring

The timestamp on when the pending payment was created

updated_atstring

The timestamp when the pending payment was last updated.

completed_atstring

The timestamp when the pending payment status was last updated.

In JSON format

pending_payment_object.json
{
  "id": 1,
  "status": "pending",
  "failure_reason": null,
  "payment_method": 2,
  "plan": 2,
  "transaction": null,
  "is_renewal": false,
  "term": "monthly",
  "created_at": "2022-06-14T11:58:10.246406-07:00",
  "updated_at": "2022-06-14T11:58:10.246406-07:00",
  "completed_at": null
}